:root {
  --bg: #08110e;
  --ink: #f6f1e6;
  --muted: #b7c3b8;
  --gold: #f0c14d;
  --coral: #ff5d3a;
  --surface: rgba(16, 36, 28, 0.94);
  --line: rgba(246, 241, 230, 0.12);
  --paper: #f3ead7;
  --ink-2: #1c1915;
  --good: #b6ffcf;
  --danger: #ffb0a1;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
  font-family: Outfit, "Noto Sans Ethiopic", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 50% -10%, rgba(240, 193, 77, 0.18), transparent 60%),
    #050a08;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.boot {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
}
.boot b { font-size: 42px; letter-spacing: 0.18em; }
.boot span, .boot p { color: var(--muted); }
.boot a.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  padding: 0 22px;
  text-decoration: none;
}

.shell {
  width: min(440px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  position: relative;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(88px + env(safe-area-inset-bottom));
  background:
    radial-gradient(420px 220px at 100% 0%, rgba(61, 222, 196, 0.08), transparent 60%),
    linear-gradient(180deg, rgba(240, 193, 77, 0.06), transparent 220px),
    var(--bg);
  box-shadow: 0 0 0 1px rgba(240, 193, 77, 0.08);
}
.shell::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: linear-gradient(rgba(246, 241, 230, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(246, 241, 230, 0.04) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, #000, transparent 70%);
}
.shell.has-dock { padding-bottom: calc(156px + env(safe-area-inset-bottom)); }

.top, main, .dock, .nav, .sheet, .modal { position: relative; z-index: 1; }
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.brand { display: flex; gap: 10px; align-items: center; margin-right: auto; }
.brand strong { display: block; letter-spacing: 0.16em; font-size: 18px; }
.brand em { font-style: normal; color: var(--gold); font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase; }
.mark { width: 36px; height: 36px; display: block; }
.tools { display: flex; gap: 8px; }
.tools button, .pager button, .ghost, .seg button, .switch button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 999px;
  min-width: 42px;
  height: 36px;
  padding: 0 12px;
}
.ribbon {
  width: 100%;
  background: var(--gold);
  color: var(--ink-2);
  border-radius: 999px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
}

.ticket, .hero, .panel, .paper, .modal, .sheet, .watch {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.ticket { padding: 16px; margin-bottom: 14px; }
.balance-chip {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 10px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  text-align: left;
}
.balance-chip span { color: var(--muted); }
.balance-chip b { color: var(--gold); font-size: 22px; font-variant-numeric: tabular-nums; }
.hero p { margin: 4px 0; }
.ticket-kicker { color: var(--muted); font-size: 14px; }
.ticket-main { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 6px 0 12px; }
.ticket-main strong { font-size: 30px; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: rgba(255, 255, 255, 0.06); }
.bar i { display: block; height: 100%; flex: 0 0 0; min-width: 0; }
.bar .cash { background: var(--gold); }
.bar .dep { background: #3ddec4; }
.bar .bon { background: var(--coral); }
.splits { display: grid; gap: 6px; margin-top: 12px; }
.splits div, .list li { display: flex; align-items: center; gap: 8px; }
.splits span { color: var(--muted); flex: 1; }
.splits b, .list b { font-variant-numeric: tabular-nums; }
.splits i, .list i { width: 8px; height: 8px; border-radius: 99px; display: block; }
.cash { background: var(--gold); }
.dep { background: #3ddec4; }
.bon { background: var(--coral); }
.hold { background: #d7d1c5; }

.hero { padding: 16px; margin-bottom: 14px; }
.hero-top, .section-head, .sheet-head, .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pill, .chips span, .chips button, .switch button {
  border-radius: 999px;
  background: rgba(240, 193, 77, 0.12);
  color: var(--gold);
  padding: 4px 10px;
  font-size: 13px;
}
.clock { text-align: right; }
.clock small, .prize small, .muted, .hint { color: var(--muted); }
.clock b { display: block; font-size: 28px; font-variant-numeric: tabular-nums; }
.prize strong { display: block; font-size: 34px; color: var(--gold); font-variant-numeric: tabular-nums; }
.prize.compact strong { font-size: 22px; }
.center { text-align: center; }
p { line-height: 1.45; }
h2, h3 { margin: 0 0 8px; }
.security { background: rgba(61, 222, 196, 0.08); border-radius: 16px; padding: 12px 14px; }
.link, .link-panel { background: none; border: 0; color: var(--gold); padding: 0; text-align: left; }
.link-panel { width: 100%; display: flex; justify-content: space-between; margin-top: 10px; }
.seated, .last { margin-top: 10px; }
.seated { display: grid; gap: 4px; padding-top: 8px; border-top: 1px solid var(--line); }
.seated button { justify-self: start; background: none; border: 0; color: var(--danger); padding: 0; }
.last { color: var(--muted); font-size: 14px; }

.section-head { margin: 8px 0; }
.finder { margin: 0 0 8px; }
.finder input {
  width: 100%;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
  padding: 0 12px;
  font-size: 16px;
}
.picker-scroll { max-height: 52dvh; overflow: auto; padding-right: 2px; }
.picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.num {
  aspect-ratio: 1;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.num.taken { opacity: 0.35; text-decoration: line-through; }
.num.mine { border-color: var(--gold); color: var(--gold); }
.num.sel { background: var(--coral); border-color: transparent; color: white; }
.pager { display: grid; grid-template-columns: 44px 1fr 44px; gap: 8px; margin-top: 12px; }
.pager input, .field input {
  width: 100%;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
  padding: 0 12px;
  font-size: 16px;
}
.field { display: grid; gap: 6px; margin: 10px 0; color: var(--muted); font-size: 13px; }

.primary, .bingo {
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #ff7a4a, var(--coral));
  color: white;
  font-weight: 700;
  min-height: 48px;
  padding: 0 16px;
}
.primary:disabled, .bingo:disabled {
  background: #24362c;
  color: #8ea194;
}
.ghost { color: var(--ink); }

.dock, .nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(440px, 100%);
  z-index: 5;
}
.dock {
  bottom: calc(72px + env(safe-area-inset-bottom));
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 0 16px;
}
.dock-copy { flex: 1; display: grid; }
.dock-copy span, .dock-copy .seg { font-size: 13px; color: var(--muted); }
.dock .primary, .dock .bingo { min-width: 128px; }
.play-call { width: 100%; }
.play-call .bingo { width: 100%; min-height: 56px; letter-spacing: 0.14em; font-size: 22px; }
.bingo.ready { box-shadow: 0 10px 30px rgba(255, 93, 58, 0.35); animation: glow 1.1s ease-in-out infinite; }
.rooms { display: grid; gap: 8px; margin: 12px 0 2px; }
.rooms p { margin: 0; color: var(--muted); font-size: 13px; }
.rooms button {
  border: 0;
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
  font-weight: 700;
  background: #143028;
  color: #f6f1e4;
}
.rooms button.on { background: var(--gold); color: #1a1406; }
.rooms button:disabled { opacity: 0.38; }
.wallet-tab { margin-bottom: 14px; }
.list.games small { display: block; color: var(--muted); }
.list .plus { color: #d7b15a; }
.seg { display: flex; padding: 3px; border-radius: 999px; background: rgba(0, 0, 0, 0.25); }
.seg button { border: 0; background: transparent; color: var(--muted); }
.seg button.on { background: var(--gold); color: var(--ink-2); }
.seg.slim { margin-top: 4px; }

.nav {
  bottom: 0;
  height: calc(64px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(8, 17, 14, 0.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.nav button { border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; gap: 2px; font-size: 11px; }
.nav button.on { color: var(--gold); }
.nav svg { width: 20px; height: 20px; }

.pot { text-align: center; display: grid; gap: 2px; }
.pot small { letter-spacing: 0.12em; text-transform: uppercase; font-size: 11px; }
.pot strong { font-size: 36px; line-height: 1.05; color: var(--gold); font-variant-numeric: tabular-nums; }
.pot span { font-size: 13px; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.facts div {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px 4px 7px;
  text-align: center;
  min-width: 0;
}
.facts small { display: block; color: var(--muted); font-size: 10px; line-height: 1.2; }
.facts b { display: block; margin-top: 2px; font-size: 14px; font-variant-numeric: tabular-nums; }
.theater { display: grid; justify-items: center; gap: 10px; }
.theater .hero-top, .theater .meter, .theater .recent, .theater .paper-wrap, .theater .stage-row, .theater .pot, .theater .facts { width: 100%; }
.stage-row { display: grid; grid-template-columns: 108px 1fr; gap: 12px; align-items: center; }
.stage-meta { display: grid; gap: 4px; min-width: 0; }
.stage-meta .next { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.stage-meta .prize strong { font-size: 20px; }
.stage { display: grid; place-items: center; }
.ball {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  color: white;
  box-shadow: inset 0 -14px 18px rgba(0, 0, 0, 0.25), inset 0 10px 16px rgba(255, 255, 255, 0.35), 0 16px 40px rgba(0, 0, 0, 0.35);
}
.ball small { position: absolute; top: 16px; letter-spacing: 0.16em; font-size: 11px; }
.ball b { font-size: 40px; line-height: 1; }
.ball.empty { background: #16241d; color: var(--muted); box-shadow: none; }
.ball.LB, .mini.LB, .cell.on.LB { background: radial-gradient(circle at 35% 30%, #9ebcff, #2f6fed 58%, #1d4ed8); }
.ball.LI, .mini.LI, .cell.on.LI { background: radial-gradient(circle at 35% 30%, #ffc1c1, #ef4444 58%, #b91c1c); }
.ball.LN, .mini.LN, .cell.on.LN { background: radial-gradient(circle at 35% 30%, #ffe7a3, #e0ac2b 58%, #a9782a); color: var(--ink-2); }
.ball.LG, .mini.LG, .cell.on.LG { background: radial-gradient(circle at 35% 30%, #b6f5c8, #22c55e 58%, #15803d); }
.ball.LO, .mini.LO, .cell.on.LO { background: radial-gradient(circle at 35% 30%, #e7ccff, #a855f7 58%, #7e22ce); }
.next b { font-size: 22px; font-variant-numeric: tabular-nums; }
.meter { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--gold); }
.recent { display: flex; gap: 6px; justify-content: flex-start; flex-wrap: wrap; min-height: 32px; }
.mini {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: white; position: relative;
}
.mini small { display: none; }
.mini.LN { color: var(--ink-2); }

.paper-wrap { display: grid; gap: 8px; }
.paper { background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent 28%), var(--paper); color: var(--ink-2); padding: 12px; }
.paper-head { display: flex; justify-content: space-between; align-items: center; }
.cells { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 8px; align-items: center; }
.row-letter { font-weight: 800; font-size: 15px; text-align: center; letter-spacing: 0.04em; }
.col-letter { font-size: 17px; padding-bottom: 2px; }
.row-letter.LB { color: #2f6fed; }
.row-letter.LI { color: #dc2626; }
.row-letter.LN { color: #a9782a; }
.row-letter.LG { color: #15803d; }
.row-letter.LO { color: #7e22ce; }
.mini-paper { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 8px; }
.cell {
  aspect-ratio: 1;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.55);
  font-weight: 700;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.cell.on { color: white; }
.cell.on.LN, .cell.free { color: var(--ink-2); }
.cell.free { background: var(--gold); font-size: 11px; letter-spacing: 0.04em; }
.cell.win { box-shadow: inset 0 0 0 2px var(--ink-2); }
.cell.hot { outline: 2px dashed #c47d12; animation: pulse 1.1s ease-in-out infinite; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips span { background: rgba(255, 255, 255, 0.04); color: var(--muted); }
.chips span.on { background: rgba(240, 193, 77, 0.18); color: var(--gold); }
.switch { display: flex; gap: 8px; }
.switch button.on { border-color: var(--gold); color: var(--gold); }
.switch button.hot { background: var(--coral); color: white; border-color: transparent; }
.claim-note { text-align: center; color: var(--gold); }
.watch { padding: 18px; text-align: center; }
.names { margin: 8px 0 0; line-height: 1.5; }

.panel { padding: 14px; margin: 12px 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips button { border: 0; min-height: 40px; }

.list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.list li {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 14px;
  padding: 10px 12px;
}
.list li div { display: grid; flex: 1; }
.list small { color: var(--muted); }
.list .plus { color: var(--good); }
.list .minus { color: var(--danger); }
.list .you { outline: 1px solid rgba(240, 193, 77, 0.4); }
.ledger li span { flex: 1; }

.steps { list-style: none; padding: 0; display: grid; gap: 12px; }
.steps li { display: flex; gap: 12px; }
.steps b {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold); color: var(--ink-2); flex: none;
}
.steps p { margin: 4px 0 0; color: var(--muted); }

.invite { display: grid; gap: 8px; }
.code {
  font-size: 28px;
  letter-spacing: 0.18em;
  text-align: center;
  padding: 16px;
  border-radius: 18px;
  border: 1px dashed rgba(240, 193, 77, 0.5);
}
.link-line { word-break: break-all; color: var(--muted); font-size: 14px; }
.row .primary, .row .ghost { flex: 1; }

.backdrop, .modal-back {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 8, 0.72);
  z-index: 20;
}
.sheet {
  position: fixed;
  z-index: 21;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(440px, 100%);
  padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.sheet-head button { border: 0; background: transparent; font-size: 28px; line-height: 1; }
.mini-paper { background: var(--paper); color: var(--ink-2); border-radius: 16px; padding: 10px; }
.mini-paper i { font-style: normal; aspect-ratio: 1; display: grid; place-items: center; background: rgba(255, 255, 255, 0.6); border-radius: 8px; font-weight: 700; }

.modal-back { z-index: 30; display: grid; place-items: center; padding: 18px; }
.modal { width: min(400px, 100%); padding: 18px; max-height: min(86dvh, 720px); overflow: auto; }
.modal .primary { width: 100%; }
.lang-list { display: grid; gap: 8px; margin-top: 12px; }
.lang-list button {
  width: 100%;
  height: 48px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  text-align: left;
  padding: 0 16px;
  font-weight: 700;
}
.lang-list button.on { border-color: var(--gold); color: var(--gold); }
.eyebrow { color: var(--gold); letter-spacing: 0.14em; text-transform: uppercase; font-size: 12px; }
.win-amount { display: block; font-size: 40px; margin: 0 0 8px; }
.hash { word-break: break-all; font-size: 12px; color: var(--muted); }
.good { color: var(--good); }
.bad { color: var(--danger); }
details summary { cursor: pointer; margin: 8px 0; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(148px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 40;
  background: var(--ink);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 10px 14px;
  max-width: min(380px, calc(100% - 32px));
  text-align: center;
}

.confetti { position: relative; height: 0; }
.confetti i {
  position: absolute;
  top: 0;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: fall 900ms ease-out forwards;
}
.confetti i:nth-child(odd) { background: var(--gold); }
.confetti i:nth-child(even) { background: var(--coral); }
.confetti i:nth-child(3n) { background: #3ddec4; }
.confetti i:nth-child(1) { left: 8%; }
.confetti i:nth-child(2) { left: 18%; animation-delay: .05s; }
.confetti i:nth-child(3) { left: 28%; }
.confetti i:nth-child(4) { left: 40%; animation-delay: .1s; }
.confetti i:nth-child(5) { left: 52%; }
.confetti i:nth-child(6) { left: 63%; animation-delay: .08s; }
.confetti i:nth-child(7) { left: 74%; }
.confetti i:nth-child(8) { left: 84%; animation-delay: .12s; }
.confetti i:nth-child(9) { left: 12%; animation-delay: .04s; }
.confetti i:nth-child(10) { left: 48%; }
.confetti i:nth-child(11) { left: 70%; animation-delay: .07s; }
.confetti i:nth-child(12) { left: 90%; }

@keyframes pop { from { transform: scale(.7) translateY(-12px); opacity: .2; } to { transform: none; opacity: 1; } }
@keyframes glow { 50% { transform: translateY(-1px) scale(1.02); } }
@keyframes pulse { 50% { transform: scale(.96); } }
@keyframes shake {
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}
@keyframes fall { to { transform: translateY(46px) rotate(40deg); opacity: 0; } }
.shake { animation: shake .4s ease; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
