:root {
    --nuit: #0b1026;
    --nuit-2: #1d1f55;
    --texte: #f4f3ff;
    --doux: #a9b0e0;
    --rose: #ff6fae;
    --orange: #ffb547;
    --ciel: #4fd8ff;
    --violet: #a786ff;
    --or: #ffd45c;
    --carte: rgba(255, 255, 255, 0.07);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: radial-gradient(ellipse at top, var(--nuit-2), var(--nuit) 70%) fixed var(--nuit);
    color: var(--texte);
    font-family: system-ui, "Segoe UI", Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior: none;
    user-select: none;
}

[hidden] {
    display: none !important;
}

.ecran {
    min-height: 100vh;
    min-height: 100dvh;
    max-width: 560px;
    margin: 0 auto;
    padding: 24px 16px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.ecran.centre {
    justify-content: center;
}

h1 {
    margin: 16px 0 0;
    font-size: clamp(2.4rem, 11vw, 3.4rem);
    font-weight: 900;
    text-align: center;
    background: linear-gradient(90deg, var(--rose), var(--orange), var(--ciel), var(--violet));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

h2 {
    margin: 8px 0 0;
    font-size: clamp(1.6rem, 7vw, 2.2rem);
    font-weight: 900;
    text-align: center;
}

.sous-titre,
.aide,
.vide {
    margin: 0;
    color: var(--doux);
    font-size: 1.1rem;
    text-align: center;
    line-height: 1.5;
}

.liste {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.liste li {
    display: flex;
    gap: 8px;
}

.chanson {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px;
    border: 0;
    border-radius: 18px;
    background: var(--carte);
    color: inherit;
    font: inherit;
    font-size: 1.15rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.chanson:active,
.niveau:active,
.bouton:active {
    transform: scale(0.97);
}

.chanson .nom {
    flex: 1;
}

.retirer {
    padding: 0 14px;
    border: 0;
    border-radius: 18px;
    background: var(--carte);
    color: var(--doux);
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
}

.bouton {
    display: inline-flex;
    justify-content: center;
    width: 100%;
    max-width: 360px;
    padding: 16px 24px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--rose), var(--violet));
    color: #fff;
    font: inherit;
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
}

.bouton.secondaire {
    background: var(--carte);
    color: var(--texte);
}

.lien {
    align-self: flex-start;
    padding: 8px 4px;
    border: 0;
    background: none;
    color: var(--doux);
    font: inherit;
    font-size: 1.05rem;
    cursor: pointer;
}

.niveaux {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.niveau {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 22px;
    border: 0;
    border-radius: 22px;
    color: #1b1036;
    font: inherit;
    font-size: 1.5rem;
    font-weight: 900;
    cursor: pointer;
}

.niveau.facile {
    background: linear-gradient(135deg, #7ef0c1, var(--ciel));
}

.niveau.moyen {
    background: linear-gradient(135deg, var(--or), var(--orange));
}

.niveau.difficile {
    background: linear-gradient(135deg, var(--rose), var(--violet));
}

.niveau .etoiles i {
    background: rgba(27, 16, 54, 0.25);
}

.niveau .etoiles i.pleine {
    background: #fff;
}

.etoiles {
    display: inline-flex;
    gap: 3px;
}

.etoiles i {
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.18);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.etoiles i.pleine {
    background: var(--or);
}

.etoiles.grandes {
    gap: 10px;
}

.etoiles.grandes i {
    width: 64px;
    height: 64px;
}

.score {
    margin: 0;
    font-size: 3rem;
    font-weight: 900;
}

.record {
    margin: 0;
    color: var(--or);
    font-size: 1.3rem;
    font-weight: 800;
}

#scene {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

.voile {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(5, 8, 25, 0.78);
}

.carte {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 20px;
    border-radius: 26px;
    background: var(--nuit-2);
}

.rond {
    width: 56px;
    height: 56px;
    border: 6px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--ciel);
    border-radius: 50%;
    animation: tourne 0.9s linear infinite;
}

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

.lien.discret {
    align-self: center;
    font-size: 0.95rem;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.aide.petite {
    font-size: 0.95rem;
}

.zone-tap {
    width: min(70vw, 280px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--carte);
    border: 3px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 900;
    color: var(--doux);
    touch-action: none;
    transition: transform 0.12s ease-out, background 0.12s ease-out;
}

.zone-tap.touche {
    transform: scale(0.93);
    background: rgba(167, 134, 255, 0.35);
    transition: none;
}

h3 {
    align-self: flex-start;
    margin: 12px 0 0;
    font-size: 1.15rem;
    color: var(--doux);
}

.demande {
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.champ {
    width: 100%;
    padding: 16px 18px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 18px;
    background: var(--carte);
    color: var(--texte);
    font: inherit;
    font-size: 1.15rem;
    user-select: text;
}

.champ:focus {
    outline: none;
    border-color: var(--violet);
}

.erreur {
    margin: 0;
    color: var(--rose);
    font-size: 1.05rem;
    text-align: center;
}

.demandes li {
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--carte);
    font-size: 1.05rem;
}

.demandes .titre-demande {
    flex: 1;
    overflow-wrap: anywhere;
}

.pastille {
    flex: none;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--doux);
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
}

.pastille.ajoutee,
.pastille.nouvelle {
    background: var(--ciel);
    color: var(--nuit);
}

.pastille.introuvable {
    background: rgba(255, 111, 174, 0.2);
    color: var(--rose);
}

.demandes li.jouable {
    cursor: pointer;
}

.demandes li.jouable:active {
    transform: scale(0.97);
}
