:root {
  color-scheme: dark;
  --bg: #07040d;
  --panel: rgba(16, 10, 25, 0.9);
  --panel2: rgba(30, 17, 42, 0.94);
  --line: rgba(255, 255, 255, 0.15);
  --text: #fff8f0;
  --muted: #b39fad;
  --green: #6dff8a;
  --red: #ff3f7f;
  --cyan: #38e8ff;
  --yellow: #ffcf33;
  --purple: #ff5cf4;
  --ink: #08030d;
  --glass: rgba(16, 8, 24, .74);
  --font-ui: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --font-display: "Arial Black", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html {
  overflow-x: hidden;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    linear-gradient(180deg, rgba(255, 92, 244, 0.13), transparent 35vh),
    radial-gradient(circle at 14% 12%, rgba(56, 232, 255, 0.14), transparent 26rem),
    radial-gradient(circle at 88% 8%, rgba(255, 63, 127, 0.16), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
}

body {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 100% 4px;
  mix-blend-mode: overlay;
  opacity: 0.4;
}

body::after {
  content: "";
  position: fixed;
  inset: auto 0 0;
  height: 42vh;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(37,242,157,.08));
  opacity: .65;
}

body.setup-open {
  overflow: hidden;
}

body.booting {
  overflow: hidden;
}

body.hit-flash::after {
  background: radial-gradient(circle at 50% 72%, rgba(255,255,255,.24), transparent 34%), linear-gradient(180deg, transparent, rgba(37,242,157,.14));
  opacity: .9;
}

button,
input {
  font: inherit;
}

input[type="text"] {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #080d15;
  color: var(--text);
  padding: 0 12px;
  font: inherit;
  font-weight: 800;
  outline: none;
}

input[type="password"] {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #080d15;
  color: var(--text);
  padding: 0 12px;
  font: inherit;
  font-weight: 800;
  outline: none;
}

button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 15px;
  background: var(--cyan);
  color: #031018;
  font-weight: 900;
  font-family: var(--font-display);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .14s ease, filter .14s ease, border-color .14s ease, background .14s ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22);
}

button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: .48;
  filter: grayscale(.35);
  transform: none;
}

button.ghost {
  background: rgba(255,255,255,.04);
  color: var(--text);
  border-color: var(--line);
}

select {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #080d15;
  color: var(--text);
  padding: 0 12px;
  font: inherit;
  font-weight: 800;
}

input:focus,
select:focus {
  border-color: rgba(94,214,255,.66);
  box-shadow: 0 0 0 3px rgba(94,214,255,.12);
}

button.long {
  background: linear-gradient(180deg, #5fffc0, var(--green));
  color: #03140d;
  box-shadow: 0 12px 34px rgba(37,242,157,.18), inset 0 1px 0 rgba(255,255,255,.4);
}

button.short {
  background: linear-gradient(180deg, #ff7790, var(--red));
  color: #180308;
  box-shadow: 0 12px 34px rgba(255,69,104,.2), inset 0 1px 0 rgba(255,255,255,.34);
}

button.tiny {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 12px;
}

button.tiny.active {
  background: var(--text);
  color: #070a10;
}

.terminal {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(8px, 1.2vw, 16px);
  position: relative;
  z-index: 1;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 6px 0 10px;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 0;
  background: linear-gradient(180deg, rgba(4,5,10,.94), rgba(4,5,10,.58), transparent);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand > div {
  min-width: 0;
}

.coin-mark {
  width: clamp(38px, 4vw, 52px);
  height: clamp(38px, 4vw, 52px);
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.22), transparent 22px),
    linear-gradient(135deg, rgba(37,242,157,.22), rgba(94,214,255,.14)),
    #080b11;
  color: var(--green);
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 950;
  box-shadow: inset 0 0 40px rgba(37,242,157,.1), 0 18px 48px rgba(37,242,157,.08);
}

.coin-mark.live {
  animation: pulseMark 1.7s ease-in-out infinite;
}

@keyframes pulseMark {
  0%, 100% { box-shadow: inset 0 0 40px rgba(37,242,157,.08), 0 0 0 rgba(37,242,157,0); }
  50% { box-shadow: inset 0 0 48px rgba(37,242,157,.16), 0 0 38px rgba(37,242,157,.15); }
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--green);
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0;
  line-height: 1.25;
}

h1,
h2,
p {
  margin: 0;
  min-width: 0;
}

h1 {
  max-width: 20ch;
  font-family: var(--font-display);
  font-size: clamp(20px, 2.65vw, 34px);
  line-height: 1;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  text-shadow: 0 18px 70px rgba(94,214,255,.18);
}

h2,
.arcade-hud strong,
.arena-callout strong,
.position-grid strong,
.account-row strong,
.result-grid strong {
  font-family: var(--font-display);
  letter-spacing: 0;
}

.sub {
  display: none;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.top-actions button {
  min-height: 38px;
}

#signOutBtn,
#newCoinBtn,
#resetBtn {
  display: none;
}

.profile-pill {
  display: none;
}

.profile-pill div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.profile-pill span {
  color: var(--text);
  font-size: 13px;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-pill strong {
  color: var(--green);
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.profile-pill em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
}

.profile-pill i {
  height: 6px;
  border-radius: 999px;
  background: #070a10;
  overflow: hidden;
}

.profile-pill b {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--cyan), var(--yellow));
  transition: width .25s ease;
}

.market-strip {
  display: none;
  grid-template-columns: minmax(180px, 1.2fr) repeat(3, minmax(128px, 1fr));
  gap: 9px;
  margin-bottom: 10px;
}

.market-strip div:nth-child(3),
.market-strip div:nth-child(4),
.market-strip div:nth-child(6) {
  display: none;
}

.market-strip div,
.card,
.chart-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.014)),
    var(--panel);
  box-shadow: 0 22px 80px rgba(0,0,0,.28);
  backdrop-filter: blur(16px);
}

.market-strip div {
  min-height: 72px;
  padding: 12px;
  position: relative;
  overflow: hidden;
}

.market-strip div:first-child {
  border-color: rgba(37,242,157,.28);
  background:
    linear-gradient(180deg, rgba(37,242,157,.09), rgba(255,255,255,.02)),
    var(--panel);
}

.market-strip div::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(94,214,255,.8), transparent);
  opacity: .42;
}

.market-strip span,
.account-row span,
.position-grid span,
label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.market-strip strong {
  display: block;
  margin-top: 5px;
  font-size: clamp(17px, 1.65vw, 24px);
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.grid {
  display: block;
}

.chart-panel {
  overflow: hidden;
  min-width: 0;
  position: relative;
  border-color: rgba(94,214,255,.18);
  box-shadow: 0 26px 90px rgba(0,0,0,.42), 0 0 0 1px rgba(37,242,157,.07);
}

.chart-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(37,242,157,.06), transparent 34%, rgba(255,69,104,.045));
  z-index: 1;
}

.chart-panel > * {
  position: relative;
  z-index: 2;
}

.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.chart-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.chart-head strong {
  display: block;
  margin-top: 2px;
  font-size: 20px;
}

.chart-tools {
  display: none;
}

canvas {
  display: block;
  width: 100%;
  height: min(52vh, 560px);
  min-height: 390px;
  background: radial-gradient(circle at 50% 0%, rgba(94,214,255,.08), transparent 36%), #05070d;
}

.chart-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  padding: 9px 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.trade-panel {
  display: grid;
  grid-template-columns: minmax(260px, .85fr) minmax(360px, 1.15fr);
  gap: 10px;
  align-items: start;
  margin-top: 10px;
}

.card {
  padding: 14px;
}

.controls {
  border-color: rgba(37,242,157,.2);
}

.account,
.leaderboard-card,
.feed {
  display: none;
}

.account-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.account-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.account-row strong {
  font-size: 18px;
}

.position-card h2 {
  font-size: 24px;
  line-height: 1;
  margin: 0;
  overflow-wrap: anywhere;
}

.position-card {
  border-color: rgba(255,255,255,.14);
}

.position-topline {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.position-topline > div {
  min-width: 0;
}

.position-topline > span {
  flex: 0 0 auto;
  max-width: 44%;
  border: 1px solid rgba(255,207,51,.28);
  border-radius: 999px;
  background: rgba(255,207,51,.08);
  color: var(--yellow);
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 950;
  line-height: 1.1;
  text-transform: uppercase;
  text-align: right;
}

.position-card.longish h2,
.positive {
  color: var(--green);
}

.position-card.shortish h2,
.negative {
  color: var(--red);
}

.position-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.position-grid div:nth-child(3),
.position-grid div:nth-child(4),
.position-grid div:nth-child(7),
.position-grid div:nth-child(8),
.position-grid div:nth-child(9),
.position-grid div:nth-child(10) {
  display: none;
}

.position-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
  padding: 10px;
}

.position-grid strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.wide {
  width: 100%;
}

.risk-meter {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
  padding: 10px;
  margin-bottom: 12px;
}

.risk-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.risk-head span,
.control-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.risk-head strong {
  font-size: 12px;
}

.risk-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #070a10;
}

.risk-track i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--yellow), var(--red));
  transition: width .18s ease;
}

.exit-zone {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, .8fr);
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255,207,51,.22);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255,207,51,.11), rgba(255,63,127,.06)),
    rgba(255,255,255,.035);
  padding: 10px;
}

.exit-zone span,
.exit-zone strong {
  display: block;
}

.exit-zone span {
  color: var(--yellow);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.exit-zone strong {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.exit-zone button {
  border-color: rgba(255,248,240,.36);
  background: linear-gradient(180deg, rgba(255,207,51,.26), rgba(255,63,127,.16));
  color: var(--text);
}

.controls {
  display: grid;
  gap: 10px;
}

.quick-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.control-note {
  display: none;
}

label b {
  float: right;
  color: var(--text);
}

.input-line {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0,0,0,.3);
  overflow: hidden;
}

.input-line.compact {
  grid-template-columns: 1fr 68px;
  margin-bottom: 10px;
}

.input-line input {
  border: 0;
  min-height: 42px;
  background: transparent;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

.input-line span {
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.derived-size {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(94,214,255,.22);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(94,214,255,.11), rgba(37,242,157,.05)),
    rgba(94,214,255,.05);
  padding: 10px 12px;
}

.derived-size span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.derived-size strong {
  color: var(--cyan);
  font-size: 20px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--green);
}

@media (pointer: coarse) {
  input,
  select,
  button {
    min-height: 46px;
  }

  input[type="range"] {
    min-height: 34px;
  }
}

.trade-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.feed-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.tape {
  display: grid;
  gap: 7px;
  max-height: 230px;
  overflow: auto;
}

.fill {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
  color: var(--muted);
  font-size: 12px;
}

.fill b {
  color: var(--text);
}

.fill.long b:first-child {
  color: var(--green);
}

.fill.short b:first-child {
  color: var(--red);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(520px, calc(100% - 24px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 14, 22, .96);
  color: var(--text);
  padding: 14px 16px;
  box-shadow: 0 20px 70px rgba(0,0,0,.5);
  font-weight: 850;
  text-align: center;
}

.mobile-trade-bar {
  display: none;
}

.mobile-close {
  background: linear-gradient(180deg, #ffe76b, #ff9d33);
  color: #180b03;
}

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at 50% 18%, rgba(37,242,157,.24), transparent 24rem),
    radial-gradient(circle at 82% 82%, rgba(255,69,104,.16), transparent 28rem),
    #03050a;
}

.boot-screen.hidden {
  display: none;
}

.boot-card {
  width: min(560px, 100%);
  border: 1px solid rgba(37,242,157,.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.015)),
    rgba(6, 10, 18, .94);
  box-shadow: 0 34px 120px rgba(0,0,0,.72), 0 0 0 1px rgba(94,214,255,.08);
  padding: clamp(20px, 5vw, 34px);
}

.boot-card h2 {
  font-size: clamp(42px, 10vw, 78px);
  line-height: .9;
  overflow-wrap: anywhere;
}

.boot-card p:last-of-type {
  min-height: 22px;
  margin-top: 14px;
  color: var(--muted);
  font-weight: 850;
}

.boot-meter {
  height: 10px;
  margin-top: 24px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
}

.boot-meter i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--cyan), var(--yellow));
  box-shadow: 0 0 24px rgba(37,242,157,.4);
  transition: width .28s ease;
}

.boot-card button {
  width: 100%;
  margin-top: 22px;
  min-height: 54px;
  background: linear-gradient(90deg, var(--green), var(--cyan));
}

.start-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 28px);
  background:
    radial-gradient(circle at 14% 16%, rgba(56,232,255,.2), transparent 28rem),
    radial-gradient(circle at 80% 18%, rgba(255,92,244,.2), transparent 28rem),
    radial-gradient(circle at 50% 94%, rgba(255,207,51,.12), transparent 26rem),
    rgba(7, 4, 13, .86);
  backdrop-filter: blur(14px);
}

.start-overlay.hidden {
  display: none;
}

.start-panel {
  width: min(820px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  background:
    radial-gradient(circle at 15% 0%, rgba(255,92,244,.2), transparent 22rem),
    radial-gradient(circle at 90% 10%, rgba(56,232,255,.14), transparent 24rem),
    linear-gradient(145deg, rgba(29,14,40,.98), rgba(8,4,14,.98));
  box-shadow: 0 34px 120px rgba(0,0,0,.66), 0 0 80px rgba(255,92,244,.08), inset 0 1px 0 rgba(255,255,255,.07);
  padding: clamp(18px, 4vw, 34px);
}

.start-copy h2 {
  margin: 0;
  max-width: 11ch;
  font-size: clamp(46px, 7vw, 86px);
  line-height: .88;
  overflow-wrap: anywhere;
  color: var(--text);
  text-shadow: 0 0 34px rgba(255,92,244,.18);
}

.start-copy p:last-child {
  display: block;
  max-width: 58ch;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 850;
}

.lobby-badges {
  display: none;
}

.lobby-badges span {
  min-height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(37,242,157,.18);
  border-radius: 999px;
  background: rgba(37,242,157,.06);
  color: var(--text);
  padding: 0 11px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.music-toggle {
  position: absolute;
  top: clamp(14px, 3vw, 28px);
  right: clamp(14px, 3vw, 28px);
  min-height: 36px;
  padding: 0 12px;
  font-size: 11px;
  text-transform: uppercase;
}

.setup-brief {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.setup-brief div {
  min-height: 84px;
  border: 1px solid rgba(94,214,255,.16);
  border-radius: 8px;
  background:
    radial-gradient(circle at 12% 0%, rgba(37,242,157,.12), transparent 60%),
    linear-gradient(180deg, rgba(94,214,255,.08), rgba(255,255,255,.025)),
    rgba(255,255,255,.035);
  padding: 12px;
}

.setup-brief b {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 950;
}

.setup-brief span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 750;
}

.setup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(170px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.setup-grid label {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.022)),
    rgba(255,255,255,.035);
  padding: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.auth-card {
  grid-column: 1 / -1;
  border: 1px solid rgba(255,92,244,.32);
  border-radius: 8px;
  background:
    radial-gradient(circle at 12% 0%, rgba(255,207,51,.16), transparent 58%),
    linear-gradient(135deg, rgba(255,92,244,.16), rgba(56,232,255,.08)),
    rgba(255,255,255,.045);
  padding: 14px;
  display: grid;
  gap: 8px;
  box-shadow: 0 0 42px rgba(255,92,244,.12), inset 0 1px 0 rgba(255,255,255,.08);
}

.auth-card::before {
  content: "Guest mode is already armed";
  width: fit-content;
  max-width: 100%;
  border: 1px solid rgba(37,242,157,.28);
  border-radius: 999px;
  background: rgba(37,242,157,.08);
  color: var(--green);
  padding: 5px 9px;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.auth-card b {
  color: var(--text);
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
}

.auth-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
}

.auth-card div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.auth-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.auth-card .auth-fields input {
  min-height: 38px;
}

.auth-actions button:last-child {
  background: linear-gradient(90deg, var(--purple), var(--yellow));
  color: #140518;
  box-shadow: 0 0 30px rgba(255,92,244,.22), inset 0 1px 0 rgba(255,255,255,.32);
}

.setup-grid input[type="number"],
.setup-grid input[type="text"],
.setup-grid input[type="password"] {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #080d15;
  color: var(--text);
  padding: 0 12px;
  font: inherit;
  font-weight: 800;
}

.unlock-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.unlock-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 10px;
}

.unlock-head span {
  color: var(--green);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.unlock-head strong {
  color: var(--muted);
  font-size: 12px;
}

.unlock-chip {
  min-height: 76px;
  border: 1px solid rgba(94,214,255,.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(94,214,255,.085), rgba(255,255,255,.026)),
    rgba(255,255,255,.035);
  padding: 10px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045);
}

.unlock-chip::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--green), var(--cyan));
  opacity: .8;
}

.unlock-chip.locked {
  border-color: rgba(255,255,255,.08);
  background: rgba(255,255,255,.024);
  opacity: .62;
}

.unlock-chip.locked::before {
  background: linear-gradient(180deg, rgba(137,149,167,.5), rgba(137,149,167,.12));
}

.unlock-chip b,
.unlock-chip span,
.unlock-chip small {
  display: block;
}

.unlock-chip b {
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.unlock-chip span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
}

.unlock-chip small {
  margin-top: 6px;
  color: var(--green);
  font-size: 11px;
  font-weight: 950;
  line-height: 1.25;
}

.setup-grid span {
  display: block;
  margin-top: 5px;
  color: var(--cyan);
  font-size: 14px;
  font-weight: 900;
}

.start-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin: 0 calc(clamp(18px, 4vw, 34px) * -1) calc(clamp(18px, 4vw, 34px) * -1);
  padding: 12px clamp(18px, 4vw, 34px) clamp(18px, 4vw, 34px);
  border-top: 1px solid rgba(255,255,255,.1);
  background: linear-gradient(180deg, rgba(6,9,15,0), rgba(6,9,15,.96) 18%, rgba(6,9,15,.98));
}

.start-actions button {
  min-height: 52px;
  font-size: 15px;
}

.start-actions button:first-child {
  background: linear-gradient(90deg, var(--green), var(--cyan));
  color: #031018;
}

.start-actions button:first-child:disabled {
  background: rgba(255,255,255,.07);
  color: rgba(246,248,252,.52);
  border-color: rgba(255,255,255,.1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

.result-panel {
  max-width: 720px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 22px 0 18px;
}

.result-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.04);
  padding: 14px;
}

.result-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.result-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

@media (max-width: 1080px) {
  .top {
    align-items: center;
    flex-direction: row;
  }

  .top-actions {
    width: auto;
    justify-content: flex-end;
  }

  .market-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .trade-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

.feed {
    grid-column: 1 / -1;
  }
}

.leaderboard-card {
  display: grid;
  gap: 10px;
}

.feed {
  max-height: 220px;
  overflow: hidden;
}

.leaderboard {
  display: grid;
  gap: 7px;
}

.leader-row {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
}

.leader-row b {
  color: var(--text);
}

.leader-row strong {
  color: var(--green);
}

.market-strip,
.account,
.leaderboard-card,
.feed {
  display: none !important;
}

@media (max-width: 900px) {
  .top-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 7px;
  }

  #signOutBtn,
  #newCoinBtn,
  #resetBtn {
    display: none;
  }

  .profile-pill {
    width: 100%;
    min-height: 48px;
    padding: 8px 10px;
  }

  .market-strip {
    display: flex;
    gap: 8px;
    margin: 0 -8px 8px;
    padding: 0 8px 4px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .market-strip::-webkit-scrollbar {
    display: none;
  }

  .market-strip div {
    flex: 0 0 124px;
    min-height: 54px;
    padding: 8px 9px;
  }

  .grid,
  .trade-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  canvas {
    height: min(52vh, 390px);
    min-height: 330px;
  }

  .account {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-row:nth-child(n+3),
  .position-grid div:nth-child(3),
  .position-grid div:nth-child(4),
  .position-grid div:nth-child(7),
  .position-grid div:nth-child(8),
  .position-grid div:nth-child(9),
  .position-grid div:nth-child(10),
  .feed,
  .controls .trade-buttons,
  .control-note {
    display: none;
  }
}

@media (max-width: 740px) {
  html,
  body {
    min-height: 100%;
  }

  body {
    background:
      radial-gradient(circle at 50% -10%, rgba(37,242,157,.22), transparent 23rem),
      radial-gradient(circle at 90% 22%, rgba(94,214,255,.12), transparent 20rem),
      var(--bg);
  }

  .terminal {
    padding: 8px 8px 88px;
  }

  .top {
    align-items: center;
    gap: 10px;
    padding: 6px 0 8px;
    border-bottom: 0;
  }

  .brand {
    align-items: center;
    gap: 12px;
  }

  .coin-mark {
    width: 36px;
    height: 36px;
    font-size: 20px;
    flex: 0 0 auto;
  }

  h1 {
    max-width: none;
    font-size: 22px;
    line-height: .96;
  }

  .sub {
    display: none;
  }

  .eyebrow {
    font-size: 9px;
    margin-bottom: 3px;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 7px;
  }

  .profile-pill {
    display: none;
  }

  #signOutBtn,
  #newCoinBtn,
  #resetBtn {
    display: none;
  }

  .top-actions button {
    min-height: 38px;
    padding: 0 12px;
    font-size: 11px;
    line-height: 1.05;
    white-space: normal;
  }

  .market-strip {
    display: flex;
    gap: 8px;
    margin: 0 -8px 8px;
    padding: 0 8px 4px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .market-strip::-webkit-scrollbar {
    display: none;
  }

  .market-strip div {
    flex: 0 0 124px;
    min-height: 54px;
    padding: 8px 9px;
    scroll-snap-align: start;
  }

  .market-strip span {
    font-size: 10px;
  }

  .market-strip strong {
    margin-top: 3px;
    font-size: 17px;
    line-height: 1.12;
  }

  .grid,
  .trade-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .chart-panel {
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,.45);
  }

  .chart-head {
    gap: 8px;
    padding: 9px 10px;
  }

  .chart-head strong {
    font-size: 17px;
  }

  .chart-tools {
    flex: 0 0 auto;
  }

  canvas {
    height: min(52vh, 390px);
    min-height: 330px;
  }

  .chart-footer {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    min-height: 40px;
    padding: 9px 10px;
    font-size: 12px;
    line-height: 1.25;
  }

  .controls {
    order: 1;
    padding: 13px;
    box-shadow: 0 18px 70px rgba(0,0,0,.62), 0 0 0 1px rgba(94,214,255,.08);
  }

  .position-card {
    order: 2;
  }

  .account {
    order: 3;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .account-row:nth-child(n+3) {
    display: none;
  }

  .account-row {
    display: block;
    min-height: 62px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255,255,255,.03);
    padding: 9px;
  }

  .account-row strong {
    display: block;
    margin-top: 4px;
    font-size: 16px;
    overflow-wrap: anywhere;
  }

  .leaderboard-card {
    order: 4;
  }

  .feed {
    order: 5;
    display: none;
  }

  .card {
    padding: 11px;
  }

  .position-card h2 {
    font-size: 30px;
  }

  .position-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .position-grid div:nth-child(3),
  .position-grid div:nth-child(4),
  .position-grid div:nth-child(7),
  .position-grid div:nth-child(8),
  .position-grid div:nth-child(9),
  .position-grid div:nth-child(10) {
    display: none;
  }

  .position-grid div {
    min-height: 58px;
    padding: 8px;
  }

  .position-grid span,
  .account-row span,
  label,
  .derived-size span,
  .risk-head span,
  .control-note {
    font-size: 10px;
  }

  .position-grid strong {
    font-size: 13px;
    overflow-wrap: anywhere;
  }

  .input-line input {
    min-height: 46px;
    font-size: 16px;
  }

  .quick-buttons,
  .trade-buttons {
    gap: 7px;
  }

  .trade-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .controls .trade-buttons {
    display: none;
  }

  .control-note {
    display: none;
  }

  .trade-buttons button {
    min-height: 56px;
    font-size: 17px;
  }

  body:not(.setup-open) .mobile-trade-bar {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 16;
    display: grid;
    grid-template-columns: minmax(78px, .78fr) 1fr 1fr .8fr;
    gap: 7px;
    align-items: center;
    padding: 8px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 8px;
    background:
      linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.025)),
      rgba(5, 8, 14, .95);
    box-shadow: 0 18px 70px rgba(0,0,0,.72);
    backdrop-filter: blur(16px);
  }

  .mobile-trade-bar div {
    min-width: 0;
  }

  .mobile-trade-bar span,
  .mobile-trade-bar strong {
    display: block;
  }

  .mobile-trade-bar span {
    color: var(--muted);
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1.1;
  }

  .mobile-trade-bar strong {
    margin-top: 3px;
    color: var(--cyan);
    font-size: 13px;
    line-height: 1.1;
    overflow-wrap: anywhere;
  }

  .mobile-trade-bar button {
    min-height: 54px;
    padding: 0 10px;
    font-size: 15px;
  }

  .derived-size {
    padding: 9px 10px;
  }

  .derived-size strong {
    font-size: 18px;
  }

  .setup-grid,
  .setup-brief,
  .start-actions,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .start-panel {
    max-height: calc(100dvh - 16px);
    padding: 16px;
    border-color: rgba(94,214,255,.2);
  }

  .start-actions {
    margin: 0 -16px -16px;
    padding: 10px 16px 16px;
  }

  .start-copy h2 {
    max-width: none;
    font-size: 40px;
    line-height: .9;
  }

  .start-copy p:last-child {
    font-size: 13px;
    line-height: 1.4;
  }

  .setup-brief {
    display: none;
  }

  .lobby-badges {
    display: none;
  }

  .lobby-badges span {
    min-height: 28px;
    padding: 0 9px;
    font-size: 10px;
  }

  .music-toggle {
    position: static;
    width: 100%;
    margin-top: 12px;
  }

  .setup-brief div {
    min-height: auto;
    padding: 10px;
  }

  .setup-grid {
    gap: 8px;
    margin: 16px 0 12px;
  }

  .auth-fields,
  .auth-card div {
    grid-template-columns: 1fr;
  }

  .auth-card {
    gap: 7px;
    padding: 11px;
  }

  .setup-grid label {
    padding: 10px;
  }

  .setup-grid input[type="number"],
  .setup-grid input[type="text"],
  .setup-grid input[type="password"],
  select {
    min-height: 46px;
    font-size: 16px;
  }

  .unlock-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 12px;
  }

  .unlock-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .unlock-chip {
    min-height: 66px;
    padding: 8px 8px 8px 10px;
  }

  .unlock-chip span {
    font-size: 10px;
  }

  .result-grid strong {
    font-size: 19px;
  }
}

@media (max-width: 460px) {
  .brand {
    align-items: flex-start;
  }

  .coin-mark {
    width: 42px;
    height: 42px;
    font-size: 23px;
  }

  h1 {
    font-size: 25px;
  }

  .sub {
    font-size: 12px;
  }

  .top-actions {
    gap: 6px;
  }

  .chart-head,
  .chart-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .chart-tools {
    width: 100%;
  }

  .chart-tools button {
    flex: 1;
  }

  .position-grid,
  .account {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  canvas {
    height: min(52vh, 390px);
    min-height: 330px;
  }

  .fill {
    grid-template-columns: 42px 1fr;
  }

  .fill > span:last-child {
    grid-column: 2;
  }
}

@media (max-width: 380px) {
  .terminal {
    padding-inline: 6px;
  }

  h1 {
    font-size: 23px;
  }

  .market-strip {
    margin-inline: -6px;
    padding-inline: 6px;
  }

  .market-strip div {
    flex-basis: 118px;
  }

  .position-grid,
  .account,
  .unlock-list {
    grid-template-columns: 1fr;
  }

  body:not(.setup-open) .mobile-trade-bar {
    left: 6px;
    right: 6px;
    grid-template-columns: 78px 1fr 1fr;
  }
}

/* Arcade game shell overrides */
body:not(.setup-open):not(.booting) .top {
  display: none;
}

body:not(.setup-open):not(.booting) .terminal {
  width: min(980px, 100%);
  min-height: 100dvh;
  display: grid;
  align-content: center;
  padding: clamp(8px, 2vw, 18px);
}

body:not(.setup-open):not(.booting) .grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

body:not(.setup-open):not(.booting) .chart-panel {
  min-height: min(62dvh, 640px);
  border: 4px solid #fff8f0;
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 12%, rgba(255,207,51,.18), transparent 30%),
    linear-gradient(180deg, #19102c, #090414 72%);
  box-shadow:
    0 26px 0 #16071e,
    0 34px 80px rgba(0,0,0,.65),
    0 0 0 8px rgba(255,92,244,.18);
}

body:not(.setup-open):not(.booting) .chart-panel::before {
  background:
    linear-gradient(rgba(255,255,255,.035) 2px, transparent 2px),
    linear-gradient(90deg, rgba(255,255,255,.025) 2px, transparent 2px);
  background-size: 36px 36px;
  opacity: .9;
}

body:not(.setup-open):not(.booting) .chart-head,
body:not(.setup-open):not(.booting) .chart-footer {
  display: none;
}

body:not(.setup-open):not(.booting) canvas {
  height: min(55dvh, 560px);
  min-height: 360px;
  background: transparent;
}

.arcade-hud,
.run-hud {
  position: absolute;
  z-index: 6;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.arcade-hud {
  inset: 12px 12px auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.run-hud {
  inset: auto 18px 96px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.arcade-hud div,
.run-hud div {
  min-height: 58px;
  border: 3px solid rgba(255,248,240,.92);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(30,17,42,.94), rgba(10,4,18,.94));
  box-shadow: 0 6px 0 rgba(0,0,0,.38), inset 0 1px 0 rgba(255,255,255,.14);
  padding: 8px 10px;
  min-width: 0;
}

.arcade-hud span,
.arena-callout span,
.run-hud span {
  display: block;
  color: var(--yellow);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.arcade-hud strong,
.run-hud strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: clamp(15px, 2.6vw, 26px);
  line-height: 1;
  text-shadow: 0 2px 0 rgba(0,0,0,.5);
  overflow-wrap: anywhere;
}

.run-hud div {
  min-height: 46px;
  border-width: 2px;
  border-color: rgba(255,207,51,.62);
  background: linear-gradient(180deg, rgba(44,18,51,.88), rgba(10,4,18,.88));
  box-shadow: 0 5px 0 rgba(0,0,0,.34);
}

.run-hud span {
  font-size: 8px;
}

.run-hud strong {
  font-size: clamp(11px, 1.8vw, 16px);
}

.arcade-hud strong.warn {
  color: var(--yellow);
}

.arcade-hud strong.danger {
  color: var(--red);
  animation: arcadeDanger .45s steps(2) infinite;
}

@keyframes arcadeDanger {
  50% { transform: translateY(1px); filter: brightness(1.5); }
}

.arena-callout {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 6;
  min-height: 64px;
  border: 3px solid rgba(255,248,240,.92);
  border-radius: 18px;
  background: linear-gradient(90deg, rgba(255,92,244,.92), rgba(56,232,255,.9));
  color: #13051a;
  padding: 10px 14px;
  box-shadow: 0 8px 0 rgba(0,0,0,.36);
  pointer-events: none;
}

.arena-callout span {
  color: #13051a;
}

.arena-callout strong {
  display: block;
  margin-top: 2px;
  font-size: clamp(20px, 4vw, 34px);
  line-height: .95;
  text-transform: uppercase;
}

body:not(.setup-open):not(.booting) .trade-panel {
  display: grid;
  grid-template-columns: minmax(250px, .9fr) minmax(360px, 1.1fr);
  align-items: stretch;
  margin-top: 18px;
}

body:not(.setup-open):not(.booting) .position-card,
body:not(.setup-open):not(.booting) .controls {
  border: 4px solid #fff8f0;
  border-radius: 22px;
  background: linear-gradient(180deg, #27113c, #10071b);
  box-shadow: 0 12px 0 rgba(0,0,0,.45);
}

body:not(.setup-open):not(.booting) .position-card {
  display: grid;
  gap: 10px;
  padding: 14px;
}

body:not(.setup-open):not(.booting) .controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  align-items: end;
  padding: 14px;
}

body:not(.setup-open):not(.booting) .position-topline {
  margin-bottom: 0;
}

body:not(.setup-open):not(.booting) .position-card h2 {
  font-size: clamp(28px, 4vw, 46px);
  text-transform: uppercase;
  text-shadow: 0 3px 0 rgba(0,0,0,.42);
}

body:not(.setup-open):not(.booting) .position-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 0;
}

body:not(.setup-open):not(.booting) .position-grid div:nth-child(3),
body:not(.setup-open):not(.booting) .position-grid div:nth-child(4),
body:not(.setup-open):not(.booting) .position-grid div:nth-child(5),
body:not(.setup-open):not(.booting) .position-grid div:nth-child(6),
body:not(.setup-open):not(.booting) .position-grid div:nth-child(11) {
  display: block;
}

body:not(.setup-open):not(.booting) .position-grid div:nth-child(7),
body:not(.setup-open):not(.booting) .position-grid div:nth-child(8),
body:not(.setup-open):not(.booting) .position-grid div:nth-child(9),
body:not(.setup-open):not(.booting) .position-grid div:nth-child(10) {
  display: none;
}

body:not(.setup-open):not(.booting) .position-grid div {
  min-height: 56px;
  border-width: 2px;
  border-color: rgba(255,248,240,.24);
  background: rgba(255,255,255,.045);
}

body:not(.setup-open):not(.booting) .position-grid span,
body:not(.setup-open):not(.booting) .risk-head span {
  color: var(--yellow);
  font-size: 10px;
}

body:not(.setup-open):not(.booting) .position-grid strong {
  font-size: 14px;
}

body:not(.setup-open):not(.booting) .risk-meter {
  margin-bottom: 0;
  border-width: 2px;
  border-color: rgba(255,248,240,.24);
}

body:not(.setup-open):not(.booting) .exit-zone {
  border-width: 2px;
  border-color: rgba(255,248,240,.52);
}

body:not(.setup-open):not(.booting) .exit-zone button {
  min-height: 58px;
  border: 3px solid rgba(255,248,240,.94);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe76b, #ff9d33);
  color: #1d0902;
  text-transform: uppercase;
  box-shadow: 0 8px 0 rgba(0,0,0,.38), inset 0 2px 0 rgba(255,255,255,.42);
}

body:not(.setup-open):not(.booting) .controls label,
body:not(.setup-open):not(.booting) .derived-size span {
  color: var(--yellow);
  font-size: 11px;
}

body:not(.setup-open):not(.booting) .controls .input-line,
body:not(.setup-open):not(.booting) .quick-buttons,
body:not(.setup-open):not(.booting) .derived-size {
  grid-column: 1;
}

body:not(.setup-open):not(.booting) .trade-buttons {
  grid-row: 1 / span 5;
  grid-column: 2;
  align-self: stretch;
  display: grid;
  gap: 10px;
}

body:not(.setup-open):not(.booting) .trade-buttons button {
  min-height: 86px;
  border: 4px solid rgba(255,248,240,.95);
  border-radius: 999px;
  font-size: clamp(20px, 3.4vw, 34px);
  text-transform: uppercase;
  box-shadow: 0 10px 0 rgba(0,0,0,.42), inset 0 2px 0 rgba(255,255,255,.4);
}

body:not(.setup-open):not(.booting) .mobile-trade-bar {
  display: none;
}

body:not(.setup-open):not(.booting) .toast {
  bottom: 18px;
  border: 3px solid var(--text);
  border-radius: 16px;
  background: rgba(16, 8, 24, .96);
}

@media (max-width: 740px) {
  body:not(.setup-open):not(.booting) .terminal {
    align-content: start;
    padding: 8px 8px 128px;
  }

  body:not(.setup-open):not(.booting) .chart-panel {
    min-height: 55dvh;
    border-width: 3px;
    border-radius: 18px;
  }

  body:not(.setup-open):not(.booting) canvas {
    height: 49dvh;
    min-height: 300px;
  }

  .arcade-hud,
  .run-hud {
    inset: 8px 8px auto;
    gap: 5px;
  }

  .arcade-hud {
    grid-template-columns: repeat(3, 1fr);
  }

  .run-hud {
    inset: auto 10px 82px;
    grid-template-columns: repeat(3, 1fr);
  }

  .arcade-hud div,
  .run-hud div {
    min-height: 50px;
    border-width: 2px;
    border-radius: 12px;
    padding: 7px;
  }

  .arcade-hud span,
  .run-hud span {
    font-size: 8px;
  }

  .arcade-hud strong {
    font-size: 16px;
  }

  .run-hud div {
    min-height: 42px;
  }

  .run-hud strong {
    font-size: 10px;
  }

  .arena-callout {
    left: 10px;
    right: 10px;
    bottom: 10px;
    min-height: 58px;
    border-width: 2px;
    border-radius: 14px;
  }

  .arena-callout strong {
    font-size: 20px;
  }

  body:not(.setup-open):not(.booting) .trade-panel {
    grid-template-columns: 1fr;
    margin-top: 10px;
  }

  body:not(.setup-open):not(.booting) .position-card {
    border-width: 3px;
    border-radius: 18px;
    padding: 11px;
    order: 2;
  }

  body:not(.setup-open):not(.booting) .controls {
    grid-template-columns: 1fr;
    border-width: 3px;
    border-radius: 18px;
    gap: 8px;
    order: 1;
  }

  body:not(.setup-open):not(.booting) .position-card h2 {
    font-size: 26px;
  }

  .position-topline > span {
    max-width: 42%;
    font-size: 9px;
  }

  body:not(.setup-open):not(.booting) .position-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  body:not(.setup-open):not(.booting) .position-grid div:nth-child(3),
  body:not(.setup-open):not(.booting) .position-grid div:nth-child(4),
  body:not(.setup-open):not(.booting) .position-grid div:nth-child(6) {
    display: none;
  }

  .exit-zone {
    grid-template-columns: 1fr;
  }

  body:not(.setup-open):not(.booting) .trade-buttons {
    display: none;
  }

  body:not(.setup-open):not(.booting) .mobile-trade-bar {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 30;
    display: grid;
    grid-template-columns: minmax(70px, .72fr) 1fr 1fr .78fr;
    gap: 6px;
    align-items: center;
    border: 3px solid #fff8f0;
    border-radius: 18px;
    background: linear-gradient(180deg, #27113c, #10071b);
    box-shadow: 0 10px 0 rgba(0,0,0,.42), 0 20px 70px rgba(0,0,0,.7);
    padding: 8px;
  }

  body:not(.setup-open):not(.booting) .mobile-trade-bar button {
    min-height: 64px;
    font-size: 16px;
    border-width: 3px;
    border-color: #fff8f0;
    border-radius: 999px;
    text-transform: uppercase;
  }

  body:not(.setup-open):not(.booting) .mobile-trade-bar span {
    color: var(--yellow);
    font-size: 8px;
    font-weight: 950;
  }

  body:not(.setup-open):not(.booting) .mobile-trade-bar strong {
    color: var(--cyan);
    font-size: 12px;
  }
}

@media (max-width: 560px) {
  .run-hud {
    display: none;
  }

  body:not(.setup-open):not(.booting) .chart-panel {
    min-height: 50dvh;
  }

  body:not(.setup-open):not(.booting) canvas {
    height: 45dvh;
    min-height: 270px;
  }
}
