:root {
    --bg-color: #1a1a2e;
    --board-color: #16213e;
    --cell-empty: #0f3460;
    --player-red: #e94560;
    --player-yellow: #f9d342;
    --text-color: #ffffff;
}

* {
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    text-align: center;
}

.container {
    width: 100%;
    max-width: 600px;
    padding: 20px;
}

header {
    margin-bottom: 20px;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--player-yellow);
    text-shadow: 2px 2px 0px #e94560;
}

.mode-select {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.mode-btn {
    background: transparent;
    border: 2px solid var(--player-yellow);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.mode-btn.active, .mode-btn:hover {
    background: var(--player-yellow);
    color: var(--bg-color);
    box-shadow: 0 0 15px rgba(249, 211, 66, 0.4);
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.turn-indicator {
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-block;
}

.player-dot.red { background-color: var(--player-red); box-shadow: 0 0 10px var(--player-red); }
.player-dot.yellow { background-color: var(--player-yellow); box-shadow: 0 0 10px var(--player-yellow); }

.btn {
    background: linear-gradient(45deg, #e94560, #c0354e);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn:hover {
    transform: scale(1.05);
}

.game-board-wrapper {
    background: var(--board-color);
    padding: 15px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: inline-block;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.cell {
    width: 50px;
    height: 50px;
    background-color: var(--cell-empty);
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    box-shadow: inset 0 5px 10px rgba(0,0,0,0.3);
    transition: background-color 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cell:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.cell.red { background-color: var(--player-red); }
.cell.yellow { background-color: var(--player-yellow); }

.cell.win {
    animation: pulse 1s infinite alternate;
    box-shadow: 0 0 20px white;
}

@keyframes pulse {
    from { opacity: 1; }
    to { opacity: 0.7; }
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-color);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    border: 2px solid var(--player-yellow);
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.back-link {
    display: block;
    margin-top: 30px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.3s;
}

.back-link:hover {
    color: white;
}

/* Responsive */
@media (max-width: 500px) {
    .cell {
        width: 40px;
        height: 40px;
    }
    .game-board {
        gap: 5px;
    }
}
