/* ============================================================
   KaraOops - Neon Karaoke Arcade
   ============================================================ */

:root {
    color-scheme: dark;
    --bg: #070711;
    --bg-deep: #03030a;
    --panel: rgba(20, 18, 38, 0.82);
    --panel-strong: rgba(30, 22, 58, 0.92);
    --panel-soft: rgba(255, 255, 255, 0.055);
    --line: rgba(191, 93, 255, 0.26);
    --line-strong: rgba(255, 72, 214, 0.55);
    --text: #fff8ff;
    --text-soft: #d9c7ff;
    --text-muted: #8f82b8;
    --white-soft: #d9c7ff;
    --magenta: #ff2ccd;
    --pink: #ff62df;
    --violet: #8c35ff;
    --purple: #4b177d;
    --blue: #2f6dff;
    --cyan: #2dfcff;
    --success: #4dffb5;
    --warning: #ffd166;
    --error: #ff4d7d;
    --shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
    --glow-pink: 0 0 18px rgba(255, 44, 205, 0.7), 0 0 52px rgba(255, 44, 205, 0.28);
    --glow-blue: 0 0 18px rgba(45, 252, 255, 0.35), 0 0 42px rgba(47, 109, 255, 0.22);
    --radius: 8px;
    --radius-sm: 6px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --max-width: 1160px;
    --splash-card-width: 680px;
    --splash-card-width-mobile: 352px;
    --site-footer-height: 58px;
    --header-height: 82px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    padding-bottom: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background:
        linear-gradient(115deg, rgba(255, 44, 205, 0.13), transparent 28%),
        linear-gradient(245deg, rgba(47, 109, 255, 0.15), transparent 32%),
        linear-gradient(180deg, var(--bg), var(--bg-deep));
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
    transition: padding-bottom 0.22s ease;
}

/* En jeu : on cache la barre de langues et le footer pour liberer l'ecran.
   body.lang-bar-hidden ajuste aussi le padding-bottom (cf. body { ... }). */
body.lang-bar-hidden .site-footer { display: none; }
body.lang-bar-hidden { padding-bottom: 0; }

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(0deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 76px 76px;
    mask-image: linear-gradient(to bottom, transparent, black 18%, black 78%, transparent);
    opacity: 0.3;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(105deg, transparent 0 18%, rgba(255, 44, 205, 0.13) 18.2%, transparent 32%),
        linear-gradient(72deg, transparent 0 55%, rgba(45, 252, 255, 0.11) 55.2%, transparent 70%),
        repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 8px);
    opacity: 0.28;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

input,
textarea,
select {
    color: var(--text);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
}

a {
    color: inherit;
}

.hidden {
    display: none !important;
}

#confetti-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

/* Motion */
.screen-enter {
    animation: screenIn 0.36s ease both;
}

.screen-exit {
    animation: screenOut 0.24s ease both;
}

@keyframes screenIn {
    from { opacity: 0; transform: translateY(14px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes screenOut {
    to { opacity: 0; transform: translateY(-10px) scale(0.99); }
}

@keyframes pulseGlow {
    0%, 100% { filter: brightness(1); box-shadow: var(--glow-pink); }
    50% { filter: brightness(1.14); box-shadow: 0 0 24px rgba(255, 44, 205, 0.9), 0 0 72px rgba(47, 109, 255, 0.34); }
}

@keyframes scorePop {
    50% { transform: translateY(-2px) scale(1.12); color: var(--success); }
}

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

@keyframes dailySweep {
    0% { transform: translateX(-120%) skewX(-18deg); opacity: 0; }
    18%, 58% { opacity: 0.55; }
    100% { transform: translateX(135%) skewX(-18deg); opacity: 0; }
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-small,
.btn-icon,
.btn-diff,
.tab-btn,
.btn-pause,
.btn-rewind,
.btn-mic-game {
    border: 1px solid transparent;
    border-radius: var(--radius);
    min-height: 42px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.btn-primary {
    padding: 0.8rem 1.35rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--magenta), var(--violet) 58%, var(--blue));
    box-shadow: var(--glow-pink);
}

.btn-glow {
    animation: pulseGlow 2.6s ease-in-out infinite;
}

.btn-secondary {
    padding: 0.72rem 1.15rem;
    font-weight: 700;
    border-color: rgba(255, 255, 255, 0.14);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.045));
}

.btn-small {
    min-height: 34px;
    padding: 0.42rem 0.72rem;
    color: var(--text-soft);
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.065);
}

.btn-icon {
    width: 46px;
    min-width: 46px;
    padding: 0;
    border-color: var(--line);
    background: rgba(255, 44, 205, 0.12);
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: var(--line-strong);
    box-shadow: 0 12px 34px rgba(255, 44, 205, 0.22);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Shared panels */
.panel,
.daily-song-card,
.splash-fallback,
.recent-songs,
.modal-content,
.calibration-bar,
.pause-panel,
.end-content,
.daily-chart-section {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
        var(--panel);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
}

.panel {
    width: min(var(--max-width), calc(100vw - 2rem));
    margin: 6.5rem auto 2rem;
    padding: clamp(1rem, 2vw, 1.45rem);
}

.panel h3 {
    margin: 0 0 0.35rem;
    font-size: clamp(1.25rem, 2vw, 1.7rem);
    line-height: 1.1;
}

.panel-hint {
    margin: 0 0 1rem;
    color: var(--text-soft);
}

/* Splash */
#splash {
    flex: 1 0 auto;
    position: relative;
    display: grid;
    place-items: center;
    padding: 6.2rem 1.25rem 1.25rem;
    /* PAS d'overflow ici : 'overflow-x: hidden' forcerait 'overflow-y: auto'
       et ferait de #splash un 2e conteneur scrollable (double barre verticale).
       Le clip horizontal des disco-lights se fait sur .disco-lights ci-dessous,
       et le scroll vertical reste celui de la page (une seule barre). */
}

.disco-lights {
    position: absolute;
    inset: 0;
    overflow: hidden;   /* clippe ses pseudo-elements (inset:-20%, rotate) sans scroller #splash */
    pointer-events: none;
    background:
        linear-gradient(118deg, transparent 0 35%, rgba(255, 44, 205, 0.22) 35.2%, transparent 46%),
        linear-gradient(62deg, transparent 0 48%, rgba(45, 252, 255, 0.14) 48.2%, transparent 62%),
        linear-gradient(180deg, transparent, rgba(255, 44, 205, 0.08));
    opacity: 0.78;
}

.disco-lights::before,
.disco-lights::after {
    content: "";
    position: absolute;
    inset: -20%;
    background:
        radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, 0.9), transparent 2px),
        radial-gradient(1px 1px at 28% 72%, rgba(255, 98, 223, 0.8), transparent 2px),
        radial-gradient(1px 1px at 48% 24%, rgba(45, 252, 255, 0.78), transparent 2px),
        radial-gradient(1px 1px at 74% 62%, rgba(255, 255, 255, 0.8), transparent 2px),
        radial-gradient(1px 1px at 88% 36%, rgba(255, 98, 223, 0.85), transparent 2px);
    background-size: 360px 360px;
    opacity: 0.55;
}

.disco-lights::after {
    transform: rotate(9deg);
    opacity: 0.34;
}

.splash-hero {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: center;
    gap: 1rem;
    width: min(820px, 100%);
    padding: clamp(1rem, 4vw, 2rem) 0 1.25rem;
    text-align: center;
    transform: translateY(-2.2rem);
}

.splash-header {
    width: min(var(--splash-card-width), 92vw);
    min-height: clamp(120px, 24vw, 250px);
    margin-bottom: -0.2rem;
    background: url("icon/karaoops-logo.png") center / contain no-repeat;
    filter: drop-shadow(0 22px 42px rgba(255, 44, 205, 0.22));
}

.splash-title {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.daily-song-card,
.splash-fallback {
    width: min(var(--splash-card-width), 100%);
    padding: clamp(1rem, 3vw, 1.45rem);
}

.daily-song-card {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    width: min(var(--splash-card-width), 100%);
    padding: clamp(1.35rem, 3.2vw, 1.9rem);
    border-color: rgba(255, 44, 205, 0.34);
    background:
        radial-gradient(circle at 50% 38%, rgba(255, 44, 205, 0.26), transparent 42%),
        radial-gradient(circle at 50% 100%, rgba(45, 252, 255, 0.12), transparent 46%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.072), rgba(255, 255, 255, 0.02)),
        rgba(10, 8, 24, 0.92);
    box-shadow:
        0 0 0 1px rgba(45, 252, 255, 0.11),
        0 0 22px rgba(255, 44, 205, 0.22),
        0 20px 62px rgba(0, 0, 0, 0.48),
        inset 0 0 42px rgba(255, 44, 205, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.daily-song-card::before,
.daily-song-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.daily-song-card::before {
    z-index: -1;
    background:
        repeating-linear-gradient(90deg, rgba(255, 98, 223, 0.05) 0 1px, transparent 1px 58px),
        repeating-linear-gradient(0deg, rgba(45, 252, 255, 0.035) 0 1px, transparent 1px 18px);
    opacity: 0.5;
}

.daily-song-card::after {
    width: 30%;
    background: linear-gradient(90deg, transparent, rgba(255, 98, 223, 0.22), rgba(45, 252, 255, 0.16), transparent);
    animation: dailySweep 4.8s ease-in-out infinite;
}

.splash-fallback:empty {
    display: none;
}

.daily-card-top {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    margin: 0.25rem 3.5rem 1.05rem;
}

.daily-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.5rem 1.15rem;
    border: 1px solid rgba(255, 98, 223, 0.42);
    border-radius: 999px;
    color: #fff;
    font-size: clamp(1.05rem, 2.8vw, 1.38rem);
    font-weight: 1000;
    line-height: 1;
    background:
        linear-gradient(135deg, rgba(255, 44, 205, 0.34), rgba(47, 109, 255, 0.18)),
        rgba(0, 0, 0, 0.34);
    box-shadow: 0 0 24px rgba(255, 44, 205, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.14);
    text-shadow: 0 0 18px rgba(255, 44, 205, 0.55);
}

.daily-countdown {
    position: absolute;
    top: clamp(0.82rem, 2vw, 1.1rem);
    right: clamp(0.82rem, 2vw, 1.1rem);
    display: grid;
    place-items: center;
    width: calc(8ch + 1.24rem);
    min-height: 32px;
    padding: 0.34rem 0.62rem;
    border: 1px solid rgba(45, 252, 255, 0.32);
    border-radius: 999px;
    color: var(--cyan);
    font-family: "SFMono-Regular", ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: clamp(0.78rem, 1.6vw, 0.9rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0;
    text-align: center;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
    background:
        linear-gradient(135deg, rgba(45, 252, 255, 0.12), rgba(255, 44, 205, 0.09)),
        rgba(5, 4, 14, 0.78);
    box-shadow:
        inset 0 0 16px rgba(45, 252, 255, 0.09),
        0 0 18px rgba(45, 252, 255, 0.14);
    text-shadow: 0 0 12px rgba(45, 252, 255, 0.34);
}

.daily-hook,
.splash-fallback-sub {
    margin: 0 auto 1.15rem;
    color: var(--text-soft);
}

.daily-hook {
    max-width: 430px;
    line-height: 1.45;
}

.daily-info {
    display: grid;
    place-items: center;
    min-height: clamp(58px, 8vw, 76px);
    margin: 1rem 0 1.25rem;
    padding: clamp(0.95rem, 2.4vw, 1.18rem);
    border: 1px solid rgba(45, 252, 255, 0.22);
    border-radius: var(--radius-sm);
    background:
        linear-gradient(90deg, rgba(255, 44, 205, 0.1), rgba(45, 252, 255, 0.055)),
        rgba(0, 0, 0, 0.34);
    box-shadow:
        inset 0 0 24px rgba(255, 44, 205, 0.08),
        0 0 18px rgba(45, 252, 255, 0.08);
}

.daily-song-text {
    display: grid;
    gap: 0.18rem;
    color: var(--text);
    font-size: clamp(1.05rem, 2.35vw, 1.32rem);
    font-weight: 1000;
    line-height: 1.08;
    text-align: center;
    text-shadow: 0 0 22px rgba(255, 44, 205, 0.28);
}

.daily-artist {
    color: var(--cyan);
    font-size: clamp(0.82rem, 1.8vw, 1rem);
    font-weight: 900;
    text-shadow: 0 0 16px rgba(45, 252, 255, 0.28);
}

.daily-status {
    width: fit-content;
    max-width: 100%;
    margin: -0.25rem auto 1rem;
    padding: 0.42rem 0.75rem;
    border: 1px solid rgba(255, 98, 223, 0.32);
    border-radius: 999px;
    color: #fff;
    font-size: clamp(0.82rem, 1.8vw, 0.95rem);
    font-weight: 900;
    line-height: 1.12;
    background:
        linear-gradient(135deg, rgba(255, 44, 205, 0.16), rgba(45, 252, 255, 0.08)),
        rgba(0, 0, 0, 0.28);
    box-shadow: inset 0 0 18px rgba(255, 44, 205, 0.08), 0 0 16px rgba(255, 44, 205, 0.11);
}

.daily-song-card-played .daily-info {
    border-color: rgba(255, 98, 223, 0.26);
}

.btn-daily-main,
.btn-fallback-play {
    min-width: min(280px, 100%);
}

.btn-daily-main {
    position: relative;
    overflow: hidden;
    min-height: 52px;
    padding-inline: clamp(1.25rem, 5vw, 2.6rem);
    border: 1px solid rgba(45, 252, 255, 0.5);
    color: #fff;
    font-size: clamp(1rem, 2vw, 1.12rem);
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 44, 205, 0.28), transparent 42%),
        linear-gradient(135deg, rgba(35, 16, 80, 0.98) 0%, rgba(18, 14, 55, 0.98) 54%, rgba(17, 38, 112, 0.98) 100%);
    box-shadow:
        0 0 0 1px rgba(255, 98, 223, 0.3),
        0 0 22px rgba(45, 252, 255, 0.16),
        0 0 28px rgba(255, 44, 205, 0.22),
        0 12px 30px rgba(0, 0, 0, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        inset 0 -12px 28px rgba(255, 44, 205, 0.12);
    text-shadow: 0 0 14px rgba(255, 255, 255, 0.26);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn-daily-main::after {
    content: "";
    position: absolute;
    inset: -40% -30%;
    pointer-events: none;
    background: linear-gradient(110deg, transparent 38%, rgba(255, 255, 255, 0.42) 50%, transparent 62%);
    transform: translateX(-120%) skewX(-16deg);
    transition: transform 0.55s ease;
}

.btn-daily-main:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.02);
    filter: saturate(1.08) brightness(1.05);
    box-shadow:
        0 0 0 1px rgba(45, 252, 255, 0.62),
        0 0 22px rgba(45, 252, 255, 0.26),
        0 0 34px rgba(255, 44, 205, 0.4),
        0 12px 34px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -12px 30px rgba(255, 44, 205, 0.16);
}

.btn-daily-main:hover::after {
    transform: translateX(120%) skewX(-16deg);
}

.btn-daily-main:active:not(:disabled) {
    transform: translateY(0) scale(0.99);
}

.splash-mode-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    width: min(var(--splash-card-width), 100%);
    margin-top: 0.45rem;
}

.favorite-playlist-card {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.9rem;
    width: min(var(--splash-card-width), 100%);
    min-height: 104px;
    padding: 1rem 1.1rem;
    overflow: hidden;
    border: 1px solid rgba(45, 252, 255, 0.28);
    border-radius: var(--radius);
    color: var(--text);
    text-align: left;
    background:
        radial-gradient(circle at 14% 50%, rgba(255, 44, 205, 0.24), transparent 34%),
        linear-gradient(135deg, rgba(255, 44, 205, 0.18), rgba(45, 252, 255, 0.08)),
        rgba(12, 10, 28, 0.92);
    box-shadow:
        var(--shadow),
        0 0 0 1px rgba(255, 98, 223, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(18px);
}

.favorite-playlist-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(115deg, transparent 0 40%, rgba(255, 255, 255, 0.13) 50%, transparent 62%),
        repeating-linear-gradient(90deg, rgba(45, 252, 255, 0.035) 0 1px, transparent 1px 52px);
    opacity: 0.62;
    pointer-events: none;
}

.favorite-playlist-card > * {
    position: relative;
    z-index: 1;
}

.favorite-playlist-card:hover {
    border-color: rgba(45, 252, 255, 0.42);
    transform: translateY(-2px);
    box-shadow:
        var(--shadow),
        0 0 26px rgba(255, 44, 205, 0.28),
        0 0 20px rgba(45, 252, 255, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.13);
}

.favorite-playlist-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border: 1px solid rgba(255, 98, 223, 0.36);
    border-radius: 999px;
    font-size: 1.55rem;
    background:
        radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.18), transparent 32%),
        linear-gradient(135deg, rgba(255, 44, 205, 0.42), rgba(47, 109, 255, 0.28));
    box-shadow: var(--glow-pink);
}

.favorite-playlist-copy {
    display: grid;
    gap: 0.18rem;
    min-width: 0;
}

.favorite-playlist-title {
    font-size: clamp(1.05rem, 2vw, 1.3rem);
    font-weight: 1000;
    line-height: 1.08;
}

.favorite-playlist-subtitle {
    color: var(--text-soft);
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.2;
}

.favorite-playlist-action {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: min(280px, 100%);
    min-height: 52px;
    padding: 0.72rem clamp(1.25rem, 4vw, 2rem);
    overflow: hidden;
    border: 1px solid rgba(255, 98, 223, 0.5);
    border-radius: var(--radius);
    color: #fff;
    font-size: clamp(1rem, 2vw, 1.1rem);
    font-weight: 1000;
    line-height: 1;
    white-space: nowrap;
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 98, 223, 0.22), transparent 44%),
        linear-gradient(135deg, rgba(54, 14, 73, 0.96) 0%, rgba(27, 14, 48, 0.98) 58%, rgba(50, 21, 84, 0.96) 100%);
    box-shadow:
        0 0 0 1px rgba(45, 252, 255, 0.12),
        0 0 18px rgba(255, 98, 223, 0.18),
        0 0 16px rgba(45, 252, 255, 0.08),
        0 12px 30px rgba(0, 0, 0, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        inset 0 -12px 28px rgba(255, 44, 205, 0.1);
    text-shadow: 0 0 14px rgba(255, 255, 255, 0.22);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.favorite-playlist-action::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(110deg, transparent 38%, rgba(255, 255, 255, 0.26) 50%, transparent 62%);
    opacity: 0;
    transform: translateX(-120%) skewX(-16deg);
    transition: opacity 0.18s ease, transform 0.55s ease;
}

.favorite-playlist-action::after {
    content: "";
    width: 0;
    height: 0;
    flex: 0 0 auto;
    margin-left: 0.05rem;
    border-top: 0.32rem solid transparent;
    border-bottom: 0.32rem solid transparent;
    border-left: 0.48rem solid rgba(255, 255, 255, 0.88);
    filter: drop-shadow(0 0 8px rgba(255, 98, 223, 0.28));
    transition: transform 0.18s ease, border-left-color 0.18s ease;
}

.favorite-playlist-card:hover .favorite-playlist-action {
    transform: translateY(-2px) scale(1.02);
    filter: saturate(1.08) brightness(1.05);
    box-shadow:
        0 0 0 1px rgba(255, 98, 223, 0.58),
        0 0 22px rgba(255, 98, 223, 0.3),
        0 0 18px rgba(45, 252, 255, 0.12),
        0 12px 34px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -12px 30px rgba(255, 44, 205, 0.14);
}

.favorite-playlist-card:hover .favorite-playlist-action::before {
    opacity: 1;
    transform: translateX(120%) skewX(-16deg);
}

.favorite-playlist-card:hover .favorite-playlist-action::after {
    transform: translateX(2px);
    border-left-color: #fff;
}

.splash-mode-card {
    position: relative;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 0.55rem;
    min-height: 142px;
    padding: 1rem;
    overflow: hidden;
    border: 1px solid rgba(255, 98, 223, 0.28);
    border-radius: var(--radius);
    color: var(--text);
    background:
        linear-gradient(145deg, rgba(255, 44, 205, 0.18), rgba(47, 109, 255, 0.12)),
        rgba(20, 18, 38, 0.82);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
}

.splash-mode-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(115deg, transparent 0 38%, rgba(255, 255, 255, 0.14) 48%, transparent 58%),
        radial-gradient(circle at 50% 0%, rgba(255, 44, 205, 0.28), transparent 54%);
    opacity: 0.72;
    pointer-events: none;
}

.splash-mode-card > * {
    position: relative;
    z-index: 1;
}

.mode-card-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    font-size: 1.55rem;
    background: linear-gradient(135deg, rgba(255, 44, 205, 0.34), rgba(47, 109, 255, 0.26));
    box-shadow: var(--glow-pink);
}

.mode-card-title {
    font-size: clamp(1rem, 2vw, 1.18rem);
    font-weight: 1000;
    text-align: center;
}

.splash-mode-card-muted {
    border-color: rgba(45, 252, 255, 0.2);
    background:
        linear-gradient(145deg, rgba(45, 252, 255, 0.1), rgba(140, 53, 255, 0.12)),
        rgba(20, 18, 38, 0.68);
}

.splash-search {
    width: min(var(--splash-card-width), 100%);
    margin-inline: auto;
}

.splash-search-bar,
.search-bar,
.youtube-input-row {
    display: flex;
    gap: 0.55rem;
    align-items: center;
}

.splash-search-bar input,
.search-bar input,
.youtube-input-row input,
.mic-lang-select {
    width: 100%;
    min-height: 46px;
    padding: 0 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius);
    background: rgba(5, 5, 14, 0.8);
    box-shadow: inset 0 0 0 1px rgba(255, 44, 205, 0.08);
}

.splash-search-bar input {
    min-height: 52px;
    padding-inline: 1.1rem;
    border-color: rgba(255, 98, 223, 0.24);
    background: rgba(5, 5, 14, 0.72);
    box-shadow:
        inset 0 0 0 1px rgba(255, 44, 205, 0.12),
        0 14px 40px rgba(0, 0, 0, 0.28);
}

.splash-search-bar .btn-icon {
    width: 52px;
    min-width: 52px;
    min-height: 52px;
    background: linear-gradient(135deg, rgba(255, 44, 205, 0.58), rgba(47, 109, 255, 0.48));
}

.account-menu-wrap {
    position: relative;
    display: grid;
    justify-self: end;
}

.btn-account {
    width: max-content;
    min-height: 46px;
    padding-inline: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    border-color: rgba(255, 98, 223, 0.24);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
}

.btn-account .account-avatar {
    width: 26px;
    height: 26px;
    font-size: 0.95rem;
    box-shadow: 0 0 12px rgba(255, 44, 205, 0.18);
}

.account-hover-menu {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    width: max-content;
    min-width: 178px;
    padding: 0.45rem;
    border: 1px solid rgba(255, 98, 223, 0.28);
    border-radius: var(--radius-sm);
    background:
        radial-gradient(circle at 80% 0%, rgba(255, 44, 205, 0.18), transparent 42%),
        rgba(9, 7, 22, 0.96);
    box-shadow:
        0 18px 44px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(255, 44, 205, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.account-hover-menu::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 0.55rem;
}

.account-menu-wrap.is-logged-in:hover .account-hover-menu,
.account-menu-wrap.is-logged-in:focus-within .account-hover-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.account-hover-logout {
    width: 100%;
    min-height: 42px;
    padding: 0.55rem 0.8rem;
    border: 1px solid rgba(255, 77, 125, 0.28);
    border-radius: var(--radius-sm);
    color: #ffd6df;
    font-size: 0.88rem;
    font-weight: 900;
    text-align: left;
    background: rgba(255, 77, 125, 0.08);
}

.account-hover-logout:hover,
.account-hover-logout:focus-visible {
    color: #fff;
    border-color: rgba(255, 77, 125, 0.55);
    background: rgba(255, 77, 125, 0.16);
    box-shadow: 0 0 18px rgba(255, 77, 125, 0.16);
}

/* En-tête : zone d'actions (sélecteur de langue + compte) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    justify-self: end;
}

.lang-switcher {
    position: relative;
}

.btn-lang {
    min-height: 46px;
    padding-inline: 0.85rem;
    white-space: nowrap;
    border-color: rgba(255, 98, 223, 0.24);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
    cursor: pointer;
}

.lang-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 168px;
    margin: 0;
    padding: 0.4rem;
    list-style: none;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
    z-index: 60;
}

.lang-menu.hidden {
    display: none;
}

.lang-menu li {
    padding: 0.6rem 0.7rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
}

.lang-menu li:hover {
    background: rgba(255, 44, 205, 0.14);
}

.lang-menu li.active {
    background: rgba(255, 44, 205, 0.22);
    font-weight: 600;
}

.splash-search-bar input:focus,
.search-bar input:focus,
.youtube-input-row input:focus,
.lyric-gap:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(45, 252, 255, 0.13), 0 0 28px rgba(45, 252, 255, 0.16);
}

.recent-songs {
    width: min(var(--splash-card-width), 100%);
    padding: 1rem;
    text-align: left;
}

.recent-songs h3 {
    margin: 0 0 0.6rem;
    font-size: 0.95rem;
    color: var(--text-soft);
}

.recent-songs ul,
#results-list,
#calibrate-results-list {
    display: grid;
    gap: 0.65rem;
    padding: 0;
    margin: 0;
    list-style: none;
}

.recent-songs li,
#results-list li,
#calibrate-results-list li {
    padding: 0.9rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.055);
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.recent-songs li,
#results-list li,
#calibrate-results-list li {
    cursor: pointer;
}

.recent-songs li:hover,
#results-list li:hover,
#calibrate-results-list li:hover,
.yt-result-item:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
    background: rgba(255, 44, 205, 0.1);
}

.site-footer {
    position: relative;
    z-index: 45;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    flex: 0 0 auto;
    margin-top: auto;
    min-height: var(--site-footer-height);
    padding: 0.65rem clamp(1rem, 3vw, 1.5rem);
    border-top: 1px solid rgba(191, 93, 255, 0.12);
    background: rgba(20, 18, 38, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.footer-links {
    grid-column: 2;
    justify-self: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.2rem 1.1rem;
}

.footer-legal-link {
    grid-column: 2;
    justify-self: center;
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
}

.footer-legal-link:hover {
    color: var(--text);
    text-shadow: 0 0 14px rgba(255, 44, 205, 0.28);
}

.footer-socials {
    grid-column: 3;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.mobile-lang-slot {
    display: none;
}

.footer-social-link {
    display: grid;
    place-items: center;
    min-width: 34px;
    height: 34px;
    padding: 0 0.46rem;
    border: 1px solid rgba(45, 252, 255, 0.24);
    border-radius: 999px;
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 1000;
    line-height: 1;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.055);
    box-shadow: inset 0 0 16px rgba(255, 44, 205, 0.06);
}

.footer-social-link:hover {
    color: #fff;
    border-color: rgba(255, 98, 223, 0.44);
    box-shadow: 0 0 16px rgba(255, 44, 205, 0.2), inset 0 0 16px rgba(45, 252, 255, 0.08);
}

.footer-social-tiktok {
    min-width: 58px;
}

/* Header */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: auto minmax(240px, 620px) auto;
    gap: 1rem;
    align-items: center;
    padding: 0.85rem clamp(1rem, 3vw, 2rem);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(5, 5, 14, 0.76);
    backdrop-filter: blur(18px);
}

.main-header.playing-hidden {
    transform: none;
    transition: transform 0.22s ease;
}

.header-title {
    display: inline-flex;
    align-items: center;
    width: min(210px, 34vw);
    min-height: 42px;
    margin: 0;
}

.header-logo {
    display: block;
    width: 100%;
    max-height: 54px;
    object-fit: contain;
    object-position: left center;
    filter: drop-shadow(0 8px 18px rgba(255, 44, 205, 0.24));
}

.search-bar {
    position: relative;
}

.main-header .search-bar {
    justify-self: center;
    width: min(620px, 100%);
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 0.55rem);
    left: 0;
    right: 0;
    max-height: 340px;
    overflow: auto;
    padding: 0.5rem;
    margin: 0;
    list-style: none;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(10, 9, 24, 0.96);
    box-shadow: var(--shadow);
}

.search-dropdown li {
    padding: 0.72rem 0.8rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.search-dropdown li:hover {
    background: rgba(255, 44, 205, 0.14);
}

/* Results/setup */
.search-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    margin: 1rem 0;
    padding: 0.35rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.24);
}

.tab-btn {
    min-height: 40px;
    font-weight: 800;
    color: var(--text-soft);
}

.tab-btn.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(255, 44, 205, 0.85), rgba(47, 109, 255, 0.74));
    box-shadow: var(--glow-blue);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.result-artist,
.result-title {
    font-weight: 800;
}

.result-artist {
    color: var(--text);
}

.result-title {
    color: var(--pink);
}

.result-album,
.result-prev,
.calibrate-pending {
    color: var(--text-muted);
    font-size: 0.86rem;
}

.result-badge,
.result-ready {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    margin-left: 0.4rem;
    padding: 0.16rem 0.48rem;
    border: 1px solid rgba(45, 252, 255, 0.35);
    border-radius: 999px;
    color: var(--cyan);
    font-size: 0.72rem;
    font-weight: 900;
    background: rgba(45, 252, 255, 0.08);
}

.result-ready {
    justify-content: center;
    width: 24px;
    margin-left: 0;
    margin-right: 0.35rem;
    padding: 0;
    color: #07101c;
    background: var(--success);
}

.selected-song {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.22);
}

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

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

.yt-results {
    margin-top: 1rem;
}

.yt-results-hint {
    color: var(--text-soft);
}

#yt-results-list {
    display: grid;
    gap: 0.65rem;
}

.yt-result-item {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 0.75rem;
    align-items: center;
    padding: 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.055);
    cursor: pointer;
}

.yt-result-item.selected {
    border-color: var(--cyan);
    box-shadow: var(--glow-blue);
}

.yt-result-thumb {
    width: 96px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.yt-result-title {
    font-weight: 800;
}

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

#prelaunch-panel {
    max-width: 620px;
}

.btn-diff {
    min-width: 96px;
    padding: 0.55rem 0.8rem;
    font-weight: 900;
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-diff.active {
    background: linear-gradient(135deg, var(--magenta), var(--violet));
    box-shadow: var(--glow-pink);
}

.prelaunch-prev {
    margin: 0.8rem 0;
    color: var(--success);
    font-weight: 800;
}

/* Game */
#game-area {
    display: grid;
    align-items: center;
    min-height: 100vh;
    padding: 5.95rem clamp(0.75rem, 1.35vw, 1.5rem) 1.5rem;
}

.game-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(0.75rem, 1.25vw, 1.25rem);
    width: 100%;
    margin: 0 auto;
    align-items: start;
}

.game-col-left,
.game-col-right {
    min-width: 0;
}

.game-col-left {
    width: 100%;
}

.game-col-right {
    width: 100%;
}

#player-wrapper,
.pause-panel,
#lyrics-container {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(7, 7, 17, 0.7);
    box-shadow: var(--shadow);
}

/* Attribution de la source des paroles sous #lyrics-container : copyright éventuel +
   logo (ou lien texte), remplis par applyLyricsSource(). Le fournisseur exige que le
   copyright soit « clearly visible » : taille de texte lisible et couleur claire, pas
   une mention discrète. */
.lyrics-attribution {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 0.6rem 0 0;
    padding: 0 0.5rem;
    text-align: center;
    font-size: 0.8rem;
    line-height: 1.35;
    color: var(--text-soft);
}
.lyrics-attribution:empty {
    display: none;
}
.lyrics-attribution a {
    display: inline-flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
}
.lyrics-logo {
    /* Le logo contient la mention « Lyrics powered by » en petits caractères : trop petit,
       elle est illisible (à 16 px de haut elle fait ~3 px). */
    height: 36px;
    width: auto;
    display: block;
}

#player-wrapper,
.pause-panel {
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

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

.pause-panel {
    display: grid;
    place-items: center;
    gap: 0.9rem;
    padding: 1.25rem;
    text-align: center;
}

.pause-text {
    margin: 0;
    color: var(--text-soft);
    font-size: clamp(1.1rem, 2vw, 1.45rem);
    font-weight: 900;
}

.pause-buttons,
.rewind-bar,
.rewind-bar-left,
.mic-controls,
.round-bar,
.game-live-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
}

.mic-controls {
    display: inline-flex;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 0.5rem;
    width: auto;
    margin-left: auto;
}

.pause-buttons {
    justify-content: center;
}

.btn-pause,
.btn-rewind,
.btn-mic-game {
    padding: 0.55rem 0.85rem;
    font-weight: 800;
    border-color: rgba(255, 255, 255, 0.12);
}

.btn-report-issue {
    border-color: rgba(255, 98, 223, 0.22);
}

/* --- Menu de signalement (vidéo / paroles) --- */
.report-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.report-menu {
    background: #1a1f2b;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 1.25rem;
    width: 100%;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.report-menu-title {
    margin: 0 0 0.4rem;
    text-align: center;
    font-weight: 600;
    color: #fff;
}
.report-menu-btn {
    padding: 0.8rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 0, 0.4);
    background: rgba(255, 215, 0, 0.08);
    color: #ffd700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.15s;
}
.report-menu-btn:hover {
    background: rgba(255, 215, 0, 0.18);
}
.report-menu-cancel {
    padding: 0.6rem 1rem;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    cursor: pointer;
}
.report-menu-cancel:hover {
    color: #fff;
}

.mic-lang-select {
    width: 168px;
    min-width: 168px;
    max-width: 168px;
    min-height: 46px;
    padding: 0 2.2rem 0 0.9rem;
    appearance: none;
    -webkit-appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-soft) 50%),
        linear-gradient(135deg, var(--text-soft) 50%, transparent 50%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    background-position:
        calc(100% - 18px) 50%,
        calc(100% - 12px) 50%,
        0 0;
    background-size:
        6px 6px,
        6px 6px,
        100% 100%;
    background-repeat: no-repeat;
}

.btn-mic-game {
    min-width: 116px;
    white-space: nowrap;
}

.btn-mic-game.active {
    background: linear-gradient(135deg, var(--magenta), var(--blue));
    box-shadow: var(--glow-pink);
}

.rewind-bar {
    justify-content: space-between;
    margin: 0.62rem 0;
}

.round-bar {
    justify-content: space-between;
    margin: 0.62rem 0 0;
    padding: 0.62rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.055);
}

.round-badge,
.live-stat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-weight: 900;
    background: rgba(255, 255, 255, 0.08);
}

.round-badge {
    color: var(--cyan);
    border: 1px solid rgba(45, 252, 255, 0.24);
}

.live-stat {
    color: var(--text);
    border: 1px solid rgba(255, 44, 205, 0.24);
}

.score-pop {
    animation: scorePop 0.32s ease;
}

.on-fire {
    color: var(--warning);
    box-shadow: 0 0 22px rgba(255, 209, 102, 0.25);
}

#lyrics-container {
    position: relative;
    height: clamp(340px, calc(100vh - 12rem), 720px);
    min-height: 0;
    overflow: hidden;
    padding: clamp(0.85rem, 1.8vw, 1.2rem);
    text-align: left;
    scroll-behavior: smooth;
    mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 82%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 82%, transparent 100%);
}

#lyrics-placeholder {
    display: grid;
    place-items: center;
    min-height: 300px;
    color: var(--text-muted);
}

/* Avant la premiere ligne chantee, le conteneur est vide : on l'efface
   completement pour ne pas laisser un grand cadre vide a l'ecran.
   La classe est retiree par game.js des que la premiere parole s'affiche. */
#lyrics-container.waiting {
    height: 0;
    min-height: 0;
    padding-block: 0;
    border-width: 0;
    opacity: 0;
    pointer-events: none;
}

.lyric-line {
    max-height: 0;
    margin: 0;
    padding: 0 clamp(0.62rem, 1vw, 0.9rem);
    overflow: hidden;
    border-radius: var(--radius);
    color: rgba(255, 248, 255, 0.18);
    font-size: clamp(1rem, 1.45vw, 1.48rem);
    font-weight: 650;
    text-align: left;
    opacity: 0;
    transform: translateY(14px) scale(0.9);
    transform-origin: left center;
    pointer-events: none;
    transition:
        max-height 0.36s ease,
        margin 0.36s ease,
        padding 0.36s ease,
        opacity 0.24s ease,
        transform 0.3s ease,
        color 0.2s ease,
        background 0.2s ease;
}

.lyric-line.active,
.lyric-line.next-line,
.lyric-line.next-2,
.lyric-line[class*="past-"] {
    max-height: 9rem;
    margin: clamp(0.32rem, 0.55vw, 0.5rem) 0;
    padding: clamp(0.48rem, 0.75vw, 0.7rem) clamp(0.62rem, 1vw, 0.9rem);
}

.lyric-line.active {
    color: var(--text);
    opacity: 1;
    transform: translateY(0) scale(1.012);
    pointer-events: auto;
    background: linear-gradient(90deg, rgba(255, 44, 205, 0.17), rgba(45, 252, 255, 0.08), transparent);
    box-shadow: inset 3px 0 0 var(--magenta);
}

.lyric-line.next-line {
    color: rgba(217, 199, 255, 0.74);
    opacity: 0.46;
    transform: translateY(3px) scale(0.96);
}

.lyric-line.next-2 {
    color: rgba(217, 199, 255, 0.52);
    opacity: 0.22;
    transform: translateY(7px) scale(0.92);
}

.lyric-line[class*="past-"] {
    color: rgba(255, 248, 255, 0.42);
    transform: translateY(-4px) scale(0.96);
}

.lyric-line.past-1 {
    opacity: 0.46;
}

.lyric-line.past-2 {
    opacity: 0.34;
    transform: translateY(-6px) scale(0.92);
}

.lyric-line.past-3 {
    opacity: 0.22;
    transform: translateY(-8px) scale(0.88);
}

.lyric-line.past-4 {
    opacity: 0.13;
    transform: translateY(-10px) scale(0.84);
}

.lyric-line.past-5 {
    opacity: 0.07;
    transform: translateY(-12px) scale(0.8);
}

#lyrics-container.calibration {
    overflow: auto;
    mask-image: none;
    -webkit-mask-image: none;
}

#lyrics-container.calibration .lyric-line {
    max-height: none;
    margin: clamp(0.46rem, 0.7vw, 0.62rem) 0;
    padding: clamp(0.48rem, 0.75vw, 0.7rem) clamp(0.62rem, 1vw, 0.9rem);
    opacity: 0.48;
    transform: none;
    pointer-events: auto;
}

.lyric-word {
    white-space: pre-wrap;
}

.lyric-gap {
    width: auto;
    min-width: 3.4ch;
    max-width: 18ch;
    height: 1.85em;
    margin: 0 0.12rem;
    padding: 0 0.35rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-weight: 900;
    text-align: center;
    background: rgba(0, 0, 0, 0.52);
    box-shadow: inset 0 -2px 0 rgba(255, 44, 205, 0.42), 0 0 18px rgba(255, 44, 205, 0.16);
}

.lyric-gap.correct {
    color: #03130d;
    border-color: rgba(77, 255, 181, 0.72);
    background: linear-gradient(135deg, var(--success), #adffe0);
    box-shadow: 0 0 22px rgba(77, 255, 181, 0.36);
}

.lyric-gap.missed {
    color: #fff;
    border-color: rgba(255, 77, 125, 0.78);
    background: linear-gradient(135deg, rgba(255, 77, 125, 0.62), rgba(75, 23, 125, 0.8));
    box-shadow: 0 0 22px rgba(255, 77, 125, 0.28);
}

/* Calibration */
.calibration-bar {
    width: min(980px, 100%);
    margin: 0 auto 1rem;
    padding: 1rem;
    text-align: center;
}

.calibration-text {
    margin: 0 0 0.55rem;
    color: var(--text);
    font-weight: 800;
}

.calib-lyric-preview,
.calib-time {
    margin: 0.35rem 0;
    color: var(--text-soft);
}

.calib-words-area {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.calib-words-area button {
    min-height: 38px;
    padding: 0.45rem 0.72rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text);
    background: rgba(255, 255, 255, 0.07);
}

#lyrics-container.calibration .lyric-line.active {
    background: rgba(45, 252, 255, 0.12);
    box-shadow: inset 3px 0 0 var(--cyan);
}

.calib-prev {
    color: var(--text-muted);
}

.round-announce {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    pointer-events: none;
    background: rgba(3, 3, 10, 0.55);
}

.round-announce span {
    padding: 1rem 1.5rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    font-size: clamp(1.6rem, 5vw, 3.2rem);
    font-weight: 1000;
    background: linear-gradient(135deg, rgba(255, 44, 205, 0.9), rgba(47, 109, 255, 0.82));
    box-shadow: var(--glow-pink);
}

/* End screen */
#end-screen {
    display: grid;
    place-items: center;
    padding: 6.4rem 1.25rem 1.25rem;
}

.end-content {
    position: relative;
    width: min(760px, 100%);
    padding: clamp(1.15rem, 3vw, 2rem);
    text-align: center;
}

.end-favorite-action {
    position: absolute;
    top: clamp(0.8rem, 2vw, 1.05rem);
    right: clamp(0.8rem, 2vw, 1.05rem);
    z-index: 2;
    min-width: 52px;
    min-height: 52px;
    display: grid;
    place-items: center;
}

.end-favorite-action:empty {
    display: none;
}

.end-favorite-action .fav-heart {
    position: static;
    width: clamp(48px, 8vw, 60px);
    height: clamp(48px, 8vw, 60px);
    padding: 0;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 44, 205, 0.42);
    border-radius: 50%;
    font-size: clamp(1.85rem, 4vw, 2.35rem);
    background:
        radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.16), transparent 36%),
        rgba(20, 12, 34, 0.9);
    box-shadow: 0 0 22px rgba(255, 44, 205, 0.28), inset 0 0 18px rgba(255, 44, 205, 0.08);
    transform: none;
}

.end-favorite-action .fav-heart:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.08);
    border-color: rgba(117, 255, 246, 0.7);
    box-shadow: 0 0 28px rgba(255, 44, 205, 0.44), 0 0 20px rgba(117, 255, 246, 0.2);
}

.end-icon {
    font-size: 3rem;
    filter: drop-shadow(0 0 22px rgba(255, 209, 102, 0.36));
}

.end-title {
    margin: 0.2rem 0 0.35rem;
    font-size: clamp(1.8rem, 5vw, 3.2rem);
    line-height: 1.05;
}

.end-song {
    margin-bottom: 1rem;
    color: var(--text-soft);
    font-weight: 800;
}

.end-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 1.1rem 0;
}

.end-stat {
    padding: 0.9rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.055);
}

.end-stat-value,
.end-stat-label {
    display: block;
}

.end-stat-value {
    color: var(--pink);
    font-size: clamp(1.5rem, 4vw, 2.3rem);
    font-weight: 1000;
}

.end-stat-label {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.end-best {
    margin: 0.8rem 0;
    color: var(--success);
    font-weight: 900;
}

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

.daily-chart-section {
    margin-top: 1rem;
    padding: 1rem;
}

.daily-chart-section h3 {
    margin: 0 0 0.8rem;
}

#daily-chart {
    width: 100%;
    height: auto;
}

/* Modal and cookies */
.cookie-banner {
    position: fixed;
    left: 50%;
    bottom: 1rem;
    z-index: 110;
    width: min(680px, calc(100vw - 2rem));
    transform: translateX(-50%);
}

.cookie-content {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.7rem 1rem;
    align-items: center;
    padding: 0.9rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(10, 9, 24, 0.96);
    box-shadow: var(--shadow);
}

.cookie-content p {
    margin: 0;
    color: var(--text-soft);
}

.cookie-buttons {
    display: flex;
    gap: 0.5rem;
}

.cookie-more {
    color: var(--cyan);
    font-size: 0.82rem;
    text-decoration: none;
}

.cookie-more:hover {
    text-decoration: underline;
}

/* Accepter et Refuser : même taille, même poids visuel (refuser doit être aussi simple qu'accepter) */
.cookie-buttons button {
    flex: 1 1 0;
    min-height: 40px;
    padding: 0.5rem 1.25rem;
    font-size: 0.88rem;
    font-weight: 800;
    white-space: nowrap;
}

/* Les mentions légales (lien « En savoir plus » du bandeau) passent par-dessus le bandeau */
#mentions-modal {
    z-index: 120;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(3, 3, 10, 0.72);
    backdrop-filter: blur(10px);
}

.modal-content {
    width: min(760px, 100%);
    max-height: min(82vh, 760px);
    overflow: auto;
    padding: 1.25rem;
}

.modal-close {
    float: right;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
}

.modal-content h2,
.modal-content h3 {
    margin-top: 0;
}

.modal-content p,
.modal-content li {
    color: var(--text-soft);
}

/* ===================== MODE "CHANSON PAR THÈME" ===================== */
.theme-modal-content {
    width: min(680px, 100%);
    text-align: center;
}

.theme-step h2 {
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    font-weight: 1000;
}

.theme-step-hint {
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-muted) !important;
}

.theme-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.theme-tile {
    position: relative;
    display: grid;
    align-content: center;
    gap: 0.2rem;
    min-height: 72px;
    padding: 0.7rem 0.5rem;
    border: 1px solid rgba(255, 98, 223, 0.28);
    border-radius: var(--radius-sm);
    color: var(--text);
    background:
        linear-gradient(145deg, rgba(255, 44, 205, 0.1), rgba(47, 109, 255, 0.08)),
        rgba(20, 18, 38, 0.78);
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.theme-tile:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 98, 223, 0.55);
}

.theme-tile.selected {
    border-color: var(--magenta);
    background: linear-gradient(135deg, rgba(255, 44, 205, 0.42), rgba(47, 109, 255, 0.32));
    box-shadow: var(--glow-pink);
}

.theme-tile-label {
    font-size: 0.98rem;
}

.theme-tile-count {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
}

.theme-tile.selected .theme-tile-count {
    color: rgba(255, 255, 255, 0.85);
}

.theme-tile-all {
    border-color: rgba(45, 252, 255, 0.4);
    background:
        linear-gradient(145deg, rgba(45, 252, 255, 0.14), rgba(140, 53, 255, 0.12)),
        rgba(20, 18, 38, 0.78);
}

.theme-tile-all.selected {
    border-color: var(--cyan);
    background: linear-gradient(135deg, rgba(45, 252, 255, 0.4), rgba(140, 53, 255, 0.34));
}

.theme-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.theme-no-results {
    margin-bottom: 1rem;
    color: var(--magenta) !important;
    font-weight: 700;
}

.theme-tiles-empty {
    grid-column: 1 / -1;
    padding: 1.5rem 0.5rem;
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* ============================================================
   Barre de filtres langue musicale (sous le header)
   - Tuiles colorées toggle, multi-sélection
   - Module accueil uniquement, sous les actions de droite du header
   - Choix multiples avec coches visibles
   - Caché par défaut, révélé par app.js
   ============================================================ */
:root {
    --lang-bar-height: 0px;
}

.song-lang-bar {
    position: fixed;
    top: calc(var(--header-height) + 0.7rem);
    right: clamp(1rem, 3vw, 1.7rem);
    z-index: 40;
    width: min(310px, calc(100vw - 2rem));
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
    padding: 0.9rem;
    border: 1px solid rgba(191, 93, 255, 0.28);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 12% 0%, rgba(255, 44, 205, 0.16), transparent 44%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
        rgba(12, 10, 24, 0.86);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34), inset 0 0 28px rgba(255, 44, 205, 0.04);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transition: transform 0.22s ease, opacity 0.22s ease, border-color 0.22s ease;
}

.song-lang-bar.hidden { display: none; }

.song-lang-card {
    display: grid;
    align-content: start;
    gap: 0.8rem;
}

.song-lang-card .account-section-title {
    margin-bottom: 0.18rem;
}

.song-lang-card .song-lang-hint {
    margin: 0;
}

.song-lang-prompt-overlay {
    z-index: 1450;
}

.song-lang-prompt-dialog {
    position: relative;
    width: min(380px, calc(100vw - 2rem));
}

.song-lang-prompt-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 3;
    float: none;
    margin: 0;
}

.song-lang-prompt-host .song-lang-card {
    padding-top: 1.35rem;
}

.song-lang-toggle {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.6rem;
    align-items: center;
    width: 100%;
    padding: 0;
    border: 0;
    color: inherit;
    text-align: left;
    background: transparent;
    box-shadow: none;
}

.song-lang-toggle-copy {
    display: grid;
    gap: 0.08rem;
    min-width: 0;
}

.song-lang-arrow {
    display: none;
}

.song-lang-panel {
    display: grid;
}

.song-lang-label {
    font-size: 0.92rem;
    font-weight: 950;
    color: var(--text);
    white-space: nowrap;
    letter-spacing: 0;
}

.song-lang-hint {
    margin-top: -0.45rem;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.song-lang-tiles {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.42rem;
    max-height: min(42vh, 360px);
    overflow-y: auto;
    padding-right: 0.1rem;
    scrollbar-width: thin;
}

.song-lang-tile {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 42px;
    padding: 0.42rem 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-sm);
    color: #fff;
    font-weight: 800;
    font-size: 0.84rem;
    letter-spacing: 0;
    cursor: pointer;
    opacity: 0.76;
    text-align: left;
    transition: opacity 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, background 0.12s ease;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
        rgba(255, 255, 255, 0.05);
}

.song-lang-tile:hover {
    opacity: 1;
    transform: translateX(-2px);
    border-color: rgba(117, 255, 246, 0.42);
}

.song-lang-tile.selected {
    opacity: 1;
    border-color: rgba(117, 255, 246, 0.72);
    background:
        linear-gradient(135deg, rgba(255, 44, 205, 0.18), rgba(47, 109, 255, 0.16)),
        color-mix(in srgb, var(--lang-color, rgba(120, 120, 130, 0.5)) 58%, rgba(10, 9, 22, 0.92));
    box-shadow: 0 0 0 2px rgba(117, 255, 246, 0.18), 0 10px 24px rgba(255, 44, 205, 0.14);
}

.song-lang-tile .check {
    width: 16px;
    height: 16px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.22);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.18);
}

.song-lang-tile.selected .check {
    border-color: rgba(117, 255, 246, 0.84);
    background: linear-gradient(135deg, var(--cyan), var(--magenta));
    box-shadow: 0 0 12px rgba(117, 255, 246, 0.22);
}

.song-lang-tile.selected .check::after {
    content: "";
    width: 7px;
    height: 4px;
    border-left: 2px solid #09101b;
    border-bottom: 2px solid #09101b;
    transform: rotate(-45deg) translateY(-1px);
}

.song-lang-tile .code {
    text-transform: uppercase;
    min-width: 0;
    font-weight: 900;
}

/* Mapping couleur par langue musicale.
   en: bleu roi / fr: marine / es: rouge / de: or noir / it: vert
   pt: vert vif / ja: cerise / ko: sarcelle / zh: rouge chinois / autre: gris */
.song-lang-tile[data-lang="en"] { --lang-color: rgba(45, 109, 255, 0.85); }
.song-lang-tile[data-lang="fr"] { --lang-color: rgba(0, 85, 164, 0.85); }
.song-lang-tile[data-lang="es"] { --lang-color: rgba(198, 11, 30, 0.85); }
.song-lang-tile[data-lang="de"] { --lang-color: rgba(255, 206, 0, 0.85); color: #1a1a1a; }
.song-lang-tile[data-lang="it"] { --lang-color: rgba(0, 146, 70, 0.85); }
.song-lang-tile[data-lang="pt"] { --lang-color: rgba(0, 102, 0, 0.85); }
.song-lang-tile[data-lang="ja"] { --lang-color: rgba(188, 0, 45, 0.85); }
.song-lang-tile[data-lang="ko"] { --lang-color: rgba(0, 71, 160, 0.85); }
.song-lang-tile[data-lang="zh"] { --lang-color: rgba(222, 41, 16, 0.85); }
.song-lang-tile[data-lang="nl"] { --lang-color: rgba(174, 28, 40, 0.85); }
.song-lang-tile[data-lang="pl"] { --lang-color: rgba(220, 20, 60, 0.85); }
.song-lang-tile[data-lang="ru"] { --lang-color: rgba(15, 35, 95, 0.85); }
.song-lang-tile[data-lang="sv"] { --lang-color: rgba(0, 102, 204, 0.85); }
.song-lang-tile[data-lang="tr"] { --lang-color: rgba(227, 10, 23, 0.85); }
.song-lang-tile[data-lang="ar"] { --lang-color: rgba(0, 122, 61, 0.85); }

/* Loading */
.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--magenta);
    border-right-color: var(--cyan);
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
}

#game-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 95;
    display: grid;
    place-items: center;
    background: rgba(3, 3, 10, 0.72);
    backdrop-filter: blur(12px);
}

#game-loading-overlay .spinner {
    width: 52px;
    height: 52px;
}

/* Scrollbars */
* {
    scrollbar-color: rgba(255, 44, 205, 0.55) rgba(255, 255, 255, 0.06);
    scrollbar-width: thin;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--magenta), var(--blue));
    border-radius: 999px;
}

/* Responsive */
@media (max-width: 860px) {
    .site-footer {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 0.55rem;
    }

    .mobile-lang-slot {
        grid-column: 1;
        justify-self: start;
        display: block;
    }

    .mobile-lang-slot .lang-switcher {
        display: block;
    }

    .mobile-lang-slot .btn-lang {
        min-height: 36px;
        padding-inline: 0.72rem;
        font-size: 0.82rem;
        box-shadow: none;
    }

    .mobile-lang-slot .lang-menu {
        top: auto;
        right: auto;
        bottom: calc(100% + 0.5rem);
        left: 0;
    }

    .footer-legal-link {
        grid-column: 2;
    }

    .footer-socials {
        grid-column: 3;
    }

    .main-header {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.65rem;
        padding: 0.72rem;
    }

    .header-title {
        grid-column: 1;
        grid-row: 1;
        width: min(136px, 34vw);
    }

    .main-header .search-bar {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
    }

    .header-actions {
        grid-column: 2;
        grid-row: 1;
        align-self: start;
        justify-self: end;
        gap: 0.45rem;
    }

    .btn-account {
        min-height: 40px;
        padding-inline: 0.85rem;
        font-size: 0.9rem;
    }

    .btn-lang {
        min-height: 40px;
        padding-inline: 0.8rem;
        font-size: 0.9rem;
    }

    .main-header .lang-switcher {
        display: none;
    }

    .panel {
        margin-top: 10.2rem;
    }

    /* Empile des 860px : les colonnes s'effacent (display: contents) pour que
       chaque bloc soit un item flex directement ordonnable. */
    .game-columns {
        display: flex;
        flex-direction: column;
        /* align-items: start du mode 2 colonnes ferait retrecir chaque bloc
           a la largeur de son contenu une fois en colonne : on retablit. */
        align-items: stretch;
        width: min(760px, 100%);
    }

    #game-area {
        align-items: start;
        padding-top: 10.2rem;
    }

    .game-col-left,
    .game-col-right {
        display: contents;
    }

    #player-wrapper,
    .pause-panel {
        order: 1;
    }

    .rewind-bar {
        order: 2;
    }

    #lyrics-container {
        order: 3;
    }

    .round-bar {
        order: 4;
    }

    .lyrics-attribution {
        order: 5;
    }

    #lyrics-container {
        height: clamp(260px, 38vh, 420px);
        min-height: 0;
        max-height: none;
    }

    .end-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    body {
        font-size: 15px;
    }

    #splash {
        padding: 12.7rem 0.9rem 0.9rem;
    }

    .splash-hero {
        gap: 0.75rem;
        padding-top: 0;
        transform: none;
    }

    .splash-header {
        display: none;
    }

    .song-lang-bar {
        top: 8.55rem;
        right: 50%;
        width: min(var(--splash-card-width-mobile), calc(100vw - 1.8rem));
        transform: translateX(50%);
    }

    .song-lang-toggle {
        min-height: 48px;
        padding: 0.5rem 0.7rem 0.5rem 0.9rem;
    }

    .song-lang-toggle-copy {
        display: grid;
    }

    .song-lang-label::before {
        content: "Je chante en";
        font-size: 0.98rem;
    }

    .song-lang-hint {
        display: block;
        color: var(--text-muted);
        font-size: 0.72rem;
        font-weight: 800;
    }

    .song-lang-bar.song-lang-open {
        transform: none;
    }

    .splash-search-bar input,
    .splash-search-bar .btn-icon {
        min-height: 48px;
    }

    .splash-search-bar .btn-icon {
        width: 48px;
        min-width: 48px;
    }

    .splash-mode-cards {
        grid-template-columns: 1fr;
        gap: 0.7rem;
        width: min(var(--splash-card-width-mobile), 100%);
    }

    .favorite-playlist-card {
        grid-template-columns: auto minmax(0, 1fr);
        width: min(var(--splash-card-width-mobile), 100%);
        min-height: 112px;
        padding: 0.9rem;
    }

    .favorite-playlist-action {
        grid-column: 1 / -1;
        width: 100%;
    }

    .daily-song-card {
        width: min(var(--splash-card-width-mobile), 100%);
        padding-top: 3.1rem;
    }

    .daily-card-top {
        margin-inline: 0;
    }

    .daily-countdown {
        width: calc(8ch + 1.05rem);
        min-height: 30px;
        font-size: 0.78rem;
    }

    .daily-status {
        padding-inline: 0.62rem;
        font-size: 0.76rem;
    }

    .recent-songs {
        width: min(var(--splash-card-width-mobile), 100%);
    }

    .site-footer {
        grid-template-columns: 1fr;
        gap: 0.55rem;
        padding-block: 0.8rem;
    }

    .footer-links,
    .footer-legal-link,
    .footer-socials {
        grid-column: 1;
        justify-self: center;
    }

    .splash-mode-card {
        min-height: 104px;
        grid-template-columns: auto 1fr;
        align-content: center;
        justify-items: start;
        text-align: left;
    }

    .splash-search-bar,
    .search-bar,
    .youtube-input-row {
        gap: 0.45rem;
    }

    .youtube-input-row {
        flex-direction: column;
        align-items: stretch;
    }

    .main-header {
        padding: 0.7rem;
    }

    .panel {
        width: calc(100vw - 1rem);
        margin: 10.2rem auto 1rem;
        padding: 0.85rem;
    }

    .search-tabs,
    .end-stats {
        grid-template-columns: 1fr;
    }

    .yt-result-item {
        grid-template-columns: 84px 1fr;
    }

    .yt-result-thumb {
        width: 84px;
    }

    #game-area {
        padding: 10.2rem 0.55rem 0.55rem;
    }

    #end-screen {
        padding-top: 10.2rem;
    }

    /* Barre de controles : chaque bouton a un emplacement fixe et reserve.
       Masquer un voisin (recalibrage verrouille, micro pas encore pret,
       selecteur de langue en mode manuel) ne deplace donc plus les autres. */
    .rewind-bar {
        display: grid;
        grid-template-columns: auto auto;
        justify-content: space-between;
        align-items: center;
        gap: 0.55rem;
    }

    .rewind-bar-left {
        display: grid;
        grid-template-columns: repeat(2, 48px);
        gap: 0.45rem;
        width: calc(2 * 48px + 0.45rem);
        min-width: 0;
    }

    #btn-report-issue {
        grid-column: 1;
    }

    #btn-recalibrate {
        grid-column: 2;
    }

    .mic-controls {
        display: grid;
        grid-template-columns: 48px minmax(0, 118px);
        justify-self: end;
        width: calc(48px + 0.45rem + 118px);
        min-width: 0;
        margin-left: 0;
        gap: 0.45rem;
    }

    #btn-mic {
        grid-column: 1;
    }

    #mic-lang {
        grid-column: 2;
    }

    .mic-lang-select {
        width: 100%;
        min-width: 0;
        max-width: none;
        padding-left: 0.78rem;
        padding-right: 1.9rem;
        background-position:
            calc(100% - 16px) 50%,
            calc(100% - 10px) 50%,
            0 0;
    }

    .btn-report-issue {
        flex: 0 0 auto;
        width: 48px;
        min-height: 48px;
    }

    #btn-recalibrate,
    .btn-mic-game {
        width: 48px;
        min-width: 0;
        min-height: 48px;
        overflow: hidden;
        white-space: nowrap;
    }

    #btn-report-issue[data-mobile-icon],
    #btn-recalibrate[data-mobile-icon],
    #btn-mic[data-mobile-icon] {
        color: transparent;
        font-size: 0;
    }

    #btn-report-issue[data-mobile-icon]::before,
    #btn-recalibrate[data-mobile-icon]::before,
    #btn-mic[data-mobile-icon]::before {
        content: attr(data-mobile-icon);
        color: var(--text);
        font-size: 1.15rem;
        line-height: 1;
    }

    .btn-mic-game,
    .mic-lang-select {
        font-size: 0.92rem;
    }

    #lyrics-container {
        height: clamp(260px, 36vh, 390px);
        padding: 0.7rem 0.55rem;
    }

    .lyric-line {
        padding-inline: 0.58rem;
        font-size: clamp(0.92rem, 4.2vw, 1.08rem);
        line-height: 1.25;
    }

    .lyric-line.active,
    .lyric-line.next-line,
    .lyric-line.next-2,
    .lyric-line[class*="past-"] {
        max-height: 7.2rem;
        margin: 0.28rem 0;
        padding-block: 0.48rem;
    }

    .lyric-line.past-3 {
        transform: translateY(-6px) scale(0.9);
    }

    .lyric-line.past-4 {
        transform: translateY(-8px) scale(0.86);
    }

    .lyric-line.past-5 {
        transform: translateY(-10px) scale(0.82);
    }

    .cookie-content {
        grid-template-columns: 1fr;
    }

    .cookie-buttons,
    .end-buttons {
        display: grid;
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }
}

/* ============================================================
   Comptes utilisateurs
   ============================================================ */
.account-content {
    width: min(560px, calc(100vw - 2rem));
    max-height: 88vh;
    overflow-y: auto;
}

#profile-screen {
    min-height: calc(100svh - var(--site-footer-height));
    padding: 6.8rem clamp(1rem, 4vw, 2.2rem) 2rem;
}

.profile-page {
    width: min(1120px, 100%);
    margin: 0 auto;
}

.profile-body {
    display: grid;
    gap: 1rem;
}

.account-body h2 {
    margin: 0 0 1rem;
    text-align: center;
}

.account-auth-shell {
    width: min(500px, 100%);
    margin: 0 auto;
    padding: clamp(1.1rem, 4vw, 1.6rem);
    border: 1px solid rgba(191, 93, 255, 0.32);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 44, 205, 0.18), transparent 48%),
        rgba(14, 11, 28, 0.82);
    box-shadow: var(--shadow), inset 0 0 32px rgba(255, 44, 205, 0.05);
    backdrop-filter: blur(16px);
}

.account-auth-shell h2 {
    font-size: clamp(1.7rem, 4vw, 2.45rem);
    line-height: 1.05;
}

.account-auth-lead {
    margin: -0.35rem 0 1rem;
    color: var(--text-soft);
    text-align: center;
    font-weight: 700;
    line-height: 1.45;
}

/* ---- Cœur favori sur les résultats ---- */
.fav-heart {
    position: absolute;
    top: 0.5rem;
    right: 0.6rem;
    padding: 0.15rem 0.3rem;
    min-height: 0;
    font-size: 1.15rem;
    line-height: 1;
    border: none;
    background: transparent;
    filter: grayscale(0.3);
    transition: transform 0.15s ease, filter 0.15s ease;
}
.fav-heart.active { filter: none; }
.fav-heart:hover:not(:disabled) {
    transform: scale(1.25);
    border-color: transparent;
    box-shadow: none;
}
/* Cœur "inline" (barre de jeu, écran de fin) : pas en position absolue */
.fav-heart-inline {
    position: static;
    top: auto;
    right: auto;
    vertical-align: middle;
    margin-left: 0.4rem;
}
.fav-heart-inline:hover:not(:disabled) {
    transform: scale(1.25);
    border-color: transparent;
    box-shadow: none;
}

/* ---- Auth (connexion / inscription) ---- */
.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    margin-bottom: 1.1rem;
    padding: 0.3rem;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.05);
}
.auth-tab {
    min-height: 40px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-soft);
    background: transparent;
    font-weight: 700;
}
.auth-tab.active {
    color: var(--text);
    background: linear-gradient(135deg, var(--magenta), var(--violet));
    box-shadow: var(--glow-pink);
}
.auth-form { display: flex; flex-direction: column; gap: 0.7rem; }
.auth-form input {
    padding: 0.8rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.06);
}
.auth-hint { margin: -0.2rem 0 0; font-size: 0.78rem; color: var(--text-muted); }
.auth-error {
    margin: 0;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--error);
    border-radius: var(--radius-sm);
    color: var(--error);
    background: rgba(255, 77, 125, 0.12);
    font-size: 0.85rem;
}
.auth-submit { margin-top: 0.3rem; }
.auth-sep {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.2rem 0 0.9rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.auth-sep::before, .auth-sep::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}
.auth-social { display: flex; flex-direction: column; gap: 0.6rem; align-items: center; }
.btn-social {
    width: 100%;
    max-width: 280px;
    min-height: 44px;
    border-radius: 24px;
    border: 1px solid var(--line);
    font-weight: 700;
    color: #fff;
}
.btn-facebook { background: #1877f2; border-color: #1877f2; }
.google-btn-wrap { display: flex; justify-content: center; min-height: 44px; }

/* ---- Tableau de bord ---- */
.account-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(0.9rem, 3vw, 1.4rem);
    margin-bottom: 1.2rem;
}

.profile-card {
    position: relative;
    overflow: hidden;
    padding: clamp(1rem, 2.5vw, 1.35rem);
    border: 1px solid rgba(191, 93, 255, 0.3);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(255, 44, 205, 0.1), transparent 36%),
        radial-gradient(circle at 90% 0%, rgba(45, 252, 255, 0.08), transparent 34%),
        rgba(15, 12, 30, 0.82);
    box-shadow:
        var(--shadow),
        0 0 0 1px rgba(45, 252, 255, 0.045),
        inset 0 0 34px rgba(255, 44, 205, 0.045);
    backdrop-filter: blur(16px);
}

.profile-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, transparent, rgba(117, 255, 246, 0.08), transparent),
        radial-gradient(circle at 12% 0%, rgba(255, 44, 205, 0.14), transparent 36%);
    opacity: 0.7;
}

.profile-card > * {
    position: relative;
    z-index: 1;
}

.profile-hero-card {
    min-height: 160px;
    margin-bottom: 0;
    border-color: rgba(117, 255, 246, 0.42);
    background:
        linear-gradient(115deg, rgba(255, 44, 205, 0.16), transparent 38%),
        radial-gradient(circle at 10% 18%, rgba(117, 255, 246, 0.2), transparent 34%),
        radial-gradient(circle at 82% 8%, rgba(255, 44, 205, 0.28), transparent 30%),
        rgba(12, 9, 26, 0.86);
}

.profile-hero-card::after {
    content: "";
    position: absolute;
    right: -42px;
    bottom: -72px;
    width: 220px;
    height: 220px;
    border: 1px solid rgba(117, 255, 246, 0.18);
    border-radius: 50%;
    box-shadow: inset 0 0 36px rgba(255, 44, 205, 0.12), 0 0 34px rgba(117, 255, 246, 0.08);
    pointer-events: none;
}

.account-avatar {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    overflow: hidden;
    font-size: 1.9rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--magenta), var(--violet));
    box-shadow: var(--glow-pink);
}

.account-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.account-avatar.has-photo {
    background: rgba(255, 255, 255, 0.06);
}

.profile-hero-card .account-avatar {
    width: clamp(88px, 11vw, 116px);
    height: clamp(88px, 11vw, 116px);
    font-size: clamp(2.45rem, 5.5vw, 3.4rem);
    border: 1px solid rgba(255, 255, 255, 0.18);
    background:
        radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.32), transparent 34%),
        linear-gradient(135deg, var(--magenta), var(--violet) 54%, var(--blue));
}

.profile-avatar-wrap {
    position: relative;
    display: inline-grid;
    justify-items: center;
    min-width: clamp(96px, 12vw, 126px);
}

.profile-avatar-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

.profile-avatar-edit {
    position: absolute;
    right: 0.28rem;
    bottom: 0.3rem;
    width: 28px;
    height: 28px;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(117, 255, 246, 0.34);
    border-radius: 999px;
    color: #dffcff;
    font-size: 0.9rem;
    font-weight: 1000;
    line-height: 1;
    cursor: pointer;
    background: rgba(8, 6, 20, 0.82);
    backdrop-filter: blur(8px);
    box-shadow:
        0 0 0 2px rgba(8, 6, 20, 0.72),
        0 8px 16px rgba(0, 0, 0, 0.28);
    transition: transform 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.profile-avatar-edit:hover {
    transform: translateY(-1px) scale(1.04);
    color: #fff;
    border-color: rgba(117, 255, 246, 0.62);
    background: rgba(12, 10, 30, 0.94);
    box-shadow:
        0 0 0 2px rgba(8, 6, 20, 0.72),
        0 0 14px rgba(117, 255, 246, 0.22),
        0 8px 16px rgba(0, 0, 0, 0.28);
}

.profile-avatar-edit:focus-visible {
    outline: 2px solid rgba(117, 255, 246, 0.75);
    outline-offset: 3px;
}

.profile-avatar-status {
    max-width: 120px;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
}

.account-name { font-size: 1.2rem; font-weight: 800; }
.profile-hero-card .account-name {
    font-size: clamp(1.7rem, 4vw, 2.8rem);
    line-height: 1;
}
.account-username { color: var(--text-muted); font-size: 0.85rem; }
.account-player-rank {
    width: max-content;
    max-width: 100%;
    margin-bottom: 0.45rem;
    padding: 0.34rem 0.62rem;
    border: 1px solid rgba(117, 255, 246, 0.34);
    border-radius: 999px;
    color: #9ffdfa;
    font-size: 0.74rem;
    font-weight: 1000;
    line-height: 1;
    text-transform: uppercase;
    background: rgba(117, 255, 246, 0.075);
    box-shadow: 0 0 18px rgba(117, 255, 246, 0.09);
}
.account-hero-stats {
    display: grid;
    grid-template-columns: 208px;
    gap: 0.55rem;
    width: 208px;
    min-width: 0;
    justify-self: end;
}

.account-hero-stat {
    position: relative;
    width: 208px;
    min-height: 92px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 0.28rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(255, 98, 223, 0.24);
    border-radius: 14px;
    background:
        radial-gradient(circle at 50% 0%, #442168 0%, #201334 54%, #151027 100%),
        #151027;
    text-align: center;
    box-shadow:
        inset 0 0 16px rgba(117, 255, 246, 0.03),
        0 0 18px rgba(255, 44, 205, 0.08);
}

.account-hero-stat strong {
    color: var(--text);
    font-size: clamp(1.95rem, 3.3vw, 2.45rem);
    font-weight: 1000;
    line-height: 1;
    text-shadow: 0 0 14px rgba(255, 44, 205, 0.22);
}

.account-hero-stat span {
    color: var(--cyan);
    font-size: 0.72rem;
    font-weight: 950;
    line-height: 1.08;
    text-transform: uppercase;
}
.account-section-title {
    display: flex;
    align-items: center;
    gap: 0.48rem;
    margin: 0 0 0.95rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-soft);
}

.account-section-title::before {
    content: "";
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--cyan), var(--magenta));
    box-shadow: 0 0 14px rgba(117, 255, 246, 0.32);
}

.profile-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
}

.profile-list-grid {
    grid-template-columns: 1fr;
}

.profile-dashboard-grid-secondary {
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.7rem;
}
.stat-cell {
    position: relative;
    min-height: 116px;
    display: grid;
    align-content: end;
    gap: 0.15rem;
    padding: 0.85rem;
    overflow: hidden;
    text-align: left;
    border: 1px solid rgba(191, 93, 255, 0.24);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 100% 0%, rgba(117, 255, 246, 0.1), transparent 44%),
        rgba(255, 255, 255, 0.045);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.stat-cell::before {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 3px;
    background: linear-gradient(90deg, var(--magenta), var(--cyan));
    opacity: 0.75;
}
.stat-cell:hover {
    transform: translateY(-2px);
    border-color: rgba(117, 255, 246, 0.42);
    box-shadow: 0 0 20px rgba(117, 255, 246, 0.1), 0 0 18px rgba(255, 44, 205, 0.1);
}
.stat-icon {
    position: absolute;
    top: 0.72rem;
    right: 0.76rem;
    font-size: 1.25rem;
    filter: drop-shadow(0 0 10px rgba(255, 44, 205, 0.22));
}
.stat-num { font-size: clamp(1.3rem, 2.8vw, 1.9rem); font-weight: 1000; line-height: 1; }
.stat-lbl { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.15rem; font-weight: 900; line-height: 1.15; }

.achievement-tracks-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.95rem;
}

.achievement-track-card {
    position: relative;
    min-height: 168px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    padding: 1.05rem 0.82rem;
    overflow: hidden;
    border: 1px solid rgba(191, 93, 255, 0.3);
    border-radius: var(--radius-sm);
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 44, 205, 0.16), transparent 52%),
        rgba(255, 255, 255, 0.035);
    text-align: center;
    cursor: pointer;
    box-shadow: inset 0 0 16px rgba(117, 255, 246, 0.025);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.achievement-track-card:hover {
    transform: translateY(-2px);
    border-color: rgba(117, 255, 246, 0.46);
    box-shadow: 0 0 22px rgba(117, 255, 246, 0.08), inset 0 0 24px rgba(255, 44, 205, 0.045);
}

.achievement-track-card:focus-visible {
    outline: 2px solid rgba(117, 255, 246, 0.78);
    outline-offset: 3px;
}

.achievement-track-card.completed {
    border-color: rgba(77, 255, 181, 0.5);
    background:
        radial-gradient(circle at 50% 0%, rgba(77, 255, 181, 0.14), transparent 54%),
        rgba(255, 255, 255, 0.04);
}

.achievement-track-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.34rem;
    min-width: 0;
}

.achievement-track-icon {
    width: 62px;
    height: 62px;
    flex: 0 0 62px;
    display: grid;
    place-items: center;
    font-size: 2.25rem;
    line-height: 1;
    filter: drop-shadow(0 0 10px rgba(255, 44, 205, 0.2));
}

.achievement-track-copy { min-width: 0; width: 100%; }

.achievement-track-title {
    margin: 0;
    min-height: 2.1em;
    display: grid;
    place-items: center;
    color: var(--text);
    font-size: 1.08rem;
    line-height: 1.08;
    font-weight: 950;
    overflow-wrap: anywhere;
}

.achievement-progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    width: 100%;
    margin-top: 0;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1;
}

.achievement-progress-meta strong {
    color: var(--text);
    font-size: 0.86rem;
}

.achievement-track-card.completed .achievement-progress-meta span,
.achievement-track-card.completed .achievement-progress-meta strong {
    color: var(--success);
}

.achievement-progress {
    width: 100%;
    height: 9px;
    margin-top: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(4, 3, 14, 0.72);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.42);
}

.achievement-progress-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--magenta), var(--violet), var(--cyan));
    box-shadow: 0 0 12px rgba(117, 255, 246, 0.42);
    transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.achievement-track-card.completed .achievement-progress-fill {
    background: linear-gradient(90deg, var(--success), var(--cyan));
}

.achievement-info-overlay {
    z-index: 1450;
}

.achievement-info-dialog {
    position: relative;
    width: min(380px, calc(100vw - 2rem));
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(1.1rem, 4vw, 1.45rem);
    text-align: center;
    border: 1px solid rgba(117, 255, 246, 0.34);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 44, 205, 0.2), transparent 48%),
        radial-gradient(circle at 100% 12%, rgba(117, 255, 246, 0.12), transparent 36%),
        rgba(14, 10, 28, 0.96);
    box-shadow: var(--shadow), 0 0 30px rgba(255, 44, 205, 0.16);
    backdrop-filter: blur(18px);
}

.achievement-info-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    float: none;
    margin: 0;
}

.achievement-info-icon {
    width: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.65rem;
    border: 1px solid rgba(255, 98, 223, 0.34);
    border-radius: 50%;
    font-size: 2.25rem;
    line-height: 1;
    padding-top: 0.04em;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    background:
        radial-gradient(circle at 35% 20%, rgba(255, 255, 255, 0.2), transparent 36%),
        linear-gradient(135deg, rgba(255, 44, 205, 0.24), rgba(47, 109, 255, 0.18));
    box-shadow: 0 0 22px rgba(255, 44, 205, 0.18), inset 0 0 18px rgba(117, 255, 246, 0.06);
}

.achievement-info-dialog h2 {
    width: 100%;
    margin: 0;
    font-size: clamp(1.25rem, 5vw, 1.65rem);
}

.achievement-info-status {
    width: max-content;
    max-width: 100%;
    margin: 0.62rem auto 0;
    padding: 0.32rem 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 950;
    background: rgba(255, 255, 255, 0.055);
}

.achievement-info-status.unlocked {
    border-color: rgba(117, 255, 246, 0.44);
    color: var(--cyan);
    background: rgba(117, 255, 246, 0.08);
    box-shadow: 0 0 16px rgba(117, 255, 246, 0.12);
}

.achievement-info-desc {
    width: 100%;
    margin: 0.8rem 0 0;
    color: var(--text-soft);
    font-weight: 750;
    line-height: 1.45;
}

.account-list { list-style: none; margin: 0; padding: 0; }
.account-list li {
    position: relative;
    margin-bottom: 0.5rem;
    padding: 0.78rem 2.35rem 0.78rem 0.9rem;
    border: 1px solid rgba(191, 93, 255, 0.16);
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.035);
}
.account-list li:hover {
    border-color: rgba(117, 255, 246, 0.28);
    background: rgba(255, 44, 205, 0.07);
}
.al-artist { font-weight: 700; }
.al-meta { display: block; margin-top: 0.15rem; font-size: 0.78rem; color: var(--text-muted); }
.account-list .fav-heart { top: 50%; transform: translateY(-50%); }
.account-list .fav-heart:hover:not(:disabled) { transform: translateY(-50%) scale(1.25); }
.profile-show-more {
    width: 100%;
    min-height: 38px;
    margin-top: 0.75rem;
    border: 1px solid rgba(117, 255, 246, 0.28);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 900;
    background:
        linear-gradient(135deg, rgba(255, 44, 205, 0.12), rgba(47, 109, 255, 0.1)),
        rgba(255, 255, 255, 0.045);
}
.profile-show-more:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: rgba(117, 255, 246, 0.52);
    box-shadow: 0 0 18px rgba(117, 255, 246, 0.12), 0 0 18px rgba(255, 44, 205, 0.12);
}

.account-list-overlay {
    z-index: 1400;
}

.account-list-dialog {
    position: relative;
    width: min(620px, calc(100vw - 2rem));
    max-height: min(82vh, 760px);
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 0.9rem;
    padding: clamp(1.1rem, 4vw, 1.55rem);
    border: 1px solid rgba(191, 93, 255, 0.32);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 18% 0%, rgba(255, 44, 205, 0.16), transparent 42%),
        rgba(14, 10, 28, 0.95);
    box-shadow: var(--shadow), 0 0 34px rgba(255, 44, 205, 0.14);
    backdrop-filter: blur(18px);
}

.account-list-dialog h2 {
    margin: 0;
    padding-right: 2.5rem;
    font-size: clamp(1.35rem, 4vw, 2rem);
}

.account-modal-list {
    min-height: 120px;
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 0.2rem;
    scrollbar-width: thin;
}

.account-list-status {
    margin: 0;
    color: var(--text-muted);
    font-weight: 800;
    text-align: center;
}

.account-list-pager {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 0.6rem;
    align-items: center;
}

.account-page-btn {
    min-height: 40px;
    width: 100%;
}

.account-page-text {
    color: var(--text-soft);
    font-size: 0.84rem;
    font-weight: 900;
    white-space: nowrap;
}

.account-page-btn:disabled {
    opacity: 0.4;
}

.account-empty {
    min-height: 92px;
    display: grid;
    place-items: center;
    margin: 0;
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 700;
    text-align: center;
    border: 1px dashed rgba(191, 93, 255, 0.24);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.025);
}

.account-actions {
    display: grid;
    gap: 0.6rem;
}
.btn-danger {
    border-color: var(--error) !important;
    color: var(--error) !important;
}

.account-delete-overlay {
    z-index: 1400;
}

.account-delete-dialog {
    width: min(440px, calc(100vw - 2rem));
    padding: clamp(1.15rem, 4vw, 1.6rem);
    text-align: center;
    border: 1px solid rgba(255, 77, 125, 0.34);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 77, 125, 0.18), transparent 48%),
        rgba(14, 10, 25, 0.95);
    box-shadow: var(--shadow), 0 0 28px rgba(255, 77, 125, 0.16);
    backdrop-filter: blur(18px);
}

.account-delete-icon {
    margin-bottom: 0.45rem;
    font-size: 2.2rem;
    filter: drop-shadow(0 0 14px rgba(255, 77, 125, 0.32));
}

.account-delete-dialog h2 {
    margin: 0 0 0.55rem;
    font-size: clamp(1.3rem, 4vw, 1.8rem);
}

.account-delete-text {
    margin: 0 0 1.15rem;
    color: var(--text-soft);
    font-weight: 700;
    line-height: 1.45;
}

.account-delete-choices {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(92px, 0.65fr);
    gap: 0.65rem;
    align-items: center;
}

.account-delete-cancel {
    min-height: 48px;
}

.account-delete-confirm {
    min-height: 42px;
    opacity: 0.78;
    font-size: 0.86rem;
}

.account-delete-confirm:hover:not(:disabled) {
    opacity: 1;
}

/* ---- Toasts succès ---- */
#achievement-toasts {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}
.achievement-toast {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 1rem;
    border: 1px solid var(--magenta);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow), var(--glow-pink);
    backdrop-filter: blur(14px);
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.achievement-toast.show { transform: translateX(0); }
.achievement-toast .at-icon { font-size: 1.7rem; }
.achievement-toast .at-text { font-size: 0.85rem; line-height: 1.3; }

@media (max-width: 900px) {
    body.song-lang-sheet-open::before {
        z-index: 52;
        background:
            radial-gradient(circle at 50% 68%, rgba(255, 44, 205, 0.18), transparent 42%),
            linear-gradient(180deg, rgba(3, 3, 10, 0.02), rgba(3, 3, 10, 0.38));
        opacity: 1;
        mask-image: none;
    }

    .song-lang-bar {
        top: 8.35rem;
        right: 0.9rem;
        transform: none;
        z-index: 45;
        width: min(126px, 34vw);
        gap: 0;
        padding: 0;
        border-color: rgba(255, 98, 223, 0.22);
        background: rgba(12, 10, 24, 0.72);
    }

    .song-lang-toggle {
        min-height: 40px;
        padding: 0.42rem 0.56rem 0.42rem 0.68rem;
        border: 1px solid rgba(255, 98, 223, 0.26);
        border-radius: var(--radius-sm);
        background:
            radial-gradient(circle at 18% 0%, rgba(255, 98, 223, 0.14), transparent 38%),
            rgba(255, 255, 255, 0.06);
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22), inset 0 0 18px rgba(255, 44, 205, 0.04);
    }

    .song-lang-toggle-copy {
        display: block;
    }

    .song-lang-label {
        overflow: hidden;
        font-size: 0;
        text-overflow: ellipsis;
    }

    .song-lang-label::before {
        content: "Chant";
        font-size: 0.92rem;
        font-weight: 1000;
        letter-spacing: 0;
    }

    .song-lang-label {
        color: transparent;
    }

    .song-lang-label::before {
        color: var(--text);
    }

    .song-lang-hint {
        display: none;
    }

    .song-lang-arrow {
        width: 1.35rem;
        height: 1.35rem;
        display: grid;
        place-items: center;
        border: 1px solid rgba(117, 255, 246, 0.3);
        border-radius: 999px;
        color: var(--cyan);
        background: rgba(45, 252, 255, 0.06);
        transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
    }

    .song-lang-arrow::before {
        content: "";
        width: 0.42rem;
        height: 0.42rem;
        border-right: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        transform: translateY(-1px) rotate(45deg);
    }

    .song-lang-bar.song-lang-open {
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        padding: 0.95rem 0.9rem calc(1rem + env(safe-area-inset-bottom));
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 18px 18px 0 0;
        border-top-color: rgba(117, 255, 246, 0.4);
        background:
            radial-gradient(circle at 18% 0%, rgba(255, 44, 205, 0.28), transparent 46%),
            radial-gradient(circle at 86% 18%, rgba(117, 255, 246, 0.16), transparent 36%),
            linear-gradient(135deg, rgba(50, 36, 78, 0.94), rgba(18, 17, 38, 0.96)),
            rgba(18, 16, 38, 0.96);
        box-shadow:
            0 -18px 52px rgba(255, 44, 205, 0.18),
            0 -26px 70px rgba(0, 0, 0, 0.36),
            inset 0 1px 0 rgba(255, 255, 255, 0.14),
            inset 0 0 34px rgba(117, 255, 246, 0.06);
    }

    .song-lang-bar.song-lang-open .song-lang-label {
        font-size: 0.92rem;
        color: var(--text);
        text-shadow: 0 0 18px rgba(255, 44, 205, 0.35);
    }

    .song-lang-bar.song-lang-open .song-lang-label::before {
        content: none;
    }

    .song-lang-bar.song-lang-open .song-lang-hint {
        display: block;
        margin-top: 0;
        color: rgba(232, 222, 255, 0.78);
    }

    .song-lang-bar.song-lang-open .song-lang-arrow {
        transform: rotate(180deg);
        border-color: rgba(117, 255, 246, 0.46);
        background: rgba(45, 252, 255, 0.1);
    }

    .song-lang-panel {
        display: grid;
        grid-template-rows: 0fr;
        overflow: hidden;
        opacity: 0;
        transition: grid-template-rows 0.22s ease, opacity 0.18s ease, margin-top 0.22s ease;
    }

    .song-lang-bar.song-lang-open .song-lang-panel {
        grid-template-rows: 1fr;
        opacity: 1;
        margin-top: 0.7rem;
    }

    .song-lang-tiles {
        min-height: 0;
        overflow: hidden auto;
        max-height: min(44vh, 310px);
    }

    .song-lang-bar.song-lang-open .song-lang-tile {
        opacity: 0.92;
        border-color: rgba(255, 255, 255, 0.18);
        background:
            linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.045)),
            rgba(255, 255, 255, 0.07);
    }

    .song-lang-bar.song-lang-open .song-lang-tile.selected {
        border-color: rgba(117, 255, 246, 0.86);
        background:
            linear-gradient(135deg, rgba(255, 44, 205, 0.24), rgba(47, 109, 255, 0.22)),
            color-mix(in srgb, var(--lang-color, rgba(120, 120, 130, 0.5)) 50%, rgba(24, 18, 45, 0.88));
        box-shadow: 0 0 0 2px rgba(117, 255, 246, 0.2), 0 12px 28px rgba(255, 44, 205, 0.18);
    }

    #profile-screen {
        padding-top: 10.8rem;
    }

    .profile-dashboard-grid,
    .profile-dashboard-grid-secondary {
        grid-template-columns: 1fr;
    }

    .account-head {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .account-hero-stats {
        grid-column: 1 / -1;
        width: 208px;
        grid-template-columns: 208px;
        min-width: 0;
        justify-self: center;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    #profile-screen {
        padding: 10.6rem 0.9rem 1.2rem;
    }

    .profile-card {
        padding: 0.95rem;
    }

    .profile-hero-card {
        min-height: 0;
        align-items: center;
    }

    .account-head {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        justify-items: stretch;
        gap: 0.85rem;
        text-align: left;
    }

    .profile-avatar-wrap {
        justify-self: start;
        min-width: 108px;
    }

    .profile-hero-card .account-avatar {
        width: 104px;
        height: 104px;
        font-size: 3rem;
    }

    .account-who {
        min-width: 0;
    }

    .profile-hero-card .account-name {
        font-size: clamp(1.35rem, 8vw, 2rem);
        overflow-wrap: anywhere;
    }

    .account-username {
        font-size: 0.86rem;
    }

    .account-player-rank {
        margin-right: auto;
        margin-left: 0;
    }

    .account-hero-stats {
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
        gap: 0.45rem;
    }

    .account-hero-stat {
        width: 100%;
        min-height: 78px;
        padding: 0.68rem 0.7rem;
    }

    .account-hero-stat strong {
        font-size: 1.55rem;
    }

    .account-hero-stat span {
        font-size: 0.66rem;
    }

    .stats-grid { grid-template-columns: repeat(2, 1fr); }

    .achievement-tracks-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.55rem;
    }

    .achievement-track-card {
        min-height: 86px;
        gap: 0.34rem;
        padding: 0.62rem 0.48rem;
    }

    .achievement-track-top { gap: 0.22rem; }

    .achievement-track-icon {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
        font-size: 1.45rem;
    }

    .achievement-track-title {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }

    .achievement-progress-meta {
        font-size: 0.59rem;
    }

    .achievement-progress-meta strong {
        font-size: 0.65rem;
    }

    .achievement-progress { height: 5px; }

    .account-actions .btn-secondary {
        width: 100%;
    }
}
