/* course.css — Course de secousses (plateau + téléphone). Autonome : ne dépend pas de party.css. */
:root {
  --c-bg: #0b1020;
  --c-ink: #f4f6ff;
  --c-muted: #aab3d6;
  --c-accent: #ffb347;
  --c-accent2: #ff5e7e;
  --c-card: rgba(16, 22, 48, .72);
  --c-line: rgba(255, 255, 255, .12);
  --c-shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --me: #ffb347;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--c-ink);
  background: radial-gradient(1200px 700px at 20% -10%, rgba(255, 179, 71, .18), transparent 60%),
              radial-gradient(1000px 600px at 90% 110%, rgba(255, 94, 126, .18), transparent 60%),
              linear-gradient(170deg, #0b1020, #141b3a);
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button { font: inherit; }

/* ── Plateau ─────────────────────────────────────────────────────────────── */
body.host { overflow: hidden; }
#track { position: fixed; inset: 0; width: 100vw; height: 100dvh; display: none; }
body.host.racing #track { display: block; }
body.host.racing #board { display: none; }
#board { position: relative; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 28px 20px; }

.ch-center { text-align: center; max-width: 1000px; width: 100%; }
.ch-center h1 { font-size: clamp(2.2rem, 6vw, 4.2rem); margin: 0 0 .2em; font-weight: 900; letter-spacing: -.02em; }
.ch-sub { color: var(--c-muted); font-size: clamp(1rem, 2.2vw, 1.35rem); margin: 0 0 1.2em; }
.ch-btn {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none; color: #1b1030;
  background: linear-gradient(160deg, #ffd27a, var(--c-accent)); font-weight: 800;
  padding: 16px 32px; border-radius: 999px; font-size: 1.15rem; box-shadow: var(--c-shadow);
  transition: transform .12s ease;
}
.ch-btn:hover { transform: translateY(-2px); }
.ch-btn:disabled { opacity: .45; cursor: default; transform: none; }
.ch-btn.ghost { background: transparent; color: var(--c-ink); border: 1px solid var(--c-line); box-shadow: none; }
.ch-btn.small { padding: 10px 18px; font-size: .95rem; }
.ch-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

.ch-lobby { display: grid; grid-template-columns: minmax(260px, 380px) 1fr; gap: 28px; align-items: start; text-align: left; }
@media (max-width: 760px) { .ch-lobby { grid-template-columns: 1fr; } }
.ch-card { background: var(--c-card); border: 1px solid var(--c-line); border-radius: 24px; padding: 22px; box-shadow: var(--c-shadow); backdrop-filter: blur(10px); }
.ch-code { font-size: clamp(54px, 9vw, 110px); font-weight: 900; letter-spacing: .14em; color: var(--c-accent); text-align: center; line-height: 1; margin: 6px 0 4px; }
.ch-url { text-align: center; color: var(--c-muted); font-size: .95rem; word-break: break-all; }
.ch-qr { display: block; width: clamp(150px, 22vw, 230px); height: auto; margin: 10px auto 4px; background: #fff; padding: 10px; border-radius: 14px; image-rendering: pixelated; box-shadow: var(--c-shadow); }
.ch-players { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.ch-player { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .06); border: 1px solid var(--c-line); }
.ch-player .av { font-size: 2rem; line-height: 1; }
.ch-player .nm { font-weight: 800; }
.ch-player .st { font-size: .8rem; color: var(--c-muted); }
.ch-player.ready { border-color: color-mix(in srgb, var(--pc) 70%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pc) 50%, transparent); }
.ch-player.ready .st { color: #8ff0b0; }
.ch-empty { color: var(--c-muted); padding: 24px; text-align: center; border: 1px dashed var(--c-line); border-radius: 16px; }
.ch-opts { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 4px; }
.ch-opt { border: 1px solid var(--c-line); background: rgba(255, 255, 255, .05); color: var(--c-ink); padding: 8px 14px; border-radius: 999px; cursor: pointer; }
.ch-opt.on { background: var(--c-accent); color: #1b1030; border-color: transparent; font-weight: 800; }
.ch-h { font-size: 1.1rem; font-weight: 800; margin: 0 0 10px; color: var(--c-muted); text-transform: uppercase; letter-spacing: .08em; }

/* Podium */
.ch-podium { display: flex; gap: 14px; align-items: flex-end; justify-content: center; margin: 18px 0 10px; }
.ch-step { width: clamp(120px, 20vw, 220px); border-radius: 18px 18px 8px 8px; background: var(--c-card); border: 1px solid var(--c-line); padding: 14px 10px; text-align: center; box-shadow: var(--c-shadow); position: relative; }
.ch-step .av { font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1; }
.ch-step .nm { font-weight: 800; font-size: 1.1rem; margin-top: 6px; }
.ch-step .tm { color: var(--c-muted); font-size: .9rem; }
.ch-step .pl { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); background: var(--c-accent); color: #1b1030; font-weight: 900; border-radius: 999px; padding: 4px 12px; font-size: .9rem; }
.ch-step.p1 { min-height: 220px; border-color: rgba(255, 215, 0, .6); }
.ch-step.p2 { min-height: 180px; }
.ch-step.p3 { min-height: 150px; }
.ch-list { list-style: none; padding: 0; margin: 10px auto 0; max-width: 520px; text-align: left; }
.ch-list li { display: flex; justify-content: space-between; padding: 8px 14px; border-bottom: 1px solid var(--c-line); color: var(--c-muted); }

/* ── Téléphone ───────────────────────────────────────────────────────────── */
#app { max-width: 520px; margin: 0 auto; padding: 18px 16px 32px; min-height: 100dvh; display: flex; flex-direction: column; justify-content: safe center; }
.cp-join h1 { text-align: center; font-size: 2rem; margin: 0 0 6px; font-weight: 900; }
.cp-hint { text-align: center; color: var(--c-muted); margin: 0 0 18px; }
.cp-join label { display: block; color: var(--c-muted); margin: 14px 0 6px; font-size: .95rem; }
.cp-input { width: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--c-line); background: rgba(0, 0, 0, .28); color: inherit; font-size: 1.1rem; }
.cp-code { text-transform: uppercase; letter-spacing: .3em; font-weight: 900; font-size: 1.8rem; text-align: center; }
.cp-btn {
  width: 100%; border: 0; cursor: pointer; color: #1b1030; margin-top: 20px;
  background: linear-gradient(160deg, #ffd27a, var(--c-accent)); font-weight: 900;
  padding: 18px; border-radius: 18px; font-size: 1.2rem; box-shadow: var(--c-shadow);
}
.cp-btn:disabled { opacity: .5; }
.cp-btn.ghost { background: transparent; color: var(--c-ink); border: 1px solid var(--c-line); box-shadow: none; }
.cp-err { color: #ff8a8a; text-align: center; margin: 0 0 10px; }

.cp-me { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 16px; background: var(--c-card); border: 1px solid var(--c-line); margin-bottom: 18px; }
.cp-me .av { font-size: 2.4rem; line-height: 1; }
.cp-me .nm { font-weight: 900; font-size: 1.2rem; }
.cp-me .st { font-size: .85rem; color: var(--c-muted); }
.cp-wait { text-align: center; color: var(--c-muted); padding: 30px 10px; }
.cp-pulse { width: 18px; height: 18px; border-radius: 50%; background: var(--c-accent); margin: 0 auto 14px; animation: cp-pulse 1.2s ease-in-out infinite; }
@keyframes cp-pulse { 0%, 100% { transform: scale(.7); opacity: .5; } 50% { transform: scale(1.2); opacity: 1; } }

.cp-count { text-align: center; padding: 40px 0; }
.cp-count .num { font-size: clamp(6rem, 40vw, 11rem); font-weight: 900; line-height: 1; color: var(--c-accent); }
.cp-count .lbl { color: var(--c-muted); margin-top: 10px; font-size: 1.1rem; }

.cp-race { text-align: center; }
.cp-race .n { font-size: clamp(5rem, 34vw, 9rem); font-weight: 900; line-height: 1; letter-spacing: -.03em; }
.cp-race .goal { color: var(--c-muted); margin-top: 4px; }
.cp-bar { height: 18px; border-radius: 999px; background: rgba(255, 255, 255, .1); overflow: hidden; margin: 22px 0 8px; border: 1px solid var(--c-line); }
.cp-bar > div { height: 100%; background: linear-gradient(90deg, var(--me), #fff3); border-radius: 999px; transition: width .25s linear; }
.cp-rank { font-size: 1.4rem; font-weight: 900; margin-top: 10px; }
.cp-rank small { color: var(--c-muted); font-weight: 500; }
.cp-shake { font-size: 1.05rem; color: var(--c-muted); margin-top: 18px; animation: cp-shake .5s ease-in-out infinite; }
@keyframes cp-shake { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.cp-tap { width: 100%; margin-top: 16px; padding: 42px 10px; font-size: 1.6rem; font-weight: 900; border-radius: 26px; border: 0; color: #1b1030; background: linear-gradient(160deg, #ffd27a, var(--c-accent)); box-shadow: var(--c-shadow); user-select: none; }
.cp-tap:active { transform: scale(.97); }
.cp-done { padding: 30px 0; text-align: center; }
.cp-done .big { font-size: 4rem; line-height: 1; }
.cp-done .pl { font-size: 2.4rem; font-weight: 900; margin-top: 10px; }
.cp-done .sub { color: var(--c-muted); margin-top: 6px; }
.cp-chip { display: inline-block; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid var(--c-line); font-size: .9rem; color: var(--c-muted); margin-bottom: 14px; }

#pp-reco { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); z-index: 9999; background: #ff5e7e; color: #fff; padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: .9rem; box-shadow: var(--c-shadow); }
