/* ============================================================
   TROUVER LES PAROLES — Design System
   Style : Disco 70s-80s — Neon & Funk
   ============================================================ */

/* --- Variables CSS --- */
:root {
    --green: #FF1493;
    --green-light: rgba(255, 20, 147, 0.12);
    --black: #0D0221;
    --bg: #0D0221;
    --surface: #1A0A3E;
    --surface-hover: #2D1B69;
    --surface-border: #4A2D8A;
    --text: #FFFFFF;
    --text-soft: #D4B8FF;
    --text-muted: #8B6FC0;
    --error: #ff4b4b;
    --success: #39FF14;
    --gold: #FFD700;
    --cyan: #00FFFF;
    --magenta: #FF1493;
    --electric-blue: #7B68EE;
    --orange-disco: #FF6B35;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-groovy: 'Pacifico', cursive;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(100, 0, 200, 0.4);
    --transition: 0.2s ease;
    --max-width: 1100px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: hidden;
    cursor: default;
    -webkit-user-select: none;
    user-select: none;
}

/* Autoriser la sélection/curseur texte uniquement dans les champs de saisie */
input, textarea, [contenteditable] {
    cursor: text;
    -webkit-user-select: text;
    user-select: text;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(255, 20, 147, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(123, 104, 238, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(0, 255, 255, 0.05) 0%, transparent 50%);
}

/* Bloquer le scroll sur fin */
body:has(#end-screen:not(.hidden)) {
    height: 100vh;
    overflow: hidden;
}

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

/* --- Canvas confettis --- */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* ============================================================
   ECRAN D'ACCUEIL (Splash)
   ============================================================ */
section:not(#main) {
    min-height: 100vh;
}

#main {
    min-height: 100vh;
}

body:has(#game-area:not(.hidden)) #main {
    height: 100vh;
    min-height: 0;
}

#splash {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: 70px;
    background: var(--bg);
    overflow-y: auto;
    background-image:
        radial-gradient(circle at 50% 50%, rgba(255, 20, 147, 0.06) 0%, transparent 60%),
        radial-gradient(circle at 20% 80%, rgba(123, 104, 238, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 80% 30%, rgba(0, 255, 255, 0.04) 0%, transparent 40%);
}

/* Disco lights — wrapper clippé, GPU-only animations */
.disco-lights {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
    contain: strict;
}

.disco-lights::before,
.disco-lights::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    will-change: transform;
}

.disco-lights::before {
    background-image:
        radial-gradient(2px 2px at 20% 30%, rgba(255, 215, 0, 0.5), transparent 3px),
        radial-gradient(2px 2px at 40% 15%, rgba(0, 255, 255, 0.4), transparent 3px),
        radial-gradient(2px 2px at 60% 45%, rgba(255, 20, 147, 0.45), transparent 3px),
        radial-gradient(2px 2px at 75% 25%, rgba(255, 215, 0, 0.4), transparent 3px),
        radial-gradient(2px 2px at 15% 60%, rgba(123, 104, 238, 0.4), transparent 3px),
        radial-gradient(2px 2px at 85% 55%, rgba(0, 255, 255, 0.35), transparent 3px),
        radial-gradient(2px 2px at 35% 75%, rgba(255, 20, 147, 0.35), transparent 3px),
        radial-gradient(2px 2px at 55% 85%, rgba(255, 215, 0, 0.35), transparent 3px),
        radial-gradient(2px 2px at 90% 70%, rgba(123, 104, 238, 0.35), transparent 3px),
        radial-gradient(2px 2px at 10% 90%, rgba(0, 255, 255, 0.3), transparent 3px),
        radial-gradient(3px 3px at 50% 50%, rgba(255, 215, 0, 0.3), transparent 4px),
        radial-gradient(2px 2px at 70% 80%, rgba(255, 20, 147, 0.3), transparent 3px);
    animation: discoBallSpin 20s linear infinite;
}

.disco-lights::after {
    top: -30%;
    left: -30%;
    width: 160%;
    height: 160%;
    background-image:
        radial-gradient(3px 3px at 25% 20%, rgba(255, 215, 0, 0.3), transparent 5px),
        radial-gradient(3px 3px at 65% 35%, rgba(0, 255, 255, 0.25), transparent 5px),
        radial-gradient(3px 3px at 45% 70%, rgba(255, 20, 147, 0.25), transparent 5px),
        radial-gradient(3px 3px at 80% 60%, rgba(123, 104, 238, 0.25), transparent 5px),
        radial-gradient(4px 4px at 30% 50%, rgba(255, 215, 0, 0.2), transparent 6px),
        radial-gradient(3px 3px at 70% 15%, rgba(0, 255, 255, 0.2), transparent 5px);
    animation: discoBallSpin 30s linear infinite reverse;
    opacity: 0.6;
}

@keyframes discoBallSpin {
    from { transform: rotate(0deg) translateZ(0); }
    to { transform: rotate(360deg) translateZ(0); }
}

#splash > *:not(.disco-lights) {
    position: relative;
    z-index: 1;
}

/* Quand la recherche est visible, permettre le scroll */
#splash:has(#splash-search:not(.hidden)) {
    overflow-y: auto;
}

/* --- Hero : centre verticalement --- */
.splash-hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: fadeInUp 0.6s ease-out;
    text-align: center;
}

/* --- Titre + icone en haut --- */
.splash-header {
    margin-bottom: 2rem;
}

.splash-icon {
    font-size: 3.5rem;
    margin-bottom: 0.75rem;
    animation: float 3s ease-in-out infinite;
}

.splash-title {
    font-family: 'Monoton', cursive;
    font-size: clamp(2.25rem, 6vw, 3.5rem);
    font-weight: 400;
    color: var(--gold);
    letter-spacing: 2px;
    text-shadow:
        0 0 10px rgba(255, 215, 0, 0.6),
        0 0 30px rgba(255, 20, 147, 0.4),
        0 0 60px rgba(255, 20, 147, 0.2),
        0 0 100px rgba(123, 104, 238, 0.15);
    animation: titleGlow 4s ease-in-out infinite;
}

@keyframes titleGlow {
    0% {
        filter: hue-rotate(0deg) brightness(1);
    }
    25% {
        filter: hue-rotate(60deg) brightness(1.1);
    }
    50% {
        filter: hue-rotate(120deg) brightness(1.05);
    }
    75% {
        filter: hue-rotate(180deg) brightness(1.1);
    }
    100% {
        filter: hue-rotate(360deg) brightness(1);
    }
}

/* --- Bouton "Choisir ma chanson" sous la carte --- */
.btn-choose {
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.55rem 1.75rem;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    border-radius: 50px;
    border: 1.5px solid var(--surface-border);
    transition: all var(--transition);
}

.btn-choose:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(255, 215, 0, 0.08);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.15);
    transform: translateY(-1px);
}

/* --- Recherche inline sur le splash --- */
.splash-search {
    width: 100%;
    max-width: 480px;
    margin-top: 1.25rem;
    animation: fadeInUp 0.3s ease-out;
}

.splash-search-bar {
    display: flex;
    gap: 0.5rem;
}

.splash-search-bar input {
    flex: 1;
    padding: 0.7rem 1.25rem;
    border-radius: 50px;
    border: 1.5px solid var(--surface-border);
    background: var(--surface);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.95rem;
    outline: none;
    transition: border-color var(--transition);
}

/* --- Custom Select (difficulté) --- */
.custom-select {
    position: relative;
    display: inline-block;
    z-index: 50;
}

.custom-select-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 44px;
    padding: 0 1.1rem;
    border-radius: 50px;
    box-sizing: border-box;
    border: 1px solid var(--surface-border);
    background: var(--surface);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.8rem;
    cursor: pointer;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    white-space: nowrap;
}

.custom-select-btn:hover {
    border-color: var(--text-muted);
}

.custom-select.open .custom-select-btn {
    border-color: var(--magenta);
    box-shadow: 0 0 8px rgba(255, 20, 147, 0.2);
}

.custom-select-arrow {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--text-soft);
    border-bottom: 2px solid var(--text-soft);
    transform: rotate(-45deg);
    transition: transform 0.3s ease, border-color 0.3s ease;
    flex-shrink: 0;
}

.custom-select.open .custom-select-arrow {
    transform: rotate(45deg);
    border-color: var(--magenta);
}

.custom-select-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) scaleY(0);
    transform-origin: top center;
    min-width: 100%;
    list-style: none;
    margin: 0;
    padding: 0.3rem 0;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
    box-shadow: var(--shadow-lg);
}

.custom-select.open .custom-select-dropdown {
    pointer-events: auto;
}

.custom-select.open .custom-select-dropdown {
    transform: translateX(-50%) scaleY(1);
    opacity: 1;
}

.custom-select-dropdown li {
    padding: 0.5rem 1.25rem;
    font-family: var(--font);
    font-size: 0.8rem;
    color: var(--text-soft);
    cursor: pointer;
    text-align: center;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.custom-select-dropdown li:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.custom-select-dropdown li.selected {
    color: var(--magenta);
    font-weight: 600;
}

/* Dans la carte défi du jour : ouvrir vers le haut */
.daily-song-card .custom-select-dropdown {
    top: auto;
    bottom: calc(100% + 6px);
    transform-origin: bottom center;
    transform: translateX(-50%) scaleY(0);
}

.daily-song-card .custom-select.open .custom-select-dropdown {
    transform: translateX(-50%) scaleY(1);
}

/* Flèche > quand fermé, ^ quand ouvert */
.daily-song-card .custom-select-arrow {
    transform: rotate(-45deg);
}

.daily-song-card .custom-select.open .custom-select-arrow {
    transform: rotate(-135deg);
}

.splash-search-bar input::placeholder {
    color: var(--text-muted);
}

.splash-search-bar input:focus {
    border-color: var(--magenta);
    box-shadow: 0 0 10px rgba(255, 20, 147, 0.2), 0 0 20px rgba(123, 104, 238, 0.1);
}

/* --- Chanson du jour : bloc dominant --- */
.daily-song-card {
    max-width: 540px;
    width: 100%;
    padding: 2rem 2.5rem 3rem;
    background: var(--surface);
    border: none;
    border-radius: 16px;
    text-align: center;
    animation: fadeInUp 0.5s ease-out 0.1s both;
    transition: transform var(--transition), box-shadow var(--transition);
    position: relative;
    overflow: visible;
}

/* (barre multicolore retirée de la carte défi du jour) */

@keyframes discoStripe {
    0% { transform: translateX(-50%) translateZ(0); }
    100% { transform: translateX(0) translateZ(0); }
}

.daily-song-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(255, 20, 147, 0.2), 0 0 15px rgba(123, 104, 238, 0.15);
}

.daily-badge {
    display: inline-block;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #fff;
    background: linear-gradient(135deg, var(--magenta), var(--electric-blue));
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    margin-bottom: 1rem;
}

.daily-hook {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
    line-height: 1.5;
}

.daily-info {
    margin-bottom: 2rem;
}

.daily-song-text {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    display: block;
    letter-spacing: -0.5px;
}

.daily-artist {
    display: block;
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-soft);
    margin-top: 0.5rem;
}

.btn-daily-main {
    font-size: 1.1rem;
    padding: 0.9rem 2.5rem;
    border-radius: 50px;
    border: none;
    color: #fff;
    transition: transform 0.2s ease;
}

.btn-daily-main:hover {
    transform: scale(1.08);
}

/* --- Fallback (pas de chanson du jour) --- */
.splash-fallback {
    text-align: center;
    animation: fadeInUp 0.6s ease-out;
}

.splash-fallback-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    animation: float 3s ease-in-out infinite;
}

.splash-fallback-title {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
    letter-spacing: -0.3px;
}

.splash-fallback-sub {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 340px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

.btn-fallback-play {
    font-size: 1.05rem;
    padding: 0.85rem 2.5rem;
}

/* --- Dernieres chansons (bas de page) --- */
.daily-chart-section {
    flex-shrink: 0;
    max-width: 600px;
    margin: 2rem auto 0;
    text-align: center;
}

.daily-chart-section h3 {
    font-size: 0.9rem;
    color: var(--text-soft);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.daily-chart-section canvas {
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: var(--radius);
}

.recent-songs {
    flex-shrink: 0;
    text-align: left;
    max-width: 540px;
    margin: 0 auto;
    margin-top: 2.5rem;
    padding: 0.75rem 1.5rem 1.25rem;
}

.recent-songs h3 {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.recent-songs ul {
    list-style: none;
}

.recent-songs li {
    padding: 0.6rem 0.75rem;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.9rem;
}

.recent-songs li:hover {
    background: var(--surface-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 20, 147, 0.15), 0 0 8px rgba(123, 104, 238, 0.1);
    border-color: var(--electric-blue);
}

.recent-songs .recent-artist {
    color: var(--green);
    font-weight: 600;
}

/* ============================================================
   BOUTONS
   ============================================================ */
.btn-primary {
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 600;
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, var(--magenta), var(--electric-blue));
    color: #fff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    will-change: transform;
    animation: btnShimmer 3s ease-in-out infinite;
}

@keyframes btnShimmer {
    0%, 70% { transform: translateX(-250%) skewX(-20deg) translateZ(0); }
    100% { transform: translateX(250%) skewX(-20deg) translateZ(0); }
}

.btn-primary:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 25px rgba(255, 20, 147, 0.5), 0 0 20px rgba(123, 104, 238, 0.35), 0 0 40px rgba(255, 107, 53, 0.15);
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-glow {
    box-shadow: 0 0 15px rgba(255, 20, 147, 0.3), 0 0 30px rgba(123, 104, 238, 0.15);
    animation: btnGlowPulse 2s ease-in-out infinite alternate;
}

@keyframes btnGlowPulse {
    from { opacity: 0.85; }
    to { opacity: 1; }
}

.btn-secondary {
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    white-space: nowrap;
}

.btn-secondary:hover {
    background: var(--surface-hover);
    border-color: var(--magenta);
    color: var(--magenta);
    box-shadow: 0 0 10px rgba(255, 20, 147, 0.15);
    transform: translateY(-1px);
}

.btn-small {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.6rem;
    background: transparent;
    color: var(--green);
    border: 1px solid var(--green);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-small:hover {
    background: var(--green-light);
}

.btn-icon {
    background: linear-gradient(135deg, var(--magenta), var(--electric-blue));
    color: #fff;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--transition);
}

.btn-icon:hover {
    background: linear-gradient(135deg, var(--electric-blue), var(--magenta));
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 20, 147, 0.4);
}

.btn-tiny {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--surface-border);
    background: var(--surface);
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
}

.btn-tiny:hover {
    background: var(--surface-hover);
}

/* ============================================================
   EN-TETE PRINCIPAL
   ============================================================ */
#main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.main-header {
    padding: 1rem 2rem;
    background: linear-gradient(180deg, var(--surface) 0%, rgba(26, 10, 62, 0.95) 100%);
    border-bottom: 2px solid;
    border-image: linear-gradient(90deg, var(--magenta), var(--gold), var(--cyan), var(--magenta)) 1;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

/* Header toujours visible, même pendant le jeu */
.main-header.playing-hidden {
    opacity: 1;
    pointer-events: auto;
}

/* Compenser l'espace du header fixe (sauf splash) */
body > .main-header ~ section {
    padding-top: 130px;
}

.header-title {
    font-family: 'Monoton', cursive;
    font-size: 1.55rem;
    font-weight: 400;
    color: var(--gold);
    text-align: center;
    margin-bottom: 0.75rem;
    letter-spacing: 2px;
    text-shadow:
        0 0 10px rgba(255, 215, 0, 0.6),
        0 0 30px rgba(255, 20, 147, 0.4),
        0 0 60px rgba(255, 20, 147, 0.2),
        0 0 100px rgba(123, 104, 238, 0.15);
}

/* Cacher le titre du header sur la page d'accueil (le grand titre splash suffit) */
body:has(#splash:not(.hidden)) .header-title {
    display: none;
}

body:has(#splash:not(.hidden)) .main-header .search-bar {
    margin-top: 0;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 600px;
    margin: 0 auto;
}

.search-bar input {
    flex: 1;
    height: 44px;
    padding: 0 1.25rem;
    border-radius: 50px;
    border: 1px solid var(--surface-border);
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9rem;
    box-sizing: border-box;
    outline: none;
    transition: border-color var(--transition);
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.search-bar input:focus {
    border-color: var(--magenta);
    box-shadow: 0 0 10px rgba(255, 20, 147, 0.2), 0 0 20px rgba(123, 104, 238, 0.1);
}

/* ============================================================
   PANELS (resultats, configuration)
   ============================================================ */
.panel {
    max-width: 700px;
    margin: 1.5rem auto;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
    animation: fadeInUp 0.4s ease-out;
    position: relative;
    overflow: hidden;
}

.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 2px;
    background: linear-gradient(90deg, var(--magenta), var(--gold), var(--cyan), var(--magenta), var(--gold), var(--cyan), var(--magenta));
    animation: discoStripe 3s linear infinite;
    will-change: transform;
}

.panel h3 {
    font-family: var(--font);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.panel-hint {
    font-size: 0.85rem;
    color: var(--text-soft);
    margin-bottom: 1rem;
}

/* --- Liste des resultats LRCLIB --- */
#results-list {
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
}

#results-list li {
    padding: 0.75rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: 0.4rem;
}

#results-list li:hover {
    background: var(--surface-hover);
    border-color: var(--green);
}

#results-list .result-artist {
    font-weight: 600;
    color: var(--green);
}

#results-list .result-title {
    color: var(--text);
}

#results-list .result-album {
    font-size: 0.8rem;
    color: var(--text-muted);
}

#results-list li.configured {
    border-left: 3px solid var(--green);
    background: var(--green-light);
}

.result-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--magenta), var(--electric-blue));
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    margin-left: 0.4rem;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-ready {
    color: var(--green);
    font-size: 0.8rem;
}

/* --- Spinner --- */
.spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid var(--surface-border);
    border-top-color: var(--magenta);
    border-right-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.5rem;
}

.spinner-lg { width: 40px; height: 40px; margin-bottom: 1rem; }

.game-loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 999;
}
.game-loading-overlay p {
    color: #fff;
    font-size: 1rem;
    font-family: var(--font);
}

/* --- Setup Panel --- */
.selected-song {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--surface-border);
}

.selected-song .label {
    font-size: 0.85rem;
    color: var(--text-soft);
}

.selected-song strong {
    color: var(--green);
    font-size: 1rem;
}

.youtube-section {
    margin-bottom: 1.25rem;
}

.youtube-section label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-soft);
}

.youtube-input-row {
    display: flex;
    gap: 0.5rem;
}

.youtube-input-row input {
    flex: 1;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--surface-border);
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition);
}

.youtube-input-row input:focus {
    border-color: var(--magenta);
    box-shadow: 0 0 10px rgba(255, 20, 147, 0.2), 0 0 20px rgba(123, 104, 238, 0.1);
}

.youtube-input-row input::placeholder {
    color: var(--text-muted);
}

/* --- Resultats YouTube --- */
.yt-results {
    margin-top: 0.75rem;
}

.yt-results-hint {
    font-size: 0.8rem;
    color: var(--text-soft);
    margin-bottom: 0.5rem;
}

#yt-results-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 250px;
    overflow-y: auto;
}

.yt-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.yt-result-item:hover {
    background: var(--surface-hover);
    border-color: var(--green);
}

.yt-result-item.selected {
    background: var(--green-light);
    border-color: var(--green);
}

.yt-result-thumb {
    width: 80px;
    height: 45px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.yt-result-info {
    flex: 1;
    min-width: 0;
}

.yt-result-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.yt-result-channel {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.lang-section {
    margin-bottom: 1.25rem;
}

.lang-section label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-soft);
}

.lang-section select {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--surface-border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.9rem;
    font-family: var(--font);
    cursor: pointer;
    outline: none;
    transition: border-color var(--transition);
}

.lang-section select:focus {
    border-color: var(--magenta);
    box-shadow: 0 0 10px rgba(255, 20, 147, 0.2);
}

.lang-section select option {
    background: var(--surface);
    color: var(--text);
}

.mode-info {
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--green-light);
    border: 1px solid rgba(255, 20, 147, 0.25);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-soft);
    line-height: 1.5;
}

.mode-info strong {
    color: var(--green);
}

/* Barre de calibration */
.calibration-bar {
    text-align: center;
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
}

.calibration-text {
    font-size: 0.9rem;
    color: var(--text-soft);
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.calibration-text strong {
    color: var(--green);
    font-weight: 600;
}

.lyrics-start-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--green);
    margin-top: 0.25rem;
    text-align: center;
}

.calib-time {
    font-size: 0.8rem;
    color: var(--green);
    font-family: 'SF Mono', 'Fira Code', monospace;
    margin-bottom: 0.75rem;
    min-height: 1.2em;
}

.calib-step {
    text-align: center;
}

.calib-lyric-preview {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
    background: var(--green-light);
    border: 1px solid rgba(255, 20, 147, 0.2);
    border-radius: var(--radius-sm);
    font-style: italic;
}

.calib-words-area {
    margin: 0.75rem 0;
    text-align: center;
}

.calib-words-area .calib-line-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin: 0.5rem 0 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calib-words-area .calib-line-label:first-child {
    margin-top: 0;
}

.calib-word {
    display: inline-block;
    padding: 0.35rem 0.6rem;
    margin: 0.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.15s;
    border: 1.5px solid transparent;
    user-select: none;
    background: var(--surface-hover);
    color: var(--text);
}

.calib-word.heard {
    background: rgba(255, 20, 147, 0.15);
    border-color: rgba(255, 20, 147, 0.4);
    color: var(--green);
}

.calib-word.not-heard {
    background: rgba(255, 75, 75, 0.12);
    border-color: rgba(255, 75, 75, 0.35);
    color: #ff7b7b;
}

.calib-word:hover {
    transform: scale(1.05);
    border-color: var(--green);
}

.calib-word.disabled {
    pointer-events: none;
    opacity: 0.3;
}

.calib-words-separator {
    border: none;
    border-top: 1px dashed var(--surface-border);
    margin: 0.5rem 2rem;
}

.calibration-bar .btn-primary {
    font-size: 1rem;
    padding: 0.6rem 2rem;
}

/* Barre de manche (pendant le jeu) */
.round-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    margin-bottom: 0.75rem;
}

.round-badge {
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 0.3px;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.25);
}

.game-live-stats {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.live-stat {
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-soft);
    padding: 0.25rem 0.6rem;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.live-streak {
    color: var(--gold);
}

.live-streak.on-fire {
    color: #fff;
    background: linear-gradient(135deg, var(--magenta), var(--orange-disco));
    border-color: transparent;
    text-shadow: 0 0 6px rgba(255, 107, 53, 0.4);
    animation: streakPulse 0.6s ease-in-out infinite alternate;
}

@keyframes streakPulse {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

.live-stat.score-pop {
    animation: scorePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* Annonce de manche (overlay) */
.round-announce {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(13, 2, 33, 0.85);
    z-index: 500;
    animation: fadeInUp 0.3s ease-out;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.round-announce span {
    font-family: var(--font-groovy);
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    font-weight: 400;
    color: var(--gold);
    text-align: center;
    padding: 1.5rem 2.5rem;
    background: linear-gradient(135deg, rgba(26, 10, 62, 0.95), rgba(45, 27, 105, 0.95));
    border: 2px solid;
    border-image: linear-gradient(135deg, var(--magenta), var(--gold), var(--cyan)) 1;
    border-radius: 0;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    box-shadow: 0 0 30px rgba(255, 20, 147, 0.2), 0 0 60px rgba(123, 104, 238, 0.15);
}

#setup-panel .btn-primary {
    display: block;
    width: 100%;
    margin-top: 0.5rem;
}

/* ============================================================
   ZONE DE JEU
   ============================================================ */
#game-area {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 1rem 1.5rem 1.5rem;
    animation: fadeInUp 0.4s ease-out;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Layout 2 colonnes desktop */
.game-columns {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.game-col-left {
    display: flex;
    flex-direction: column;
}

.game-col-right {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}

@media (min-width: 1025px) {
    #game-area {
        max-width: none;
        padding: 1rem 2rem 1.5rem;
        overflow: hidden;
    }

    .game-columns {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
        gap: 1.25rem;
        align-items: center;
    }

    .game-col-left {
        display: flex;
        flex-direction: column;
    }

    .game-col-right {
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    #player-wrapper,
    .pause-panel {
        max-width: 100% !important;
        width: 100%;
        margin: 0 0 0.75rem;
    }

    #lyrics-container {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
    }

    .round-bar {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
        background: var(--surface);
        border: 1px solid var(--surface-border);
        border-radius: var(--radius-sm);
    }

    .round-badge {
        flex: 1;
        font-size: 0.85rem;
    }
}

/* Bouton reculer */
.rewind-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

.rewind-bar-left {
    display: flex;
    gap: 0.5rem;
}

.btn-rewind {
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.4rem 1.2rem;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--surface-border);
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-rewind:hover {
    background: var(--surface-hover);
    border-color: var(--green);
    color: var(--green);
}

.btn-mic-game {
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.4rem 1.2rem;
    background: linear-gradient(135deg, var(--magenta), var(--electric-blue));
    color: #fff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-mic-game:hover {
    opacity: 0.85;
    transform: translateY(-1px);
    box-shadow: 0 0 15px rgba(255, 20, 147, 0.4);
}

#btn-mic.active {
    background: rgba(255, 75, 75, 0.15);
    border-color: #ff4b4b;
    color: #ff4b4b;
    animation: mic-pulse 1.5s ease-in-out infinite;
}

@keyframes mic-pulse {
    0%, 100% { transform: scale(1); opacity: 0.85; }
    50% { transform: scale(1.08); opacity: 1; }
}

/* Player YouTube */
#player-wrapper {
    position: relative;
    width: 100%;
    max-width: 800px;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    margin: 0 auto 1rem;
    box-shadow: 0 4px 20px rgba(255, 20, 147, 0.15), 0 0 30px rgba(123, 104, 238, 0.1);
    flex-shrink: 0;
}

/* Panel de pause (remplace la vidéo pendant les trous) */
.pause-panel {
    width: 100%;
    max-width: 800px;
    aspect-ratio: 16 / 9;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin: 0 auto 1rem;
    flex-shrink: 0;
}

.pause-text {
    color: var(--text);
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
    padding: 0 1rem;
}

.pause-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-pause {
    font-family: var(--font);
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    border: 2px solid var(--surface-border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-pause:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--magenta);
    color: var(--magenta);
}

.btn-pause-skip {
    border-color: var(--magenta);
    color: var(--magenta);
}

.btn-pause-hint {
    border-color: var(--gold);
    color: var(--gold);
}

.btn-pause-hint:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(255, 215, 0, 0.1);
}

/* Boutons de difficulté (pré-lancement) */
.btn-diff {
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    border: 2px solid var(--surface-border);
    background: var(--surface);
    color: var(--text-soft);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-diff:hover {
    border-color: var(--magenta);
    color: var(--text);
}

.result-prev {
    font-size: 0.75rem;
    color: var(--gold);
    opacity: 0.8;
}

.prelaunch-prev {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
}

.prelaunch-prev strong {
    color: var(--magenta);
}

.btn-diff.active {
    border-color: var(--magenta);
    background: rgba(255, 20, 147, 0.15);
    color: var(--magenta);
}

#player-wrapper iframe,
#yt-player {
    width: 100%;
    height: 100%;
}

/* Barre d'infos */
.game-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--surface);
    flex-shrink: 0;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.game-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.stat-value {
    font-family: var(--font);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--green);
}

/* ============================================================
   PAROLES
   ============================================================ */
#lyrics-container {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
    border-top: 2px solid;
    border-image: linear-gradient(90deg, var(--magenta), var(--gold), var(--cyan), var(--magenta)) 1;
    border-image-slice: 1 0 0 0;
    padding: 1.5rem 1.25rem;
    flex: 1 1 0;
    min-height: 0;
    min-width: 0;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

#lyrics-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.lyric-line {
    border-radius: var(--radius-sm);
    font-size: 1.125rem;
    line-height: 1.8;
    border-left: 3px solid transparent;
    /* Cache par defaut */
    max-height: 0;
    opacity: 0;
    padding: 0 0.75rem;
    margin: 0;
    border-left-width: 0;
    overflow: hidden;
    /* Scale pour l'effet cascade */
    transform: scale(1);
    transform-origin: left center;
    transition: max-height 0.5s ease, opacity 0.5s ease, transform 0.5s ease, padding 0.5s ease;
    width: 100%;
    box-sizing: border-box;
    contain: layout style;
    word-break: break-word;
    overflow-wrap: break-word;
}

.lyric-line.next-line {
    max-height: 5rem;
    opacity: 0.35;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.3rem;
}

/* En mode calibration, toutes les lignes sont visibles */
#lyrics-container.calibration .lyric-line {
    max-height: 5rem;
    opacity: 0.5;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.3rem;
}

#lyrics-container.calibration .lyric-line.active {
    opacity: 1;
}

#lyrics-container.calibration .lyric-line.calib-prev {
    opacity: 1;
    background: rgba(255, 20, 147, 0.08);
    border-left: 3px solid var(--green);
}

#lyrics-container.calibration .lyric-line[class*="past-"] {
    opacity: 0.35;
    transform: scale(1);
    color: inherit;
}

/* Ligne active : scale up */
.lyric-line.active {
    max-height: 8rem;
    opacity: 1;
    padding: 0.8rem 0.75rem;
    margin-bottom: 0.3rem;
    width: 87%;
    transform: scale(1.15);
    transform-origin: left center;
    background: rgba(255, 20, 147, 0.08);
    border-left-width: 3px;
    border-left-color: var(--green);
    animation: pulseGlow 2.5s ease-in-out infinite;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Cascade : 10 lignes passees */
.lyric-line.past-1 {
    max-height: 5rem; opacity: 0.85; padding: 0.55rem 0.75rem; margin-bottom: 0.3rem;
    width: 95%; transform: scale(1.05); color: rgba(255, 255, 255, 0.85);
}
.lyric-line.past-2 {
    max-height: 5rem; opacity: 0.75; padding: 0.5rem 0.75rem; margin-bottom: 0.28rem;
    transform: scale(1.0); color: rgba(255, 255, 255, 0.75);
}
.lyric-line.past-3 {
    max-height: 5rem; opacity: 0.65; padding: 0.45rem 0.75rem; margin-bottom: 0.26rem;
    transform: scale(0.93); color: rgba(255, 255, 255, 0.65);
}
.lyric-line.past-4 {
    max-height: 4.5rem; opacity: 0.55; padding: 0.4rem 0.75rem; margin-bottom: 0.24rem;
    transform: scale(0.87); color: rgba(255, 255, 255, 0.55);
}
.lyric-line.past-5 {
    max-height: 4rem; opacity: 0.45; padding: 0.35rem 0.75rem; margin-bottom: 0.22rem;
    transform: scale(0.82); color: rgba(255, 255, 255, 0.45);
}
.lyric-line.past-6 {
    max-height: 3.5rem; opacity: 0.35; padding: 0.3rem 0.75rem; margin-bottom: 0.2rem;
    transform: scale(0.77); color: rgba(255, 255, 255, 0.35);
}
.lyric-line.past-7 {
    max-height: 3rem; opacity: 0.25; padding: 0.25rem 0.75rem; margin-bottom: 0.18rem;
    transform: scale(0.72); color: rgba(255, 255, 255, 0.25);
}
.lyric-line.past-8 {
    max-height: 2.5rem; opacity: 0.18; padding: 0.2rem 0.75rem; margin-bottom: 0.15rem;
    transform: scale(0.67); color: rgba(255, 255, 255, 0.18);
}
.lyric-line.past-9 {
    max-height: 2rem; opacity: 0.1; padding: 0.15rem 0.75rem; margin-bottom: 0.1rem;
    transform: scale(0.62); color: rgba(255, 255, 255, 0.1);
}
.lyric-line.past-10 {
    max-height: 1.5rem; opacity: 0.05; padding: 0.1rem 0.75rem; margin-bottom: 0.05rem;
    transform: scale(0.57); color: rgba(255, 255, 255, 0.05);
}

/* Mots dans les paroles */
.lyric-word {
    display: inline;
    font-size: inherit;
}

/* Champs a remplir (trous) */
.lyric-gap {
    display: inline-block;
    min-width: 4ch;
    max-width: 100%;
    padding: 0.15rem 0.4rem;
    margin: 0 0.15rem;
    border: none;
    border-bottom: 2px solid var(--green);
    background: rgba(255, 20, 147, 0.06);
    color: var(--text);
    font-family: var(--font);
    font-size: inherit;
    text-align: center;
    outline: none;
    border-radius: 2px;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
    vertical-align: baseline;
}

.lyric-gap:focus {
    border-bottom-color: #fff;
    background: rgba(255, 20, 147, 0.12);
    box-shadow: 0 2px 8px rgba(255, 20, 147, 0.2);
}

.lyric-gap.correct {
    border-bottom-color: var(--success);
    background: rgba(57, 255, 20, 0.12);
    color: var(--success);
    font-weight: 600;
    animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-shadow: 0 0 6px rgba(57, 255, 20, 0.4);
}

.lyric-gap.missed {
    border-bottom-color: var(--error);
    background: rgba(255, 75, 75, 0.1);
    color: var(--error);
    font-weight: 600;
}

/* ============================================================
   ECRAN DE FIN
   ============================================================ */
#end-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    background: var(--bg);
    background-image:
        radial-gradient(ellipse at 50% 30%, rgba(255, 20, 147, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 30% 70%, rgba(255, 215, 0, 0.05) 0%, transparent 40%);
}

.end-header-title {
    font-family: 'Monoton', cursive;
    font-size: 1.55rem;
    font-weight: 400;
    color: var(--gold);
    text-align: center;
    flex-shrink: 0;
    padding: 1rem 0 0;
    letter-spacing: 2px;
    text-shadow:
        0 0 10px rgba(255, 215, 0, 0.6),
        0 0 30px rgba(255, 20, 147, 0.4),
        0 0 60px rgba(255, 20, 147, 0.2),
        0 0 100px rgba(123, 104, 238, 0.15);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.end-header-title:hover {
    color: var(--magenta);
    text-shadow: 0 0 12px rgba(255, 20, 147, 0.4);
}

.end-content {
    animation: fadeInUp 0.5s ease-out;
    max-width: 480px;
    width: 100%;
}

.end-icon {
    font-size: 3.5rem;
    margin-bottom: 0.75rem;
}

.end-title {
    font-family: var(--font-groovy);
    font-size: 1.75rem;
    font-weight: 400;
    color: var(--gold);
    margin-bottom: 0.25rem;
    letter-spacing: 0.5px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.end-song {
    font-size: 0.9rem;
    color: var(--text-soft);
    margin-bottom: 1.5rem;
}

.end-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.end-stat {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
    padding: 1rem 0.5rem;
    transition: transform var(--transition);
}

.end-stat:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 20, 147, 0.2), 0 0 10px rgba(123, 104, 238, 0.15);
    border-color: var(--magenta);
}

.end-stat-value {
    display: block;
    font-family: var(--font);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--green);
}

.end-stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.end-best {
    background: var(--green-light);
    border: 1px solid rgba(255, 20, 147, 0.3);
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    color: var(--green);
}

.end-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Transitions entre écrans --- */
.screen-enter {
    animation: screenFadeIn 0.35s ease-out forwards;
}

.screen-exit {
    animation: screenFadeOut 0.35s ease-in forwards;
    pointer-events: none;
}

@keyframes screenFadeIn {
    from {
        opacity: 0;
        transform: scale(0.97) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes screenFadeOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(1.02) translateY(-10px);
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0) translateZ(0); }
    50% { transform: translateY(-10px) translateZ(0); }
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.92; }
    50% { opacity: 1; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes popIn {
    0% { transform: scale(0.6); }
    50% { transform: scale(1.15); }
    70% { transform: scale(0.95); }
    100% { transform: scale(1); }
}


/* ============================================================
   SCROLLBAR
   ============================================================ */
#lyrics-container::-webkit-scrollbar,
#results-list::-webkit-scrollbar {
    width: 5px;
}

#lyrics-container::-webkit-scrollbar-track,
#results-list::-webkit-scrollbar-track {
    background: transparent;
}

#lyrics-container::-webkit-scrollbar-thumb,
#results-list::-webkit-scrollbar-thumb {
    background: rgba(255, 20, 147, 0.3);
    border-radius: 3px;
}

#lyrics-container::-webkit-scrollbar-thumb:hover,
#results-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 20, 147, 0.5);
}

/* Responsive : voir style-mobile.css et style-tablet.css */

/* --- Mentions legales --- */
.splash-legal-link {
    display: block;
    text-align: center;
    padding: 0.5rem 0 1rem;
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 0.7rem;
    text-decoration: none;
    transition: color var(--transition);
}

.splash-legal-link:hover {
    color: var(--text-soft);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(13, 2, 33, 0.85);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    color: var(--text-soft);
    font-size: 0.9rem;
    line-height: 1.7;
}

.modal-content h2 {
    color: var(--text);
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.modal-content h3 {
    color: var(--green);
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.modal-content ul {
    padding-left: 1.25rem;
}

.modal-content li {
    margin-bottom: 0.25rem;
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color var(--transition);
}

.modal-close:hover {
    color: var(--text);
}

/* --- Bannière cookies RGPD --- */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10001;
    padding: 1rem 1.5rem;
    background: var(--surface);
    border-top: 2px solid;
    border-image: linear-gradient(90deg, var(--magenta), var(--gold), var(--cyan)) 1;
    animation: fadeInUp 0.4s ease-out;
}

.cookie-content {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.cookie-content p {
    font-size: 0.85rem;
    color: var(--text-soft);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.cookie-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.cookie-more {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: underline;
}

.cookie-more:hover {
    color: var(--text-soft);
}

/* --- Page Admin --- */
.admin-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.admin-header {
    text-align: center;
    margin-bottom: 2rem;
}

.admin-header h1 {
    font-family: var(--font);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--green);
}

.admin-section {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.admin-section h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--green);
    margin-bottom: 1rem;
}

.admin-field {
    margin-bottom: 1rem;
}

.admin-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-soft);
    margin-bottom: 0.4rem;
}

.admin-field input,
.admin-field select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--surface-border);
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition);
}

.admin-field input:focus {
    border-color: var(--green);
}

.admin-field input::placeholder {
    color: var(--text-muted);
}

.admin-selected-song {
    padding: 0.75rem 1rem;
    background: var(--green-light);
    border: 1px solid rgba(255, 20, 147, 0.2);
    border-radius: var(--radius-sm);
    color: var(--green);
    font-weight: 600;
}

.admin-offset-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.5rem;
}

.admin-offset-value {
    font-size: 1rem;
    color: var(--green);
    min-width: 50px;
    text-align: center;
    font-family: monospace;
}

.admin-status {
    text-align: center;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    margin-top: 1rem;
    font-weight: 600;
}

.admin-status.success {
    background: rgba(57, 255, 20, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.admin-status.error {
    background: rgba(255, 75, 75, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
}

.admin-calib-time {
    font-size: 0.8rem;
    color: var(--green);
    font-family: monospace;
    text-align: center;
    min-height: 1.2em;
    margin-top: 0.5rem;
}

/* Desktop large height fix */

/* ============================================================
   TABLETTE — min-width: 601px et max-width: 1024px
   ============================================================ */
@media (min-width: 601px) and (max-width: 1024px) {
    #game-area {
        max-width: 90vw;
        padding: 1rem;
    }
    #player-wrapper {
        width: 90%;
        max-width: 700px;
    }
    .panel {
        max-width: 600px;
    }
    .search-bar {
        max-width: 500px;
    }
    .game-bar {
        gap: 0.75rem;
    }
    .lyric-line.active {
        transform: scale(1.1);
    }
    .end-stats {
        gap: 0.75rem;
    }
}

@media (min-width: 601px) and (max-width: 1024px) and (max-height: 800px) {
    body, body:has(section) {
        height: auto !important;
        overflow-y: auto !important;
    }
    section, #main {
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
    }
    #game-area {
        overflow: visible !important;
        flex: none !important;
    }
    #lyrics-container {
        min-height: 8rem;
        max-height: 30vh;
        overflow-y: auto !important;
    }
}

/* ============================================================
   MOBILE — max-width: 600px
   ============================================================ */
@media (max-width: 600px) {
    .main-header {
        padding: 0.75rem 1rem;
    }
    .header-title {
        font-size: 1.25rem;
    }
    .search-bar input {
        font-size: 0.85rem;
        padding: 0.5rem 0.8rem;
    }
    .panel {
        margin: 1rem 0.5rem;
        padding: 1rem;
    }
    .youtube-input-row {
        flex-direction: column;
    }
    .game-bar {
        gap: 0.5rem;
        padding: 0.5rem;
    }
    .stat-value {
        font-size: 1rem;
    }
    #main {
        overflow-y: auto;
    }
    #game-area {
        width: 100%;
        max-width: 100%;
        min-width: 100%;
        padding: 0.5rem 0.5rem 1rem;
    }
    #lyrics-container {
        padding: 1rem 0.5rem;
        width: 100%;
        min-width: 0;
        flex: 1 1 0;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
    }
    #lyrics-container > * {
        min-width: 0;
    }
    .lyric-line {
        width: 100% !important;
        max-width: 100%;
        box-sizing: border-box;
        overflow-wrap: break-word;
        word-break: break-word;
    }
    .lyric-gap {
        font-size: inherit;
        min-width: 3ch;
    }
    #player-wrapper {
        width: 100%;
        max-width: none;
    }
    .rewind-bar {
        flex-wrap: wrap;
        gap: 0.3rem;
    }
    .rewind-bar button {
        font-size: 0.7rem;
        padding: 0.3rem 0.5rem;
    }
    .end-stats {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    .end-stat-value {
        font-size: 1.5rem;
    }
    .end-buttons {
        flex-direction: column;
    }
    .level-btn {
        width: 42px;
        height: 42px;
        font-size: 1rem;
    }
    .lyric-line.active,
    .lyric-line[class*="past-"],
    .lyric-line.next-line {
        transform: scale(1) !important;
        font-size: 1rem !important;
        padding: 0.5rem 0.75rem !important;
    }
    .calibration-bar {
        padding: 0.75rem;
    }
    .calibration-text {
        font-size: 0.8rem;
    }
    .calib-lyric-preview {
        font-size: 0.95rem;
    }
    .calib-word {
        font-size: 0.85rem;
        padding: 0.25rem 0.45rem;
    }
    .round-badge {
        font-size: 0.85rem;
    }
    .splash-hero {
        padding: 1.5rem 1rem;
    }
    .splash-icon {
        font-size: 2.5rem;
    }
    .splash-title {
        font-size: clamp(1.75rem, 7vw, 2.25rem);
    }
    .splash-header {
        margin-bottom: 1.5rem;
    }
    .daily-song-card {
        padding: 1.75rem 1.25rem;
    }
    .daily-hook {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }
    .daily-song-text {
        font-size: clamp(1.25rem, 5.5vw, 1.75rem);
    }
    .daily-artist {
        font-size: 0.85rem;
    }
    .btn-daily-main {
        font-size: 0.95rem;
        padding: 0.75rem 2rem;
        width: 100%;
    }
    .btn-choose {
        font-size: 0.8rem;
        padding: 0.45rem 1.25rem;
    }
    .recent-songs {
        padding: 0.5rem 1rem 1rem;
    }
    .recent-songs li {
        font-size: 0.8rem;
        padding: 0.5rem 0.6rem;
    }
}
