/* 2048 Game WordPress Plugin Styles */
.game-2048-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 100%);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.game-2048-header {
    text-align: center;
    margin-bottom: 24px;
}

.game-title {
    font-size: 3rem;
    font-weight: 800;
    color: #374151;
    margin: 0 0 8px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.game-subtitle {
    color: #6b7280;
    font-size: 1.125rem;
    margin: 0;
}

.game-2048-scoreboard {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 12px;
}

.score-container {
    background: #f59e0b;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    text-align: center;
    min-width: 80px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.score-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.score-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.new-game-btn {
    background: #6b7280;
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.new-game-btn:hover {
    background: #4b5563;
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 1.2rem;
}

.game-2048-board {
    background: #fbbf24;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(251, 191, 36, 0.3);
    position: relative;
    touch-action: none;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    position: relative;
}

.game-tile {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.5rem;
    transition: all 0.15s ease-in-out;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.game-tile.empty {
    background: rgba(255, 255, 255, 0.3);
    color: transparent;
}

.game-tile.tile-2 { background: #fef3c7; color: #374151; }
.game-tile.tile-4 { background: #fde68a; color: #374151; }
.game-tile.tile-8 { background: #fed7aa; color: #374151; }
.game-tile.tile-16 { background: #fdba74; color: white; }
.game-tile.tile-32 { background: #fb923c; color: white; }
.game-tile.tile-64 { background: #f97316; color: white; }
.game-tile.tile-128 { background: #fde047; color: white; font-size: 1.25rem; }
.game-tile.tile-256 { background: #facc15; color: white; font-size: 1.25rem; }
.game-tile.tile-512 { background: #eab308; color: white; font-size: 1.25rem; }
.game-tile.tile-1024 { background: #ca8a04; color: white; font-size: 1rem; }
.game-tile.tile-2048 { background: #f59e0b; color: white; font-size: 1rem; box-shadow: 0 4px 16px rgba(245, 158, 11, 0.5); }

.game-tile.new-tile {
    animation: tileAppear 0.2s ease-in-out;
}

.game-tile.merged-tile {
    animation: tileMerge 0.2s ease-in-out;
}

@keyframes tileAppear {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

@keyframes tileMerge {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.game-2048-controls {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.control-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    color: #6b7280;
    font-size: 0.875rem;
}

.control-item:last-child {
    margin-bottom: 0;
}

.control-icon {
    font-size: 1.25rem;
}

.game-2048-leaderboard {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.game-2048-leaderboard h3 {
    margin: 0 0 16px 0;
    color: #374151;
    font-size: 1.25rem;
    font-weight: 700;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.leaderboard-rank {
    font-weight: 600;
    color: #f59e0b;
    min-width: 24px;
}

.leaderboard-name {
    flex: 1;
    margin-left: 12px;
    color: #374151;
}

.leaderboard-score {
    font-weight: 600;
    color: #6b7280;
}

.game-2048-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.overlay-content {
    background: white;
    padding: 32px;
    border-radius: 16px;
    text-align: center;
    max-width: 300px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.overlay-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.overlay-title {
    font-size: 2rem;
    font-weight: 700;
    color: #374151;
    margin: 0 0 8px 0;
}

.overlay-message {
    color: #6b7280;
    margin: 0 0 24px 0;
}

.overlay-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.overlay-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.overlay-btn.primary {
    background: #10b981;
    color: white;
}

.overlay-btn.primary:hover {
    background: #059669;
}

.overlay-btn.secondary {
    background: #f59e0b;
    color: white;
}

.overlay-btn.secondary:hover {
    background: #d97706;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-2048-container {
        padding: 16px;
        margin: 0 16px;
    }
    
    .game-title {
        font-size: 2.5rem;
    }
    
    .game-2048-scoreboard {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .score-container {
        flex: 1;
        min-width: 70px;
    }
    
    .new-game-btn {
        width: 100%;
        justify-content: center;
    }
    
    .btn-text {
        display: inline;
    }
    
    .game-tile {
        width: 60px;
        height: 60px;
        font-size: 1.25rem;
    }
    
    .game-tile.tile-128,
    .game-tile.tile-256,
    .game-tile.tile-512 {
        font-size: 1rem;
    }
    
    .game-tile.tile-1024,
    .game-tile.tile-2048 {
        font-size: 0.875rem;
    }
    
    .overlay-content {
        margin: 0 16px;
        padding: 24px;
    }
    
    .overlay-buttons {
        flex-direction: column;
    }
    
    .overlay-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .game-tile {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }
    
    .game-tile.tile-128,
    .game-tile.tile-256,
    .game-tile.tile-512,
    .game-tile.tile-1024,
    .game-tile.tile-2048 {
        font-size: 0.75rem;
    }
    
    .game-2048-board {
        padding: 12px;
    }
    
    .game-grid {
        gap: 6px;
    }
}

/* Animation for score updates */
.score-animation {
    animation: scoreUpdate 0.3s ease-in-out;
}

@keyframes scoreUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Loading state */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Accessibility improvements */
.game-2048-container:focus-within {
    outline: 2px solid #f59e0b;
    outline-offset: 4px;
}

.game-tile:focus {
    outline: 2px solid #374151;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .game-tile {
        border: 2px solid #000;
    }
    
    .game-2048-overlay {
        background: rgba(0, 0, 0, 0.9);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .game-tile,
    .overlay-btn,
    .new-game-btn {
        transition: none;
    }
    
    .game-tile.new-tile,
    .game-tile.merged-tile {
        animation: none;
    }
}