/* Phone: one column, big tap targets, the barometer look. */
body.player { min-height: 100vh; min-height: 100dvh; }
.bar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.bar-inner { max-width: 640px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
main { max-width: 640px; margin: 0 auto; padding: 16px 16px 48px; }

.join h1 { font-size: clamp(28px, 8vw, 38px); margin-bottom: 12px; }
.join .lead { color: var(--muted); margin-bottom: 24px; }
.field { margin-bottom: 16px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.btn.block { width: 100%; padding: 15px; font-size: 17px; }
#pin { font-family: Outfit, sans-serif; font-size: 28px; letter-spacing: .2em; text-align: center; }
#name { font-size: 18px; }

.wait { text-align: center; padding: 44px 24px; }
.wait .check { width: 68px; height: 68px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; margin: 0 auto 20px; animation: pop .5s cubic-bezier(.2, .9, .3, 1.4) both; }
.wait .check svg { width: 34px; height: 34px; stroke: var(--on-accent); fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.wait h1 { font-size: 26px; margin-bottom: 10px; }
.wait p { color: var(--muted); }
.dots { margin: 22px 0 6px; font-size: 30px; letter-spacing: 6px; color: var(--accent); }
.dots span { animation: pulse 1.4s infinite; }
.dots span:nth-child(2) { animation-delay: .2s; }
.dots span:nth-child(3) { animation-delay: .4s; }
.wait .count { margin-top: 10px; font-weight: 600; color: var(--ink); }

.pq { background: var(--surface); border: 1px solid var(--line); }
.band.small { min-height: 88px; padding: 12px 16px 12px 22px; }
.band.small .tile-icon { width: 44px; height: 44px; }
.band.small h2 { font-size: 20px; color: #fff; }
.band.big { min-height: 220px; padding: 22px 20px 22px 26px; align-items: flex-end; }
.band.big h2 { font-size: 28px; color: #fff; margin: 4px 0 6px; }
.band.big p { font-size: 15px; color: #fff; opacity: .9; }
.band.big > div { display: grid; gap: 6px; }
.look { display: flex; gap: 10px; align-items: center; padding: 16px 20px; color: var(--accent-strong); font-weight: 600; }
.look svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; }

.timebar { height: 6px; background: var(--line); }
.timebar span { display: block; height: 100%; width: 100%; background: var(--accent); }
.timebar.low span { background: var(--alert); }
.pbody { padding: 16px; }
.ptop { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.ptop h3 { font-size: 21px; }
.secs { flex: none; font-family: Outfit, sans-serif; font-weight: 600; font-size: 28px; line-height: 1; color: var(--accent-strong); min-width: 2ch; text-align: right; font-variant-numeric: tabular-nums; }
.secs.low { color: var(--alert); }
.pbody .qhint { font-size: 13px; color: var(--muted); margin: -4px 0 10px; }
.tiles.player .tile { width: 100%; min-height: 52px; padding: 11px 14px; font-size: 16px; }
button.tile { cursor: pointer; }
button.tile:disabled { cursor: default; opacity: .55; }
button.tile[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, var(--surface)); font-weight: 600; }
button.tile[aria-pressed="true"] .letter { background: var(--accent); color: var(--on-accent); }
.tile.mine { border-color: var(--accent-strong); font-weight: 600; }
.tile.mine .letter { background: var(--accent-strong); color: var(--on-accent); }
#done { margin-top: 14px; }
.status { margin-top: 14px; font-size: 14px; color: var(--muted); min-height: 1.5em; }
.status.ok { color: var(--ok); }
.answer-line { margin: 4px 0 14px; }
.answer-line b { color: var(--accent-strong); }
.same { margin-top: 14px; font-weight: 600; }
.next-wait { margin-top: 10px; color: var(--muted); font-size: 14px; }

/* Personal result */
.result .card { margin-bottom: 16px; }
.result .lvl { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.result h1 { font-size: 34px; margin: 4px 0 10px; }
.result .self { color: var(--accent-strong); font-size: 14px; margin-top: 10px; }
.result .gauge { margin: 18px auto 0; max-width: 280px; }
.result h2 { font-size: 22px; margin-bottom: 14px; }
.result .dim { grid-template-columns: 1fr 3ch; gap: 6px 10px; }
.result .dim .name { grid-column: 1 / -1; font-size: 14px; }
.result .dim .track { grid-column: 1; }
.step { border-left: 4px solid var(--accent); padding: 2px 0 2px 14px; margin-bottom: 16px; }
.step h3 { font-size: 17px; margin-bottom: 4px; }
.step h3 span { color: var(--accent); }
.step .fwf { font-size: 13px; color: var(--muted); margin-top: 6px; }
.areas { display: grid; gap: 10px; }
.area { background: var(--surface-2); padding: 14px; }
.area h3 { font-size: 16px; margin-bottom: 4px; }
.area p { font-size: 14px; color: var(--muted); }
.cta { background: var(--deep); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.cta h2 { margin-bottom: 8px; }
.cta > p { margin-bottom: 16px; }
.cta .grid { display: grid; gap: 14px; }
.cta input, .cta select { background: var(--surface); }
.consent { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; font-size: 14px; margin: 4px 0 0; cursor: pointer; }
.consent input { width: 20px; height: 20px; flex: none; margin: 1px 0 0; accent-color: var(--accent); }
.privacy { font-size: 12px; color: var(--muted); margin-top: 12px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.offline { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 20; background: var(--alert); color: var(--on-accent); font-weight: 600; font-size: 14px; padding: 8px 14px; border-radius: 999px; }

@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #f5f5f5; --deep: #f1ecff; --ink: #1c0f47; --muted: #4a4e57; --line: #e2dfec; --accent: #5929ce; --accent-strong: #5929ce; }
  .bar, .cta, .actions, .offline { display: none !important; }
  .card { break-inside: avoid; }
}

/* The artwork of the host screen, fixed behind the page; a separate layer because phones ignore fixed backgrounds.
   Screen only: "Save as PDF" prints on white. */
@media screen {
  body.player::before { content: ""; position: fixed; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(18, 10, 48, .8), rgba(28, 15, 71, .9)), url(../img/stage.jpg) 62% center / cover no-repeat; }
  .bar { background: rgba(18, 10, 48, .72); border-bottom-color: rgba(201, 184, 255, .16); backdrop-filter: blur(10px); }
  .card, .pq { background: rgba(18, 10, 48, .72); border-color: rgba(201, 184, 255, .22); }
  .tile { background: rgba(28, 15, 71, .72); }
}
.card, .pq, .area, .cta { border-radius: var(--radius); }
.pq { overflow: hidden; }
.pq .band { border-radius: 0; }
.timebar, .timebar span { border-radius: 999px; }

/* No official reversed logo exists: the white comes in from the page corner and ends in the 14 degree slant of the decks */
.bar-inner { max-width: none; padding: 0 16px 0 0; min-height: 56px; }
.bar .plate { align-self: stretch; display: flex; align-items: center; padding: 0 32px 0 16px; border-radius: 0; clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 0 100%); }
.bar .plate img { height: 32px; }
