/* DAOWOW live round view. Self-contained; no remote fonts or assets.
   Colour and type are ported from entry.css so the live client and the entry
   preview read as one product. */
:root {
  color-scheme: dark;
  --blue: hsl(220 67% 24%); --deep: hsl(222 65% 17%);
  --paper: hsl(45 35% 96%); --ink: hsl(222 49% 20%);
  --amber: hsl(39 96% 64%); --muted: hsl(217 27% 76%);
  --quiet: hsl(220 17% 42%); --line: hsl(220 26% 42%);
  --good: hsl(152 52% 62%); --warn: hsl(39 96% 64%);
  font-family: 'Avenir Next', Avenir, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--deep); color: var(--paper); font-size: 16px; line-height: 1.6; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 5px; }
h1, h2, h3, p { margin: 0; }
h1, h2 { letter-spacing: -.04em; line-height: 1.08; font-weight: 600; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.site-header { max-width: 1120px; margin: auto; padding: 24px 32px; display: flex; gap: 32px; align-items: center; }
.brand { font-size: 24px; font-weight: 700; letter-spacing: -.06em; display: inline-flex; align-items: center; }
.brand-symbol { font-size: 40px; margin-right: 12px; color: var(--amber); line-height: 1; }
.brand-light { font-weight: 400; }
.wallet-button { margin-left: auto; display: flex; align-items: center; gap: 8px; background: transparent;
  color: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; font-size: 14px; }
.wallet-button:hover:not(:disabled) { background: hsl(220 50% 28%); }

main { max-width: 1120px; margin: auto; padding: 0 32px 64px; }
.banner { display: flex; gap: 12px; align-items: baseline; padding: 12px 16px; border-radius: 8px;
  background: hsl(219 48% 31%); color: hsl(218 60% 90%); font-size: 12px; margin-bottom: 24px; }
.banner strong { color: var(--paper); }

.card { background: var(--blue); border-radius: 24px; padding: 32px; margin-bottom: 24px; }
.card h2 { font-size: 32px; }
.card-head { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.state { border-radius: 24px; padding: 4px 14px; font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.state-open { background: var(--good); color: var(--ink); }
.state-pending { background: hsl(220 36% 44%); color: var(--paper); }
.state-frozen { background: hsl(220 20% 62%); color: var(--ink); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 24px; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat dt { font-size: 12px; color: var(--muted); }
.stat dd { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -.03em; }
.stat dd span { font-size: 15px; font-weight: 400; color: var(--muted); }
.stat .sub { font-size: 12px; color: var(--muted); font-weight: 400; letter-spacing: 0; }

.bar { height: 10px; border-radius: 6px; background: hsl(221 55% 32%); overflow: hidden; margin: 24px 0 8px; }
.bar > i { display: block; height: 100%; background: var(--amber); }
.bar-note { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }

.empty { color: var(--muted); font-size: 14px; }
.error { border-radius: 8px; padding: 16px; background: hsl(0 40% 28%); color: hsl(0 60% 92%); font-size: 14px; }
.error code { display: block; margin-top: 8px; font-size: 12px; opacity: .85; word-break: break-all; }

footer { max-width: 1120px; margin: auto; padding: 24px 32px 48px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 12px; color: var(--muted); }
footer .mono { color: var(--paper); }

@media (max-width: 720px) {
  .site-header { padding: 16px; gap: 16px; flex-wrap: wrap; }
  main, footer { padding-left: 16px; padding-right: 16px; }
  .card { padding: 24px 20px; } .card h2 { font-size: 26px; }
}

/* Entry view */
.nav-link { margin-left: 24px; color: var(--muted); font-size: 14px; text-decoration: none; }
.nav-link:hover { color: var(--paper); text-decoration: underline; text-underline-offset: 6px; }
.section-heading { font-size: 14px; color: var(--muted); font-weight: 600;
  margin: 24px 0 12px; letter-spacing: .02em; }
.field { display: flex; flex-direction: column; gap: 8px; max-width: 220px; }
.field label { font-size: 14px; font-weight: 600; }
.field input { font: inherit; font-size: 24px; font-weight: 600; padding: 12px 16px;
  border-radius: 8px; border: 1px solid var(--line); background: hsl(221 55% 20%);
  color: var(--paper); }
.sub { font-size: 12px; color: var(--muted); margin: 0; }
.quote { margin: 0; display: grid; gap: 12px; }
.quote > div { display: grid; grid-template-columns: 1fr auto; gap: 4px 24px; align-items: baseline; }
.quote dt { font-size: 14px; }
.quote dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.quote .note { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.quote .total { border-top: 1px solid var(--line); padding-top: 12px; }
.quote .total dd { font-size: 20px; color: var(--amber); }
.payout-summary { font-size: 14px; margin-bottom: 12px; }
.payout { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 13px; }
.payout li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px;
  color: var(--muted); }
.payout li.open { color: var(--paper); }
.payout li.unreachable { opacity: .45; }
.confirm-line { font-size: 13px; margin: 24px 0 16px; }
.confirm-line input { margin-right: 8px; }
.primary-button { width: 100%; padding: 16px 24px; min-height: 56px; color: var(--ink);
  background: var(--amber); border: 0; border-radius: 8px; font-weight: 600; font-size: 16px; }
.primary-button:hover:not(:disabled) { background: hsl(39 100% 70%); }

/* Prose pages */
.prose { max-width: 720px; }
.prose h1 { font-size: 40px; margin: 24px 0 8px; }
.prose h2 { font-size: 24px; margin: 40px 0 12px; }
.prose h3 { font-size: 16px; margin: 0 0 8px; }
.prose p { margin: 0 0 16px; color: hsl(220 30% 88%); }
.prose .lede { font-size: 20px; line-height: 1.5; color: var(--paper);
  border-left: 3px solid var(--amber); padding-left: 20px; margin: 24px 0 32px; }
.prose .aside { font-size: 14px; color: var(--muted); }
.prose ul { margin: 0 0 16px; padding-left: 20px; color: hsl(220 30% 88%); }
.prose li { margin-bottom: 6px; }
.caveat { background: hsl(28 45% 20%); border-left: 3px solid var(--amber);
  border-radius: 8px; padding: 20px 24px; margin: 24px 0; }
.caveat p:last-child { margin-bottom: 0; }

/* --- the refund list ---------------------------------------------------- */
.entries { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.entries li {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  gap: 8px;
}
.entries li.unreachable { opacity: 0.62; }
.entry-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  font-weight: 600;
}
.entries li .primary-button { justify-self: start; }
.warn-line { color: var(--warn); font-weight: 600; }

/* === The one-app shell ====================================================
   Phone first. The tab bar sits at the bottom within thumb reach and moves
   under the header from 720px. Spacing is on the 4/8 scale; one radius for
   controls (8px) and one for cards (24px). */
html { scroll-behavior: smooth; }
body { min-height: 100vh; padding-bottom: calc(72px + env(safe-area-inset-bottom)); overflow-x: hidden; }
a { color: inherit; }
main > section > h1 { font-size: 32px; margin: 8px 0 24px; outline: none; }
main > section[hidden] { display: none; }

.site-header { position: sticky; top: 0; z-index: 100; background: var(--deep); padding: 12px 16px;
  gap: 16px; flex-wrap: nowrap; }
.brand { text-decoration: none; font-size: 20px; }
.brand-symbol { font-size: 28px; margin-right: 8px; }
.wallet { margin-left: auto; position: relative; }
.wallet-button { margin-left: 0; min-height: 44px; padding: 8px 16px; border-radius: 999px;
  border-color: var(--amber); color: var(--amber); white-space: nowrap; max-width: 62vw;
  overflow: hidden; text-overflow: ellipsis; display: block; }
.wallet-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 200; min-width: 160px;
  background: var(--blue); border-radius: 8px; padding: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, .07), 0 2px 4px rgba(0, 0, 0, .06); }
.wallet-menu[hidden] { display: none; }
.link-button { background: transparent; border: 0; color: var(--paper); padding: 12px 16px;
  min-height: 44px; border-radius: 8px; text-decoration: underline; text-underline-offset: 4px; }
.link-button:hover { background: hsl(220 50% 28%); }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; display: flex;
  background: var(--blue); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-height: 56px; padding: 8px 4px; font-size: 12px; line-height: 1.3; text-decoration: none;
  color: rgba(255, 255, 255, .65); border-top: 2px solid transparent; }
.tab:hover { color: var(--paper); }
.tab[aria-current="page"] { color: var(--amber); font-weight: 600; border-top-color: var(--amber); }
.tab:focus-visible { outline-offset: -3px; }

main { padding: 0 16px 32px; }
.banner { margin: 8px 0 16px; }
.notice { display: flex; gap: 16px; align-items: center; justify-content: space-between;
  background: hsl(0 40% 28%); color: hsl(0 60% 92%); border-radius: 8px; padding: 12px 16px;
  margin-bottom: 16px; font-size: 14px; }
.notice[hidden] { display: none; }
.back-link { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 8px;
  color: rgba(255, 255, 255, .65); text-decoration: none; }
.back-link:hover { color: var(--paper); }

.card { padding: 24px 16px; border-radius: 24px; margin-bottom: 16px; display: grid; gap: 16px; }
.card h2 { font-size: 24px; }
.card h3 { font-size: 16px; font-weight: 600; }
.card-head { margin-bottom: 0; flex-wrap: wrap; gap: 8px 12px; justify-content: space-between; }
.card .bar { margin: 0; }
.muted { color: rgba(255, 255, 255, .65); font-size: 14px; }
.figure { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.group-heading { font-size: 14px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: rgba(255, 255, 255, .65); margin: 32px 0 12px; }
.group-heading:first-child { margin-top: 0; }

.badge { display: inline-block; border-radius: 999px; padding: 4px 12px; font-size: 12px;
  font-weight: 600; line-height: 1.3; white-space: nowrap; }
.badge-neutral { background: hsl(220 36% 44%); color: var(--paper); }
.badge-good { background: var(--good); color: var(--ink); }
.badge-warm { background: var(--amber); color: var(--ink); }
.badge-quiet { background: hsl(220 20% 62%); color: var(--ink); }

.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 24px; border-radius: 8px; font-weight: 600; font-size: 16px;
  text-decoration: none; text-align: center; }
.secondary-button { background: transparent; color: var(--paper); border: 1px solid var(--line);
  justify-self: start; }
.secondary-button:hover:not(:disabled) { background: hsl(220 50% 28%); }
.primary-button:active:not(:disabled), .secondary-button:active:not(:disabled) { transform: scale(.98); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.actions .primary-button { width: auto; flex: 1 1 200px; }

.error { display: grid; gap: 8px; }
.error details { font-size: 12px; }
.error summary { cursor: pointer; min-height: 24px; }
details > summary { cursor: pointer; color: rgba(255, 255, 255, .65); font-size: 14px; min-height: 32px; }
details .mono { font-size: 12px; word-break: break-all; }

@media (min-width: 720px) {
  body { padding-bottom: 0; }
  .site-header { padding: 16px 32px; max-width: 1120px; }
  .brand { font-size: 24px; }
  .brand-symbol { font-size: 40px; margin-right: 12px; }
  .tabs { position: sticky; top: 76px; bottom: auto; max-width: 1120px; margin: 0 auto 16px;
    background: var(--deep); border-top: 0; border-bottom: 1px solid var(--line);
    padding: 0 32px; gap: 8px; }
  .tab { flex: 0 0 auto; flex-direction: row; gap: 8px; font-size: 14px; padding: 12px 16px;
    border-top: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; }
  .tab[aria-current="page"] { border-bottom-color: var(--amber); }
  main { padding: 0 32px 64px; max-width: 800px; }
  main > section > h1 { font-size: 40px; }
  .card { padding: 32px; margin-bottom: 24px; }
  .wallet-button { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* --- Home and Rounds ------------------------------------------------------ */
.lede { font-size: 20px; line-height: 1.5; margin: 0 0 24px; max-width: 65ch; }
.explain p { color: hsl(220 30% 88%); max-width: 65ch; }
.stack-tight { display: grid; gap: 8px; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plain-list li { padding-left: 16px; border-left: 2px solid var(--line); }
progress.fill { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 8px;
  border: 0; border-radius: 4px; background: hsl(221 55% 32%); overflow: hidden; }
progress.fill::-webkit-progress-bar { background: hsl(221 55% 32%); }
progress.fill::-webkit-progress-value { background: var(--amber); }
progress.fill::-moz-progress-bar { background: var(--amber); }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.timeline li { position: relative; display: grid; gap: 0 12px; padding: 0 0 16px 28px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 6px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--deep); border: 2px solid var(--line); }
.timeline li::after { content: ""; position: absolute; left: 11px; top: 20px; bottom: 0; width: 2px;
  background: var(--line); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline li.done::before { background: var(--line); }
.timeline li.here::before { background: var(--amber); border-color: var(--amber);
  box-shadow: 0 0 0 4px hsl(39 96% 64% / .25); }
.timeline li.here .timeline-label { color: var(--amber); font-weight: 600; }
.timeline-label { font-weight: 600; }
#home-enter { margin: 8px 0 24px; }
#home-enter .muted { flex-basis: 100%; }
main > section > h1:focus-visible { outline: none; }

/* --- Entering ------------------------------------------------------------- */
.field input { min-height: 48px; }
.status { min-height: 24px; font-weight: 600; }
.status:empty { display: none; }
.confirm-line { margin: 0; font-size: 14px; }
.confirm-line[hidden] { display: none; }
.confirm-line label { display: flex; gap: 12px; align-items: flex-start; min-height: 44px; cursor: pointer; }
.confirm-line input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--amber); }
.section-heading { margin: 8px 0 0; }

/* --- My tickets ----------------------------------------------------------- */
.confirm-box { display: grid; gap: 8px; padding: 16px; border-radius: 8px; background: hsl(221 55% 20%); }
.notice-good { display: flex; gap: 16px; align-items: center; justify-content: space-between;
  background: hsl(152 40% 24%); color: hsl(152 60% 92%); border-radius: 8px; padding: 12px 16px;
  margin-bottom: 16px; font-size: 14px; }

/* --- The draw ------------------------------------------------------------- */
.honesty { font-size: 14px; color: rgba(255, 255, 255, .65); border-left: 2px solid var(--amber);
  padding-left: 12px; }
.draw-stage { position: relative; width: 100%; aspect-ratio: 4 / 5; max-height: 70vh;
  border-radius: 16px; overflow: hidden;
  background: radial-gradient(circle at 50% 30%, hsl(220 67% 28%), hsl(222 65% 11%)); }
.draw-stage[hidden] { display: none; }
.draw-stage canvas { display: block; width: 100%; height: 100%; }
.rail { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; min-height: 48px; }
.rail li { padding: 12px 16px; border-radius: 8px; background: hsl(221 55% 20%); font-weight: 600;
  font-variant-numeric: tabular-nums; }
.rail li.mine { background: hsl(152 40% 24%); box-shadow: inset 0 0 0 2px var(--good); }
.actions[hidden] { display: none; }
@media (min-width: 720px) { .draw-stage { aspect-ratio: 16 / 10; } }
