:root {
  color-scheme: light;
  --ink: #17132b;
  --paper: #201e18;
  --honey: #ffcb47;
  --lilac: #ffda67;
  --muted: #565248;
  --panel: #ffffff;
  --line: #dfd9c9;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  color: var(--paper);
  background: white;
}
* { box-sizing: border-box }
[hidden] { display: none !important }
body { margin: 0; min-height: 100svh; background: #fff }
button, input, textarea { font: inherit }
button, a, input, textarea, summary { -webkit-tap-highlight-color: transparent }
button, .button { cursor: pointer }
button { color: inherit }
button:disabled { opacity: .48; cursor: default }
a { color: inherit }
:focus-visible { outline: 3px solid var(--lilac); outline-offset: 3px }
h1, h2, p { margin: 0 }
h1, h2 { line-height: 1.07; overflow-wrap: anywhere }
h1 { font-size: clamp(2.7rem, 5.9vw, 4.7rem); letter-spacing: -.068em; font-weight: 850; text-wrap: balance }
h1:focus:not(:focus-visible) { outline: 0 }
h2 { font-size: clamp(1.38rem, 3vw, 1.8rem); letter-spacing: -.047em; font-weight: 780 }
p { line-height: 1.55 }
.masthead, main { width: min(100% - 48px, 1050px); margin-inline: auto }
.masthead { min-height: 84px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line) }
.brand img { display: block; width: 62px; height: 62px; object-fit: contain }
.header-actions, .action-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px }
.header-actions { gap: 15px }
.text-button { background: transparent; border: none; padding: 10px 5px; color: var(--muted); text-decoration: underline; text-underline-offset: 4px; font-weight: 650; font-size: .94rem }
.text-button:hover { color: var(--paper) }
.code-tag, .count { border: 1px solid var(--line); border-radius: 100px; background: var(--panel); font-size: .85rem; font-weight: 700 }
.code-tag { padding: 9px 14px; letter-spacing: .1em; color: var(--honey) }
main { padding: clamp(28px, 5vw, 64px) 0 72px }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(225px, 284px); align-items: start; gap: clamp(24px, 5vw, 68px) }
.stage { min-width: 0 }
.eyebrow { font-size: .82rem; color: var(--honey); font-weight: 800; text-transform: uppercase; letter-spacing: .12em; line-height: 1.4 }
.phase-heading { margin-bottom: 24px }
.phase-heading h1, .connection-card h1 { margin-block: 9px 12px }
.description, .connection-card > p:not(.eyebrow) { max-width: 53ch; color: var(--muted); font-size: 1.05rem }
.panel, .roster, .connection-card { border: 1px solid var(--line); background: var(--panel); border-radius: 20px }
.panel, .connection-card { padding: clamp(20px, 3.2vw, 34px) }
.invite { position: relative; isolation: isolate; overflow: hidden; background: #fff6d9 }
.invite::after { content: ""; position: absolute; z-index: -1; pointer-events: none; width: 210px; height: 210px; transform: rotate(24deg); right: -86px; top: -74px; opacity: .26; background: repeating-radial-gradient(circle, transparent 0 10px, #7c659c 11px 12px, transparent 13px 22px) }
.invite > p, .waiting p, .hint { color: var(--muted); margin-top: 8px }
.big-code { display: block; width: fit-content; max-width: 100%; color: var(--honey); margin: 16px 0 24px; padding: 0; font-family: ui-monospace, Menlo, monospace; font-size: clamp(2.4rem, 7vw, 4.2rem); line-height: 1.1; font-weight: 800; border: 0; background: none; letter-spacing: .08em; font-variant-numeric: tabular-nums }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .5em; padding: 12px 20px; min-height: 46px; border: 1px solid transparent; border-radius: 12px; font-weight: 750; line-height: 1.22; text-decoration: none; text-align: center }
.primary { background: var(--honey); color: var(--ink) }
.primary:hover:enabled, a.primary:hover { background: #ffdb7f }
.secondary { background: transparent; border-color: #726680; color: var(--paper) }
.secondary:hover:enabled, a.secondary:hover { background: #fff2cc }
#manual-copy { width: 100%; margin-top: 14px; padding: 12px; background: #fff; border: 1px solid #655a73; border-radius: 10px; color: var(--paper) }
.hint { font-size: .93rem }
fieldset, legend { margin: 0; padding: 0; border: 0; min-width: 0 }
.proposals { display: grid; gap: 10px; margin-bottom: 18px }
.choice { display: flex; align-items: flex-start; gap: 12px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; cursor: pointer }
.choice:has(input:checked) { border-color: var(--honey); background: #fff3c8 }
.choice input { accent-color: var(--honey); flex: none; margin: .28rem 0 0; width: 17px; height: 17px }
.choice-text { min-width: 0; overflow-wrap: anywhere }
.choice-text strong, .choice-text small { display: block }
.choice-text small { color: var(--muted); margin-top: 3px; font-size: .9rem; line-height: 1.4 }
.rank-list, .result-list, #players { list-style: none; padding: 0; margin: 0 }
.rank-list, .result-list { margin: 18px 0; display: grid; gap: 7px }
.rank-row, .result-row { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 6px 8px; min-height: 50px; background: #fff }
.rank-row.drop-target { border-color: var(--lilac); box-shadow: 0 0 0 1px var(--lilac) }
.rank-row.dragging { opacity: .6 }
.position { flex: none; min-width: 22px; text-align: center; font-weight: 750; font-variant-numeric: tabular-nums; color: var(--lilac) }
.option-text { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 650; line-height: 1.35 }
.handle, .nudge { display: grid; place-items: center; min-height: 40px; width: 38px; color: var(--muted); border: 0; border-radius: 8px }
.handle { touch-action: none; cursor: grab; user-select: none; width: 22px; background: none; font-size: 1.4rem }
.nudge { background: #f6efd9; color: var(--paper); font-weight: 750 }
.nudge:hover:enabled { background: #ffeab0 }
.waiting, .closest { display: flex; align-items: center; gap: 15px }
.waiting-mark, .closest-icon { display: grid; flex: none; place-items: center; background: var(--lilac); color: var(--ink); width: 42px; height: 42px; border-radius: 50%; font-size: 1.3rem; font-weight: 900 }
.waiting p { margin-top: 4px }
.reveal h2 { margin-top: 6px }
.result-list { margin-bottom: 0 }
.result-row { padding: 11px 12px }
.result-row.winner { border-color: var(--honey); background: #fff3c8 }
.winner .position, .winner .option-text { color: var(--honey) }
.points { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .9rem }
.closest { margin-top: 10px; padding: 19px; background: var(--lilac); border-radius: 16px; color: var(--ink) }
.closest .eyebrow { color: #39294d }
.closest h2 { margin-top: 3px }
.closest-icon { background: var(--ink); color: var(--lilac) }
.roster { padding: 21px; background: #fffdf7 }
.roster-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px }
.roster-heading h2 { font-size: 1.3rem }
.count { padding: 4px 9px; color: var(--lilac); white-space: nowrap }
.roster-progress { color: var(--muted); font-size: .9rem }
.roster-progress:not(:empty) { margin-top: 8px }
#players { margin-top: 14px }
.player { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line) }
.player:last-child { padding-bottom: 2px }
.avatar { color: var(--ink); width: 34px; height: 34px; isolation: isolate; display: grid; place-items: center; border-radius: 12px; flex: none; font-size: .9rem; font-weight: 820 }
.person { min-width: 0; flex: 1 }
.person strong, .person small { display: block; overflow-wrap: anywhere }
.person small { color: var(--muted); font-size: .82rem; margin-top: 2px }
.ready-check { color: var(--honey); font-weight: 850 }
.host-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 20px }
.host-actions .hint { flex: 1 1 185px; margin: 0 }
.notice { padding: 12px 16px; margin-bottom: 18px; background: #42263b; border: 1px solid #a36185; color: #ffdfed; border-radius: 12px }
.connection-card { max-width: 680px; margin: 25px auto }
#connection-links:not([hidden]) { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px }
#toast { position: fixed; z-index: 2; left: 50%; bottom: max(25px, env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: calc(100% - 30px); border-radius: 12px; padding: 10px 16px; color: var(--ink); background: var(--paper); box-shadow: 0 4px 18px #0005; font-weight: 700 }
.result-details { margin-top: 15px }
.result-details summary { cursor: pointer; padding: 3px 0; font-size: .95rem; font-weight: 680; color: var(--lilac) }
.result-details p { margin-top: 8px; color: var(--muted); font-size: .95rem }
.comparison-table { width: 100%; margin-top: 9px; border-collapse: collapse; text-align: left; font-size: .95rem; font-variant-numeric: tabular-nums }
.comparison-table th, .comparison-table td { padding: 7px 5px; border-bottom: 1px solid var(--line) }
.comparison-table thead th { color: var(--muted); font-size: .88rem; font-weight: 650 }
.comparison-table tbody th { font-weight: 650; overflow-wrap: anywhere }
.comparison-table td:first-child { color: var(--lilac); font-weight: 750 }
.comparison-table td:last-child, .comparison-table th:last-child { text-align: right }
dialog { width: min(calc(100% - 32px), 395px); padding: 25px; border: 1px solid #6f607f; background: var(--panel); color: var(--paper); border-radius: 16px }
dialog p { margin: 12px 0 20px; color: var(--muted) }
dialog::backdrop { background: #0b091bd9 }
.visually-hidden { clip-path: inset(50%); width: 1px; height: 1px; position: absolute; overflow: hidden; white-space: nowrap }
@media (max-width: 720px) {
  .layout { grid-template-columns: minmax(0, 1fr) }
  .masthead, main { width: min(100% - 32px, 570px) }
  .masthead { min-height: 67px }
  .brand img { width: 52px; height: 52px }
  .phase-heading { margin-bottom: 17px }
}
@media (max-width: 420px) {
  .panel, .roster { padding: 15px }
  .rank-row { gap: 4px; padding: 4px }
  .nudge { width: 32px }
  .header-actions { gap: 8px }
}

.brand img { filter:brightness(0) }
.eyebrow,.code-tag,.big-code,.count,.position,.winner .position,.winner .option-text,.ready-check,.result-details summary,.comparison-table td:first-child {color:#795000}
.prediction-list {padding:0;display:grid;gap:.35rem;list-style:none}
.screen {width:min(94vw,1440px)}
.screen h1 {font-size:clamp(2rem,4vw,4rem)}
@media(min-width:750px){.screen .prediction-list {grid-template-rows:repeat(5,auto);grid-auto-flow:column;grid-template-columns:1fr 1fr;gap:.5rem 1rem}.screen .rank-row,.screen .result-row {font-size:1.25rem}}
#display-tools, #own-recall {margin-top:1rem}

/* HDCC participant banner and numbered ranking tiles. */
    .show-banner {
      background: linear-gradient(135deg, #FF8C00 0%, #FFB800 50%, #FFD700 100%);
      padding: 18px 20px 14px;
      text-align: center;
      box-shadow: 0 4px 20px rgba(255, 140, 0, 0.3);
    }    .show-banner .brand img {
      height: 160px;
      width: auto;
      object-fit: contain;
      filter: drop-shadow(0 2px 8px rgba(0,0,0,0.15));
      display: block;
      margin: 0 auto;
    }
.show-banner {width:100%;position:relative;display:flex;justify-content:center;border:0}
.show-banner .brand img {height:96px;width:auto}
.show-banner .header-actions {position:absolute;right:1rem}
.show-banner .text-button {color:#302400}
#order .rank-row {background:#f8f8f8;border:2px solid transparent;border-radius:12px}
#order .rank-row.drop-target {background:#fff8e1;border-color:#ffb800}
    #order .position {
      width: 36px;
      height: 36px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: linear-gradient(135deg, #FF8C00, #FFB800);
      border-radius: 50%;
      font-weight: 800;
      font-size: 0.9rem;
      margin-right: 15px;
      flex-shrink: 0;
      color: #1a1a1a;
    }

.invite {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(16px, 3vw, 32px);
}
.invite::after { display: none }
#invite-qr { width: clamp(125px, 16vw, 170px); height: auto; border-radius: 12px }
.invite-options .big-code { margin: 8px 0 15px; font-size: clamp(1.9rem, 4vw, 3.2rem) }
#display-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px }
#host-info:empty { display: none }
@media (max-width: 720px) {
  .masthead.show-banner { justify-content: flex-start; padding: 8px 12px; gap: 8px }
  .show-banner .brand img { height: 50px }
  .show-banner .header-actions { position: static; margin-left: auto }
  .invite { justify-content: center; text-align: center }
  .invite-options .big-code { margin-inline: auto }
}
@media (max-width: 720px) {
  .masthead.show-banner .languages { position: relative; left: auto }
  .masthead.show-banner .languages nav { left: auto; right: 0 }
}
