:root {
  color-scheme: dark;
  --ink: #fff6df;
  --muted: rgba(255, 246, 223, 0.64);
  --dim: rgba(255, 246, 223, 0.42);
  --panel: rgba(18, 14, 8, 0.72);
  --panel-strong: rgba(12, 10, 7, 0.9);
  --line: rgba(255, 214, 115, 0.18);
  --gold: #f4c950;
  --hot: #ff6b35;
  --acid: #d7ff59;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: #080704;
  color: var(--ink);
}

button, input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 28% 16%, rgba(255, 196, 53, 0.24), transparent 28%),
    radial-gradient(circle at 76% 82%, rgba(255, 93, 43, 0.18), transparent 30%),
    linear-gradient(140deg, #080704 0%, #151009 48%, #050403 100%);
}

.app-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 50%, black, transparent 82%);
  z-index: 2;
}

#game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
  touch-action: none;
}

.brand-lockup,
.top-stats,
.play-hud,
.sponsor-console,
.bid-sheet {
  position: absolute;
  z-index: 5;
}

.brand-lockup {
  left: clamp(18px, 3vw, 44px);
  top: clamp(16px, 3vw, 34px);
}

.wordmark {
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.08em;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 5.2vw, 76px);
  font-weight: 900;
  line-height: 0.88;
  text-shadow: 0 10px 40px rgba(0,0,0,.55);
}

.wordmark span {
  color: var(--gold);
  font-size: 0.5em;
  letter-spacing: -0.03em;
}

.brand-lockup p {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 750;
}

.top-stats {
  top: clamp(18px, 3vw, 38px);
  right: clamp(18px, 3vw, 42px);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: min(680px, calc(100vw - 360px));
}

.top-stats span,
.console-card,
.play-hud,
.bid-card {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow);
}

.top-stats span {
  padding: 9px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.top-stats strong {
  color: var(--ink);
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 15px;
}

.play-hud {
  left: clamp(18px, 3vw, 44px);
  bottom: clamp(18px, 4vw, 44px);
  width: min(330px, calc(100vw - 36px));
  padding: 18px;
  border-radius: 28px;
}

.micro-label {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.play-hud strong {
  display: block;
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 56px;
  line-height: 0.86;
  letter-spacing: -0.08em;
}

.play-hud span,
.game-prompt,
.intro-card p,
.active-card p,
.form-note {
  color: var(--muted);
}

.power-meter {
  height: 7px;
  margin: 18px 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  overflow: hidden;
}

.power-meter span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--hot), var(--acid));
  transition: width 80ms linear;
}

.game-prompt {
  margin: 0;
  font-size: 14px;
}

.sponsor-console {
  right: clamp(16px, 2.8vw, 36px);
  bottom: clamp(16px, 2.8vw, 34px);
  width: min(390px, calc(100vw - 32px));
  display: grid;
  gap: 12px;
}

.console-card {
  border-radius: 28px;
  padding: 18px;
}

.intro-card h1,
.bid-card h2 {
  margin: 0 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 33px;
  line-height: 0.94;
  letter-spacing: -0.06em;
}

.intro-card p,
.active-card p,
.form-note {
  margin: 0 0 14px;
  line-height: 1.45;
}

.primary-button,
.ghost-button,
.board-heading button {
  border: 0;
  border-radius: 999px;
  font-weight: 900;
}

.primary-button {
  width: 100%;
  padding: 14px 18px;
  color: #180f03;
  background: linear-gradient(135deg, var(--gold), var(--hot));
  box-shadow: 0 18px 38px rgba(255, 112, 46, .25);
}

.ghost-button,
.board-heading button {
  padding: 10px 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255,255,255,.12);
}

.ghost-button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.active-card h2 {
  margin: 0 0 4px;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.active-card dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0;
}

.active-card div {
  min-width: 0;
}

.active-card dt {
  color: var(--dim);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.active-card dd {
  margin: 3px 0 0;
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 15px;
  font-weight: 850;
}

.board-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.platform-list {
  list-style: none;
  display: grid;
  gap: 8px;
  max-height: 190px;
  margin: 0;
  padding: 0;
  overflow: auto;
}

.platform-list li {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px;
  border-radius: 17px;
  background: rgba(255,255,255,.055);
}

.platform-list img,
.platform-list .fallback-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #201a10;
}

.fallback-icon {
  display: grid;
  place-items: center;
  color: var(--gold);
  font-weight: 900;
}

.platform-list strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.platform-list small {
  color: var(--muted);
  font-size: 12px;
}

.platform-list em {
  color: var(--gold);
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.bid-sheet {
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 2, 1, .62);
}

.bid-sheet[hidden] {
  display: none;
}

.bid-card {
  position: relative;
  width: min(460px, 100%);
  padding: 24px;
  border-radius: 34px;
  background: var(--panel-strong);
}

.sheet-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255,255,255,.08);
  font-size: 23px;
  line-height: 1;
}

.bid-card label {
  display: grid;
  gap: 7px;
  margin: 13px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.bid-card input {
  width: 100%;
  border: 1px solid rgba(255, 214, 115, .22);
  border-radius: 17px;
  padding: 13px 14px;
  color: var(--ink);
  background: rgba(255,255,255,.07);
  outline: none;
}

.bid-card input:focus {
  border-color: rgba(244, 201, 80, .74);
  box-shadow: 0 0 0 4px rgba(244, 201, 80, .12);
}

.bid-preview {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  align-items: center;
  margin: 18px 0 12px;
  padding: 12px;
  border: 1px solid rgba(244, 201, 80, .2);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(244,201,80,.16), rgba(255,107,53,.08));
}

.bid-preview span {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #1b1103;
  background: var(--gold);
  font-weight: 950;
  font-size: 24px;
}

.bid-preview strong,
.bid-preview small {
  display: block;
}

.bid-preview small {
  color: var(--muted);
}

@media (max-width: 900px) {
  .top-stats {
    left: 18px;
    right: 18px;
    top: 90px;
    max-width: none;
    justify-content: flex-start;
  }

  .sponsor-console {
    left: 14px;
    right: 14px;
    bottom: 14px;
    width: auto;
    grid-template-columns: 1fr;
  }

  .intro-card {
    display: none;
  }

  .platform-list {
    max-height: 128px;
  }

  .play-hud {
    bottom: 258px;
  }
}
