/* nav */
.nav {
  height: var(--nav-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}
.nav-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.logo { color: inherit; text-decoration: none; }
.logo:focus-visible { outline: 2px solid var(--fg); outline-offset: 4px; border-radius: 2px; }
.logo {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 17px;
  line-height: 1;
  letter-spacing: .02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.logo sup { font-size: .5em; line-height: 1; vertical-align: top; margin-left: 1px; }
.logo { display: inline-flex; align-items: center; gap: 9px; }
.logo-mark { width: 38px; height: 38px; flex: none; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .3)); }
.ca-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 4px 0 10px;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .04);
  font: 500 12px/1 var(--font-ui); white-space: nowrap; transition: border-color .15s, background .15s;
}
.ca-pill:hover { border-color: rgba(255, 255, 255, .32); background: rgba(255, 255, 255, .08); }
.ca-k { color: var(--fg-2); letter-spacing: .12em; font-size: 10.5px; }
.ca-v { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.ca-copy { padding: 5px 9px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 11px; }
/* The centred tabs leave the brand little room below desktop widths: the pill shrinks to "CA", the copy result takes
   its place for a moment. */
@media (max-width: 1000px) {
  .ca-pill { height: 28px; padding: 0 10px; }
  .ca-v, .ca-copy, .ca-pill.is-copied .ca-k { display: none; }
  .ca-k, .ca-pill.is-copied .ca-copy { display: inline; color: var(--fg); }
  .ca-pill.is-copied .ca-copy { padding: 0; background: none; }
}

@media (max-width: 700px) { .logo span { display: none; } } /* the badge already reads HIT; the link keeps its label */

/* Before the token launches: only the pre-launch screen; no tabs, totals strip or wallet. */
body[data-prelaunch="1"] :is(#strip, #minibar, .acct-wrap) { display: none !important; }
body[data-prelaunch="1"] .tabs { visibility: hidden; } /* keeps the header grid, so the menu stays on the right */
body[data-prelaunch="1"] .menu-item[data-go="my"] { display: none; }
.live-view[data-show="prelaunch"] .prelaunch-layer {
  opacity: 1; visibility: visible; pointer-events: auto; transform: none;
  transition: opacity .6s var(--ease) .1s, transform .8s var(--ease) .1s, visibility 0s;
}
.prelaunch-layer { gap: clamp(10px, 1.8svh, 18px); max-width: 920px; margin: 0 auto; }
.pl-badge {
  display: inline-flex; align-items: center; gap: 9px; padding: 7px 14px 7px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(0, 0, 0, .22);
  font: 600 11px/1 var(--font-ui); letter-spacing: .18em; text-transform: uppercase; color: var(--fg);
}
.pl-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 70%, transparent); animation: pl-pulse 1.8s ease-out infinite; }
@keyframes pl-pulse { to { box-shadow: 0 0 0 9px transparent; } }
.pl-title {
  font-family: var(--font-display); font-size: clamp(34px, min(6.6svh, 7.4vw), 70px); line-height: .96;
  letter-spacing: -.005em; text-transform: uppercase; text-shadow: 0 4px 24px rgba(90, 0, 0, .35);
}
.pl-object { width: clamp(150px, 26svh, 240px); aspect-ratio: .62; }
.pl-object .slab-box { width: 100%; height: 100%; }
.pl-sub { max-width: 40ch; font-size: 16px; font-weight: 500; line-height: 1.5; color: var(--fg); }
.pl-steps { display: flex; gap: clamp(14px, 3vw, 34px); flex-wrap: wrap; justify-content: center; }
.pl-steps li { display: flex; align-items: baseline; gap: 8px; font: 500 13px/1.3 var(--font-ui); }
.pl-steps b { font-size: 18px; color: var(--accent); }
.pl-cta { display: inline-flex; align-items: center; margin-top: 4px; text-decoration: none; }
@media (max-width: 520px) { .pl-steps { flex-direction: column; align-items: center; gap: 8px; } }

.tabs { position: relative; display: flex; gap: 8px; }
.tabs::after {
  content: ""; position: absolute; left: 0; bottom: 8px; height: 2px; background: var(--fg);
  width: var(--iw, 0); transform: translateX(var(--ix, 0)); opacity: var(--io, 0);
  transition: transform .42s var(--ease-out), width .42s var(--ease-out), opacity .2s;
}
.tab {
  position: relative;
  padding: 14px 6px;
  margin-inline: 6px;
  font: 500 12px/1 var(--font-ui);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fg-2);
  transition: color .2s;
}
.tab:hover, .tab[aria-selected="true"] { color: var(--fg); }
.nav-side { justify-self: end; display: flex; align-items: center; gap: 22px; }
.acct-wrap { position: relative; }
.account {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 30;
  width: 240px; padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  display: grid; gap: 8px; justify-items: start;
  transition: opacity .14s ease-out, transform .14s ease-out;
}
@starting-style { .account { opacity: 0; transform: translateY(-4px); } }
.acct-addr { font: 600 16px/1.2 var(--font-ui); letter-spacing: .02em; }
.account .label:empty { display: none; }
.acct-bal { display: flex; align-items: baseline; gap: 10px; margin-top: 4px; }
.acct-bal b { font-size: 22px; font-weight: 400; }

/* stage */
.live-view {
  position: relative; min-height: 0;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  padding-block: 6px;
}
.layer {
  grid-area: 1 / 1; min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(10px);
  transition: opacity .3s var(--ease), transform .3s var(--ease), visibility 0s linear .3s;
}
.live-view[data-show="status"] .status-layer,
.live-view[data-show="idle"] .idle-layer,
.live-view[data-show="opening"] .opening-layer {
  opacity: 1; visibility: visible; pointer-events: auto; transform: none;
  transition: opacity .45s var(--ease) .35s, transform .6s var(--ease) .35s, visibility 0s;
}
.live-view[data-show="opening"] .idle-layer {
  transform: translateY(-32px) scale(.92);
  transition: opacity .45s var(--ease), transform .6s var(--ease), visibility 0s linear .6s;
}
.status-text { font: 400 14px/1.4 var(--font-ui); letter-spacing: .04em; color: var(--fg-2); }

/* idle: the meter */
.big {
  font-size: clamp(64px, min(17svh, 22vw), 168px);
  line-height: .85;
}
.meter-sum { display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 4px 16px; margin-top: 12px; }
.meter-of { font: 500 15px/1 var(--font-ui); letter-spacing: .06em; color: var(--fg-2); }
.meter-of b { font-size: 30px; font-weight: 400; color: var(--fg); letter-spacing: 0; margin-left: 4px; }
/* The figure sits on the flash's white heart: comic lettering (white face, deep red keyline under it, a hard drop)
   reads on white and on red alike, in the burst's own idiom. */
.meter-sum .big, .meter-of b {
  -webkit-text-stroke: .08em #7A0000; paint-order: stroke fill;
  text-shadow: 0 .06em 0 #5A0000, 0 .18em .45em rgba(60, 0, 0, .35);
}
.meter {
  position: relative; width: min(560px, 100%); height: 14px; margin-top: clamp(14px, 2.6svh, 24px);
  border-radius: 999px; background: var(--track); overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(60, 0, 0, .35);
}
.meter i {
  position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit;
  background: var(--fg); box-shadow: 0 0 18px rgba(255, 255, 255, .55);
  transition: width .6s var(--ease);
}
.meter.is-near i { background: linear-gradient(90deg, var(--fg) 60%, var(--live)); }
.meter-cap { margin-top: 10px; font: 600 13px/1.3 var(--font-ui); letter-spacing: .08em; color: var(--fg); text-shadow: 0 1px 2px rgba(90, 0, 0, .7), 0 0 10px rgba(90, 0, 0, .65); }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; min-height: 30px; margin-top: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 13px; border-radius: 999px;
  background: rgba(40, 0, 0, .3); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--line); font: 600 12px/1 var(--font-ui); letter-spacing: .06em;
}
.chip.is-pot { background: var(--hit); color: var(--hit-ink); border-color: transparent; text-shadow: none; }
.chip.is-pot b { font-size: 16px; font-weight: 400; letter-spacing: 0; }

/* the viewer's own panel under the meter */
.you { width: min(560px, 100%); margin-top: clamp(18px, 3.4svh, 34px); }
.you-box {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px 16px;
  padding: 14px 16px; border-radius: 16px;
  background: rgba(40, 0, 0, .3); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.you-box[data-you="join"] { flex-direction: column; gap: 10px; }
.you-t { font: 500 14px/1.35 var(--font-ui); letter-spacing: .02em; }
.you-box.is-joined { justify-content: space-between; text-align: left; }
.you-side { display: flex; align-items: center; gap: 8px; min-width: 0; font: 500 13px/1.3 var(--font-ui); }
.you-badge {
  flex: none; padding: 4px 8px; border-radius: 6px; background: var(--hit); color: var(--hit-ink);
  font: 600 11px/1 var(--font-ui); letter-spacing: .06em; text-shadow: none;
}
.you-bal { display: flex; align-items: baseline; gap: 10px; }
.you-bal b { font-size: 30px; font-weight: 400; line-height: 1; }
.you-wd { display: flex; align-items: center; gap: 10px; }
.you-note { font-size: 12px; line-height: 1.35; color: var(--fg-2); }
.you-note:empty { display: none; }
.you-note a { color: var(--fg); }
@media (max-width: 520px) {
  .you-box.is-joined { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
  .you-side { grid-column: 1 / -1; }
  .you-wd { justify-content: flex-end; }
}

/* opening */
.op-head { display: inline-flex; align-items: center; gap: 8px; }
.op-steps { display: flex; gap: 4px; margin-top: 12px; }
.op-steps li {
  position: relative; min-width: 64px; padding-top: 10px;
  font: 500 11px/1 var(--font-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--fg-2); opacity: .7;
  transition: color .3s, opacity .3s;
}
.op-steps li::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 3px; border-radius: 2px; background: var(--track);
  transition: background .3s;
}
.op-steps li:is(.is-done, .is-on) { color: var(--fg); opacity: 1; }
.op-steps li:is(.is-done, .is-on)::before { background: var(--fg); }
.op-steps li.is-on::before { box-shadow: 0 0 12px rgba(255, 255, 255, .7); }

.game-object {
  flex: 1 1 0; min-height: 150px; max-height: 400px;
  /* Same gap above and below the slab: the steps and the tag sit at equal distance from it. */
  --gap: clamp(18px, 3.2svh, 28px);
  /* The contact shadow reads as part of the object, so the gap below gets back the ≈4px it covers. */
  width: min(100%, 248px); margin-block: var(--gap) calc(var(--gap) + 4px);
}
.live-view:not([data-show="opening"]) .game-object {
  flex-grow: 0; min-height: 0; max-height: 0; margin-block: 0; overflow: hidden;
  transition: flex-grow 0s .5s, min-height 0s .5s, max-height 0s .5s, margin 0s .5s;
}
.slab-box { position: relative; width: 100%; height: 100%; }
.slab-fallback, .slab-fallback-face {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
}
.slab-fallback-face {
  inset: auto; left: 50%; top: 53%; width: auto; height: 68%; max-width: 76%;
  transform: translate(-50%, -50%);
}

.pack-info {
  width: min(560px, 100%); min-height: 76px;
  display: flex; flex-direction: column; justify-content: flex-start;
}
.pi { display: flex; flex-direction: column; align-items: center; gap: 4px; }
/* The line under the slab sits on the burst's edge: a smoked tag keeps it legible whatever flashes behind it. */
.pack-info .pi {
  align-self: center; padding: 8px 18px; border-radius: 14px;
  background: rgba(40, 0, 0, .3); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
a#op-pack { flex-direction: row; gap: 12px; color: inherit; text-decoration: none; transition: background .15s; }
a#op-pack[href]:hover { background: rgba(40, 0, 0, .45); }
a#op-pack[href]:hover .pack-name { text-decoration: underline; text-underline-offset: 3px; }
.pi-txt { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; }
.pack-img { height: 52px; width: auto; border-radius: 4px; }
.pack-name { font: 600 16px/1.3 var(--font-ui); letter-spacing: .04em; }
.pack-q { font-size: 13px; line-height: 1.3; letter-spacing: .08em; color: var(--fg-2); }
.card-name { font: 600 15px/1.3 var(--font-ui); letter-spacing: .03em; }
.card-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px; }
.card-value { font-size: 40px; line-height: .9; }
.card-vs { font-size: 13px; letter-spacing: .06em; color: var(--fg-2); }
.pill {
  display: inline-flex; align-items: center;
  padding: 5px 11px; border-radius: 999px;
  font: 500 11px/1 var(--font-ui); letter-spacing: .14em;
  background: var(--brick); color: var(--brick-ink);
}
.pill.is-hit { background: var(--hit); color: var(--hit-ink); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .16); }
.op-next { min-height: 16px; margin-top: 10px; font-size: 12px; letter-spacing: .06em; color: var(--fg-2); font-variant-numeric: tabular-nums; }

/* strip: the black band */
.strip {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  min-height: var(--strip-h);
  background: var(--bg);
}
.cell { position: relative; display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 8px clamp(16px, 2.4vw, 40px); }
.cell:first-child { padding-left: 0; }
.cell:last-child { padding-right: 0; }
.cell + .cell::before { content: ""; position: absolute; left: 0; top: 50%; height: 44px; margin-top: -22px; width: 1px; background: var(--line); }
.strip-num { margin-top: 4px; font-size: 26px; line-height: 1; }
.paid .strip-num { font-size: 30px; }
.last { flex-direction: row; align-items: center; justify-content: flex-end; gap: 12px; white-space: nowrap; }
.thumb { width: 32px; height: 44px; flex: none; border-radius: 4px; overflow: hidden; background: var(--track); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.last-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.last-text b { font-weight: 500; font-size: 13px; letter-spacing: .02em; }

/* mini bar */
.minibar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  height: calc(48px + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--panel); border-bottom: 1px solid var(--line);
  transform: translateY(-100%); visibility: hidden;
  transition: transform .3s var(--ease), visibility 0s linear .3s;
}
.minibar.is-on { transform: none; visibility: visible; transition: transform .3s var(--ease); }
.mb-text { color: var(--fg); letter-spacing: .12em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.minibar .btn-text { white-space: nowrap; }

/* wallet modal */
.wallet {
  width: min(360px, calc(100vw - 32px)); padding: 0;
  background: var(--panel); color: var(--fg);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .14);
  opacity: 0; transform: translateY(4px);
  transition: opacity .16s ease-out, transform .16s ease-out, overlay .16s allow-discrete, display .16s allow-discrete;
}
.wallet[open] { opacity: 1; transform: none; }
@starting-style { .wallet[open] { opacity: 0; transform: translateY(4px); } }
.wallet::backdrop { background: rgba(0, 0, 0, 0); transition: background .16s ease-out, overlay .16s allow-discrete, display .16s allow-discrete; }
.wallet[open]::backdrop { background: rgba(0, 0, 0, .28); }
@starting-style { .wallet[open]::backdrop { background: rgba(0, 0, 0, 0); } }
.wm-body { display: grid; gap: 12px; padding: 20px; }
.wm-title { font: 600 18px/1.25 var(--font-ui); letter-spacing: .01em; }
.wm-list { display: grid; gap: 8px; }
.wm-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 48px; padding: 6px 14px;
  border: 1px solid var(--line); border-radius: 8px;
  font: 500 14px/1.2 var(--font-ui); text-align: left;
  transition: background .15s;
}
.wm-item:not(:disabled):hover { background: var(--tint); }
.wm-item.is-missing { color: var(--fg-2); text-decoration: none; }
.wm-item:disabled { opacity: .55; }
.wm-note { font-size: 11.5px; font-weight: 400; color: var(--fg-2); text-align: right; }
.wm-status { min-height: 18px; font-size: 13px; color: var(--fg-2); }
.wm-close { justify-self: start; }

/* short laptops */
@media (max-height: 740px) and (min-width: 761px) {
  .pack-info { min-height: 68px; }
  .card-value { font-size: 34px; }
  .you { margin-top: 14px; }
}

/* narrow */
@media (max-width: 900px) {
  .cell { padding-inline: 16px; }
}
@media (max-width: 760px) {
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); min-height: 0; padding-block: 6px 10px; }
  .cell { padding: 8px 0; }
  .cell + .cell::before { display: none; }
  .packs { align-items: flex-end; text-align: right; }
  .strip-num, .paid .strip-num { font-size: 24px; }
  .last { grid-column: 1 / -1; justify-content: flex-start; }
  .pack-info { min-height: 84px; }
}
@media (max-width: 520px) {
  .nav { grid-template-columns: auto 1fr auto; gap: 6px; }
  .nav-brand { gap: 6px; }
  /* No room for the X icon in the bar: the menu carries the link instead. */
  .nav-side > .icon-btn { display: none; }
  .menu-x { display: flex !important; }
  .logo { font-size: 16px; }
  .tabs { gap: 0; justify-self: center; }
  .tab { margin-inline: 2px; padding-inline: 6px; font-size: 11px; letter-spacing: .12em; }
  .btn-dark { height: 36px; padding: 0 12px; font-size: 13px; }
  .game-object { min-height: 130px; }
  .op-steps li { min-width: 54px; letter-spacing: .1em; }
  .card-value { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .wallet, .wallet[open], .account { transform: none; }
  @starting-style { .wallet[open] { transform: none; } .account { transform: none; } }
}

/* Live <-> Payouts: the stage slides toward the direction of travel; nav and 3D canvas stay put. */
.screen { view-transition-name: stage; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-group(stage) { animation: none; }
::view-transition-old(stage), ::view-transition-new(stage) { height: 100%; object-fit: none; object-position: top center; }
::view-transition-old(stage) { animation: vt-out .3s var(--ease-out) both; }
::view-transition-new(stage) { animation: vt-in .52s var(--ease-out) .05s both; }
html[data-vt="back"]::view-transition-old(stage) { animation-name: vt-out-back; }
html[data-vt="back"]::view-transition-new(stage) { animation-name: vt-in-back; }
@keyframes vt-out { to { opacity: 0; transform: translateX(-56px); filter: blur(3px); } }
@keyframes vt-in { from { opacity: 0; transform: translateX(56px); filter: blur(3px); } }
@keyframes vt-out-back { to { opacity: 0; transform: translateX(56px); filter: blur(3px); } }
@keyframes vt-in-back { from { opacity: 0; transform: translateX(-56px); filter: blur(3px); } }
