:root {
  color-scheme: dark;
  --ink: #f6fffd;
  --muted: #a9c5c1;
  --bg: #061615;
  --panel: #0c2926;
  --panel-2: #123c36;
  --cyan: #00d9c2;
  --mint: #94ffe9;
  --red: #ff4c55;
  --orange: #ff9e3f;
  --yellow: #ffe66a;
  --line: rgba(192,255,244,.14);
  --shadow: 0 25px 75px rgba(0,0,0,.48);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; margin: 0; background: #020c0b; }
body { color: var(--ink); overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; }
button { touch-action: manipulation; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
[hidden] { display: none !important; }
.app-shell { position: relative; width: 100%; min-height: 100dvh; overflow: hidden; background: radial-gradient(circle at 88% 2%, rgba(0,217,194,.18), transparent 28%), radial-gradient(circle at 2% 90%, rgba(255,76,85,.14), transparent 30%), linear-gradient(155deg, #0a2421 0%, #061615 55%, #0d1d19 100%); }
.screen { display: none; min-height: 100dvh; padding: max(17px, env(safe-area-inset-top)) 16px max(19px, env(safe-area-inset-bottom)); }
.screen--active { display: flex; flex-direction: column; animation: screen-in .2s ease-out both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } }

.home { position: relative; justify-content: center; align-items: center; padding-inline: 23px; text-align: center; }
.sound-rings { position: absolute; top: 12%; left: 50%; width: 320px; height: 190px; translate: -50% 0; pointer-events: none; opacity: .34; }
.sound-rings i { position: absolute; top: 50%; left: 50%; border: 2px solid var(--cyan); border-radius: 50%; translate: -50% -50%; }
.sound-rings i:nth-child(1) { width: 125px; height: 70px; }
.sound-rings i:nth-child(2) { width: 220px; height: 125px; opacity: .6; }
.sound-rings i:nth-child(3) { width: 310px; height: 180px; opacity: .28; }
.brand-mouth { position: relative; display: grid; place-items: center; width: 105px; height: 88px; margin-bottom: 22px; border: 2px solid rgba(255,255,255,.28); border-radius: 50% 50% 45% 45% / 58% 58% 42% 42%; background: linear-gradient(145deg, #15efd4, #00a899); box-shadow: 0 20px 55px rgba(0,217,194,.26), inset 0 1px rgba(255,255,255,.45); transform: rotate(-4deg); }
.brand-mouth::before { content: ""; position: absolute; right: 19px; bottom: -16px; width: 22px; height: 29px; background: #00ad9c; clip-path: polygon(0 0,100% 0,100% 100%); }
.brand-mouth span { position: relative; z-index: 1; color: #06211e; font-size: 2.45rem; font-weight: 1000; letter-spacing: -.11em; }
.brand-mouth b { position: absolute; z-index: 2; top: -15px; right: -12px; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: #291008; background: var(--orange); box-shadow: 0 8px 20px rgba(0,0,0,.3); font-size: 1.45rem; }
.eyebrow { margin: 0; color: var(--mint); font-size: .66rem; font-weight: 900; letter-spacing: .17em; text-transform: uppercase; }
.home h1 { margin: 7px 0 9px; font-size: clamp(4rem, 20vw, 7rem); font-weight: 1000; line-height: .77; letter-spacing: -.085em; text-transform: uppercase; }
.home h1 em { color: var(--cyan); font-style: normal; }
.lead { max-width: 430px; margin: 0; color: var(--muted); font-size: .91rem; line-height: 1.52; }
.home-actions { display: grid; width: min(100%, 430px); gap: 8px; margin-top: 25px; }
.feature-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 19px; }
.feature-row span { padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; color: #8db4af; background: rgba(255,255,255,.025); font-size: .59rem; font-weight: 800; }

.btn { min-height: 49px; border: 0; border-radius: 16px; padding: 0 17px; color: var(--ink); font-weight: 900; cursor: pointer; transition: transform .12s ease, opacity .12s ease; }
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .38; cursor: not-allowed; }
.btn--xl { min-height: 59px; }
.btn--primary { color: #05231f; background: linear-gradient(135deg, var(--mint), var(--cyan)); box-shadow: 0 13px 33px rgba(0,217,194,.15); }
.btn--soft { border: 1px solid var(--line); background: rgba(255,255,255,.055); }
.btn--outline { width: 100%; border: 1px dashed rgba(148,255,233,.35); color: var(--mint); background: rgba(0,217,194,.045); }
.btn--raise { color: #172212; background: linear-gradient(135deg, var(--yellow), var(--orange)); }
.btn--call { color: white; background: linear-gradient(135deg, #ff5d66, #d9243c); box-shadow: 0 12px 30px rgba(255,40,65,.18); }
.btn--success { color: #06241f; background: var(--mint); }
.btn--fail { color: white; background: var(--red); }
.btn--tie { grid-column: 1 / -1; border: 1px solid var(--line); background: rgba(255,255,255,.06); }
.text-button { min-height: 41px; border: 0; padding: 8px 10px; color: var(--mint); background: transparent; font-size: .75rem; font-weight: 800; cursor: pointer; }
.text-button--muted { color: #89aaa6; }
.text-button--danger { color: #ff8d93; }

.topbar, .game-header { display: grid; grid-template-columns: 46px minmax(0,1fr) 46px; align-items: center; gap: 9px; flex: 0 0 auto; }
.topbar h2 { margin: 3px 0 0; font-size: 1.22rem; font-weight: 950; line-height: 1.08; letter-spacing: -.04em; }
.icon-button { display: grid; place-items: center; width: 43px; height: 43px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: rgba(255,255,255,.045); font-size: 1.45rem; font-weight: 900; cursor: pointer; }
.icon-button--dots { font-size: .84rem; letter-spacing: .06em; }
.icon-button--ghost { opacity: 0; pointer-events: none; }
.scroll-content { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 20px 0 114px; scrollbar-width: thin; }
.player-fields { display: grid; gap: 8px; }
.player-field { display: grid; grid-template-columns: 36px minmax(0,1fr) 36px; gap: 9px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.035); }
.player-number { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 11px; color: #05231f; background: var(--cyan); font-weight: 950; }
.player-field input { width: 100%; min-width: 0; height: 42px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 1rem; font-weight: 800; }
.player-field input::placeholder { color: #648883; font-weight: 600; }
.remove-player { width: 34px; height: 34px; border: 0; border-radius: 11px; color: #87aaa6; background: transparent; font-size: 1.3rem; cursor: pointer; }
.remove-player:disabled { opacity: .2; }
.player-fields + .btn { margin-top: 9px; }
.settings-card { margin: 17px 0 0; padding: 14px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.03); }
.settings-card legend { padding: 0 6px; color: var(--mint); font-size: .69rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.setting-help { margin: -2px 0 11px; color: #89aaa6; font-size: .69rem; line-height: 1.4; }
.segments { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; padding: 4px; border-radius: 13px; background: rgba(0,0,0,.24); }
.segments button { min-height: 40px; border: 0; border-radius: 10px; color: #8bada9; background: transparent; font-size: .68rem; font-weight: 900; cursor: pointer; }
.segments button.is-active { color: #06231f; background: var(--cyan); }
.category-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.category-grid button { display: flex; align-items: center; gap: 8px; min-height: 49px; border: 1px solid var(--line); border-radius: 13px; padding: 0 10px; color: #9bb9b6; background: rgba(0,0,0,.13); font-size: .69rem; font-weight: 850; cursor: pointer; }
.category-grid button span { font-size: 1.14rem; }
.category-grid button[aria-pressed="true"] { border-color: rgba(0,217,194,.58); color: #06231f; background: var(--cyan); }
.sticky-footer { position: absolute; z-index: 4; right: 0; bottom: 0; left: 0; padding: 15px 16px max(15px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, #071916 30%); }
.sticky-footer .btn { width: 100%; }
.form-error { min-height: 17px; margin: 0 0 3px; color: #ff8e96; text-align: center; font-size: .69rem; }

.game-screen { background: radial-gradient(circle at 50% 3%, rgba(0,217,194,.12), transparent 31%); }
.round-pill { justify-self: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--mint); background: rgba(255,255,255,.035); font-size: .65rem; font-weight: 900; letter-spacing: .12em; }
.arena-wrap { display: flex; flex-direction: column; justify-content: center; flex: 1 1 auto; width: min(100%, 545px); margin: auto; padding: 12px 0 6px; }
.arena-status { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: stretch; margin-bottom: 8px; }
.arena-status > div { display: grid; align-content: center; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.04); }
.arena-status small, .arena-status strong { display: block; }
.arena-status small { color: #7fa39e; font-size: .55rem; font-weight: 900; letter-spacing: .1em; }
.arena-status strong { overflow: hidden; margin-top: 2px; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; }
.stake-badge { min-width: 104px; text-align: right; }
.stake-badge strong { color: var(--orange); }
.claim-card { position: relative; padding: 21px 18px 18px; border: 1px solid rgba(148,255,233,.2); border-radius: 25px; overflow: hidden; background: linear-gradient(145deg, #104740, #0a302d 60%, #08241f); box-shadow: var(--shadow); }
.claim-card::before { content: ""; position: absolute; top: -75px; right: -58px; width: 170px; height: 170px; border: 32px solid rgba(0,217,194,.07); border-radius: 50%; }
.claim-card[data-category="lef"] { background: linear-gradient(145deg, #4b2710, #35200e 60%, #241607); }
.claim-card[data-category="taal"] { background: linear-gradient(145deg, #173a5b, #102a43 60%, #0c1c2d); }
.claim-card[data-category="bluf"] { background: linear-gradient(145deg, #4f1732, #351124 60%, #230b18); }
.claim-label { position: relative; display: flex; align-items: center; gap: 8px; color: var(--mint); font-size: .64rem; font-weight: 950; letter-spacing: .13em; }
.claim-label span { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid rgba(255,255,255,.14); border-radius: 13px; background: rgba(255,255,255,.07); font-size: 1.24rem; }
.opening-cue { position: relative; margin: 21px 0 6px; color: #a7c4bf; font-size: .65rem; font-weight: 750; }
.claim-card h2 { position: relative; margin: 0; font-size: clamp(1.5rem, 7.4vw, 2.3rem); font-weight: 950; line-height: 1.08; letter-spacing: -.05em; }
.proof-note { position: relative; margin: 14px 0; padding: 10px 11px; border-radius: 13px; color: #c5dcd9; background: rgba(0,0,0,.2); font-size: .68rem; line-height: 1.43; }
.bid-meter { position: relative; height: 7px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.1); }
.bid-meter span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--yellow), var(--red)); transition: width .24s ease; }
.bid-caption { position: relative; margin: 7px 0 0; color: #8bada8; font-size: .58rem; }
.activity-box { max-height: 72px; overflow-y: auto; margin: 8px 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: 13px; color: #9abbb6; background: rgba(255,255,255,.025); font-size: .61rem; line-height: 1.4; }
.activity-box p { margin: 0; }
.activity-box p + p { margin-top: 4px; padding-top: 4px; border-top: 1px solid rgba(255,255,255,.06); }
.arena-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.arena-actions .text-button { grid-column: 1 / -1; }
.arena-actions .text-button + .text-button { margin-top: -8px; }

.showdown-wrap, .tiebreak-wrap, .result-wrap { display: grid; place-items: center; align-content: center; flex: 1 1 auto; width: min(100%, 510px); margin: auto; text-align: center; }
.versus { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.versus span { display: grid; place-items: center; width: 70px; height: 70px; border: 1px solid var(--line); border-radius: 23px; background: rgba(255,255,255,.06); font-size: 2.15rem; box-shadow: 0 12px 32px rgba(0,0,0,.25); }
.versus b { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 50%; color: #24140a; background: var(--orange); font-size: .73rem; transform: rotate(-6deg); }
.showdown-wrap h2, .tiebreak-wrap h2, .result-wrap h2 { margin: 7px 0 11px; font-size: clamp(1.9rem, 9vw, 2.8rem); font-weight: 950; line-height: 1.04; letter-spacing: -.055em; }
.showdown-claim { width: 100%; padding: 16px; border: 1px solid rgba(0,217,194,.25); border-radius: 18px; color: #f2fffd; background: rgba(0,217,194,.075); font-size: .94rem; font-weight: 800; line-height: 1.45; }
.showdown-proof { margin: 10px 0 19px; color: var(--muted); font-size: .7rem; line-height: 1.45; }
.decision-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.decision-grid .btn { min-height: 56px; }
.bolt { display: grid; place-items: center; width: 87px; height: 87px; margin-bottom: 19px; border-radius: 28px; color: #2a1d05; background: var(--yellow); box-shadow: 0 16px 42px rgba(255,230,106,.17); font-size: 2.7rem; transform: rotate(6deg); }
.tiebreak-wrap > p:not(.eyebrow) { max-width: 410px; margin: 2px 0 22px; color: var(--muted); font-size: .83rem; line-height: 1.5; }
.winner-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.winner-pick button { display: grid; place-items: center; min-height: 87px; border: 1px solid var(--line); border-radius: 19px; padding: 9px; color: var(--ink); background: rgba(255,255,255,.055); font-weight: 900; cursor: pointer; }
.winner-pick button span { font-size: 1.55rem; }
.winner-pick button small { margin-top: 4px; color: #97b7b3; font-size: .6rem; }
.result-mouth { display: grid; place-items: center; width: 90px; height: 90px; margin-bottom: 19px; border-radius: 29px; color: #06231f; background: linear-gradient(145deg, var(--mint), var(--cyan)); box-shadow: 0 16px 43px rgba(0,217,194,.19); font-size: 2.75rem; transform: rotate(-6deg); }
.result-wrap > p:not(.eyebrow) { max-width: 400px; margin: 3px 0 23px; color: var(--muted); font-size: .85rem; line-height: 1.5; }
.result-actions { display: grid; width: min(100%, 430px); gap: 8px; }

.score-list, .history-list { display: grid; gap: 8px; }
.score-row { display: grid; grid-template-columns: 25px 42px minmax(0,1fr) auto; gap: 9px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.035); }
.score-row:first-child { border-color: rgba(0,217,194,.42); background: rgba(0,217,194,.07); }
.score-rank { color: #86a8a3; text-align: center; font-size: .72rem; font-weight: 900; }
.score-avatar { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 13px; background: rgba(255,255,255,.07); font-size: 1.23rem; }
.score-copy { min-width: 0; }
.score-copy strong, .score-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-copy strong { font-size: .83rem; }
.score-copy span { margin-top: 3px; color: #88aaa6; font-size: .57rem; }
.score-value { color: var(--cyan); font-size: 1.25rem; font-weight: 950; }
.stat-totals { display: grid; grid-template-columns: repeat(3,1fr); margin: 14px 0; padding: 14px 6px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.025); text-align: center; }
.stat-totals div + div { border-left: 1px solid var(--line); }
.stat-totals strong, .stat-totals span { display: block; }
.stat-totals strong { font-size: 1.25rem; }
.stat-totals span { margin-top: 3px; color: #86a8a3; font-size: .58rem; }
.scroll-content > .btn { width: 100%; }
.history-row { display: grid; grid-template-columns: 43px minmax(0,1fr); gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.03); }
.history-number { display: grid; place-items: center; align-self: start; width: 40px; height: 40px; border-radius: 13px; color: #05231f; background: var(--cyan); font-size: .7rem; font-weight: 950; }
.history-copy { min-width: 0; }
.history-copy b, .history-copy span, .history-copy small { display: block; }
.history-copy b { font-size: .76rem; }
.history-copy span { margin-top: 4px; color: #c4d9d6; font-size: .69rem; line-height: 1.35; }
.history-copy small { margin-top: 6px; color: #7fa19c; font-size: .58rem; }
.empty-state { padding: 28px 18px; border: 1px dashed var(--line); border-radius: 19px; color: #88aaa6; text-align: center; font-size: .76rem; line-height: 1.5; }

.dialog { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: max(17px, env(safe-area-inset-top)) 16px max(17px, env(safe-area-inset-bottom)); border: 0; color: var(--ink); background: rgba(1,10,9,.8); backdrop-filter: blur(14px); }
.dialog[open] { display: grid; place-items: center; animation: fade .17s ease-out; }
@keyframes fade { from { opacity: 0; } }
.dialog::backdrop { background: transparent; }
.dialog-card { position: relative; display: grid; gap: 8px; width: min(100%, 445px); max-height: calc(100dvh - 34px); overflow-y: auto; padding: 24px; border: 1px solid var(--line); border-radius: 25px; background: #0c2926; box-shadow: var(--shadow); text-align: center; }
.dialog-card h2 { margin: 4px 0; font-size: 1.8rem; font-weight: 950; line-height: 1.05; letter-spacing: -.05em; }
.dialog-card > p:not(.eyebrow):not(.help-note) { margin: 0 0 10px; color: var(--muted); font-size: .75rem; line-height: 1.48; }
.dialog-close { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 39px; height: 39px; border: 0; border-radius: 13px; color: var(--ink); background: rgba(255,255,255,.06); font-size: 1.35rem; cursor: pointer; }
.player-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 4px; }
.player-picker button { display: grid; grid-template-columns: 31px minmax(0,1fr); align-items: center; gap: 7px; min-height: 50px; border: 1px solid var(--line); border-radius: 14px; padding: 7px 9px; color: var(--ink); background: rgba(255,255,255,.05); text-align: left; font-size: .72rem; font-weight: 850; cursor: pointer; }
.player-picker button span:first-child { font-size: 1.18rem; }
.player-picker button span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dialog-card--help { text-align: left; }
.dialog-card--help ol { display: grid; gap: 11px; margin: 10px 0; padding-left: 20px; color: var(--muted); font-size: .74rem; line-height: 1.48; }
.dialog-card--help li::marker { color: var(--cyan); font-weight: 950; }
.dialog-card--help b { color: var(--ink); }
.help-note { margin: 2px 0 0; padding: 11px; border-radius: 13px; color: #c4fff4; background: rgba(0,217,194,.08); font-size: .69rem; line-height: 1.42; }
.toast { position: fixed; z-index: 30; right: 16px; bottom: max(18px, env(safe-area-inset-bottom)); left: 16px; max-width: 450px; margin: auto; padding: 12px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: #12443e; box-shadow: var(--shadow); opacity: 0; transform: translateY(17px); pointer-events: none; transition: .2s ease; text-align: center; font-size: .72rem; }
.toast--visible { opacity: 1; transform: translateY(0); }

@media (max-width: 350px) {
  .screen { padding-inline: 13px; }
  .home { padding-inline: 18px; }
  .home h1 { font-size: 3.65rem; }
  .claim-card { padding: 18px 14px 16px; }
  .category-grid, .player-picker { gap: 5px; }
  .category-grid button { padding-inline: 7px; }
}
@media (max-height: 710px) {
  .brand-mouth { width: 83px; height: 70px; margin-bottom: 14px; }
  .brand-mouth span { font-size: 2rem; }
  .home h1 { font-size: 3.8rem; }
  .home-actions { margin-top: 18px; }
  .feature-row { margin-top: 12px; }
  .claim-card { padding-block: 16px; }
  .opening-cue { margin-top: 14px; }
  .proof-note { margin-block: 10px; }
  .versus { margin-bottom: 13px; }
  .versus span { width: 58px; height: 58px; border-radius: 19px; font-size: 1.8rem; }
}
@media (min-width: 720px) {
  body { display: grid; place-items: center; }
  .app-shell { width: 700px; min-height: min(940px,100dvh); max-height: 100dvh; border-inline: 1px solid rgba(255,255,255,.06); box-shadow: 0 0 90px rgba(0,0,0,.42); }
  .screen { min-height: min(940px,100dvh); padding-inline: 34px; }
  .sticky-footer { padding-inline: 34px; }
  .claim-card { padding: 29px 28px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
