/* Arena Pit v3 — dark premium, ledger palette */
:root {
  --bg: #0f1219;
  --bg-deep: #0a0d14;
  --panel: #1a2030;
  --panel-2: #151b28;
  --border: #2a3348;
  --text: #e8ecf4;
  --muted: #8b95a8;
  --accent: #6c9eff;
  --good: #5ddea8;
  --warn: #f0c14a;
  --danger: #ff6b8a;
  --gold: #f0c14a;
  --gold-2: #ffe9a0;
  --you: #7eb6ff;
  --house: #9b8ec4;
  --radius: 12px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

html,
body {
  height: 100%;
}

body {
  font-family: var(--font);
  background:
    radial-gradient(ellipse at 50% -10%, #1c2438 0%, transparent 50%),
    radial-gradient(ellipse at 50% 110%, #1a1620 0%, var(--bg-deep) 55%);
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: manipulation;
}

body.ceremony-on {
  background:
    radial-gradient(ellipse at 50% 40%, rgba(240, 193, 74, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 50% -10%, #1c2438 0%, transparent 50%),
    var(--bg-deep);
}

body.win-flash {
  background:
    radial-gradient(ellipse at 50% 40%, rgba(240, 193, 74, 0.32) 0%, transparent 55%),
    var(--bg-deep);
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 0.85rem 0.75rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.brand h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.tag {
  font-size: 0.68rem;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
}

.nav {
  display: flex;
  gap: 0.65rem;
  font-size: 0.82rem;
}

.nav a {
  color: var(--accent);
  text-decoration: none;
}

.nav a:hover {
  text-decoration: underline;
}

.nav a.active {
  color: var(--text);
  font-weight: 600;
}

.wallet {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.45rem;
}

.wallet:has(.last:not([hidden])) {
  grid-template-columns: 1fr 1fr 1.2fr;
}

.wallet-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.08rem;
  min-width: 0;
}

.wallet-cell .label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.wallet-cell strong {
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.wallet-cell.last strong {
  font-size: 0.78rem;
  color: var(--gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.wallet-cell.flash strong {
  animation: numflash 0.45s ease;
}

.wallet.shake {
  animation: shake 0.4s ease;
}

@keyframes numflash {
  0% { color: var(--gold-2); transform: scale(1.15); }
  100% { color: inherit; transform: scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.screen[hidden] {
  display: none !important;
}

.hero {
  text-align: center;
  padding: 0.35rem 0.2rem 0.15rem;
}

.kicker {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.35rem;
}

.hero h2 {
  font-size: 1.7rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

.lede {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.pit-cards {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 0.35rem;
}

.pit-card {
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.05rem 0.95rem;
  color: inherit;
  cursor: pointer;
  font: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.pit-card:hover {
  border-color: var(--accent);
}

.pit-card.featured {
  background:
    linear-gradient(180deg, #222a3e 0%, var(--panel) 70%);
  border-color: #3d4d72;
  padding: 1.15rem 1.1rem 1.05rem;
}

.pit-card.gem {
  border-color: #5a4a20;
  background: linear-gradient(180deg, #241e14 0%, var(--panel) 72%);
}

.pit-card.ad {
  opacity: 0.95;
}

.pit-card .pc-kicker {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.pit-card.featured .pc-kicker { color: var(--accent); }
.pit-card.gem .pc-kicker { color: var(--gold); }

.pit-card h3 {
  font-size: 1.2rem;
  font-weight: 750;
}

.pit-card .pc-blurb {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.35;
}

.pit-card .pc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.35rem 0 0.5rem;
}

.chip {
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  padding: 0.16rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
}

.chip.gold {
  border-color: #5a4a20;
  color: var(--gold);
  background: #2a2414;
}

.chip.mock {
  border-color: #4a3a58;
  color: var(--house);
}

.pit-card .pc-cta {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0a0d14;
  background: var(--accent);
  border-radius: 9px;
  padding: 0.5rem 0.7rem;
  text-align: center;
  margin-top: 0.15rem;
}

.pit-card.gem .pc-cta {
  background: var(--gold);
}

.pit-card.ad .pc-cta {
  background: #7a6ea0;
}

.foot-link {
  text-align: center;
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.foot-link a,
.linkish {
  color: var(--accent);
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}

.foot-link a:hover,
.linkish:hover {
  text-decoration: underline;
}

.pit-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.6rem;
}

.pit-head h2 {
  font-size: 1.2rem;
}

.pit-entry {
  color: var(--muted);
  font-size: 0.78rem;
}

.odds {
  font-size: 0.78rem;
  color: var(--you);
  font-weight: 650;
  text-align: right;
}

.coliseum {
  --r: 132px;
  position: relative;
  width: min(360px, 92vw);
  aspect-ratio: 1;
  margin: 0.15rem auto 0.1rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #141a26 0%, #0c1018 62%, #080a10 100%);
  border: 1px solid #2e3850;
  box-shadow:
    0 0 0 6px rgba(20, 26, 38, 0.8),
    0 16px 40px rgba(0, 0, 0, 0.45),
    inset 0 0 48px rgba(0, 0, 0, 0.35);
  overflow: visible;
}

.coliseum::before {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  border: 1px dashed rgba(108, 158, 255, 0.12);
  pointer-events: none;
}

#fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.ring {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.seat {
  --ang: 0deg;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  transform: rotate(var(--ang)) translateY(calc(-1 * var(--r))) rotate(calc(-1 * var(--ang)));
  border-radius: 50%;
  border: 1.5px solid #2a3348;
  background: #121722;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.seat-num {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1;
}

.seat-who {
  font-size: 0.52rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5a6478;
  line-height: 1.2;
}

.seat.empty {
  border-style: dashed;
  border-color: #3d4a66;
  background: #141a26;
}

.seat.empty .seat-who {
  font-size: 0.7rem;
}

.seat.you {
  border-color: var(--you);
  background: #152036;
  box-shadow: 0 0 16px rgba(126, 182, 255, 0.35);
}

.seat.you .seat-num { color: var(--you); }
.seat.you .seat-who { color: var(--you); }

.seat.house {
  border-color: #6a5e88;
  background: #1c1828;
}

.seat.house .seat-num { color: var(--house); }
.seat.house .seat-who { color: var(--house); }

.seat.last-empty {
  border-color: var(--danger);
  animation: lastpulse 0.85s ease-in-out infinite;
}

.seat.lit {
  transform: rotate(var(--ang)) translateY(calc(-1 * var(--r))) rotate(calc(-1 * var(--ang))) scale(1.16);
  border-color: var(--gold);
  box-shadow: 0 0 22px rgba(240, 193, 74, 0.55);
  z-index: 3;
}

.seat.lit .seat-num { color: var(--gold-2); }

.seat.lit.you {
  box-shadow: 0 0 28px rgba(126, 182, 255, 0.75), 0 0 16px rgba(240, 193, 74, 0.45);
  animation: yousting 0.28s ease;
}

.seat.winner {
  border-color: var(--gold);
  background: #3a2e14;
  box-shadow: 0 0 36px rgba(240, 193, 74, 0.85);
  transform: rotate(var(--ang)) translateY(calc(-1 * var(--r))) rotate(calc(-1 * var(--ang))) scale(1.22);
  z-index: 4;
}

.seat.winner .seat-num,
.seat.winner .seat-who {
  color: var(--gold-2);
}

.seat.near {
  box-shadow: 0 0 18px rgba(255, 107, 138, 0.55);
  border-color: var(--danger);
}

@keyframes lastpulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 138, 0.15); }
  50% { box-shadow: 0 0 14px 2px rgba(255, 107, 138, 0.35); }
}

@keyframes yousting {
  0% { filter: brightness(1.6); }
  100% { filter: brightness(1); }
}

.pointer {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  transform: rotate(var(--rot, 0deg));
  z-index: 5;
  pointer-events: none;
}

.pointer .arm {
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 4px;
  height: calc(var(--r) - 18px);
  margin-left: -2px;
  background: linear-gradient(to top, rgba(240, 193, 74, 0.05), var(--gold) 55%, var(--gold-2));
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(240, 193, 74, 0.55);
}

.pointer .head {
  position: absolute;
  left: 50%;
  bottom: calc(var(--r) - 16px);
  width: 0;
  height: 0;
  margin-left: -7px;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 12px solid var(--gold-2);
  filter: drop-shadow(0 0 8px var(--gold));
}

.pot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 128px;
  height: 128px;
  margin: -64px 0 0 -64px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #4a3a1c, #1a140c 70%);
  border: 2px solid #c9a24a;
  box-shadow:
    0 0 36px rgba(240, 193, 74, 0.28),
    inset 0 0 22px rgba(240, 193, 74, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 4;
  text-align: center;
}

.pot.pulse {
  animation: potpulse 1.1s ease-in-out infinite;
}

.pot.slam {
  animation: potslam 0.55s ease;
}

@keyframes potpulse {
  0%, 100% { box-shadow: 0 0 28px rgba(240, 193, 74, 0.25), inset 0 0 22px rgba(240, 193, 74, 0.1); }
  50% { box-shadow: 0 0 48px rgba(240, 193, 74, 0.5), inset 0 0 28px rgba(240, 193, 74, 0.2); }
}

@keyframes potslam {
  0% { transform: scale(0.86); }
  60% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.pot-label {
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  color: var(--gold);
  font-weight: 700;
}

.pot-amt {
  font-size: 1.7rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--gold-2);
  line-height: 1.1;
}

.pot-asset {
  font-size: 0.68rem;
  color: #c4b48a;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.fill-block {
  text-align: center;
}

.fill-count {
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.fill-count strong {
  font-size: 2.4rem;
  font-weight: 800;
}

.fill-count .slash {
  font-size: 1.4rem;
  color: var(--muted);
  margin: 0 0.15rem;
}

.fill-count strong:last-child {
  font-size: 1.35rem;
  color: var(--muted);
}

.fill-bar {
  height: 8px;
  border-radius: 999px;
  background: #151b28;
  border: 1px solid var(--border);
  overflow: hidden;
  margin: 0 auto 0.5rem;
  max-width: 280px;
}

.fill-bar-in {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transition: width 0.22s ease;
}

.fill-copy {
  font-size: 0.95rem;
  font-weight: 650;
  min-height: 1.3em;
}

.fill-copy.urgent {
  color: var(--danger);
  letter-spacing: 0.04em;
}

.fill-copy.almost {
  color: var(--gold);
}

.your-tickets {
  margin-top: 0.3rem;
  font-size: 0.82rem;
  color: var(--you);
  font-weight: 650;
  min-height: 1.2em;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

button.primary,
.primary {
  font: inherit;
  font-weight: 750;
  font-size: 1rem;
  padding: 0.72rem 1.2rem;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #0a0d14;
  cursor: pointer;
  width: 100%;
}

button.primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

button.primary:disabled,
.ghost:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ghost {
  font: inherit;
  font-weight: 650;
  font-size: 0.92rem;
  padding: 0.62rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--house);
  cursor: pointer;
  width: 100%;
}

.ghost:hover:not(:disabled) {
  border-color: var(--house);
}

button.text {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.4rem;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

button.text:hover {
  color: var(--text);
}

.ceremony-chrome,
.results-chrome {
  text-align: center;
}

.ceremony-chrome[hidden],
.results-chrome[hidden],
.fill-block[hidden],
.actions[hidden],
.overlay[hidden],
.coin-rain[hidden],
.wallet-cell[hidden] {
  display: none !important;
}

.cer-kicker,
.res-kicker {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.25rem;
}

.cer-title {
  font-size: 2.4rem;
  letter-spacing: 0.12em;
  font-weight: 850;
  animation: titleslam 0.5s ease;
}

.cer-sub {
  margin-top: 0.25rem;
  font-size: 1.05rem;
  color: var(--gold-2);
  min-height: 1.4em;
  font-weight: 650;
}

.cer-sub.yours {
  color: var(--you);
  text-shadow: 0 0 12px rgba(126, 182, 255, 0.45);
}

@keyframes titleslam {
  0% { transform: scale(0.7); opacity: 0; letter-spacing: 0.4em; }
  100% { transform: scale(1); opacity: 1; letter-spacing: 0.12em; }
}

.results-chrome h2 {
  font-size: 2rem;
  margin: 0.1rem 0;
}

.results-chrome h2.win {
  color: var(--gold-2);
}

.results-chrome h2.loss {
  color: var(--house);
}

.res-ticket {
  font-family: var(--mono);
  font-size: 1.35rem;
  color: var(--gold);
  font-weight: 700;
}

.res-copy {
  margin: 0.45rem 0 0.85rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.res-copy.sting {
  color: var(--danger);
}

.res-copy.win {
  color: var(--good);
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(8, 10, 16, 0.82);
  z-index: 30;
}

.card.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.4rem 1.3rem;
  width: min(320px, 100%);
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.ad-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: var(--house);
}

.ad-title {
  font-size: 1.3rem;
  font-weight: 750;
  margin: 0.3rem 0 0.8rem;
}

.ad-bar {
  height: 8px;
  border-radius: 99px;
  background: #121722;
  overflow: hidden;
  border: 1px solid var(--border);
}

.ad-bar-in {
  height: 100%;
  width: 0;
  background: var(--house);
  animation: adfill 1.35s linear forwards;
}

@keyframes adfill {
  to { width: 100%; }
}

.ad-sub {
  margin-top: 0.65rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.coin-rain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 25;
  overflow: hidden;
}

.coin-rain span {
  position: absolute;
  top: -12px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
  animation: fall 1.6s linear forwards;
}

@keyframes fall {
  to { transform: translateY(110vh) rotate(220deg); opacity: 0.15; }
}

@media (max-width: 400px) {
  .seat {
    width: 48px;
    height: 48px;
    margin: -24px 0 0 -24px;
  }
  .pot {
    width: 112px;
    height: 112px;
    margin: -56px 0 0 -56px;
  }
  .pot-amt { font-size: 1.45rem; }
  .fill-count strong { font-size: 2rem; }
  .cer-title { font-size: 2rem; }
}

@media (max-height: 700px) {
  .coliseum { width: min(300px, 84vw); }
  .fill-count strong { font-size: 1.8rem; }
  .hero h2 { font-size: 1.4rem; }
  .app { padding-bottom: 0.8rem; }
}

/* ---------- no-scroll pass (ns1): every pit screen fits 390x844 and 1280x800 ---------- */
.app { min-height: 0; height: 100vh; height: 100dvh; padding-bottom: 0.6rem; gap: 0.5rem; }
#screenLobby .hero { padding: 0; }
#screenLobby .kicker { margin-bottom: 0.15rem; }
#screenLobby .hero h2 { font-size: 1.45rem; margin-bottom: 0.2rem; }
#screenLobby .lede { font-size: 0.84rem; line-height: 1.3; }
#screenLobby .pit-cards { gap: 0.5rem; margin-top: 0.4rem; }
#screenLobby .pit-card, #screenLobby .pit-card.featured { padding: 0.7rem 0.9rem 0.7rem; gap: 0.18rem; }
#screenLobby .pit-card .pc-blurb { font-size: 0.8rem; line-height: 1.25; }
#screenLobby .pit-card .pc-meta { margin: 0.2rem 0 0.3rem; }
#screenLobby .foot-link { margin-top: 0.3rem; }
@media (min-width: 900px) {
  .app { max-width: 980px; }
  #screenLobby .pit-cards { flex-direction: row; align-items: stretch; }
  #screenLobby .pit-card { flex: 1; }
  #screenLobby .pit-card .pc-cta { margin-top: auto; }
}
