:root {
  --bg: #1a0a18;
  --ink: #fff6e8;
  --muted: #d7b8c8;
  --gold: #ffd56a;
  --pink: #ff3d7f;
  --cyan: #3ef0ff;
  --ok: #7dffb3;
  --you: #ffd56a;
  --qiang: #ff7a4d;
  --mei: #ff7ad9;
  --zhou: #6ce0ff;
  --thumb-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #080308;
  color: var(--ink);
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

#app {
  position: relative;
  width: min(100%, 430px);
  height: 100dvh;
  margin: 0 auto;
  background:
    radial-gradient(120% 70% at 50% 110%, #3a1020 0%, transparent 50%),
    linear-gradient(180deg, #2a1024 0%, var(--bg) 42%, #0c040a 100%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.spot {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  filter: blur(46px);
  pointer-events: none;
  opacity: 0.42;
}
.spot-a { top: -50px; left: -30px; background: #ffb020; }
.spot-b { top: 8%; right: -50px; background: #ff2d7a; }
.spot-c { bottom: 18%; left: 20%; background: #5a2cff; opacity: 0.28; }

.hud {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 6px;
  gap: 8px;
}

.hud-cell { text-align: center; }
.hud-cell:first-child { text-align: left; }
.hud-cell:last-child { text-align: right; }
.hud-k {
  display: block;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.hud-cell span:last-child {
  font-variant-numeric: tabular-nums;
  font-size: 20px;
  font-weight: 800;
  color: var(--gold);
}
.hud-title h1 {
  font-size: 18px;
  letter-spacing: 0.16em;
  text-shadow: 0 0 18px rgba(255, 213, 106, 0.45);
}
.hud-title p {
  font-size: 11px;
  color: var(--pink);
  letter-spacing: 0.18em;
}

.board {
  position: relative;
  z-index: 4;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 0 12px 8px;
}
.board li {
  background: rgba(255, 246, 232, 0.06);
  border: 1px solid rgba(255, 213, 106, 0.18);
  border-radius: 12px;
  padding: 6px 4px 7px;
  text-align: center;
}
.board .who {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.board .pts {
  font-variant-numeric: tabular-nums;
  font-size: 16px;
  font-weight: 800;
}
.board li.lead { box-shadow: 0 0 0 1px var(--gold); }
.board [data-who="you"] .pts { color: var(--you); }
.board [data-who="qiang"] .pts { color: var(--qiang); }
.board [data-who="mei"] .pts { color: var(--mei); }
.board [data-who="zhou"] .pts { color: var(--zhou); }

#stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 16px 10px;
  gap: 10px;
}
.screen[hidden] { display: none; }

.plaque {
  width: 100%;
  background: rgba(12, 4, 10, 0.55);
  border: 1px solid rgba(255, 213, 106, 0.28);
  border-radius: 20px;
  padding: 18px 16px 16px;
  box-shadow: inset 0 0 40px rgba(255, 61, 127, 0.08);
}

.neon {
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.42em;
  color: var(--gold);
  margin-bottom: 10px;
  text-shadow: 0 0 12px rgba(255, 213, 106, 0.7);
}

.lead {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  margin-bottom: 10px;
}

.rules {
  list-style: none;
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}
.rules li {
  font-size: 13px;
  color: var(--muted);
  padding-left: 16px;
  position: relative;
}
.rules li::before {
  content: "◆";
  position: absolute;
  left: 0;
  color: var(--gold);
  font-size: 10px;
  top: 3px;
}

.best-line {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.best-line strong { color: var(--gold); }

.product-card {
  width: 100%;
  text-align: center;
  background: linear-gradient(180deg, rgba(255, 246, 232, 0.08), rgba(255, 61, 127, 0.06));
  border: 1px solid rgba(255, 213, 106, 0.24);
  border-radius: 22px;
  padding: 12px 12px 14px;
  position: relative;
}
.product-card.bundle-mode { padding-bottom: 10px; }

.tag {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 11px;
  letter-spacing: 0.08em;
  background: var(--pink);
  color: #fff;
  border-radius: 999px;
  padding: 3px 8px;
}

.art {
  font-size: 64px;
  line-height: 1;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.35));
  margin: 8px 0 6px;
}
.product-card.bundle-mode .art { font-size: 40px; margin: 2px 0 4px; }

.product-card h2 {
  font-size: 24px;
  letter-spacing: 0.06em;
}
.hint {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.bundle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
}
.bundle[hidden] { display: none; }
.bundle .mini {
  background: rgba(8, 3, 8, 0.35);
  border-radius: 12px;
  padding: 6px 4px;
  font-size: 12px;
}
.bundle .mini .e { display: block; font-size: 22px; }

.host {
  font-size: 14px;
  color: var(--gold);
  text-align: center;
  min-height: 1.4em;
}

.price-readout {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 42px;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(255, 213, 106, 0.35);
  letter-spacing: 0.04em;
}
.yen { font-size: 0.55em; color: var(--muted); }

.reveal-k {
  font-size: 12px;
  letter-spacing: 0.28em;
  color: var(--muted);
}
.reveal-price {
  font-size: 48px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
  line-height: 1;
}
.reveal-tag {
  font-size: 18px;
  font-weight: 800;
  color: var(--ok);
}
.reveal-tag.miss { color: var(--pink); }
.reveal-tag.exact { color: var(--gold); }

.bids {
  list-style: none;
  width: 100%;
  display: grid;
  gap: 6px;
}
.bids li {
  display: flex;
  justify-content: space-between;
  background: rgba(255, 246, 232, 0.06);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 14px;
}
.bids .bid-name { color: var(--muted); }
.bids .winner { box-shadow: 0 0 0 1px var(--gold); }

.round-score {
  font-size: 14px;
  color: var(--muted);
}
.round-score strong { color: var(--gold); }

.final-board {
  list-style: none;
  display: grid;
  gap: 8px;
  margin: 8px 0 12px;
}
.final-board li {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 246, 232, 0.06);
}
.final-board li.you { box-shadow: 0 0 0 1px var(--gold); }

.dock {
  position: relative;
  z-index: 6;
  padding: 6px 12px calc(10px + var(--safe-b));
  background: linear-gradient(180deg, transparent, rgba(8, 3, 8, 0.7) 18%, #0c040a);
}
.dock[hidden] { display: none; }

.pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 8px;
}
.pad[hidden] { display: none; }
.pad button {
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 246, 232, 0.1);
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
}
.pad button:active { transform: scale(0.97); background: rgba(255, 213, 106, 0.22); }
.pad-alt { font-size: 15px !important; color: var(--muted) !important; }

.hint-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.hint-row[hidden] { display: none; }

.thumb {
  width: 100%;
  height: var(--thumb-h);
  border: 0;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffd56a, #ff9a2e);
  color: #3a1608;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.12em;
  box-shadow: 0 8px 20px rgba(255, 154, 46, 0.28);
}
.thumb:active { transform: scale(0.98); }
.thumb[hidden] { display: none; }
.thumb.ghost {
  background: rgba(255, 246, 232, 0.1);
  color: var(--ink);
  box-shadow: none;
  letter-spacing: 0.08em;
}

@media (max-height: 700px) {
  .art { font-size: 48px; }
  .product-card h2 { font-size: 20px; }
  .price-readout { font-size: 34px; }
  .pad button { height: 42px; }
  .thumb { height: 56px; font-size: 18px; }
}
