* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 20px;
    transition: background 0.3s ease;
    overflow: hidden;
}

body.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

body.dark-mode .container {
    background: #0f3460;
    color: #e4e4e4;
}

body.dark-mode h1 {
    color: #00d4ff;
}

body.dark-mode .date {
    color: #b0b0b0;
}

body.dark-mode .cell {
    background: #1a1a2e;
    color: #e4e4e4;
    border-color: #2d4059;
}

body.dark-mode .cell.fixed {
    background: #16213e;
    color: #9ba4b5;
}

body.dark-mode .cell.same-region {
    background: rgba(240, 248, 255, 0.37) !important;
}

body.dark-mode .cell.same-number {
    background: rgba(173, 216, 230, 0.25) !important;
}

body.dark-mode .cell.error {
    background: rgba(211, 47, 47, 0.3) !important;
    color: #ef5350 !important;
}

body.dark-mode .game-controls-bar {
    background: #16213e;
}

body.dark-mode .progress-container {
    background: #16213e;
}

body.dark-mode .number-btn, body.dark-mode .erase-btn {
    background: #1a1a2e;
    border-color: #00d4ff;
    color: #00d4ff;
}

body.dark-mode .number-btn:hover, body.dark-mode .erase-btn:hover {
    background: #00d4ff;
    color: #1a1a2e;
}

body.dark-mode .erase-btn {
    background: #c62828;
    border-color: #e53935;
    color: white;
}

body.dark-mode .erase-btn:hover {
    background: #e53935;
    border-color: #ef5350;
}

.container {
    background: white;
    border-radius: 24px;
    padding: 8px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.25), 0 10px 30px rgba(102, 126, 234, 0.15);
    max-width: 600px;
    width: 100%;
    max-height: calc(100vh - 30px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Fix pour Chrome uniquement (pas Edge) */
.chrome-browser body {
    padding: 3px 10px;
}

.chrome-browser .container {
    padding: 5px;
    max-height: calc(100vh - 6px);
}

.chrome-browser header {
    margin-bottom: 3px;
}

.chrome-browser h1 {
    font-size: 1.1em;
    margin-bottom: 2px;
}

.chrome-browser .date {
    font-size: 0.75em;
}

.chrome-browser .game-controls-bar {
    padding: 4px 0;
    margin-bottom: 4px;
    gap: 8px;
}

.chrome-browser .timer,
.chrome-browser .lives {
    font-size: 0.85em;
    gap: 3px;
}

.chrome-browser #timer,
.chrome-browser #lives {
    font-size: 0.95em;
}

.chrome-browser .progress-container {
    height: 14px;
    margin-bottom: 4px;
}

.chrome-browser .progress-text {
    font-size: 0.75em;
}

.chrome-browser .sudoku-grid {
    margin-bottom: 4px;
    max-width: 450px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    border: 2px solid #333;
}

.chrome-browser .cell {
    font-size: 1.15em;
    border: 0.5px solid #ddd;
}

.chrome-browser .cell:nth-child(3n):not(:nth-child(9n)) {
    border-right: 2px solid #333;
}

.chrome-browser .cell:nth-child(n+19):nth-child(-n+27),
.chrome-browser .cell:nth-child(n+46):nth-child(-n+54) {
    border-bottom: 2px solid #333;
}

.chrome-browser .number-pad {
    gap: 3px;
    margin: 4px auto;
    max-width: 450px;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
}

.chrome-browser .number-btn,
.chrome-browser .erase-btn {
    padding: 6px;
    font-size: 0.95em;
    border: 1px solid #667eea;
    width: 100%;
}

.chrome-browser .controls {
    gap: 3px;
    margin-bottom: 4px;
    max-width: 450px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    display: flex;
}

.chrome-browser .btn {
    padding: 6px;
    font-size: 0.8em;
}

.chrome-browser .message {
    padding: 5px;
    font-size: 0.8em;
    min-height: 24px;
    margin-bottom: 4px;
}

.chrome-browser #btn-leaderboard {
    padding: 7px 10px;
    font-size: 0.85em;
}

/* Fix pour Edge et Firefox - ADAPTATIF COMPLET SANS SCROLL */
.edge-firefox-browser body {
    padding: 0;
    overflow: hidden;
}

.edge-firefox-browser .container {
    padding: 2px;
    max-height: 100vh;
    height: 100vh;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.edge-firefox-browser header {
    margin-bottom: 1px;
    flex-shrink: 0;
}

.edge-firefox-browser h1 {
    font-size: 0.85em;
    margin-bottom: 0;
    line-height: 1;
}

.edge-firefox-browser .date {
    font-size: 0.6em;
    margin-bottom: 1px;
    line-height: 1;
}

.edge-firefox-browser #view-leaderboard-btn {
    padding: 2px 4px;
    font-size: 0.6em;
    margin-top: 1px;
    min-height: auto;
    line-height: 1.2;
}

.edge-firefox-browser .game-controls-bar {
    padding: 3px 0;
    margin-bottom: 2px;
    gap: 6px;
    flex-shrink: 0;
}

.edge-firefox-browser .timer,
.edge-firefox-browser .lives {
    font-size: 0.7em;
    gap: 2px;
}

.edge-firefox-browser .timer-label,
.edge-firefox-browser .lives-label {
    font-size: 0.9em;
}

.edge-firefox-browser #timer,
.edge-firefox-browser #lives {
    font-size: 0.8em;
}

.edge-firefox-browser .progress-container {
    display: none;
}

.edge-firefox-browser .sudoku-grid {
    margin-bottom: 1px;
    border: 1px solid #333;
    width: 100%;
    height: auto;
    max-height: calc(100vh - 280px);
    aspect-ratio: 1;
    flex-shrink: 1;
    margin-left: auto;
    margin-right: auto;
}

.edge-firefox-browser .cell {
    font-size: 0.95em;
    border: 0.5px solid #ddd;
}

.edge-firefox-browser .number-pad {
    gap: 1px;
    margin: 1px 0;
    flex-shrink: 0;
}

.edge-firefox-browser .number-btn,
.edge-firefox-browser .erase-btn {
    padding: 3px;
    font-size: 0.75em;
    min-height: 24px;
    line-height: 1;
}

.edge-firefox-browser .controls {
    gap: 1px;
    margin-bottom: 1px;
    flex-shrink: 0;
}

.edge-firefox-browser .btn {
    padding: 3px;
    font-size: 0.65em;
    min-height: 22px;
    line-height: 1.2;
}

.edge-firefox-browser .message {
    padding: 1px;
    font-size: 0.6em;
    min-height: 14px;
    margin-bottom: 0;
    flex-shrink: 0;
    line-height: 1.2;
}

header {
    text-align: center;
    margin-bottom: 0;
}

h1 {
    color: #667eea;
    font-size: 1.5em;
    margin-bottom: 0;
    text-shadow: 0 2px 4px rgba(102, 126, 234, 0.15);
}

.date {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Barre de contrôle unifiée */
.game-controls-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    padding: 6px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    width: 100%;
    box-sizing: border-box;
}

.timer {
    flex: 0 0 auto;
}

.lives {
    flex: 0 0 auto;
}

/* Sélecteur de difficulté */
.difficulty-selector {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    padding: 0;
}

.difficulty-btn {
    padding: 6px 20px;
    font-size: 0.85em;
    font-weight: 600;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.difficulty-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.difficulty-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.difficulty-btn.completed {
    background: linear-gradient(135deg, #66bb6a 0%, #43a047 100%);
    color: white;
    border-color: #66bb6a;
}

.difficulty-btn.completed:not(.active) {
    opacity: 0.7;
}

.timer, .lives {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 1em;
    white-space: nowrap;
}

.timer-label, .lives-label {
    font-size: 1.2em;
}

#timer {
    color: #667eea;
    font-weight: bold;
    font-size: 1.1em;
    transition: all 0.3s ease;
}

#lives {
    color: #ef5350;
    font-weight: bold;
    font-size: 1.1em;
    transition: all 0.3s ease;
}

#timer.penalty-flash {
    animation: penaltyFlash 1s ease;
}

@keyframes penaltyFlash {
    0%, 100% { 
        color: #667eea;
        transform: scale(1);
    }
    15%, 45%, 75% { 
        color: #e53935;
        transform: scale(1.1);
    }
    30%, 60%, 90% { 
        color: #667eea;
        transform: scale(1);
    }
}

.progress-container {
    position: relative;
    width: 100%;
    height: 30px;
    background: #f0f0f0;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    color: #333;
    font-size: 0.9em;
}

.sudoku-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 0;
    width: 100%;
    aspect-ratio: 1;
    border: 3px solid #333;
    margin-bottom: 6px;
    background: #333;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
    box-sizing: border-box;
    transition: filter 0.3s ease;
}

.sudoku-grid.paused {
    filter: blur(20px);
    pointer-events: none;
    user-select: none;
    opacity: 0.5;
}

.cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3em;
    font-weight: bold;
    background: white;
    border: 1px solid #ddd;
    cursor: pointer;
}

.cell:hover:not(.fixed) {
    background: #e3f2fd;
}

.cell.selected {
    background: #bbdefb !important;
    border: 2px solid #667eea;
    box-shadow: inset 0 0 8px rgba(102, 126, 234, 0.3);
}

.cell.fixed {
    background: linear-gradient(135deg, #f9f9f9 0%, #f0f0f0 100%);
    color: #333;
    cursor: pointer;
    font-weight: 800;
}

.cell.user-input {
    color: #667eea;
}

.cell.correct {
    background: #e8f5e9 !important;
    color: #2e7d32;
}

.cell.same-region {
    background: rgba(245, 250, 255, 0.75) !important;
}

.cell.same-number {
    background: rgba(173, 216, 230, 0.8) !important;
}

.cell.error {
    background: #ffcdd2 !important;
    color: #c62828 !important;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.cell.notes-active {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    padding: 2px;
    gap: 1px;
    font-size: 1em;
}

.note-number {
    font-size: 10px;
    color: #555;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.note-number.same-number-note {
    background: rgba(173, 216, 230, 0.8);
    border-radius: 3px;
    font-weight: 700;
    color: #1565c0;
}

/* Bordures épaisses pour les blocs 3x3 */
.cell:nth-child(3n):not(:nth-child(9n)) {
    border-right: 3px solid #333;
}

.cell:nth-child(n+19):nth-child(-n+27),
.cell:nth-child(n+46):nth-child(-n+54) {
    border-bottom: 3px solid #333;
}

/* Clavier numérique */
.number-pad {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin: 8px 0;
}

.number-btn, .erase-btn {
    padding: 10px;
    font-size: 1.2em;
    font-weight: bold;
    border: 2px solid #667eea;
    border-radius: 10px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    color: #667eea;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.15);
}

.number-btn:hover, .erase-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.number-btn:active, .erase-btn:active {
    transform: translateY(0);
}

.number-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #e0e0e0;
    color: #9e9e9e;
    border-color: #bdbdbd;
}

.number-btn:disabled:hover {
    transform: none;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.15);
}

.erase-btn {
    background: linear-gradient(135deg, #ef5350 0%, #e53935 100%);
    border-color: #ef5350;
    color: white;
    box-shadow: 0 2px 6px rgba(229, 57, 53, 0.25);
}

.erase-btn:hover {
    background: linear-gradient(135deg, #c62828 0%, #b71c1c 100%);
    border-color: #c62828;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(198, 40, 40, 0.4);
}

.controls {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.btn {
    flex: 1;
    padding: 9px;
    font-size: 0.95em;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #5a67d8 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #4c51bf 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #9e9e9e;
    color: white;
}

.btn-secondary:hover {
    background: #757575;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(158, 158, 158, 0.4);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-warning {
    background: linear-gradient(135deg, #ffa726 0%, #fb8c00 100%);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #fb8c00 0%, #f57c00 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(251, 140, 0, 0.3);
}

.btn-success {
    background: #66bb6a;
    color: white;
}

.btn-success:hover {
    background: #4caf50;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 187, 106, 0.4);
}

.btn-notes {
    background: #ab47bc;
    color: white;
}

.btn-notes:hover {
    background: #8e24aa;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(171, 71, 188, 0.4);
}

.btn-notes.active {
    background: #8e24aa;
    box-shadow: 0 0 15px rgba(171, 71, 188, 0.6);
}

.btn-theme {
    background: #607d8b;
    color: white;
}

.btn-theme:hover {
    background: #455a64;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(96, 125, 139, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #667eea 0%, #5a67d8 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #4c51bf 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.message {
    text-align: center;
    padding: 8px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.95em;
    min-height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
}

.message.success {
    background: #e8f5e9;
    color: #2e7d32;
}

.message.error {
    background: #ffebee;
    color: #c62828;
}

.message.info {
    background: #e3f2fd;
    color: #1565c0;
}

@keyframes celebrate {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.05) rotate(2deg); }
    75% { transform: scale(1.05) rotate(-2deg); }
}

@keyframes confetti {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: #667eea;
    animation: confetti 3s linear;
    pointer-events: none;
}

/* Grille en mode notes - bordure violette visible */
.sudoku-grid.notes-mode {
    border-color: #ab47bc !important;
    border-width: 6px !important;
    box-shadow: 0 0 60px rgba(171, 71, 188, 0.9) !important;
    transition: all 0.3s ease;
}

.sudoku-grid.notes-mode .cell:hover:not(.fixed) {
    background: #f3e5f5 !important;
    box-shadow: inset 0 0 20px rgba(171, 71, 188, 0.3);
}

.sudoku-grid.notes-mode .cell.selected {
    background: #e1bee7 !important;
    border-color: #ab47bc;
    box-shadow: 0 0 15px rgba(171, 71, 188, 0.8);
}

body.dark-mode .sudoku-grid.notes-mode {
    border-color: #ba68c8 !important;
    box-shadow: 0 0 60px rgba(186, 104, 200, 0.9) !important;
}

body.dark-mode .sudoku-grid.notes-mode .cell:hover:not(.fixed) {
    background: #4a148c !important;
}

body.dark-mode .sudoku-grid.notes-mode .cell.selected {
    background: #6a1b9a !important;
}

@media (max-width: 600px) {
    .container {
        padding: 10px;
    }

    h1 {
        font-size: 1.5em;
    }
    
    .game-controls-bar {
        gap: 6px;
        padding: 6px 0;
    }
    
    .difficulty-selector {
        gap: 4px;
    }
    
    .difficulty-btn {
        padding: 6px 12px;
        font-size: 0.75em;
    }
    
    .timer, .lives {
        font-size: 0.9em;
    }

    .cell {
        font-size: 1em;
    }

    .controls {
        flex-direction: column;
        gap: 5px;
    }
    
    .number-pad {
        gap: 4px;
        margin: 8px 0;
    }
    
    .number-btn, .erase-btn {
        padding: 8px;
        font-size: 1em;
    }
}

/* Styles pour le bouton du classement */
.btn-leaderboard {
    background: #ffa726;
    color: white;
    padding: 6px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
    margin-top: 4px;
    transition: all 0.3s;
}

.btn-leaderboard:hover {
    background: #fb8c00;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 167, 38, 0.4);
}

/* Styles pour les modales */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 30px;
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    color: #667eea;
    text-align: center;
    margin-bottom: 20px;
}

.modal-content p {
    text-align: center;
    font-size: 1.1em;
    margin-bottom: 20px;
    color: #666;
}

.time-display {
    text-align: center;
    font-size: 1.3em;
    margin: 20px 0;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: white;
}

.final-time {
    font-weight: bold;
    font-size: 1.5em;
    margin-left: 10px;
}

.name-input-container {
    margin: 20px 0;
}

.name-input-container label {
    display: block;
    margin-bottom: 10px;
    color: #333;
    font-weight: 600;
}

.name-input-container input {
    width: 100%;
    padding: 12px;
    font-size: 1.1em;
    border: 2px solid #667eea;
    border-radius: 8px;
    box-sizing: border-box;
    transition: all 0.3s;
}

.name-input-container input:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

#submit-score-btn {
    width: 100%;
    margin-bottom: 10px;
}

#skip-score-btn {
    width: 100%;
}

/* Styles pour la modale Game Over */
.gameover-content {
    max-width: 450px;
    text-align: center;
}

.gameover-content h2 {
    color: #ef5350;
    font-size: 2.5em;
    margin-bottom: 15px;
}

.gameover-content p {
    font-size: 1.2em;
    margin-bottom: 10px;
}

.gameover-message {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    padding: 25px;
    border-radius: 12px;
    margin: 25px 0;
    border: 2px solid #ef5350;
}

.gameover-message p {
    margin: 10px 0;
    font-size: 1.1em;
    color: #c62828;
    font-weight: 600;
}

#view-solution-btn {
    width: 100%;
    margin-top: 10px;
}

/* Styles pour la modale À demain */
.seeYouTomorrow-content {
    max-width: 500px;
    text-align: center;
}

.seeYouTomorrow-content h2 {
    color: #667eea;
    font-size: 2.5em;
    margin-bottom: 15px;
}

.seeYouTomorrow-content > p {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: #666;
}

.seeYouTomorrow-message {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 25px;
    border-radius: 12px;
    margin: 25px 0;
    border: 2px solid #667eea;
}

.seeYouTomorrow-message p {
    margin: 10px 0;
    font-size: 1.1em;
    color: #1565c0;
    font-weight: 600;
}

#view-final-leaderboard-btn {
    width: 100%;
    margin-top: 10px;
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close-btn:hover,
.close-btn:focus {
    color: #000;
}

.leaderboard-content {
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
}

.user-rank {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 20px;
}

.leaderboard-header {
    display: grid;
    grid-template-columns: 80px 1fr 120px 120px;
    gap: 10px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

/* Onglets du classement */
.leaderboard-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.leaderboard-tab {
    flex: 1;
    max-width: 200px;
    padding: 12px 24px;
    font-size: 1em;
    font-weight: 600;
    border: 2px solid #ddd;
    border-radius: 10px;
    background: white;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.leaderboard-tab:hover {
    background: #f5f5f5;
    transform: translateY(-2px);
}

.leaderboard-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.leaderboard-list {
    max-height: 400px;
    overflow-y: auto;
}

.leaderboard-item {
    display: grid;
    grid-template-columns: 80px 1fr 120px 120px;
    gap: 10px;
    padding: 15px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.3s;
}

.leaderboard-item:hover {
    background: #f9f9f9;
    transform: translateX(5px);
}

.leaderboard-item.user-entry {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 2px solid #667eea;
    font-weight: bold;
}

.leaderboard-item.top-3 {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
}

.leaderboard-item.top-3:nth-child(2) {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
}

.leaderboard-item.top-3:nth-child(3) {
    background: linear-gradient(135deg, #cd7f32 0%, #e6a86a 100%);
}

.rank-col, .time-col, .date-col {
    text-align: center;
}

.name-col {
    text-align: left;
    font-weight: 600;
}

.medal {
    font-size: 1.5em;
    margin-right: 5px;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

body.dark-mode .modal-content {
    background: #0f3460;
    color: #e4e4e4;
}

body.dark-mode .modal-content h2 {
    color: #00d4ff;
}

body.dark-mode .gameover-content h2 {
    color: #ef5350;
}

body.dark-mode .gameover-message {
    background: linear-gradient(135deg, rgba(211, 47, 47, 0.2) 0%, rgba(229, 57, 53, 0.2) 100%);
    border-color: #ef5350;
}

body.dark-mode .gameover-message p {
    color: #ef5350;
}

body.dark-mode .seeYouTomorrow-content h2 {
    color: #00d4ff;
}

body.dark-mode .seeYouTomorrow-message {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15) 0%, rgba(102, 126, 234, 0.15) 100%);
    border-color: #00d4ff;
}

body.dark-mode .seeYouTomorrow-message p {
    color: #00d4ff;
}

body.dark-mode .name-input-container input {
    background: #1a1a2e;
    color: #e4e4e4;
    border-color: #00d4ff;
}

body.dark-mode .leaderboard-header {
    background: #16213e;
    color: #e4e4e4;
}

body.dark-mode .leaderboard-item {
    background: #1a1a2e;
    border-color: #2d4059;
    color: #e4e4e4;
}

body.dark-mode .leaderboard-item:hover {
    background: #16213e;
}

@media (max-width: 600px) {
    .leaderboard-header,
    .leaderboard-item {
        grid-template-columns: 60px 1fr 90px;
        font-size: 0.9em;
    }

    .date-col {
        display: none;
    }
}

.leaderboard-item.top-3 {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
}

.leaderboard-item.top-3:nth-child(2) {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
}

.leaderboard-item.top-3:nth-child(3) {
    background: linear-gradient(135deg, #cd7f32 0%, #e6a86a 100%);
}

.rank-col, .time-col, .date-col {
    text-align: center;
}

.name-col {
    text-align: left;
    font-weight: 600;
}

.medal {
    font-size: 1.5em;
    margin-right: 5px;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

body.dark-mode .modal-content {
    background: #0f3460;
    color: #e4e4e4;
}

body.dark-mode .modal-content h2 {
    color: #00d4ff;
}

body.dark-mode .gameover-content h2 {
    color: #ef5350;
}

body.dark-mode .gameover-message {
    background: linear-gradient(135deg, rgba(211, 47, 47, 0.2) 0%, rgba(229, 57, 53, 0.2) 100%);
    border-color: #ef5350;
}

body.dark-mode .gameover-message p {
    color: #ef5350;
}

body.dark-mode .seeYouTomorrow-content h2 {
    color: #00d4ff;
}

body.dark-mode .seeYouTomorrow-message {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15) 0%, rgba(102, 126, 234, 0.15) 100%);
    border-color: #00d4ff;
}

body.dark-mode .seeYouTomorrow-message p {
    color: #00d4ff;
}

body.dark-mode .name-input-container input {
    background: #1a1a2e;
    color: #e4e4e4;
    border-color: #00d4ff;
}

body.dark-mode .leaderboard-header {
    background: #16213e;
    color: #e4e4e4;
}

body.dark-mode .leaderboard-item {
    background: #1a1a2e;
    border-color: #2d4059;
    color: #e4e4e4;
}

body.dark-mode .leaderboard-item:hover {
    background: #16213e;
}

@media (max-width: 600px) {
    .leaderboard-header,
    .leaderboard-item {
        grid-template-columns: 60px 1fr 90px;
        font-size: 0.9em;
    }

    .date-col {
        display: none;
    }
}

body.dark-mode .gameover-message p {
    color: #ef5350;
}

body.dark-mode .seeYouTomorrow-content h2 {
    color: #00d4ff;
}

body.dark-mode .seeYouTomorrow-message {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15) 0%, rgba(102, 126, 234, 0.15) 100%);
    border-color: #00d4ff;
}

body.dark-mode .seeYouTomorrow-message p {
    color: #00d4ff;
}

body.dark-mode .name-input-container input {
    background: #1a1a2e;
    color: #e4e4e4;
    border-color: #00d4ff;
}

body.dark-mode .leaderboard-header {
    background: #16213e;
    color: #e4e4e4;
}

body.dark-mode .leaderboard-item {
    background: #1a1a2e;
    border-color: #2d4059;
    color: #e4e4e4;
}

body.dark-mode .leaderboard-item:hover {
    background: #16213e;
}

@media (max-width: 600px) {
    .leaderboard-header,
    .leaderboard-item {
        grid-template-columns: 60px 1fr 90px;
        font-size: 0.9em;
    }

    .date-col {
        display: none;
    }
}
