/* 2048 Game - Premium Redesign */

/* Page Layout */
.page-wrapper {
    min-height: 100vh;
    padding-bottom: 60px;
}

/* Navigation Bar */
.game-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(10, 15, 37, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-home {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-home:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
}

.nav-icon {
    font-size: 18px;
}

.nav-title {
    font-size: 24px;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(135deg, #fff 30%, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.nav-spacer {
    width: 100px;
}

/* Main Game Layout */
.game-main {
    display: flex;
    gap: 32px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Sidebar */
.game-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 240px;
    flex-shrink: 0;
}

.score-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.score-item {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
}

.score-item.current {
    background: linear-gradient(145deg, rgba(139, 92, 246, 0.25), rgba(139, 92, 246, 0.1));
    border-color: rgba(139, 92, 246, 0.4);
}

.score-item.best {
    background: linear-gradient(145deg, rgba(6, 182, 212, 0.2), rgba(6, 182, 212, 0.08));
    border-color: rgba(6, 182, 212, 0.35);
}

.score-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 6px;
}

.score-value {
    display: block;
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    font-family: 'Outfit', sans-serif;
}

.game-stats {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 16px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-name {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.stat-num {
    font-size: 20px;
    font-weight: 700;
    color: #06b6d4;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.25s ease;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    color: #fff;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.35);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-action:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

.btn-large {
    padding: 18px 36px;
    font-size: 17px;
}

.btn-icon {
    font-size: 18px;
}

.swipe-hint {
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    padding: 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
}

@media (min-width: 769px) {
    .swipe-hint {
        display: none;
    }
}

/* Game Center */
.game-center {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.board-container {
    position: relative;
    background: linear-gradient(145deg, rgba(20, 25, 50, 0.9), rgba(10, 15, 35, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.game-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 10px;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 12px;
    width: 380px;
    height: 380px;
    position: relative;
    touch-action: none;
    user-select: none;
}

.grid-cell {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

/* Tiles */
.tile {
    position: absolute;
    width: 85px;
    height: 85px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 32px;
    color: #fff;
    z-index: 10;
    transition: transform 0.12s ease-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Tile Colors */
.tile-2 {
    background: linear-gradient(135deg, #f3e5cb, #e8d4b8);
    color: #6b5d4d;
}

.tile-4 {
    background: linear-gradient(135deg, #efe0c5, #e5c97a);
    color: #6b5d4d;
}

.tile-8 {
    background: linear-gradient(135deg, #f5a862, #ec8e4d);
}

.tile-16 {
    background: linear-gradient(135deg, #f58e4d, #e6724a);
}

.tile-32 {
    background: linear-gradient(135deg, #f06b4d, #d85545);
}

.tile-64 {
    background: linear-gradient(135deg, #f54e3a, #c73e2d);
}

.tile-128 {
    background: linear-gradient(135deg, #ecd86b, #d4bc3e);
    font-size: 28px;
    box-shadow: 0 0 20px rgba(236, 216, 107, 0.5);
}

.tile-256 {
    background: linear-gradient(135deg, #edcc4a, #c9a820);
    font-size: 28px;
    box-shadow: 0 0 25px rgba(237, 204, 74, 0.5);
}

.tile-512 {
    background: linear-gradient(135deg, #edc22e, #b89a12);
    font-size: 28px;
    box-shadow: 0 0 30px rgba(237, 194, 46, 0.6);
}

.tile-1024 {
    background: linear-gradient(135deg, #4dc3f7, #1e9bd0);
    font-size: 22px;
    box-shadow: 0 0 35px rgba(77, 195, 247, 0.6);
}

.tile-2048 {
    background: linear-gradient(135deg, #2de6bf, #15b394);
    font-size: 22px;
    box-shadow: 0 0 40px rgba(45, 230, 191, 0.7);
}

.tile-super {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    font-size: 18px;
    box-shadow: 0 0 45px rgba(139, 92, 246, 0.7);
}

/* Overlays */
.overlay-panel {
    position: absolute;
    inset: 0;
    background: rgba(5, 10, 25, 0.92);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 20px;
    z-index: 50;
}

.overlay-panel.hidden {
    display: none;
}

.overlay-content {
    text-align: center;
    padding: 32px;
    max-width: 320px;
}

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

.overlay-title {
    font-size: 36px;
    font-weight: 800;
    margin: 0 0 12px;
    background: linear-gradient(135deg, #fff, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.overlay-desc {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 24px;
    line-height: 1.5;
}

.overlay-stats {
    margin-bottom: 20px;
}

.overlay-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.overlay-stat .stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

.overlay-stat .stat-value {
    font-size: 42px;
    font-weight: 800;
    color: #8b5cf6;
}

.new-record {
    font-size: 18px;
    font-weight: 700;
    color: #fbbf24;
    margin: 16px 0;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

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

/* Help Section */
.help-section {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 24px;
}

.help-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 20px;
    color: #fff;
}

.help-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.help-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.help-key {
    padding: 6px 12px;
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #a78bfa;
    white-space: nowrap;
}

.help-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

/* SEO Section */
.seo-section {
    max-width: 900px;
    margin: 48px auto;
    padding: 0 24px;
}

.seo-section h2 {
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 24px;
    background: linear-gradient(135deg, #fff, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.seo-content {
    display: grid;
    gap: 24px;
}

.seo-block {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 24px;
}

.seo-block h4 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 12px;
    color: #06b6d4;
}

.seo-block p {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin: 0;
}

.seo-block ul {
    margin: 0;
    padding-left: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
    line-height: 1.8;
}

/* Recommendations */
.recommendations-section {
    max-width: 900px;
    margin: 48px auto;
    padding: 0 24px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 20px;
    color: #fff;
}

.game-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
}

.game-card-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.game-card-mini:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateY(-4px);
}

.card-icon {
    font-size: 32px;
}

.card-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .game-nav {
        padding: 12px 16px;
    }

    .nav-title {
        font-size: 20px;
    }

    .nav-spacer {
        display: none;
    }

    .game-main {
        flex-direction: column;
        align-items: center;
        padding: 20px 16px;
        gap: 24px;
    }

    .game-sidebar {
        width: 100%;
        max-width: 380px;
        order: 2;
    }

    .game-center {
        order: 1;
    }

    .score-card {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 420px) {
    .game-board {
        width: 320px;
        height: 320px;
        gap: 8px;
        padding: 8px;
    }

    .tile {
        width: 70px;
        height: 70px;
        font-size: 26px;
    }

    .tile-128,
    .tile-256,
    .tile-512 {
        font-size: 22px;
    }

    .tile-1024,
    .tile-2048,
    .tile-super {
        font-size: 18px;
    }

    .board-container {
        padding: 12px;
    }
}

/* Utilities */
.hidden {
    display: none !important;
}