/* Sudoku Game - Premium Redesign */

/* Page Layout */
.page-wrapper {
    min-height: 100vh;
    padding-bottom: 60px;
}

/* Navigation */
.game-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(10, 15, 37, 0.85);
    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(168, 85, 247, 0.2);
    border-color: rgba(168, 85, 247, 0.4);
    transform: translateY(-2px);
}

.nav-icon {
    font-size: 18px;
}

.nav-title {
    font-size: 24px;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(135deg, #a855f7 20%, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.timer-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.timer-icon {
    font-size: 16px;
}

.timer-value {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    font-family: 'Outfit', monospace;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 20px;
    flex-wrap: wrap;
}

.stat-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 22px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    min-width: 90px;
}

.stat-chip.progress {
    background: linear-gradient(145deg, rgba(168, 85, 247, 0.15), rgba(168, 85, 247, 0.05));
    border-color: rgba(168, 85, 247, 0.25);
}

.stat-chip.errors {
    background: linear-gradient(145deg, rgba(239, 68, 68, 0.12), rgba(239, 68, 68, 0.04));
    border-color: rgba(239, 68, 68, 0.2);
}

.chip-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 4px;
}

.chip-value {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    font-family: 'Outfit', sans-serif;
}

/* Main Controls */
.main-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 0 20px 16px;
    flex-wrap: wrap;
}

.btn-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.25s ease;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #a855f7, #9333ea);
    color: #fff;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5);
}

.btn-hint {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.25);
}

.btn-solve {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.btn-check {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-share {
    background: rgba(6, 182, 212, 0.12);
    color: #22d3ee;
    border: 1px solid rgba(6, 182, 212, 0.25);
}

.btn-xl {
    padding: 16px 32px;
    font-size: 16px;
}

.btn-main:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Difficulty Bar */
.difficulty-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 0 20px 20px;
    flex-wrap: wrap;
}

.diff-btn {
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s ease;
}

.diff-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.diff-btn.active {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(168, 85, 247, 0.1));
    border-color: rgba(168, 85, 247, 0.5);
    color: #c084fc;
}

/* Game Main */
.game-main {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 0 20px;
    flex-wrap: wrap;
}

/* Sudoku Board */
.board-container {
    background: linear-gradient(145deg, rgba(20, 25, 50, 0.95), rgba(10, 15, 35, 0.98));
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 40px rgba(168, 85, 247, 0.08);
}

.sudoku-board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 2px;
    background: rgba(168, 85, 247, 0.3);
    padding: 2px;
    border-radius: 10px;
}

.sudoku-board .cell {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    background: rgba(15, 20, 40, 0.95);
    color: #fff;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
}

.sudoku-board .cell:hover {
    background: rgba(168, 85, 247, 0.2);
}

.sudoku-board .cell.selected {
    background: rgba(168, 85, 247, 0.35);
    box-shadow: inset 0 0 0 2px #a855f7;
}

.sudoku-board .cell.given {
    color: rgba(255, 255, 255, 0.6);
    cursor: default;
}

.sudoku-board .cell.error {
    background: rgba(239, 68, 68, 0.25);
    color: #f87171;
}

.sudoku-board .cell.highlight {
    background: rgba(168, 85, 247, 0.15);
}

/* 3x3 box borders */
.sudoku-board .cell:nth-child(3n) {
    border-right: 2px solid rgba(168, 85, 247, 0.5);
}

.sudoku-board .cell:nth-child(n+19):nth-child(-n+27),
.sudoku-board .cell:nth-child(n+46):nth-child(-n+54) {
    border-bottom: 2px solid rgba(168, 85, 247, 0.5);
}

/* Number Panel */
.number-panel {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
}

.panel-title {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 16px;
}

.number-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.num-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.num-btn:hover {
    background: rgba(168, 85, 247, 0.25);
    border-color: rgba(168, 85, 247, 0.5);
}

.num-btn:active {
    transform: scale(0.95);
}

.num-btn.erase {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.25);
}

/* Action Bar */
.action-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
}

.action-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
}

.action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Overlays */
.overlay-panel {
    position: fixed;
    inset: 0;
    background: rgba(5, 10, 25, 0.92);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.overlay-panel.hidden {
    display: none;
}

.overlay-content {
    text-align: center;
    padding: 40px;
    max-width: 400px;
}

.overlay-emoji {
    font-size: 64px;
    margin-bottom: 16px;
}

.overlay-title {
    font-size: 36px;
    font-weight: 800;
    margin: 0 0 12px;
    background: linear-gradient(135deg, #a855f7, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.overlay-text {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 16px;
}

.overlay-tip {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin: 0 0 24px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

/* Modal Box */
.modal-box {
    background: rgba(15, 20, 45, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 28px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-box.success {
    border-color: rgba(34, 197, 94, 0.3);
}

.modal-box.failed {
    border-color: rgba(239, 68, 68, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: #fff;
}

.close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-text {
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 20px;
}

/* Difficulty Options */
.diff-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.diff-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.diff-card:hover {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.4);
}

.diff-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.diff-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 6px;
    color: #fff;
}

.diff-card p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

.diff-time {
    font-size: 11px;
    color: rgba(168, 85, 247, 0.8);
    margin-top: 6px;
    display: block;
}

/* Final Stats */
.final-stats {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 20px;
}

.final-stat {
    text-align: center;
}

.fs-label {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.fs-value {
    font-size: 24px;
    font-weight: 800;
    color: #c084fc;
}

/* Tips List */
.tips-list {
    margin-bottom: 20px;
}

.tip-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    margin-bottom: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75);
}

.tip-row span {
    font-size: 18px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Help Section */
.help-section {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.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: 14px;
}

.help-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 18px;
    text-align: center;
}

.hc-icon {
    font-size: 28px;
    margin-bottom: 10px;
    display: block;
}

.help-card h4 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #c084fc;
}

.help-card p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    line-height: 1.5;
}

/* Recommendations */
.recommendations-section {
    max-width: 800px;
    margin: 48px auto;
    padding: 0 20px;
}

.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(130px, 1fr));
    gap: 12px;
}

.game-card-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px 14px;
    background: rgba(255, 255, 255, 0.05);
    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(168, 85, 247, 0.12);
    border-color: rgba(168, 85, 247, 0.4);
    transform: translateY(-4px);
}

.card-icon {
    font-size: 30px;
}

.card-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

/* Responsive */
@media (max-width: 700px) {
    .game-main {
        flex-direction: column;
        align-items: center;
    }

    .sudoku-board .cell {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .number-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .num-btn {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }

    .diff-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 450px) {
    .sudoku-board .cell {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .main-controls {
        gap: 8px;
    }

    .btn-main {
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* Utilities */
.hidden {
    display: none !important;
}