:root {
    --bg-color: #1a1a2e;
    --text-color: #e94560;
    --accent-color: #16213e;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --cell-bg: #0f3460;
    --cell-hover: #1f4287;
    --mine-color: #e94560;
    --safe-color: #4ecca3;
}

body {
    background-color: var(--bg-color);
    color: #fff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
}

.container {
    width: 90%;
    max-width: 800px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

h1 {
    color: var(--text-color);
    margin-bottom: 2rem;
    text-shadow: 0 0 10px rgba(233, 69, 96, 0.5);
}

/* Lobby Styles */
#lobby {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

input,
select,
button {
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 1rem;
    width: 100%;
    max-width: 300px;
    transition: all 0.3s ease;
}

button {
    background: var(--text-color);
    border: none;
    cursor: pointer;
    font-weight: bold;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(233, 69, 96, 0.4);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Game Board Styles */
#game-container {
    display: none;
    /* Hidden by default */
    flex-direction: column;
    align-items: center;
}

.game-info {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

#board {
    display: grid;
    gap: 5px;
    margin: 2rem auto;
    width: 100%;
    max-width: 500px;
}

.cell {
    width: auto;
    height: auto;
    aspect-ratio: 1;
    background: var(--cell-bg);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    user-select: none;
}

.cell:hover:not(.revealed) {
    background: var(--cell-hover);
    transform: scale(1.05);
}

.cell.revealed {
    background: var(--accent-color);
    cursor: default;
    transform: none;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.cell.mine {
    background: var(--mine-color);
    animation: shake 0.5s;
}

.cell.safe {
    color: var(--safe-color);
}

.turn-indicator {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--safe-color);
}

@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }

    100% {
        transform: translateX(0);
    }
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #1a1a2e;
    border: 2px solid var(--text-color);
    padding: 2rem;
    border-radius: 16px;
    z-index: 100;
    text-align: center;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    display: none;
    /* Controlled by JS */
}


.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--text-color);
}

.secondary-btn:hover {
    background: rgba(233, 69, 96, 0.1);
}

#loser-display {
    margin: 15px 0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.hidden {
    display: none !important;
}