@font-face {
  font-family: "Baloo 2";
  src: url("fonts/Baloo2.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Mono";
  src: url("fonts/SpaceMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Mono";
  src: url("fonts/SpaceMono-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #171024;
  --ink-2: #2a1d4a;
  --cream: #fff6dd;
  --cream-2: #ffe9b3;
  --paper: #fffaf0;
  --gold: #ffc94f;
  --gold-deep: #e29a20;
  --cyan: #4fe3ff;
  --cyan-deep: #18a8c9;
  --lilac: #c9a6f7;
  --violet: #a86ef2;
  --magenta: #ef4bd8;
  --coral: #f2665e;
  --green: #8ede6a;
  --green-deep: #58b23c;
  --shadow: 0 7px 0 var(--ink);
  --shadow-big: 0 12px 0 var(--ink);
  --display: "Baloo 2", "Trebuchet MS", "Verdana", sans-serif;
  --mono: "Space Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0d0917;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 600;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
input { -webkit-user-select: text; user-select: text; }
button { cursor: pointer; }
canvas { display: block; }
.hidden { display: none !important; }
.mono { font-family: var(--mono); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

#world {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* ---------- shared UI ---------- */
.hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}
.fps {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  color: rgba(255, 247, 225, .86);
  text-shadow: 0 2px 0 rgba(23, 16, 36, .55);
  white-space: nowrap;
}
.wallet-pill {
  position: absolute;
  top: calc(max(10px, env(safe-area-inset-top)) + 26px);
  left: max(14px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 8px;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: var(--cream);
  box-shadow: 0 4px 0 var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  pointer-events: auto;
}
.wallet-pill .shard-glyph {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 15px;
  font-size: 17px;
  line-height: 1;
  color: var(--gold);
  text-shadow: 0 0 0 transparent, 0 2px 0 var(--cyan-deep);
  transform: translateY(-1px);
}
.wallet-pill .lifetime {
  font-size: 9px;
  color: #6d5a86;
  letter-spacing: .02em;
}
.plus-badge.pioneer-pill { background: var(--cyan); }
.plus-badge {
  display: inline-grid;
  place-items: center;
  min-width: 23px;
  height: 23px;
  padding: 0 5px;
  border: 2.5px solid var(--ink);
  border-radius: 8px;
  background: var(--gold);
  color: var(--ink);
  font-family: var(--display);
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 2px 0 var(--ink);
}
.hud-right {
  position: absolute;
  top: max(9px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  display: flex;
  align-items: flex-start;
  gap: 10px;
  pointer-events: auto;
}
.roundchip {
  position: relative;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--cream);
  box-shadow: 0 5px 0 var(--ink);
  display: grid;
  place-items: center;
  transition: transform .08s ease, box-shadow .08s ease, background .15s;
}
.roundchip:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--ink); }
.roundchip:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.roundchip svg { width: 32px; height: 32px; overflow: visible; }
.roundchip .sub {
  position: absolute;
  left: 50%;
  top: calc(100% + 7px);
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .06em;
  color: rgba(255, 247, 225, .8);
  text-shadow: 0 1px 0 rgba(23,16,36,.6);
  white-space: nowrap;
}
.session-chip { overflow: hidden; }
.session-chip .pie {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: conic-gradient(var(--gold) calc(var(--left, 1) * 1turn), #d8c9ad 0);
}
.session-chip .face {
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  background: var(--cream);
  border: 2px solid var(--ink);
}
.session-chip .time {
  position: relative;
  z-index: 2;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: -.04em;
  color: var(--ink);
}
.session-chip.low .pie { background: conic-gradient(var(--coral) calc(var(--left, 1) * 1turn), #e3cfc7 0); }
.session-chip.low { animation: lowPulse 1.4s ease-in-out infinite; }
@keyframes lowPulse {
  0%, 100% { box-shadow: 0 5px 0 var(--ink); }
  50% { box-shadow: 0 5px 0 var(--ink), 0 0 0 5px rgba(242,102,94,.35); }
}
.mute-chip.muted .face-dim { opacity: .55; }
.mute-chip:not(.muted) .face-dim { opacity: 1; }
.mute-chip .slash { display: none; }
.mute-chip.muted .slash { display: block; }
.mute-chip.muted { background: #f1e1c8; }
.mute-chip .arc { display: none; }
.mute-chip:not(.muted) .arc { display: block; }
.mute-chip:not(.muted) { background: #e8fbff; }

/* ---------- buttons and chips ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 22px;
  border: 3px solid var(--ink);
  border-radius: 17px;
  background: var(--cream);
  box-shadow: var(--shadow);
  font-family: var(--display);
  font-weight: 800;
  font-size: 18px;
  line-height: 1.05;
  letter-spacing: .01em;
  color: var(--ink);
  transition: transform .08s ease, box-shadow .08s ease, background .12s;
  text-align: center;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 9px 0 var(--ink); }
.btn:active { transform: translateY(4px); box-shadow: 0 3px 0 var(--ink); }
.btn.primary { background: var(--gold); }
.btn.cyanbtn { background: #c9f6ff; }
.btn.ghost { background: rgba(255,246,221,.78); }
.btn.small { min-height: 40px; font-size: 14px; padding: 8px 15px; border-radius: 13px; box-shadow: 0 5px 0 var(--ink); }
.btn.wide { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] {
  cursor: not-allowed;
  background: #e4d7c1;
  color: #85768e;
  transform: none;
  box-shadow: var(--shadow);
}
.btn .sub {
  display: block;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: .02em;
  color: #6d5a86;
}
.btn .tag {
  position: absolute;
  top: -10px;
  right: 10px;
  padding: 2px 7px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .07em;
}
.btn.primary .tag { background: var(--paper); }
.btn.gold { background: var(--gold); }
.btn .lead-icon { width: 26px; height: 26px; flex: 0 0 auto; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--cream);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}
.chip.gold { background: var(--gold); }
.chip.cyan { background: #c9f6ff; }
.chip.dim { background: #e5d9c5; color: #756585; }

.xbtn {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--cream);
  box-shadow: 0 4px 0 var(--ink);
  font-family: var(--display);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: transform .08s, box-shadow .08s;
}
.xbtn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); }
.xbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }

.kicker {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .16em;
  color: #7b6795;
  text-transform: uppercase;
}

/* ---------- screens ---------- */
.screen { position: fixed; inset: 0; z-index: 10; }
.screen.title-screen {
  background:
    radial-gradient(58% 72% at 9% 103%, rgba(255, 196, 93, .55) 0%, rgba(255, 190, 90, .18) 42%, rgba(255, 190, 90, 0) 70%),
    radial-gradient(70% 90% at 92% 8%, rgba(255, 255, 255, .18) 0%, rgba(255, 255, 255, 0) 60%),
    linear-gradient(99deg, #c6a4f4 0%, #c58cf3 30%, #c56aec 58%, #e245d4 84%, #f33ed0 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}
.screen.title-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 78%, rgba(255, 239, 174, .22), rgba(255, 239, 174, 0) 29%),
    radial-gradient(circle at 82% 22%, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 24%);
  pointer-events: none;
}
.title-inner {
  position: relative;
  z-index: 2;
  width: min(470px, 92vw);
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(10px, env(safe-area-inset-top)) 0 max(12px, env(safe-area-inset-bottom));
}
.logo-wrap {
  position: relative;
  margin-top: clamp(4px, 2.6vh, 26px);
  flex: 0 0 auto;
  filter: drop-shadow(0 0 0 transparent);
}
.logo {
  position: relative;
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(58px, min(10.6vw, 15.5vh), 136px);
  line-height: .82;
  letter-spacing: -.015em;
  color: var(--paper);
  -webkit-text-stroke: clamp(4px, .7vw, 9px) var(--ink);
  paint-order: stroke fill;
}
.logo::before {
  content: "NorBit";
  position: absolute;
  inset: 0;
  z-index: -1;
  color: var(--gold);
  -webkit-text-stroke: clamp(4px, .7vw, 9px) var(--ink);
  transform: translateY(clamp(7px, 1.2vh, 14px));
}
.title-pilot {
  margin-top: 2px;
  font-size: 9px;
  letter-spacing: .18em;
  color: rgba(255, 248, 230, .82);
  text-shadow: 0 1px 0 rgba(23, 16, 36, .5);
  flex: 0 0 auto;
}
.title-stage {
  position: relative;
  flex: 1 1 auto;
  width: min(420px, 88vw);
  min-height: 132px;
  max-height: 300px;
  margin-top: -2px;
}
.title-stage::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 54%;
  width: min(300px, 64vw);
  height: min(240px, 30vh);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 239, 176, .42) 0%, rgba(255, 232, 140, .12) 48%, rgba(255, 232, 140, 0) 71%);
  pointer-events: none;
}
#titleAvatar { position: absolute; inset: 0; width: 100%; height: 100%; }
.title-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 0 0 auto;
}
.title-actions .row { display: flex; gap: 9px; align-items: stretch; }
.title-actions .row > * { flex: 1 1 0; }
.code-card {
  padding: 8px 9px 9px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: rgba(255, 246, 221, .92);
  box-shadow: 0 6px 0 var(--ink);
}
.code-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .1em;
  color: #7b6795;
}
.code-row { display: flex; gap: 7px; }
.code-row input {
  min-width: 0;
  flex: 1 1 auto;
  height: 40px;
  padding: 0 12px;
  border: 2.5px solid var(--ink);
  border-radius: 11px;
  background: var(--paper);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  outline: none;
}
.code-row input::placeholder { color: #a592bd; letter-spacing: .04em; }
.code-row input:focus { border-color: var(--cyan-deep); box-shadow: 0 0 0 3px rgba(79,227,255,.28); }
.code-row .btn { min-height: 40px; padding: 7px 16px; font-size: 15px; box-shadow: 0 4px 0 var(--ink); }
.title-stats {
  margin-top: 8px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 9px;
  color: rgba(255, 248, 230, .9);
  text-shadow: 0 1px 0 rgba(23,16,36,.5);
}
.jumpback {
  background: var(--gold);
  animation: jumpPulse 2.2s ease-in-out infinite;
}
@keyframes jumpPulse {
  0%, 100% { box-shadow: 0 7px 0 var(--ink); }
  50% { box-shadow: 0 7px 0 var(--ink), 0 0 0 6px rgba(79,227,255,.22); }
}
body.has-snapshot .title-stage { max-height: 210px; }
body.has-snapshot .logo { font-size: clamp(50px, min(9.4vw, 12.5vh), 112px); }

/* queue */
.queue-screen {
  background:
    radial-gradient(50% 70% at 12% 90%, rgba(255, 200, 100, .28), rgba(255, 200, 100, 0) 70%),
    linear-gradient(104deg, #a887e0 0%, #ad78df 38%, #a856d5 70%, #c33bc1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.queue-inner {
  width: min(560px, 92vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 0;
}
.queue-canvas-wrap {
  position: relative;
  width: min(390px, 86vw);
  height: min(320px, 40vh);
}
.queue-canvas-wrap::before {
  content: "";
  position: absolute;
  left: 50%; top: 55%;
  width: 70%; height: 46%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 201, 79, .34), rgba(255, 201, 79, 0) 70%);
}
#queueAvatar { position: absolute; inset: 0; width: 100%; height: 100%; }
.queue-plaque {
  margin-top: -4px;
  padding: 12px 20px 14px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: var(--cream);
  box-shadow: var(--shadow-big);
  max-width: 100%;
}
.queue-status {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(18px, 2.6vw, 25px);
  font-weight: 800;
  letter-spacing: .01em;
}
.queue-sub {
  margin: 3px 0 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .05em;
  color: #79678f;
}
.queue-progress {
  width: min(320px, 72vw);
  height: 14px;
  margin: 13px auto 0;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: #e4d6c0;
  overflow: hidden;
}
.queue-progress i {
  display: block;
  height: 100%;
  width: 8%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--cyan));
  transition: width .5s cubic-bezier(.3,1.4,.5,1);
}
.queue-foot {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.queue-foot .chip { background: rgba(255,246,221,.86); }
.queue-foot .btn { background: rgba(255,246,221,.9); }

/* 404 */
.err-screen {
  background:
    radial-gradient(70% 60% at 50% 38%, rgba(99, 55, 150, .38), rgba(10, 7, 22, 0) 70%),
    radial-gradient(40% 40% at 80% 20%, rgba(79, 227, 255, .12), rgba(79, 227, 255, 0) 60%),
    #0b0817;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cream);
}
.err-inner {
  width: min(660px, 92vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.err-canvas-wrap {
  width: min(340px, 72vw);
  height: min(280px, 32vh);
  position: relative;
}
#errAvatar { position: absolute; inset: 0; width: 100%; height: 100%; }
.err-code {
  display: inline-block;
  padding: 5px 11px;
  border: 2px solid rgba(79,227,255,.4);
  border-radius: 8px;
  background: rgba(79,227,255,.07);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
}
.err-screen h1 {
  margin: 10px 0 4px;
  font-size: clamp(30px, 5vw, 54px);
  line-height: .95;
  color: var(--paper);
  -webkit-text-stroke: 1px rgba(23,16,36,.4);
}
.err-screen p {
  max-width: 470px;
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.6;
  color: rgba(255,246,221,.7);
}
.err-actions { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.err-screen .btn { background: var(--gold); }
.err-tiny {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .06em;
  color: rgba(255,246,221,.45);
}

/* ---------- overlays and panels ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
}
.overlay-scrim {
  position: absolute;
  inset: 0;
  background: rgba(17, 10, 32, .58);
}
.panel {
  position: relative;
  z-index: 1;
  width: min(980px, 96vw);
  max-height: min(88vh, 880px);
  display: flex;
  flex-direction: column;
  border: 4px solid var(--ink);
  border-radius: 24px;
  background: var(--cream);
  box-shadow: var(--shadow-big);
  overflow: hidden;
  animation: panelIn .28s cubic-bezier(.2,1.45,.45,1) both;
}
@keyframes panelIn {
  from { transform: translateY(24px) scale(.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.panel-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 12px 20px;
  border-bottom: 3px solid var(--ink);
  background: #fff0c9;
}
.panel-head .head-copy { flex: 1 1 auto; min-width: 0; }
.panel-head h2 {
  margin: 1px 0 0;
  font-size: clamp(22px, 3vw, 32px);
  line-height: .95;
  font-weight: 800;
  letter-spacing: -.01em;
}
.panel-head .head-side {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.panel-scroll {
  flex: 1 1 auto;
  overflow: auto;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 16px 18px 20px;
}
.panel-foot {
  flex: 0 0 auto;
  padding: 12px 18px;
  border-top: 3px solid var(--ink);
  background: #fff0c9;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: space-between;
}

/* locker */
.locker-body {
  display: grid;
  grid-template-columns: minmax(240px, .85fr) minmax(320px, 1.4fr);
  gap: 16px;
  min-height: 0;
}
.locker-stage {
  position: relative;
  min-height: 330px;
  border: 3px solid var(--ink);
  border-radius: 19px;
  background:
    radial-gradient(60% 58% at 50% 55%, rgba(255, 205, 90, .32), rgba(255, 205, 90, 0) 70%),
    linear-gradient(160deg, #caa9f6, #a869e6);
  overflow: hidden;
}
.locker-stage::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 38px;
  width: 150px; height: 24px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(23, 16, 36, .22);
}
#lockerAvatar { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage-name {
  position: absolute;
  left: 10px; right: 10px; bottom: 10px;
  text-align: center;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .04em;
  color: rgba(255,248,230,.88);
  text-shadow: 0 1px 0 rgba(23,16,36,.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.locker-shop { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  padding: 7px 12px;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: #efe2c9;
  box-shadow: 0 3px 0 var(--ink);
  font-family: var(--display);
  font-weight: 800;
  font-size: 12px;
  color: #5c4b73;
}
.tab.active { background: var(--gold); color: var(--ink); }
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(134px, 1fr));
  gap: 9px;
}
.item-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 6px 6px 8px;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 4px 0 var(--ink);
  text-align: left;
  transition: transform .08s, box-shadow .08s;
  overflow: hidden;
}
.item-card:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); }
.item-card.equipped { background: #fff2bc; outline: 3px solid var(--gold); outline-offset: -3px; }
.item-card.preview { outline: 3px dashed var(--cyan-deep); outline-offset: -3px; }
.item-card .thumb { width: 100%; height: 76px; position: relative; }
.item-card canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.item-card .name {
  font-family: var(--display);
  font-weight: 800;
  font-size: 12px;
  line-height: 1.05;
  margin: 2px 2px 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item-card .price {
  margin: 0 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  color: #6d5a86;
}
.item-card .price b { color: var(--ink); font-size: 11px; }
.item-card .badge {
  position: absolute;
  top: 5px; right: 5px;
  padding: 1px 5px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--cyan);
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .04em;
}
.item-card.equipped .badge { background: var(--gold); }
.locker-hint {
  margin: 0;
  font-family: var(--mono);
  font-size: 9px;
  color: #7b6795;
  letter-spacing: .02em;
}

/* crate */
.crate-panel { width: min(900px, 96vw); }
.crate-window {
  position: relative;
  height: 134px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: #2a1d4a;
  overflow: hidden;
}
.crate-window::before, .crate-window::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; width: 54px;
  z-index: 2;
  pointer-events: none;
}
.crate-window::before { left: 0; background: linear-gradient(90deg, #2a1d4a, rgba(42,29,74,0)); }
.crate-window::after { right: 0; background: linear-gradient(270deg, #2a1d4a, rgba(42,29,74,0)); }
.crate-strip {
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  will-change: transform;
}
.crate-tile {
  flex: 0 0 128px;
  height: 110px;
  border: 2.5px solid var(--ink);
  border-radius: 13px;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  overflow: hidden;
}
.crate-tile canvas { width: 70px; height: 70px; }
.crate-tile .tile-name { font-size: 10px; font-weight: 800; line-height: 1; padding: 0 4px; text-align: center; }
.crate-pointer {
  position: absolute;
  left: 50%; top: 0;
  transform: translateX(-50%);
  z-index: 3;
  width: 0; height: 0;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-top: 18px solid var(--gold);
  filter: drop-shadow(0 2px 0 var(--ink));
}
.crate-pointer::after {
  content: "";
  position: absolute;
  left: -11px; top: -20px;
  width: 22px; height: 0;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-top: 6px solid var(--ink);
}
.crate-lower { display: grid; grid-template-columns: 1.2fr .8fr; gap: 14px; margin-top: 14px; align-items: start; }
.crate-result {
  min-height: 74px;
  padding: 12px 15px;
  border: 2.5px dashed #b9a785;
  border-radius: 14px;
  background: var(--paper);
}
.crate-result .big {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}
.crate-result p { margin: 3px 0 0; font-family: var(--mono); font-size: 9px; line-height: 1.5; color: #6d5a86; }
.crate-actions { display: flex; flex-direction: column; gap: 8px; }
.crate-actions .btn { width: 100%; }
.odds { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 10px; }
.odds .chip { font-size: 8px; }

/* shrine */
.shrine-panel { width: min(820px, 96vw); background: var(--cream); }
.shrine-top {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 16px;
  align-items: center;
}
.plus-mark {
  position: relative;
  aspect-ratio: 1;
  border: 3px solid var(--ink);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 42%, rgba(79,227,255,.55), rgba(79,227,255,0) 55%),
    radial-gradient(circle at 50% 50%, #ffe89b, #ffc94f 58%, #e29a20 100%);
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: inset 0 -9px 0 rgba(23,16,36,.16);
}
.plus-mark span {
  font-family: var(--display);
  font-size: 96px;
  font-weight: 800;
  line-height: 1;
  color: var(--paper);
  -webkit-text-stroke: 6px var(--ink);
  paint-order: stroke fill;
}
.plus-mark::after {
  content: "∞";
  position: absolute;
  right: 8px; bottom: 2px;
  font-family: var(--display);
  font-size: 30px;
  color: var(--cyan);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  transform: rotate(-8deg);
}
.shrine-copy h3 { margin: 0; font-size: 28px; line-height: .95; }
.shrine-copy p { margin: 5px 0 0; font-family: var(--mono); font-size: 10px; line-height: 1.55; color: #6d5a86; }
.perk-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.perk {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 9px 11px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--paper);
}
.perk .dot { width: 18px; height: 18px; flex: 0 0 auto; border: 2px solid var(--ink); border-radius: 50%; background: var(--cyan); }
.perk.gold .dot { background: var(--gold); }
.perk b { display: block; font-size: 13px; line-height: 1.05; }
.perk small { display: block; margin-top: 1px; font-family: var(--mono); font-size: 8px; line-height: 1.4; color: #6d5a86; }
.shrine-status {
  margin-top: 14px;
  padding: 11px 13px;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  background: #fff0c9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.shrine-status .mono { font-size: 10px; color: #6d5a86; }

/* monument */
.monument-panel { width: min(900px, 96vw); }
.monument-grid { display: grid; grid-template-columns: 260px 1fr; gap: 18px; align-items: stretch; }
.monument-plinth {
  position: relative;
  min-height: 300px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: linear-gradient(180deg, #241a3f, #120c20);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.monument-plinth::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 42px;
  width: 160px; height: 24px;
  transform: translateX(-50%);
  background: #0a0714;
  border: 2px solid #3f2f65;
  border-radius: 50%;
}
#monumentAvatar { position: absolute; inset: 0; width: 100%; height: 100%; }
.monument-copy h3 { margin: 0; font-size: clamp(26px, 4vw, 42px); line-height: .92; }
.monument-copy .lifetime {
  margin-top: 5px;
  font-family: var(--mono);
  font-size: clamp(18px, 2.8vw, 26px);
  font-weight: 700;
  letter-spacing: -.03em;
}
.monument-copy .goal { font-family: var(--mono); font-size: 10px; color: #6d5a86; margin-top: 2px; }
.progress {
  height: 22px;
  margin-top: 12px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: #e0d2ba;
  overflow: hidden;
}
.progress i { display: block; height: 100%; min-width: 6px; background: linear-gradient(90deg, var(--gold), #ffe9a1); transition: width .4s ease; }
.monument-notes { margin-top: 12px; display: grid; gap: 7px; }
.note-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 11px; border: 2px solid #d6c6a9; border-radius: 11px; background: var(--paper);
  font-family: var(--mono); font-size: 9px; color: #6d5a86;
}
.note-row b { color: var(--ink); font-size: 10px; }
.pioneer {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 9px; border: 2px solid var(--ink); border-radius: 9px;
  background: var(--gold); color: var(--ink); font-family: var(--mono); font-size: 9px; font-weight: 700;
}
.pioneer.locked { background: #e4d7c1; color: #85768e; }

/* podium */
.podium-panel { width: min(760px, 96vw); }
.podium-stage {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 10px;
  padding-top: 12px;
  min-height: 300px;
}
.podium-card { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.podium-card .ava { width: 92px; height: 92px; position: relative; }
.podium-card .ava canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.podium-card .who {
  max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--display); font-weight: 800; font-size: 13px;
  margin-top: -2px;
}
.podium-card .score { font-family: var(--mono); font-size: 9px; color: #6d5a86; }
.podium-base {
  width: 100%;
  margin-top: 6px;
  border: 3px solid var(--ink);
  border-radius: 12px 12px 4px 4px;
  background: #d9c7a8;
  box-shadow: inset 0 -8px 0 rgba(23,16,36,.1);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
}
.podium-card.first .podium-base { height: 120px; background: var(--gold); }
.podium-card.second .podium-base { height: 88px; background: #e8d9e2; }
.podium-card.third .podium-base { height: 66px; background: #d6b790; }
.podium-card.mine .who { color: var(--cyan-deep); }
.podium-note { margin: 8px 0 0; text-align: center; font-family: var(--mono); font-size: 9px; color: #6d5a86; }

/* dock */
.dock-panel { width: min(820px, 96vw); }
.dock-art {
  position: relative;
  height: 210px;
  border: 3px solid var(--ink);
  border-radius: 17px;
  background:
    radial-gradient(60% 70% at 50% 90%, rgba(255, 205, 90, .3), rgba(255, 205, 90, 0) 70%),
    #2a1d4a;
  overflow: hidden;
}
#dockCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.dock-count { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.count-cell {
  min-width: 70px;
  padding: 6px 9px 8px;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  background: var(--paper);
  text-align: center;
}
.count-cell b { display: block; font-family: var(--mono); font-size: 24px; line-height: 1; letter-spacing: -.06em; }
.count-cell small { display: block; margin-top: 3px; font-family: var(--mono); font-size: 8px; color: #6d5a86; letter-spacing: .1em; }
.dock-copy { margin-top: 12px; font-family: var(--mono); font-size: 10px; line-height: 1.6; color: #6d5a86; }

/* cave */
.cave-panel { width: min(760px, 96vw); }
.cave-art {
  position: relative;
  height: 230px;
  border: 3px solid var(--ink);
  border-radius: 17px;
  overflow: hidden;
  background: linear-gradient(180deg, #9fe7f5 0%, #5dbde0 30%, #176a9b 100%);
}
.cave-art::before {
  content: "";
  position: absolute;
  right: 12%; top: 0; bottom: 0;
  width: 25%;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.6) 0 5px, rgba(255,255,255,.22) 5px 12px, rgba(255,255,255,.45) 12px 17px, rgba(255,255,255,.1) 17px 25px);
}
.cave-art::after {
  content: "";
  position: absolute;
  left: 12%; bottom: 15%;
  width: 38%; height: 52%;
  background: #171024;
  border: 4px solid #171024;
  border-radius: 50% 50% 12% 12% / 60% 60% 10% 10%;
  box-shadow: inset 0 16px 0 #241a3f;
}
.cave-glow {
  position: absolute;
  left: 27%; bottom: 28%;
  width: 24%; height: 24%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79,227,255,.65), rgba(79,227,255,0) 70%);
}
.cave-rock {
  position: absolute;
  left: 5%; bottom: 0;
  width: 90%; height: 30%;
  background: #6bd9e9;
  border-top: 4px solid var(--ink);
  border-radius: 50% 50% 0 0 / 18% 18% 0 0;
  opacity: .85;
}

/* modes */
.mode-panel { width: min(860px, 96vw); }
.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mode-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 13px 13px 14px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 5px 0 var(--ink);
  text-align: left;
  transition: transform .08s, box-shadow .08s, background .12s;
}
.mode-card:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--ink); }
.mode-card.active { background: #fff0c9; outline: 3px solid var(--gold); outline-offset: -3px; }
.mode-card .mode-icon {
  width: 48px; height: 48px;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  background: #e9f7ff;
  display: grid; place-items: center;
  font-family: var(--display); font-size: 26px; font-weight: 800;
}
.mode-card:nth-child(2) .mode-icon { background: #ffe8f5; }
.mode-card:nth-child(3) .mode-icon { background: #ecffef; }
.mode-card b { font-size: 17px; line-height: 1; }
.mode-card small { font-family: var(--mono); font-size: 8px; line-height: 1.5; color: #6d5a86; }
.onlyup-brief {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px;
}
.onlyup-brief .chip { font-size: 9px; }

/* results */
.result-panel { width: min(560px, 94vw); text-align: center; }
.result-hero { padding: 18px 20px 6px; }
.result-hero .big {
  font-family: var(--display); font-weight: 800; font-size: clamp(40px, 8vw, 74px); line-height: .82;
  color: var(--gold); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill;
}
.result-hero p { margin: 7px 0 0; font-family: var(--mono); font-size: 10px; color: #6d5a86; }
.result-rows { display: grid; gap: 6px; padding: 10px 20px 4px; text-align: left; }
.result-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 10px; border: 2px solid #d6c6a9; border-radius: 10px; background: var(--paper);
  font-family: var(--mono); font-size: 9px; color: #6d5a86;
}
.result-row b { color: var(--ink); }
.result-actions { display: flex; gap: 8px; padding: 12px 20px 20px; }
.result-actions .btn { flex: 1 1 0; }

/* session / kick / generic */
.session-panel { width: min(540px, 94vw); }
.session-time {
  text-align: center;
  padding: 8px 0 12px;
  font-family: var(--mono);
  font-size: clamp(44px, 9vw, 76px);
  font-weight: 700;
  letter-spacing: -.07em;
  line-height: 1;
}
.session-sub { text-align: center; font-family: var(--mono); font-size: 9px; color: #6d5a86; }
.session-actions { display: grid; gap: 8px; margin-top: 15px; }
.session-note { margin-top: 10px; text-align: center; font-family: var(--mono); font-size: 8px; line-height: 1.5; color: #85768e; }
.kick-panel { width: min(560px, 94vw); text-align: center; }
.kick-panel .big {
  font-size: clamp(34px, 7vw, 56px); font-weight: 800; line-height: .9; color: var(--coral);
  -webkit-text-stroke: 2.5px var(--ink); paint-order: stroke fill; padding: 16px 20px 0;
}
.kick-panel p { font-family: var(--mono); font-size: 9px; line-height: 1.6; color: #6d5a86; padding: 0 22px; }
.kick-actions { padding: 10px 20px 20px; display: flex; gap: 8px; }
.kick-actions .btn { flex: 1 1 0; }
.coming-panel { width: min(520px, 94vw); text-align: center; }
.coming-panel .big { font-size: 38px; font-weight: 800; line-height: .9; padding: 18px 20px 0; }
.coming-panel p { font-family: var(--mono); font-size: 9px; line-height: 1.6; color: #6d5a86; padding: 0 22px; }
.coming-actions { padding: 12px 22px 22px; }

/* banner */
.session-banner {
  position: fixed;
  z-index: 32;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  transform: translate(-50%, calc(100% + 40px));
  width: min(760px, 94vw);
  padding: 10px 12px 11px;
  border: 3px solid var(--ink);
  border-radius: 17px;
  background: var(--cream);
  box-shadow: var(--shadow-big);
  transition: transform .4s cubic-bezier(.2,1.35,.4,1);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  pointer-events: none;
  visibility: hidden;
}
.session-banner.show { transform: translate(-50%, 0); visibility: visible; pointer-events: auto; }
.session-banner .copy { flex: 1 1 220px; min-width: 0; }
.session-banner .copy b { display: block; font-size: 17px; line-height: 1; }
.session-banner .copy small { display: block; margin-top: 2px; font-family: var(--mono); font-size: 8px; color: #6d5a86; }
.session-banner .actions { display: flex; gap: 7px; flex: 0 1 auto; flex-wrap: wrap; }
.session-banner .btn { min-height: 42px; font-size: 13px; padding: 7px 12px; border-radius: 12px; box-shadow: 0 4px 0 var(--ink); }

/* toasts */
.toast-layer {
  position: fixed;
  z-index: 60;
  left: 50%;
  top: max(74px, calc(env(safe-area-inset-top) + 64px));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  width: min(480px, 92vw);
}
.toast {
  padding: 8px 14px;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: var(--cream);
  box-shadow: 0 4px 0 var(--ink);
  font-family: var(--display);
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 7px;
  animation: toastIn .22s cubic-bezier(.2,1.4,.4,1) both;
  max-width: 100%;
  text-align: center;
}
.toast.out { animation: toastOut .2s ease both; }
.toast.gold { background: var(--gold); }
.toast.cyan { background: #c9f6ff; }
@keyframes toastIn { from { transform: translateY(-10px) scale(.94); opacity: 0; } }
@keyframes toastOut { to { transform: translateY(-8px) scale(.96); opacity: 0; } }

/* touch */
.touch-ui { position: fixed; inset: 0; z-index: 18; pointer-events: none; display: none; }
body.in-hub.touch .touch-ui, body.in-onlyup.touch .touch-ui { display: block; }
.touch-move {
  position: absolute;
  left: max(14px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  display: flex;
  gap: 9px;
  pointer-events: auto;
}
.touch-actions {
  position: absolute;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  display: flex;
  align-items: flex-end;
  gap: 9px;
  pointer-events: auto;
}
.tbtn {
  width: 62px; height: 62px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: rgba(255,246,221,.9);
  box-shadow: 0 5px 0 var(--ink);
  display: grid; place-items: center;
  font-family: var(--display); font-size: 24px; font-weight: 800;
  touch-action: none;
  color: var(--ink);
}
.tbtn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.tbtn.jump { width: 76px; height: 76px; background: var(--gold); font-size: 18px; letter-spacing: .03em; }
.tbtn.emote { width: 54px; height: 54px; background: #c9f6ff; font-size: 16px; }
body:not(.in-onlyup) .tbtn.jump { display: none; }
body.in-hub .tbtn.emote { display: grid; }
body.touch .session-banner { bottom: calc(max(16px, env(safe-area-inset-bottom)) + 96px); }
body.touch .play-hint { bottom: calc(max(16px, env(safe-area-inset-bottom)) + 94px); }

/* emote wheel */
.emote-layer {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  background: rgba(17,10,32,.46);
}
.emote-layer .wheel {
  position: relative;
  width: min(440px, 92vw);
  height: min(440px, 92vw);
}
.wheel-core {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 92px; height: 92px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 6px 0 var(--ink);
  display: grid; place-items: center;
  font-family: var(--display); font-size: 38px; font-weight: 800;
  z-index: 2;
}
.wedge {
  position: absolute;
  left: 50%; top: 50%;
  width: 150px;
  height: 76px;
  padding: 0 12px;
  border: 4px solid var(--ink);
  border-radius: 24px;
  background: var(--cream);
  box-shadow: 0 6px 0 var(--ink);
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  transform: translate(-50%, -50%) rotate(var(--a, 0deg)) translateY(-148px) rotate(calc(var(--a, 0deg) * -1));
  transition: transform .16s cubic-bezier(.2,1.5,.4,1), background .12s;
  z-index: 3;
}
.wedge:hover, .wedge:focus-visible { background: var(--gold); transform: translate(-50%, -50%) rotate(var(--a, 0deg)) translateY(-154px) rotate(calc(var(--a, 0deg) * -1)); outline: none; }
.wedge::before {
  content: "";
  position: absolute;
  left: 50%; top: 100%;
  width: 18px; height: 42px;
  transform: translateX(-50%);
  background: var(--cream);
  border-left: 4px solid var(--ink);
  border-right: 4px solid var(--ink);
  z-index: -1;
}
.wedge .wicon {
  width: 38px; height: 38px; flex: 0 0 auto;
  border: 2.5px solid var(--ink); border-radius: 11px;
  background: #fffdf4;
  display: grid; place-items: center;
  font-size: 21px; font-weight: 800;
}
.wedge .wtxt b { display: block; font-size: 15px; line-height: 1; }
.wedge .wtxt small { display: block; margin-top: 2px; font-family: var(--mono); font-size: 8px; color: #6d5a86; }
.emote-hint {
  position: absolute;
  left: 50%; bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 7px 13px;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: var(--cream);
  box-shadow: 0 4px 0 var(--ink);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .03em;
  white-space: nowrap;
}

/* canvas game HUD (only up) */
.play-hud {
  position: fixed;
  inset: 0;
  z-index: 16;
  pointer-events: none;
}
.play-top {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}
.home-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 13px;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: var(--cream);
  box-shadow: 0 4px 0 var(--ink);
  font-family: var(--display);
  font-size: 13px;
  font-weight: 800;
}
.home-pill svg { width: 17px; height: 17px; }
.alt-box {
  position: absolute;
  left: max(14px, env(safe-area-inset-left));
  top: calc(max(10px, env(safe-area-inset-top)) + 58px);
  text-shadow: 0 2px 0 rgba(23,16,36,.55);
  color: var(--cream);
}
.alt-box .alt {
  font-family: var(--display);
  font-size: clamp(38px, 5vw, 62px);
  font-weight: 800;
  line-height: .82;
}
.alt-box .unit { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--cyan); margin-left: 4px; }
.alt-box .best { margin-top: 3px; font-family: var(--mono); font-size: 9px; color: rgba(255,246,221,.65); letter-spacing: .03em; }
.race-box {
  position: absolute;
  top: calc(max(12px, env(safe-area-inset-top)) + 84px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  max-width: 72vw;
  padding: 6px 10px 7px;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  background: rgba(255,246,221,.94);
  box-shadow: 0 4px 0 var(--ink);
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink);
}
.race-box .race-row { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.race-box .race-row:first-child { margin-top: 0; }
.race-box .dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--ink); flex: 0 0 auto; }
.race-box .bar { flex: 1 1 auto; height: 5px; border-radius: 999px; background: #dfd0b7; overflow: hidden; }
.race-box .bar i { display: block; height: 100%; background: var(--ink); }
.race-box .me .bar i { background: var(--gold-deep); }
.gravity-pill {
  position: absolute;
  top: calc(max(12px, env(safe-area-inset-top)) + 44px);
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 11px;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: #7b4bd6;
  color: #f3e9ff;
  box-shadow: 0 4px 0 var(--ink);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  animation: flipPulse 0.9s ease-in-out infinite;
}
@keyframes flipPulse { 50% { background: #9a62ff; } }
.play-back {
  position: absolute;
  left: max(14px, env(safe-area-inset-left));
  bottom: max(14px, env(safe-area-inset-bottom));
  pointer-events: auto;
  font-family: var(--mono);
  font-size: 9px;
  color: rgba(255,246,221,.82);
  text-shadow: 0 1px 0 rgba(23,16,36,.6);
}
.play-hint {
  position: absolute;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 7px 13px;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: rgba(255,246,221,.9);
  box-shadow: 0 4px 0 var(--ink);
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink);
  white-space: nowrap;
  max-width: 82vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
.play-hint b { font-family: var(--display); font-size: 11px; }
.power-pill {
  position: absolute;
  right: max(14px, env(safe-area-inset-right));
  top: calc(max(10px, env(safe-area-inset-top)) + 62px);
  padding: 5px 10px;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: #c9f6ff;
  box-shadow: 0 4px 0 var(--ink);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--ink);
}
body.in-onlyup .fps { color: rgba(255,246,221,.8); }
body.in-onlyup .play-hud { display: block; }
body:not(.in-onlyup) .play-hud { display: none; }

/* island hover label */
.hub-tip {
  position: fixed;
  z-index: 17;
  transform: translate(-50%, -100%);
  padding: 5px 10px;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  background: var(--cream);
  box-shadow: 0 4px 0 var(--ink);
  font-family: var(--display);
  font-size: 12px;
  font-weight: 800;
  pointer-events: none;
  white-space: nowrap;
}
.hub-tip small { display: block; font-family: var(--mono); font-size: 8px; color: #6d5a86; font-weight: 400; }

/* a few responsive shapes */
@media (max-width: 900px) {
  .locker-body { grid-template-columns: 1fr; }
  .locker-stage { min-height: 250px; }
  .item-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
  .monument-grid { grid-template-columns: 1fr; }
  .monument-plinth { min-height: 220px; }
  .crate-lower { grid-template-columns: 1fr; }
  .shrine-top { grid-template-columns: 140px 1fr; }
  .perk-list { grid-template-columns: 1fr; }
  .mode-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .hud-right { gap: 7px; }
  .roundchip { width: 48px; height: 48px; }
  .roundchip svg { width: 27px; height: 27px; }
  .session-chip .time { font-size: 8px; }
  .wallet-pill { padding: 4px 9px 4px 6px; font-size: 10px; }
  .wallet-pill .lifetime { display: none; }
  .title-inner { width: min(420px, 94vw); }
  .title-actions .btn { min-height: 47px; font-size: 16px; }
  .title-stage { min-height: 120px; }
  .logo { font-size: clamp(52px, 15vw, 92px); }
  .session-banner { gap: 8px; }
  .session-banner .actions { flex: 1 1 100%; }
  .session-banner .actions .btn { flex: 1 1 0; }
  .play-hint { font-size: 8px; padding: 6px 10px; }
  .play-back { display: none; }
  .race-box { top: auto; bottom: 76px; }
  body.in-onlyup .play-top { top: calc(max(9px, env(safe-area-inset-top)) + 54px); }
  body.in-onlyup .alt-box { top: calc(max(9px, env(safe-area-inset-top)) + 108px); }
  body.in-onlyup .gravity-pill { top: calc(max(9px, env(safe-area-inset-top)) + 104px); }
  .power-pill { top: auto; bottom: 76px; }
}
@media (max-height: 640px) {
  .title-pilot { display: none; }
  .title-stage { min-height: 100px; max-height: 180px; }
  .logo { font-size: clamp(48px, min(9.4vw, 12.5vh), 88px); }
  .title-actions { gap: 7px; }
  .title-actions .btn { min-height: 44px; font-size: 15px; padding: 8px 16px; }
  .code-card { padding: 6px 8px 7px; }
  .code-row input, .code-row .btn { height: 34px; min-height: 34px; }
  .title-stats { margin-top: 5px; }
  .err-canvas-wrap { height: 180px; }
  .panel { max-height: 94vh; }
}
@media (max-height: 540px) {
  .title-stage { display: none; }
  .logo-wrap { margin-top: 6px; }
  .title-inner { justify-content: flex-start; }
  .title-actions { margin-top: 8px; }
  .title-stats { margin-top: 5px; }
}
@media (orientation: portrait) and (min-height: 700px) {
  .title-stage { max-height: 34vh; }
}


.shake { animation: shakeIt .28s ease both; }
@keyframes shakeIt {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  45% { transform: translateX(5px); }
  70% { transform: translateX(-3px); }
}
