/* ============================================
   CHATFLY GAMES - HIGH QUALITY UI
   ============================================ */

/* Game Container */
.game-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    animation: gameSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes gameSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.game-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 999;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Game Header */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.game-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.game-icon {
    width: 32px;
    height: 32px;
    background: var(--color-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.game-close {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.game-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: scale(1.1);
}

/* Game Status */
.game-status {
    text-align: center;
    margin-bottom: 24px;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.game-status.your-turn {
    background: linear-gradient(135deg, var(--color-primary), #ff3380);
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.game-status.opponent-turn {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.game-status.winner {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.game-status.loser {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.game-status.draw {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

/* ============================================
   TIC-TAC-TOE GAME
   ============================================ */

.tictactoe-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto 24px;
    aspect-ratio: 1;
}

.tictactoe-cell {
    background: var(--bg-secondary);
    border: 3px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.tictactoe-cell:hover:not(.taken):not(.disabled) {
    background: var(--bg-hover);
    border-color: var(--color-primary);
    transform: scale(1.05);
}

.tictactoe-cell.taken {
    cursor: not-allowed;
}

.tictactoe-cell.disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.tictactoe-cell.x {
    color: #ff006e;
    animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tictactoe-cell.o {
    color: #06b6d4;
    animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.tictactoe-cell.winning {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.2));
    border-color: #10b981;
    animation: winningCell 0.6s ease-in-out;
}

@keyframes winningCell {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Player Info */
.game-players {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.player-info {
    flex: 1;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 2px solid var(--border-color);
    text-align: center;
}

.player-info.active {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, rgba(255, 0, 110, 0.1), rgba(255, 51, 128, 0.1));
}

.player-symbol {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.player-symbol.x { color: #ff006e; }
.player-symbol.o { color: #06b6d4; }

.player-name {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Game Actions */
.game-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

.game-btn {
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.game-btn-primary {
    background: linear-gradient(135deg, var(--color-primary), #ff3380);
    color: white;
}

.game-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 0, 110, 0.3);
}

.game-btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.game-btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--color-primary);
}

.game-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ============================================
   TETRIS GAME - Polished Version
   ============================================ */

.tetris-game {
    max-width: 520px !important;
    max-height: 85vh !important;
    overflow: hidden;
}

/* Scale down tetris for smaller viewports */
@media (max-height: 800px) {
    .tetris-game {
        transform: scale(0.85);
        transform-origin: center center;
    }
}

@media (max-height: 700px) {
    .tetris-game {
        transform: scale(0.75);
        transform-origin: center center;
    }
}

@media (max-height: 600px) {
    .tetris-game {
        transform: scale(0.65);
        transform-origin: center center;
    }
}

.tetris-container {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    justify-content: center;
}

.tetris-board-wrapper {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.tetris-board-wrapper canvas {
    display: block;
    border: 3px solid #3a3a4e;
    border-radius: 8px;
}

.tetris-pause-overlay,
.tetris-gameover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 10;
}

.pause-text,
.gameover-text {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 0, 110, 0.5);
}

.gameover-score {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.tetris-board {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(20, 1fr);
    gap: 1px;
    background: var(--border-color);
    border: 3px solid var(--border-color);
    border-radius: 12px;
    padding: 2px;
    width: 300px;
    height: 600px;
}

.tetris-cell {
    background: var(--bg-secondary);
    border-radius: 2px;
    transition: all 0.1s;
}

.tetris-cell.filled {
    background: var(--color-primary);
    box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.3);
}

.tetris-cell.I { background: #00f0f0; } /* Cyan */
.tetris-cell.O { background: #f0f000; } /* Yellow */
.tetris-cell.T { background: #a000f0; } /* Purple */
.tetris-cell.S { background: #00f000; } /* Green */
.tetris-cell.Z { background: #f00000; } /* Red */
.tetris-cell.J { background: #0000f0; } /* Blue */
.tetris-cell.L { background: #f0a000; } /* Orange */

.tetris-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tetris-next {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.tetris-next-title {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 600;
}

.tetris-next-preview {
    display: grid;
    grid-template-columns: repeat(4, 24px);
    grid-template-rows: repeat(4, 24px);
    gap: 2px;
    margin: 0 auto;
    width: fit-content;
}

.tetris-stats {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 16px;
}

.tetris-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.tetris-stat:last-child {
    border-bottom: none;
}

.tetris-stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.tetris-stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.tetris-controls {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 16px;
}

.tetris-controls-title {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 600;
}

.tetris-control-key {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.85rem;
}

.tetris-key {
    background: var(--bg-hover);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--color-primary);
}

/* Mobile Controls */
.tetris-controls-mobile {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.tetris-btn-row {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.tetris-ctrl-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tetris-ctrl-btn:hover,
.tetris-ctrl-btn:active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
    transform: scale(0.95);
}

.tetris-ctrl-btn.wide {
    width: 120px;
    font-size: 0.9rem;
}

/* Hide mobile controls on desktop */
@media (min-width: 769px) {
    .tetris-controls-mobile {
        display: none;
    }
}

/* Show mobile controls on mobile */
@media (max-width: 768px) {
    .tetris-controls {
        display: none;
    }
}

/* ============================================
   BATTLESHIP GAME
   ============================================ */

.battleship-board {
    margin: 0 auto;
}

.battleship-cell {
    aspect-ratio: 1;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.5rem;
}

.battleship-cell:hover:not(.hit):not(.miss) {
    background: var(--bg-hover);
    border-color: var(--color-primary);
    transform: scale(1.05);
}

.battleship-cell.ship {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: #1d4ed8;
}

.battleship-cell.hit {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: #b91c1c;
    animation: hitAnimation 0.5s ease-out;
}

@keyframes hitAnimation {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}

.battleship-cell.miss {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    border-color: #0e7490;
    opacity: 0.6;
}

.battleship-cell.preview {
    background: rgba(59, 130, 246, 0.3);
    border-color: #3b82f6;
}

.battleship-cell.invalid {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
}

/* ============================================
   GAME INVITE MODAL
   ============================================ */

.game-invite-modal {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-card);
    border: 2px solid var(--color-primary);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 1001;
    min-width: 300px;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.game-invite-header {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.game-invite-message {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.game-invite-actions {
    display: flex;
    gap: 8px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .game-container {
        padding: 20px;
        border-radius: 16px;
    }

    .tictactoe-board {
        max-width: 300px;
        gap: 8px;
    }

    .tictactoe-cell {
        font-size: 2rem;
        border-radius: 12px;
    }

    .game-players {
        flex-direction: column;
    }

    .tetris-container {
        flex-direction: column;
        align-items: center;
    }

    .tetris-board {
        width: 250px;
        height: 500px;
    }

    .game-invite-modal {
        right: 10px;
        left: 10px;
        min-width: auto;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .tictactoe-cell {
        border-width: 4px;
    }

    .game-container {
        border-width: 3px;
    }
}

/* Focus visible for keyboard navigation */
.tictactoe-cell:focus-visible,
.game-btn:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

/* ============================================
   CHESS GAME - Professional Styling
   ============================================ */

.chess-game {
    max-width: 900px !important;
}

.chess-layout {
    display: flex;
    gap: 24px;
    padding: 20px;
}

.chess-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chess-player-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.chess-player-bar.your-turn {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.chess-player-bar.opponent-turn {
    opacity: 0.7;
}

.chess-player-bar .player-avatar {
    font-size: 2rem;
    line-height: 1;
}

.chess-player-bar .player-name {
    font-weight: 600;
    flex: 1;
}

.chess-player-bar .turn-indicator {
    font-size: 0.85rem;
    padding: 4px 12px;
    background: var(--color-primary);
    border-radius: 20px;
    font-weight: 500;
}

.chess-player-bar .captured-pieces {
    display: flex;
    gap: 2px;
    font-size: 1.2rem;
    opacity: 0.8;
}

.chess-board-container {
    position: relative;
}

.chess-status {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    animation: pulse 1s infinite;
}

.chess-status.check {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}

.chess-status.checkmate {
    background: rgba(16, 185, 129, 0.95);
    color: white;
    font-size: 1.8rem;
}

.chess-status.draw {
    background: rgba(251, 191, 36, 0.95);
    color: #1a1a1a;
}

.chess-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    aspect-ratio: 1;
    border: 3px solid #4a4a5a;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.chess-square {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.chess-square.light {
    background: #f0d9b5;
}

.chess-square.dark {
    background: #b58863;
}

.chess-square:hover {
    filter: brightness(1.1);
}

.chess-square.selected {
    background: rgba(255, 255, 0, 0.5) !important;
}

.chess-square.legal-move::after {
    content: '';
    position: absolute;
    width: 30%;
    height: 30%;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 50%;
}

.chess-square.legal-move.capture::after {
    width: 100%;
    height: 100%;
    background: transparent;
    border: 4px solid rgba(255, 0, 0, 0.4);
    border-radius: 0;
    box-sizing: border-box;
}

.chess-square.last-move {
    background: rgba(255, 255, 0, 0.3) !important;
}

.chess-square.in-check {
    background: rgba(255, 0, 0, 0.5) !important;
    animation: check-pulse 0.5s ease infinite alternate;
}

@keyframes check-pulse {
    from { box-shadow: inset 0 0 20px rgba(255, 0, 0, 0.5); }
    to { box-shadow: inset 0 0 30px rgba(255, 0, 0, 0.8); }
}

.chess-piece {
    font-size: 3rem;
    line-height: 1;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s ease;
    user-select: none;
}

.chess-piece.white {
    color: #ffffff;
    text-shadow: 0 0 3px #000, 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.chess-piece.black {
    color: #1a1a1a;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.3);
}

.chess-square:hover .chess-piece {
    transform: scale(1.05);
}

.square-label {
    position: absolute;
    font-size: 0.65rem;
    font-weight: 600;
    opacity: 0.7;
}

.square-label.file {
    bottom: 2px;
    right: 4px;
}

.square-label.rank {
    top: 2px;
    left: 4px;
}

.chess-square.light .square-label {
    color: #b58863;
}

.chess-square.dark .square-label {
    color: #f0d9b5;
}

.chess-sidebar {
    width: 200px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.move-history {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    min-height: 200px;
    max-height: 400px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.move-history-title {
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.move-list {
    flex: 1;
    overflow-y: auto;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
}

.move-row {
    display: flex;
    gap: 8px;
    padding: 4px 0;
}

.move-row:nth-child(even) {
    background: rgba(255, 255, 255, 0.03);
}

.move-num {
    width: 28px;
    color: var(--text-muted);
}

.move {
    width: 50px;
}

.move.white {
    color: #f0d9b5;
}

.move.black {
    color: #b58863;
}

.chess-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chess-actions .btn {
    font-size: 0.85rem;
    padding: 10px;
}

/* Responsive Chess */
@media (max-width: 768px) {
    .chess-layout {
        flex-direction: column;
    }

    .chess-sidebar {
        width: 100%;
        flex-direction: row;
    }

    .move-history {
        min-height: 100px;
        max-height: 150px;
    }

    .chess-actions {
        flex-direction: row;
        width: auto;
    }

    .chess-piece {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .chess-piece {
        font-size: 1.5rem;
    }

    .chess-player-bar {
        padding: 8px 12px;
    }

    .chess-player-bar .player-avatar {
        font-size: 1.5rem;
    }
}

/* ============================================
   2048 GAME - Addictive Sliding Puzzle
   ============================================ */

.game-2048 {
    max-width: 480px !important;
}

.game-2048-scores {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 16px 0;
}

.score-box {
    background: #bbada0;
    border-radius: 6px;
    padding: 10px 24px;
    text-align: center;
    min-width: 100px;
}

.score-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #eee4da;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.score-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
}

.game-2048-container {
    position: relative;
    padding: 16px;
}

.game-2048-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    background: #bbada0;
    border-radius: 8px;
    padding: 12px;
    aspect-ratio: 1;
    touch-action: none;
}

.tile-2048 {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    border-radius: 6px;
    transition: all 0.15s ease;
    user-select: none;
}

.tile-2048.tile-large {
    font-size: 1.5rem;
}

.tile-2048.tile-empty {
    background: rgba(238, 228, 218, 0.35);
}

/* Tile animations */
.tile-2048:not(.tile-empty) {
    animation: tile-pop 0.15s ease;
}

@keyframes tile-pop {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Special tile glow effects */
.tile-2048.tile-128,
.tile-2048.tile-256,
.tile-2048.tile-512 {
    box-shadow: 0 0 20px rgba(237, 207, 114, 0.5);
}

.tile-2048.tile-1024,
.tile-2048.tile-2048 {
    box-shadow: 0 0 30px rgba(237, 194, 46, 0.7);
    animation: tile-glow 1s ease infinite alternate;
}

@keyframes tile-glow {
    from { box-shadow: 0 0 20px rgba(237, 194, 46, 0.5); }
    to { box-shadow: 0 0 40px rgba(237, 194, 46, 0.8); }
}

.game-2048-overlay {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    bottom: 16px;
    background: rgba(238, 228, 218, 0.85);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 10;
    animation: fadeIn 0.3s ease;
}

.game-over-text {
    font-size: 2.5rem;
    font-weight: 700;
    color: #776e65;
}

.game-2048-controls {
    text-align: center;
    padding: 16px;
    color: var(--text-muted);
}

.game-2048-controls p {
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.game-2048-controls strong {
    color: var(--text-primary);
}

/* Responsive 2048 */
@media (max-width: 400px) {
    .game-2048-grid {
        gap: 8px;
        padding: 8px;
    }

    .tile-2048 {
        font-size: 1.5rem;
    }

    .tile-2048.tile-large {
        font-size: 1.1rem;
    }

    .score-box {
        padding: 8px 16px;
        min-width: 80px;
    }

    .score-value {
        font-size: 1.4rem;
    }
}
