/**
 * LinkCentre Sudoku - World-Class Styling
 * Matching the fun, colorful gaming portal theme
 */

/* ============================================
   DIFFICULTY BAR
   ============================================ */
.sudoku-difficulty-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px;
    background: linear-gradient(135deg, #f0f7ff 0%, #e0f2fe 100%);
    border-radius: 16px;
    flex-wrap: wrap;
}

.difficulty-label {
    font-weight: 700;
    color: #00498f;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.difficulty-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.difficulty-btn {
    padding: 10px 20px;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    color: #555;
    font-family: 'Raleway', sans-serif;
    font-size: 13px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.difficulty-btn:hover {
    border-color: #00498f;
    color: #00498f;
    transform: translateY(-2px);
}

.difficulty-btn.active {
    background: linear-gradient(135deg, #00498f 0%, #0066cc 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(0, 73, 143, 0.3);
}

/* ============================================
   STATUS BAR
   ============================================ */
.sudoku-status-bar {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 24px;
    padding: 16px 24px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 73, 143, 0.08);
    flex-wrap: wrap;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.status-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: #00498f;
}

.score-display .status-value {
    color: #f59e0b;
}

/* ============================================
   SUDOKU BOARD
   ============================================ */
.sudoku-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.sudoku-board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 0;
    background: #00498f;
    padding: 4px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 73, 143, 0.25);
    max-width: 450px;
    width: 100%;
    aspect-ratio: 1;
}

.sudoku-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    font-weight: 700;
    color: #333;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    user-select: none;
}

/* Grid borders for 3x3 boxes */
.sudoku-cell { margin: 1px; }

.sudoku-cell:nth-child(3n) { margin-right: 3px; }
.sudoku-cell:nth-child(9n) { margin-right: 1px; }
.sudoku-cell:nth-child(n+19):nth-child(-n+27) { margin-bottom: 3px; }
.sudoku-cell:nth-child(n+46):nth-child(-n+54) { margin-bottom: 3px; }

/* First row top corners */
.sudoku-cell:nth-child(1) { border-radius: 8px 0 0 0; }
.sudoku-cell:nth-child(9) { border-radius: 0 8px 0 0; }

/* Last row bottom corners */
.sudoku-cell:nth-child(73) { border-radius: 0 0 0 8px; }
.sudoku-cell:nth-child(81) { border-radius: 0 0 8px 0; }

/* Cell states */
.sudoku-cell.given {
    background: #f8fafc;
    color: #1e3a5f;
}

.sudoku-cell.selected {
    background: #fef3c7 !important;
    box-shadow: inset 0 0 0 3px #f59e0b;
}

.sudoku-cell.highlighted {
    background: #e0f2fe;
}

.sudoku-cell.same-number {
    background: #dbeafe;
}

.sudoku-cell.error {
    background: #fee2e2 !important;
    color: #dc2626 !important;
    animation: shake 0.3s ease;
}

.sudoku-cell.correct-hint {
    animation: pulse-green 0.5s ease;
}

.sudoku-cell.user-input {
    color: #0066cc;
}

.sudoku-cell:hover:not(.given):not(.selected) {
    background: #f0f9ff;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

@keyframes pulse-green {
    0% { background: #86efac; }
    100% { background: #ffffff; }
}

/* Notes (pencil marks) */
.sudoku-cell .notes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    width: 100%;
    height: 100%;
    padding: 2px;
}

.sudoku-cell .note {
    font-size: clamp(0.5rem, 1.5vw, 0.7rem);
    font-weight: 500;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ============================================
   NUMBER PAD
   ============================================ */
.sudoku-numpad {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
}

.numpad-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    color: #00498f;
    cursor: pointer;
    transition: all 0.2s ease;
}

.numpad-btn:hover {
    background: #f0f7ff;
    border-color: #00498f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 73, 143, 0.15);
}

.numpad-btn:active {
    transform: translateY(0);
}

.numpad-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.numpad-btn.erase-btn {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.numpad-btn.erase-btn:hover {
    background: #fee2e2;
    border-color: #dc2626;
}

/* ============================================
   GAME CONTROLS
   ============================================ */
.sudoku-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.control-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    font-family: 'Raleway', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-btn:hover {
    border-color: #00498f;
    color: #00498f;
    background: #f0f7ff;
    transform: translateY(-2px);
}

.control-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.control-btn.active {
    background: linear-gradient(135deg, #ffc107 0%, #ffda6a 100%);
    border-color: transparent;
    color: #003366;
}

.control-btn svg {
    flex-shrink: 0;
}

.notes-btn.active {
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
    border-color: transparent;
    color: #ffffff;
}

.hint-btn {
    background: linear-gradient(135deg, #fef3c7 0%, #fef9c3 100%);
    border-color: #fcd34d;
    color: #92400e;
}

.hint-btn:hover {
    background: linear-gradient(135deg, #fde68a 0%, #fef08a 100%);
    border-color: #f59e0b;
}

/* ============================================
   NUMBER COUNTS
   ============================================ */
.number-counts {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.number-count {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 8px;
    min-width: 36px;
}

.number-count-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 700;
    color: #00498f;
}

.number-count-remaining {
    font-size: 10px;
    color: #94a3b8;
    font-weight: 600;
}

.number-count.complete {
    background: #dcfce7;
}

.number-count.complete .number-count-num {
    color: #16a34a;
}

/* ============================================
   HELP SECTION
   ============================================ */
.sudoku-help {
    background: #fff;
    border-radius: 12px;
    padding: 28px 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border: 1px solid #e8e8e8;
    margin-top: 24px;
}

.sudoku-help-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.sudoku-help-icon {
    width: 52px;
    height: 52px;
    background: #00498f;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.sudoku-help h3 {
    font-size: 1.1rem;
    color: #222;
    margin: 0;
    font-weight: 700;
}

.sudoku-help ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.sudoku-help ul li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 8px;
}

.sudoku-help ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: 700;
}

.sudoku-help li {
    color: #666;
    font-size: 14px;
    line-height: 1.8;
}

/* ============================================
   VICTORY OVERLAY
   ============================================ */
.victory-overlay,
.gameover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 10;
}

.victory-overlay.show,
.gameover-overlay.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.victory-content,
.gameover-content {
    text-align: center;
    padding: 32px;
}

.victory-icon,
.gameover-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.victory-title,
.gameover-title {
    font-family: 'Raleway', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: #00498f;
    margin: 0 0 24px;
}

.gameover-text {
    color: #666;
    margin: 0 0 24px;
}

.victory-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 28px;
}

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

.victory-stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: #00498f;
}

.victory-stat-label {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.victory-actions,
.gameover-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================
   ACHIEVEMENTS WIDGET
   ============================================ */
.achievements-widget {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 73, 143, 0.1);
    overflow: hidden;
}

.achievements-header {
    background: linear-gradient(135deg, #fef3c7 0%, #fffbeb 100%);
    padding: 14px 18px;
    border-bottom: 1px solid #fcd34d;
}

.achievements-title {
    font-size: 13px;
    font-weight: 700;
    color: #92400e;
    margin: 0;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 16px;
}

.achievement {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 12px;
    font-size: 1.5rem;
    cursor: help;
    transition: all 0.2s ease;
}

.achievement:hover {
    transform: scale(1.1);
}

.achievement.locked {
    background: #f1f5f9;
    filter: grayscale(1);
    opacity: 0.5;
}

.achievement.unlocked {
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
    animation: achievementPop 0.5s ease;
}

@keyframes achievementPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ============================================
   MORE GAMES WIDGET
   ============================================ */
.more-games-widget {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 73, 143, 0.1);
    padding: 20px;
}

.more-games-title {
    font-size: 13px;
    font-weight: 700;
    color: #00498f;
    margin: 0 0 16px;
}

.more-games-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.more-games-list li {
    margin-bottom: 12px;
}

.more-games-list li:last-child {
    margin-bottom: 0;
}

.more-games-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.more-games-list a:hover {
    background: #f0f7ff;
    color: #00498f;
}

.game-status {
    margin-left: auto;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.game-status.live {
    background: #dcfce7;
    color: #16a34a;
}

.game-status.soon {
    background: #f1f5f9;
    color: #94a3b8;
}

/* ============================================
   SHORTCUTS WIDGET
   ============================================ */
.shortcuts-widget {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 20px;
    padding: 20px;
}

.shortcuts-title {
    font-size: 13px;
    font-weight: 700;
    color: #00498f;
    margin: 0 0 14px;
}

.shortcuts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shortcut {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #555;
}

.shortcut kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 4px 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    color: #333;
    box-shadow: 0 2px 0 #e2e8f0;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .sudoku-status-bar {
        gap: 16px;
        padding: 12px 16px;
    }
    
    .status-value {
        font-size: 1rem;
    }
    
    .sudoku-board {
        max-width: 100%;
    }
    
    .numpad-btn {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }
    
    .control-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .victory-stats {
        gap: 20px;
    }
    
    .achievements-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 480px) {
    .sudoku-difficulty-bar {
        flex-direction: column;
        gap: 12px;
    }
    
    .difficulty-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .difficulty-btn {
        padding: 8px 14px;
        font-size: 12px;
    }
    
    .sudoku-numpad {
        gap: 6px;
    }
    
    .numpad-btn {
        width: 34px;
        height: 34px;
        font-size: 1rem;
        border-radius: 8px;
    }
    
    .sudoku-controls {
        gap: 6px;
    }
    
    .control-btn {
        padding: 8px 10px;
        font-size: 11px;
    }
    
    .control-btn span {
        display: none;
    }
    
    .number-counts {
        gap: 4px;
    }
    
    .number-count {
        padding: 6px 8px;
        min-width: 30px;
    }
}
