:root {
  --bg: #0f0f0f; --surface: #1f1f1f; --surface-2: #272727; --line: #3a3a3a;
  --text: #f1f1f1; --muted: #aaaaaa; --red: #ff0033; --gold: #f5c518; --silver: #c9ced6; --bronze: #d08a4e; --green: #2ecc71;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: Roboto, system-ui, sans-serif; -webkit-text-size-adjust: 100%; }
body.eleve { padding-bottom: 120px; }
button { font: inherit; cursor: pointer; }
h1 { font-size: 22px; font-weight: 700; margin: 8px 0 6px; line-height: 1.25; }
h2 { font-size: 18px; margin: 0; }
.muted { color: var(--muted); }
.center { text-align: center; }
.erreur { color: #ff6b6b; min-height: 1em; margin: 8px 0 0; font-size: 14px; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: rgba(15,15,15,.94); backdrop-filter: blur(8px); border-bottom: 1px solid #222; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: -.2px; }
.play { width: 28px; height: 20px; border-radius: 6px; background: var(--red); position: relative; flex: none; }
.play::after { content: ""; position: absolute; left: 11px; top: 5px; border-left: 8px solid #fff; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.moi { color: var(--muted); font-size: 14px; }
main { max-width: 760px; margin: 0 auto; padding: 16px; }

/* Choix du prénom */
.noms { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 16px; }
.nom { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 16px 10px; font-size: 16px; font-weight: 500; }
.nom:active { background: #333; }
.nom[disabled] { opacity: .35; cursor: default; }
.nom small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; }

/* Cartes YouTube */
.yt { color: var(--text); border-radius: 14px; transition: transform .2s, opacity .2s, box-shadow .2s; -webkit-tap-highlight-color: transparent; }
.yt .thumb { position: relative; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.yt .thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.yt-long .thumb { aspect-ratio: 16 / 9; }
.yt-short .thumb { aspect-ratio: 9 / 16; }
.vide { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; border: 2px dashed var(--line); border-radius: 12px; }
.duree { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.8); color: #fff; font-size: 12px; font-weight: 500; padding: 1px 4px; border-radius: 4px; }
.yt-long .meta { display: flex; gap: 12px; padding: 10px 2px 4px; }
.avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; background: #555; display: grid; place-items: center; font-weight: 700; color: #ddd; }
.titre { font-size: 16px; font-weight: 500; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.yt-short .meta { padding: 8px 2px 0; }
.yt-short .titre { font-size: 15px; }

/* Dépôt */
.depot { background: var(--surface); border: 1px solid #2a2a2a; border-radius: 16px; padding: 16px; margin-top: 16px; }
.depot-tete { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.format { color: var(--muted); font-size: 13px; border: 1px solid var(--line); border-radius: 99px; padding: 2px 8px; }
.ok { margin-left: auto; color: var(--green); font-size: 13px; font-weight: 500; }
.depot[data-type=short] .apercu { max-width: 220px; }
.champ { display: block; font-size: 14px; color: var(--muted); margin-top: 14px; }
.champ input { display: block; width: 100%; margin-top: 6px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font: inherit; font-size: 16px; }
.fichier { display: block; text-align: center; margin-top: 12px; padding: 12px; border: 1px dashed #555; border-radius: 10px; color: var(--text); font-size: 15px; cursor: pointer; }
.fichier input { display: none; }
.btn { display: block; width: 100%; margin-top: 12px; background: var(--text); color: #0f0f0f; border: 0; border-radius: 99px; padding: 14px; font-weight: 700; font-size: 16px; }
.btn[disabled] { background: #3a3a3a; color: #888; cursor: default; }
.btn.valide { background: var(--green); color: #fff; }

/* Vote */
.progress { height: 4px; background: #2a2a2a; border-radius: 4px; overflow: hidden; }
.progress div { height: 100%; background: var(--red); transition: width .4s; }
.duel-tete { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; font-size: 14px; }
.pill { font-weight: 700; font-size: 13px; padding: 4px 10px; border-radius: 99px; background: var(--surface-2); }
.pill.short { background: #3b0a12; color: #ff8fa1; }
.question { font-size: 20px; margin: 10px 0 14px; }
.duel { display: grid; gap: 14px; align-items: start; }
.duel-long { grid-template-columns: 1fr; }
.duel-short { grid-template-columns: 1fr auto 1fr; gap: 10px; }
.vs { font-weight: 900; color: var(--red); text-align: center; align-self: center; font-size: 15px; }
.duel-long .vs { margin: -4px 0; }
.duel .yt { cursor: pointer; padding: 6px; outline: 3px solid transparent; outline-offset: 0; }
.duel .yt.choisie { outline-color: var(--red); background: #1d0a0d; transform: scale(1.01); }
.duel .yt.pas-choisie { opacity: .45; }
.barre-vote { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); }
.barre-vote .btn { max-width: 728px; margin: 0 auto; }
.barre-vote .erreur { text-align: center; }
@media (min-width: 700px) { .duel-long { grid-template-columns: 1fr auto 1fr; } .duel-long .vs { margin: 0; } }

.fin { text-align: center; padding: 18vh 8px; }
.fin .big { font-size: 30px; font-weight: 900; margin-bottom: 10px; }
.fin p { color: var(--muted); font-size: 17px; }
