:root {
  --bg: #000;
  --fg: #fff;
  --muted: rgba(255, 255, 255, .6);
  --faint: rgba(255, 255, 255, .35);
  --line: rgba(255, 255, 255, .14);
  --card: #070707;
  --up: #7cffb2;
  --down: #ff7c7c;
  --pad-x: clamp(16px, 3vw, 40px);
  --panel-w: 400px;
  --top-h: 72px;
  --tape-h: 40px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0 }
html, body { height: 100%; background: var(--bg); color: var(--fg); font-family: 'Poppins', sans-serif; -webkit-font-smoothing: antialiased }
body { overflow-x: hidden }
button { font: inherit; color: inherit }
[hidden] { display: none !important }

/* top bar */
.topbar { height: var(--top-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 var(--pad-x); border-bottom: 1px solid var(--line) }
.logo { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-size: 15px; letter-spacing: -0.01em }
.logo-mark { width: 16px; height: 32px; background: #fff; border-radius: 0 16px 16px 0 }
.logo b { font-weight: 700 }
.logo span { font-weight: 400 }
.top-links { display: flex; gap: clamp(16px, 3vw, 44px) }
.top-links a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; transition: color .2s }
.top-links a:hover, .top-links a.on { color: #fff }
.top-right { display: flex; align-items: center; gap: 12px }
.pill { font-size: 12px; padding: 6px 10px; border: 1px solid var(--down); color: var(--down); border-radius: 99px; cursor: pointer }

.btn { display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 18px; border: 1.5px solid rgba(255, 255, 255, .85); border-radius: 6px; background: transparent; color: #fff; font-size: 14px; cursor: pointer; transition: background .25s, color .25s, opacity .2s; white-space: nowrap; text-decoration: none }
.btn:hover { background: #fff; color: #000 }
.btn.solid { background: #fff; color: #000 }
.btn.solid:hover { background: transparent; color: #fff }
.btn.wide { width: 100% }
.btn:disabled { opacity: .35; cursor: not-allowed; background: transparent; color: #fff }
.btn.busy { pointer-events: none; opacity: .6 }
.mini { border: 1px solid var(--line); background: transparent; border-radius: 4px; padding: 0 10px; font-size: 11px; letter-spacing: .1em; cursor: pointer }
.mini:hover { border-color: #fff }

.ca-pill { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 4px 0 14px; border: 1px solid var(--line); border-radius: 99px; background: transparent; font-size: 12px; cursor: pointer; white-space: nowrap }
.ca-pill .ca-k { font-weight: 700; letter-spacing: .14em }
.ca-pill .ca-addr { color: var(--muted); font-variant-numeric: tabular-nums }
.ca-pill .ca-copy { height: 28px; padding: 0 12px; border-radius: 99px; background: #fff; color: #000; display: inline-flex; align-items: center; font-weight: 600; font-size: 10.5px; letter-spacing: .12em }
.ca-pill.soon .ca-copy { background: transparent; color: #fff; box-shadow: inset 0 0 0 1px var(--line) }
.ca-pill:hover { border-color: #fff }

/* layout */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) var(--panel-w); height: calc(100vh - var(--top-h) - var(--tape-h)); height: calc(100svh - var(--top-h) - var(--tape-h)); min-height: 560px }
.stage { position: relative; overflow: hidden; border-right: 1px solid var(--line) }
#floor-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: pan-y }
.stage-hud { position: absolute; top: 24px; left: 24px; right: 24px; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none }
.hud-status, .hud-clock { display: flex; flex-direction: column; gap: 4px }
.hud-clock { text-align: right; align-items: flex-end }
.hud-kicker, .kicker { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted) }
.hud-label { font-size: clamp(30px, 3.6vw, 56px); font-weight: 800; letter-spacing: -0.03em; line-height: 1 }
.hud-sub { font-size: 13px; color: var(--muted) }
.hud-time { font-size: clamp(28px, 3vw, 44px); font-weight: 300; font-variant-numeric: tabular-nums; letter-spacing: -0.02em }
.stage.live .hud-label { color: var(--up) }
.stage.unattended .hud-label { color: var(--down) }

.coverage { position: absolute; left: 24px; right: 24px; bottom: 20px; pointer-events: none }
.cov-head { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px }
.cov-head span:last-child { color: #fff; font-variant-numeric: tabular-nums }
.cov-bar { display: grid; grid-template-columns: repeat(30, 1fr); gap: 3px }
.cov-bar i { height: 10px; background: rgba(255, 255, 255, .1); border-radius: 1px; transition: background .3s }
.cov-bar i.on { background: #fff }
.cov-bar i.now { outline: 1px solid rgba(255, 255, 255, .6) }

.receipt { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(380px, calc(100% - 32px)); background: #000; border: 1px solid #fff; border-radius: 8px; padding: 28px; z-index: 5; box-shadow: 0 30px 80px rgba(0, 0, 0, .8) }
.receipt h3 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin: 6px 0 18px }
.receipt dl > div { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14px }
.receipt dt { color: var(--muted) }
.receipt dd { font-variant-numeric: tabular-nums; font-weight: 600 }
.receipt .fine { font-size: 12px; color: var(--muted); margin: 16px 0; line-height: 1.6 }

/* panel */
.panel { overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 20px; scrollbar-width: thin }
.panel > * { flex-shrink: 0 }
.seat-card { border: 1px solid var(--line); border-radius: 8px; padding: 20px; display: flex; flex-direction: column; gap: 14px; background: var(--card) }
.seat-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px }
.seat-head h2 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px }
.tag { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; border: 1px solid #fff; border-radius: 99px; padding: 4px 10px; white-space: nowrap }
.tag.t3 { border-color: #d4af37; color: #d4af37 }
.tag.t2 { border-color: #c08a50; color: #e0b080 }
.tag.t1 { border-color: #6f8fb0; color: #9fc0e0 }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.6; font-weight: 300 }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden }
.kv > div { background: #000; padding: 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0 }
.kv span { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted) }
.kv b { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }

.tabs { display: flex; border-bottom: 1px solid var(--line); gap: 4px; overflow-x: auto; scrollbar-width: none }
.tab { background: none; border: 0; padding: 10px 10px 12px; font-size: 13px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap }
.tab:hover { color: #fff }
.tab.on { color: #fff; border-bottom-color: #fff }
.tab-body { display: flex; flex-direction: column; gap: 14px }

.field { display: flex; flex-direction: column; gap: 8px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted) }
.input-row { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; height: 48px }
.input-row:focus-within { border-color: #fff }
.input-row input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: #fff; padding: 0 14px; font: 500 18px 'Poppins', sans-serif; font-variant-numeric: tabular-nums }
.input-row .mini { border: 0; border-left: 1px solid var(--line); border-radius: 0 }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 6px }
.choice { border: 1px solid var(--line); background: transparent; border-radius: 6px; padding: 10px 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; transition: border-color .2s, background .2s }
.choice b { font-size: 14px; font-weight: 600 }
.choice small { font-size: 11px; color: var(--muted) }
.choice:hover { border-color: rgba(255, 255, 255, .6) }
.choice.on { background: #fff; color: #000; border-color: #fff }
.choice.on small { color: rgba(0, 0, 0, .6) }
.choices.assets { grid-template-columns: 1fr 1fr }
.choices.assets .choice { flex-direction: row; justify-content: center; gap: 8px; padding: 12px 6px }
.lane-note { font-size: 12px; color: var(--muted); line-height: 1.6; border-left: 2px solid var(--line); padding-left: 10px }
.quote { font-size: 14px; padding: 14px; border: 1px dashed var(--line); border-radius: 6px; font-variant-numeric: tabular-nums; line-height: 1.6 }
.sub { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin-top: 8px }
.list { display: flex; flex-direction: column; gap: 8px }
.empty { font-size: 13px; color: var(--faint) }
.item { border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px }
.item .l { display: flex; flex-direction: column; gap: 2px; min-width: 0 }
.item .l b { font-weight: 600; font-variant-numeric: tabular-nums }
.item .l small { color: var(--muted); font-size: 11.5px; overflow-wrap: anywhere }
.item .r { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none }
.item .btn { height: 32px; padding: 0 12px; font-size: 12px }
.odds { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden }
.odds > div { background: #000; padding: 10px 12px; display: flex; justify-content: space-between; font-size: 13px }
.odds span { color: var(--muted) }
a.x { color: #fff; text-decoration: underline; text-underline-offset: 2px }

/* tape */
.tape { height: var(--tape-h); border-top: 1px solid var(--line); display: flex; align-items: center; overflow: hidden; font-size: 13px }
.tape-label { flex: none; padding: 0 16px; height: 100%; display: flex; align-items: center; border-right: 1px solid var(--line); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted) }
.tape-track { flex: 1; overflow: hidden; position: relative }
.tape-inner { display: inline-flex; gap: 40px; white-space: nowrap; padding-left: 24px; animation: tape 40s linear infinite; font-variant-numeric: tabular-nums }
.tape-inner .up { color: var(--up) }
.tape-inner .down { color: var(--down) }
@keyframes tape { from { transform: translateX(0) } to { transform: translateX(-50%) } }

/* modal / toast */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .75); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 50; padding: 16px }
.modal-card { width: min(420px, 100%); background: #000; border: 1px solid var(--line); border-radius: 10px; padding: 24px; display: flex; flex-direction: column; gap: 14px }
.modal-card h3 { font-size: 22px; font-weight: 700 }
.wallet-opt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; background: transparent; cursor: pointer; text-align: left; font-size: 14px }
.wallet-opt:hover { border-color: #fff }
.wallet-opt img { width: 28px; height: 28px; border-radius: 6px }
.toast { position: fixed; left: 50%; bottom: calc(var(--tape-h) + 20px); transform: translateX(-50%); background: #fff; color: #000; padding: 12px 18px; border-radius: 6px; font-size: 13.5px; z-index: 60; max-width: calc(100% - 32px); box-shadow: 0 10px 40px rgba(0, 0, 0, .6) }
.toast.err { background: var(--down) }

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; height: auto; min-height: 0 }
  .stage { height: 62svh; min-height: 420px; border-right: 0; border-bottom: 1px solid var(--line) }
  .panel { overflow: visible }
  .top-links { display: none }
}
@media (max-width: 520px) {
  .stage-hud { top: 16px; left: 16px; right: 16px }
  .coverage { left: 16px; right: 16px }
  .panel { padding: 16px }
  .topbar .btn { height: 38px; padding: 0 12px; font-size: 13px }
  .ca-pill .ca-addr, .ca-pill .ca-k { display: none }
  .ca-pill { padding-left: 4px }
  .hud-sub { max-width: 52vw }
}
