/* Karaoké Live — feuille de style unique.
   Identité : fond crème, encre noire, aplats vifs, titres massifs en capitales,
   bordures épaisses et ombres franches. */

@font-face {
  font-family: "Archivo Black";
  src: url("../fonts/archivo-black.4b6914a69e6a.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk.87c506d88b9f.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --cream: #f6f1e7;
  --paper: #fffdf8;
  --ink: #111111;
  --muted: #5d5a54;
  --blue: #2b4bff;
  --pink: #ff4fa3;
  --yellow: #ffd84a;
  --green: #19c37d;
  --red: #e5383b;
  --line: 2.5px solid var(--ink);
  --shadow: 5px 5px 0 var(--ink);
  --radius: 18px;
  --display: "Archivo Black", "Arial Black", Impact, sans-serif;
  --body: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 500 1rem/1.55 var(--body);
}
img, svg { max-width: 100%; }
a { color: inherit; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; text-transform: uppercase; line-height: 1.02; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 8vw, 5.6rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.6rem, 4.5vw, 3rem); }
h3 { font-size: 1.15rem; letter-spacing: .01em; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.wrap { width: min(1120px, 100% - 2rem); margin-inline: auto; }
.narrow { width: min(720px, 100% - 2rem); margin-inline: auto; }

/* --- Boutons ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .8em 1.4em; border: var(--line); border-radius: 999px;
  background: var(--ink); color: var(--cream);
  font: 400 .9rem/1 var(--display); text-transform: uppercase; letter-spacing: .03em; text-decoration: none;
  cursor: pointer; transition: transform .12s, box-shadow .12s, background .12s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); background: var(--blue); color: #fff; }
.btn:active { transform: none; box-shadow: none; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.light { background: var(--paper); color: var(--ink); }
.btn.light:hover { background: var(--yellow); color: var(--ink); }
.btn.yellow { background: var(--yellow); color: var(--ink); }
.btn.yellow:hover { background: var(--pink); color: var(--ink); }
.btn.danger { background: var(--paper); color: var(--red); border-color: var(--red); }
.btn.danger:hover { background: var(--red); color: #fff; box-shadow: 4px 4px 0 var(--ink); }
.btn.sm { padding: .55em 1em; font-size: .72rem; }
.btn.block { width: 100%; }
.inline { display: inline; }

/* --- Cartes, badges ------------------------------------------------------------ */
.card { background: var(--paper); border: var(--line); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.badge {
  display: inline-flex; align-items: center; gap: .3em; padding: .15em .7em; border: 2px solid var(--ink);
  border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--paper); white-space: nowrap;
}
.badge.yellow { background: var(--yellow); } .badge.pink { background: var(--pink); }
.badge.blue { background: var(--blue); color: #fff; } .badge.green { background: var(--green); }
.badge.grey { background: #e4dfd3; }

/* --- En-tête / pied de page du site -------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--cream); border-bottom: var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .8rem; }
.logo { font: 400 1.25rem/1 var(--display); text-transform: uppercase; text-decoration: none; display: inline-flex; align-items: center; gap: .45em; }
.logo i { display: inline-block; width: .8em; height: .8em; border-radius: 50%; background: var(--pink); border: 2.5px solid var(--ink); }
.nav { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; font-weight: 700; font-size: .95rem; }
.nav a { text-decoration: none; }
.nav a:not(.btn):hover, .nav a.on { text-decoration: underline; text-decoration-thickness: 3px; }
.site-footer { background: var(--ink); color: var(--cream); margin-top: 5rem; padding: 3rem 0 2rem; }
.site-footer .cols { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.site-footer a { display: block; margin-bottom: .4rem; color: var(--cream); }
.site-footer .logo i { border-color: var(--cream); }
.site-footer .legal-line { border-top: 1px solid #444; margin-top: 2rem; padding-top: 1rem; font-size: .85rem; color: #bbb; }

/* --- Page d'accueil ---------------------------------------------------------- */
.hero { padding: clamp(3rem, 9vw, 7rem) 0 clamp(2.5rem, 6vw, 4.5rem); position: relative; overflow: hidden; }
.hero h1 .hl { background: var(--yellow); padding: 0 .12em; border: var(--line); border-radius: 14px; display: inline-block; transform: rotate(-2deg); }
.hero h1 .hl.pink { background: var(--pink); transform: rotate(1.5deg); }
.hero .lead { font-size: clamp(1.05rem, 2.2vw, 1.35rem); max-width: 40ch; margin: 1.4rem 0 2rem; }
.hero .actions { display: flex; gap: .8rem; flex-wrap: wrap; }
.hero .disc {
  position: absolute; right: -90px; top: 40px; width: min(42vw, 430px); aspect-ratio: 1; border-radius: 50%;
  border: var(--line); background:
    radial-gradient(circle, var(--cream) 0 9%, var(--ink) 9.5% 11%, var(--pink) 11.5% 30%, var(--ink) 30.5% 32%, var(--blue) 32.5% 100%);
  animation: spin 22s linear infinite; z-index: -1;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 760px) { .hero .disc { opacity: .28; right: -120px; width: 320px; } }

.ticker { border-block: var(--line); background: var(--ink); color: var(--cream); overflow: hidden; white-space: nowrap; }
.ticker.blue { background: var(--blue); color: #fff; }
.ticker div { display: inline-block; padding: .7rem 0; animation: ticker 32s linear infinite; font: 400 1.2rem/1 var(--display); text-transform: uppercase; }
.ticker span { margin: 0 1.2rem; }
.ticker span::after { content: "✦"; margin-left: 2.4rem; color: var(--yellow); }
@keyframes ticker { to { transform: translateX(-50%); } }

.section { padding: clamp(3rem, 7vw, 5.5rem) 0 0; }
.grid { display: grid; gap: 1.4rem; }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.step .num { font: 400 3.4rem/1 var(--display); color: var(--blue); }
.feature { position: relative; }
.feature .ico { font-size: 2.2rem; display: inline-grid; place-items: center; width: 3.6rem; height: 3.6rem; border: var(--line); border-radius: 50%; margin-bottom: .8rem; background: var(--yellow); }
.feature:nth-child(2) .ico { background: var(--pink); } .feature:nth-child(3) .ico { background: var(--blue); } .feature:nth-child(4) .ico { background: var(--green); }
.cta { background: var(--yellow); border: var(--line); border-radius: 28px; padding: clamp(2rem, 6vw, 4rem); box-shadow: var(--shadow); text-align: center; }

.prose h2 { font-size: 1.5rem; margin-top: 2.2rem; }
.prose h1 { font-size: clamp(2rem, 6vw, 3.4rem); margin-top: 3rem; }
.prose table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .95rem; }
.prose th, .prose td { border: 1.5px solid var(--ink); padding: .55rem .7rem; text-align: left; vertical-align: top; }
.prose th { background: var(--yellow); }
.table-scroll { overflow-x: auto; }

/* --- Formulaires -------------------------------------------------------------- */
form.stack > div { margin-bottom: 1.1rem; }
label { font-weight: 700; display: block; margin-bottom: .3rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search],
input[type=datetime-local], input[type=file], select, textarea {
  width: 100%; padding: .75rem .9rem; border: var(--line); border-radius: 12px; background: #fff;
  font: inherit; color: inherit;
}
textarea { resize: vertical; }
input[type=checkbox] { width: 1.2rem; height: 1.2rem; accent-color: var(--blue); vertical-align: -3px; margin-right: .4rem; }
form.stack > div:has(> input[type=checkbox]) label { display: inline; }
.helptext { display: block; font-size: .85rem; color: var(--muted); margin: .15rem 0 .3rem; }
.errorlist { list-style: none; margin: .2rem 0 .4rem; padding: 0; color: var(--red); font-weight: 700; font-size: .9rem; }
.flash { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .5rem; }
.flash li { border: var(--line); border-radius: 12px; padding: .7rem 1rem; background: var(--paper); font-weight: 700; }
.flash .success { background: #c9f5df; } .flash .error { background: #ffd3d4; } .flash .info { background: #dfe5ff; }
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 2rem 1rem; }
.auth .card { width: min(440px, 100%); }
.auth h1 { font-size: 2rem; }
.qr-box { display: grid; place-items: center; padding: 1rem; background: #fff; border: var(--line); border-radius: 14px; margin: 1rem 0; }
.secret { font-family: ui-monospace, Consolas, monospace; word-break: break-all; background: #fff; border: 1.5px dashed var(--ink); border-radius: 10px; padding: .5rem .7rem; }

/* --- Espace organisateur ------------------------------------------------------ */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin: 2.2rem 0 1.4rem; }
.page-head h1 { font-size: clamp(1.8rem, 5vw, 3rem); margin: 0; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.event-card { display: grid; gap: .7rem; }
.event-card h3 { font-size: 1.3rem; margin: 0; }
.event-card .meta { display: flex; gap: .4rem; flex-wrap: wrap; }
table.list { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--paper); border: var(--line); border-radius: var(--radius); overflow: hidden; }
table.list th, table.list td { padding: .7rem .9rem; text-align: left; border-bottom: 1.5px solid #ddd6c6; vertical-align: middle; }
table.list th { background: var(--ink); color: var(--cream); font: 400 .78rem/1 var(--display); text-transform: uppercase; letter-spacing: .04em; }
table.list tr:last-child td { border-bottom: 0; }
.bar { height: .8rem; background: #e4dfd3; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; min-width: 120px; }
.bar i { display: block; height: 100%; background: var(--blue); }
.kpis { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 1.5rem; }
.kpi b { display: block; font: 400 2.4rem/1 var(--display); }
.two-col { display: grid; gap: 1.4rem; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.filterbar { display: flex; gap: .6rem; margin-bottom: 1rem; flex-wrap: wrap; }
.filterbar input, .filterbar select { flex: 1; min-width: 200px; }

/* --- Application spectateur (mobile d'abord) ----------------------------------- */
.app { max-width: 620px; margin-inline: auto; padding: 0 1rem 6.5rem; }
.app-head { display: flex; justify-content: space-between; align-items: center; padding: .9rem 0; gap: .8rem; }
.app-head .who { font-weight: 700; font-size: .9rem; text-align: right; }
.now { background: var(--ink); color: var(--cream); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1rem; }
.now .label { font: 400 .68rem/1 var(--display); text-transform: uppercase; letter-spacing: .08em; color: var(--yellow); }
.now .title { font-weight: 700; font-size: 1.1rem; margin: .25rem 0 0; }
.now .next { margin-top: .7rem; padding-top: .7rem; border-top: 1px solid #444; }
.now .next .label { color: var(--pink); }
.notice { border: var(--line); border-radius: 14px; padding: .8rem 1rem; background: var(--yellow); font-weight: 700; margin-bottom: 1rem; }
.notice.pink { background: var(--pink); } .notice.plain { background: var(--paper); }
.segmented { display: grid; grid-template-columns: 1fr 1fr; border: var(--line); border-radius: 999px; overflow: hidden; margin-bottom: .8rem; background: #fff; }
.segmented button { border: 0; background: none; padding: .75rem .5rem; font: 400 .85rem/1 var(--display); text-transform: uppercase; cursor: pointer; color: var(--ink); }
.segmented button[aria-pressed=true] { background: var(--blue); color: #fff; }
.chips { display: flex; gap: .4rem; margin: .7rem 0; overflow-x: auto; }
.chips button { border: 2px solid var(--ink); background: #fff; border-radius: 999px; padding: .35rem .9rem; font: 700 .85rem var(--body); cursor: pointer; white-space: nowrap; color: var(--ink); }
.chips button[aria-pressed=true] { background: var(--ink); color: var(--cream); }
.songs { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.song {
  width: 100%; display: flex; align-items: center; gap: .8rem; text-align: left; padding: .75rem .9rem;
  background: var(--paper); border: var(--line); border-radius: 14px; cursor: pointer; font: inherit; color: inherit;
}
button.song:hover { background: #fff; box-shadow: 3px 3px 0 var(--ink); }
.song .flag { font-size: 1.5rem; flex: none; }
img.flag { width: 30px; height: 20px; border: 1.5px solid var(--ink); border-radius: 4px; object-fit: cover; vertical-align: -3px; }
img.flag.sm { width: 21px; height: 14px; vertical-align: -1px; }
.song .txt { flex: 1; min-width: 0; }
.song .t { font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song .a { font-size: .85rem; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song .tags { display: flex; gap: .25rem; flex: none; font-size: 1.1rem; }
.song.off { opacity: .5; cursor: not-allowed; background: #e9e4d8; }
.song .ctl { display: flex; gap: .25rem; flex: none; }
.icon-btn { width: 2.2rem; height: 2.2rem; border: 2px solid var(--ink); border-radius: 50%; background: #fff; cursor: pointer; font-size: 1rem; color: var(--ink); }
.icon-btn:hover { background: var(--yellow); }
.pos { font: 400 1.2rem/1 var(--display); width: 1.8rem; flex: none; color: var(--blue); }
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 30; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--paper); border-top: var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button { border: 0; background: none; padding: .6rem .2rem .7rem; font: 700 .72rem var(--body); cursor: pointer; display: grid; gap: .15rem; justify-items: center; color: var(--ink); }
.tabbar button span { font-size: 1.35rem; }
.tabbar button[aria-selected=true] { background: var(--yellow); }
.emoji-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; margin: 1rem 0 1.5rem; }
.emoji-grid button { aspect-ratio: 1; font-size: 2rem; border: var(--line); border-radius: 18px; background: var(--paper); cursor: pointer; transition: transform .1s; }
.emoji-grid button:active { transform: scale(.85); background: var(--yellow); }
.duo-ad { display: grid; gap: .6rem; }
.duo-ad.match { background: var(--green); }
.toast {
  position: fixed; left: 50%; bottom: 5.6rem; transform: translateX(-50%); z-index: 50; max-width: calc(100% - 2rem);
  background: var(--ink); color: var(--cream); padding: .8rem 1.2rem; border-radius: 999px; font-weight: 700; text-align: center;
}
.toast.err { background: var(--red); color: #fff; }
dialog { border: var(--line); border-radius: var(--radius); padding: 1.4rem; width: min(440px, calc(100% - 2rem)); background: var(--paper); box-shadow: var(--shadow); color: var(--ink); }
dialog::backdrop { background: rgba(17, 17, 17, .6); }
dialog h3 { margin-bottom: .6rem; }
dialog .actions { margin-top: 1.2rem; justify-content: flex-end; }

/* --- Console d'animation -------------------------------------------------------- */
.console { display: grid; gap: 1.2rem; grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr); align-items: start; padding-bottom: 3rem; }
@media (max-width: 980px) { .console { grid-template-columns: 1fr; } }
.stage { background: #000; border: var(--line); border-radius: 14px; aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden; color: #fff; }
.stage img { width: 100%; height: 100%; object-fit: contain; }
.stage .lyrics { width: 100%; height: 100%; overflow-y: auto; padding: 1.2rem; white-space: pre-wrap; font-size: 1.1rem; line-height: 1.6; text-align: center; }
.slide-ctl { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-top: .8rem; }
.slide-ctl .count { font: 400 1.1rem var(--display); }
.panel-title { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .8rem; }
.panel-title h3 { margin: 0; }
.queue { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.queue li { display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: center; border: 2px solid var(--ink); border-radius: 14px; padding: .6rem .8rem; background: #fff; }
.queue .votes { font: 400 1.5rem/1 var(--display); background: var(--yellow); border: 2px solid var(--ink); border-radius: 12px; min-width: 2.6rem; padding: .35rem; text-align: center; }
.queue .votes small { display: block; font: 700 .55rem var(--body); text-transform: uppercase; }
.msg-feed { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; max-height: 260px; overflow-y: auto; }
.msg-feed li { display: flex; justify-content: space-between; gap: .6rem; align-items: center; font-size: .92rem; border-bottom: 1px dashed #c9c2b0; padding-bottom: .35rem; }
.stack-gap { display: grid; gap: 1.2rem; }

/* --- Écran de projection -------------------------------------------------------- */
body.screen { background: #000; color: #fff; overflow: hidden; height: 100dvh; cursor: none; }
.screen-main { position: fixed; inset: 0; display: grid; place-items: center; }
.screen-main img { width: 100vw; height: 100dvh; object-fit: contain; }
.screen-lyrics { width: 100vw; height: 100dvh; overflow: hidden; padding: 6vh 8vw 30vh; text-align: center; white-space: pre-wrap; font-size: clamp(1.6rem, 3.6vw, 4rem); line-height: 1.5; font-weight: 600; scroll-behavior: smooth; }
.screen-lyrics h2 { color: var(--yellow); font-size: clamp(2rem, 5vw, 5rem); margin-bottom: .2em; }
.screen-lyrics .by { color: #bbb; font-size: .7em; margin-bottom: 1.5em; }
.screen-idle { text-align: center; padding: 4vh 4vw 22vh; display: grid; gap: 3vh; justify-items: center; }
.screen-idle h1 { font-size: clamp(3rem, 9vw, 9rem); color: var(--yellow); margin: 0; }
.screen-idle p { font-size: clamp(1.2rem, 2.6vw, 2.6rem); margin: 0; }
.screen-idle .qr { background: #fff; padding: 1.2vw; border-radius: 1.5vw; line-height: 0; }
.screen-idle .qr svg { width: min(34vh, 30vw); height: auto; }
.overlay {
  position: fixed; inset: auto 0 0 0; z-index: 10; display: grid; grid-template-columns: auto 1fr; gap: 2vw; align-items: end;
  padding: 1.6vh 2vw; background: linear-gradient(to top, rgba(0, 0, 0, .78), rgba(0, 0, 0, .5) 70%, transparent);
  min-height: 16vh; pointer-events: none;
}
.status { background: rgba(17, 17, 17, .72); border: 2px solid rgba(255, 255, 255, .35); border-radius: 1.2vw; padding: 1.2vh 1.4vw; backdrop-filter: blur(6px); font-size: clamp(.9rem, 1.5vw, 1.7rem); display: grid; gap: .4vh; }
.status b { color: var(--yellow); }
.status .nx b { color: var(--pink); }
.bubbles { display: flex; flex-direction: column; align-items: flex-end; gap: .8vh; overflow: hidden; }
.bubble { background: rgba(255, 253, 248, .9); color: var(--ink); border-radius: 999px; padding: .7vh 1.4vw; font-size: clamp(.9rem, 1.6vw, 1.8rem); font-weight: 600; max-width: 100%; animation: pop .35s ease-out; }
.bubble b { color: var(--blue); }
.bubble.out { opacity: 0; transition: opacity .6s; }
@keyframes pop { from { transform: translateY(20px) scale(.9); opacity: 0; } }
.fly { position: fixed; bottom: 10vh; z-index: 11; font-size: clamp(2.5rem, 5vw, 5.5rem); animation: fly 3.4s ease-out forwards; pointer-events: none; text-align: center; }
.fly small { display: block; font-size: .22em; font-weight: 700; color: #fff; text-shadow: 0 1px 4px #000; }
@keyframes fly {
  0% { transform: translateY(0) scale(.5); opacity: 0; }
  12% { opacity: 1; transform: translateY(-6vh) scale(1.1); }
  100% { transform: translateY(-70vh) translateX(var(--drift, 0)) scale(1); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hero .disc, .ticker div { animation: none; }
  .btn, .emoji-grid button { transition: none; }
}
@media print { .site-header, .site-footer, .tabbar { display: none; } }
