/* Wangi Legends match simulator. Builds on wangi.css (tokens, cards, tables, balls).
   Royal blue is too dark for text on this background, so Blue XI text and lines
   use a lighter tint (--blue-ink) and #2a3bb7 is kept for fills. */

:root {
  --blue: #2a3bb7;
  --blue-ink: #93a0ff;
  --gold: #f2c230;
  --gold-ink: #f2c230;
  --dock-h: 64px;
}

.t-blue { color: var(--blue-ink); }
.t-gold { color: var(--gold-ink); }

.sim-hero { padding-bottom: 28px; }
.tag--link { text-decoration: none; }
.tag--link:hover { color: var(--ink); }
.sim-title { display: flex; align-items: baseline; gap: .25em; flex-wrap: wrap; }
.sim-title i { font-style: normal; font-size: .45em; color: var(--muted); font-weight: 700; }
.sim-title span { display: inline; -webkit-text-stroke: 0; }
.sim-title .t-blue { color: var(--blue-ink); }
.sim-title .t-gold { color: var(--gold); }
.sim-odds { margin: 10px 0 0; font-size: 15px; color: var(--ink-2); max-width: 640px; }
.sim-odds span { color: var(--muted); }
.sim-main { padding-bottom: calc(var(--dock-h) + 40px); }
.in-match .sim-hero { padding: 14px 0 10px; }
.in-match .sim-hero .hero__brand, .in-match .sim-odds { display: none; }
.in-match .sim-title { margin: 10px 0 0; font-size: 34px; }

/* ---------------------------------------------------------------- setup */

.pick { margin-top: 20px; padding: 20px 18px; }
.pick__q { margin: 0 0 14px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.pick__q2 { margin: 22px 0 0; font-size: 16px; font-weight: 700; }
.pick__q2 span { color: var(--muted); font-weight: 500; }
.sides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.side {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  min-height: 132px; padding: 14px; border: 0; border-radius: 16px; cursor: pointer; text-align: left;
  background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.side:active { transform: scale(.98); }
.side__name { font-size: 22px; font-weight: 900; letter-spacing: -.02em; }
.side__cap { font-size: 13px; color: var(--ink-2); }
.side__stars { font-size: 12px; color: var(--muted); }
.side__odds { margin-top: auto; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.side--blue .side__name { color: var(--blue-ink); }
.side--gold .side__name { color: var(--gold-ink); }
.side--blue[aria-pressed="true"] { background: linear-gradient(160deg, rgba(42, 59, 183, .55), rgba(42, 59, 183, .18)); box-shadow: inset 0 0 0 2px var(--blue-ink); }
.side--gold[aria-pressed="true"] { background: linear-gradient(160deg, rgba(242, 194, 48, .28), rgba(242, 194, 48, .08)); box-shadow: inset 0 0 0 2px var(--gold); }
.side[aria-pressed="true"] .side__odds { color: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
  min-height: 36px; padding: 6px 12px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.chip--blue { box-shadow: inset 3px 0 0 var(--blue-ink), inset 0 0 0 1px var(--line); }
.chip--gold { box-shadow: inset 3px 0 0 var(--gold), inset 0 0 0 1px var(--line); }
.chip.is-on { background: var(--gold); color: #1a1205; box-shadow: none; }

.btn--big { min-height: 48px; padding: 12px 20px; font-size: 15px; border: 0; cursor: pointer; justify-content: center; }
.btn--big:disabled { opacity: .45; cursor: default; }
.btn.btn--big.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--axis); }
#go { width: 100%; margin-top: 22px; background: var(--gold); color: #1a1205; }
#shared .sides { margin: 16px 0 12px; }
#shared .linkish { font-size: 14px; color: var(--ink-2); }

.sheets { margin-top: 16px; }
.xi h3 { font-size: 18px; }
.xi--blue h3 { color: var(--blue-ink); }
.xi--gold h3 { color: var(--gold-ink); }
.xi__list { list-style: none; margin: 12px 0 0; padding: 0; }
.xi__p { border-top: 1px solid var(--line); }
.xi__p.is-follow { background: rgba(242, 194, 48, .08); box-shadow: inset 3px 0 0 var(--gold); }
.xi__btn { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center; width: 100%; min-height: 44px; padding: 8px 6px; border: 0; background: none; cursor: pointer; text-align: left; }
.xi__n { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.xi__nm { font-weight: 600; font-size: 14px; }
.xi__s { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.xi__more { display: flex; flex-direction: column; gap: 2px; padding: 0 6px 10px 36px; font-size: 13px; color: var(--ink-2); }
.badge { display: inline-block; margin-left: 6px; padding: 1px 5px; border-radius: 4px; font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: .04em; background: rgba(255, 255, 255, .08); color: var(--ink-2); vertical-align: 1px; }
.badge--bowl { background: rgba(25, 158, 112, .18); color: #7fe0bd; }

.more { margin-top: 12px; }
.more summary { cursor: pointer; list-style: none; font-weight: 700; font-size: 15px; min-height: 28px; }
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: "\25B8  "; color: var(--accent); }
.more[open] summary::before { content: "\25BE  "; }
.more h4 { margin: 18px 0 2px; font-size: 14px; }
.more p { font-size: 14px; color: var(--ink-2); margin: 10px 0; }
.more .sub { margin: 2px 0 0; }
.prose p { max-width: 680px; }
.dot-team { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; }
.dot-team--blue { background: var(--blue-ink); }
.dot-team--gold { background: var(--gold); }

/* ---------------------------------------------------------------- toss */

.toss { margin-top: 20px; padding: 28px 18px; text-align: center; }
.toss__h { margin: 18px 0 6px; font-size: 30px; font-weight: 900; letter-spacing: -.02em; }
.toss__p { margin: 0 auto; max-width: 420px; color: var(--ink-2); font-size: 16px; }
.toss__btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.toss__btns .btn { min-width: 140px; background: var(--gold); color: #1a1205; }
.coin {
  width: 96px; height: 96px; margin: 0 auto; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 32% 28%, #fff3c2, var(--gold) 45%, #a77d0b);
  box-shadow: 0 0 0 4px rgba(242, 194, 48, .25), 0 14px 30px rgba(0, 0, 0, .5);
  color: #5a4204; font-weight: 900; font-size: 34px;
}
.coin.is-flip { animation: flip 1.2s cubic-bezier(.3, .7, .4, 1) both; }
@keyframes flip {
  0% { transform: translateY(0) rotateX(0); }
  45% { transform: translateY(-90px) rotateX(900deg); }
  100% { transform: translateY(0) rotateX(1800deg); }
}
.pitch { display: flex; flex-direction: column; gap: 2px; margin: 18px auto 0; max-width: 420px; padding: 12px 14px; border-radius: 14px; background: rgba(25, 158, 112, .1); box-shadow: inset 0 0 0 1px rgba(25, 158, 112, .35); font-size: 14px; }
.pitch span { color: var(--ink-2); }

/* ---------------------------------------------------------------- scoreboard */

.board {
  position: sticky; top: 0; z-index: 15;
  margin: 12px -16px 0; padding: 12px 16px 10px;
  background: rgba(12, 16, 32, .94);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
@media (min-width: 700px) { .board { margin: 16px 0 0; border-radius: var(--radius); border: 1px solid var(--line); } }
.b__top { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.b__no { color: var(--muted); }
.b__main { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 2px; }
.b__score { font-size: 44px; line-height: 1.05; font-weight: 900; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.b__score.is-pop { animation: pop .6s ease; }
@keyframes pop { 0% { color: var(--gold); transform: scale(1.08); } 100% { color: var(--ink); transform: none; } }
.b__ov, .b__rr { color: var(--ink-2); font-size: 14px; font-variant-numeric: tabular-nums; }
.b__need { margin-top: 2px; font-size: 17px; font-weight: 600; }
.b__need b { color: var(--gold); font-size: 20px; font-variant-numeric: tabular-nums; }
.b__need span { color: var(--muted); font-size: 13px; font-weight: 500; }
.b__need--soft { font-size: 14px; color: var(--muted); font-weight: 500; }
.wp { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; margin-top: 8px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wp__track { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.wp__fill { display: block; height: 100%; border-radius: 999px; transition: width .6s ease; }
.wp__fill--blue { background: var(--blue-ink); }
.wp__fill--gold { background: var(--gold); }
.b__crease { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; margin-top: 10px; font-size: 15px; }
.b__bat-row { display: flex; justify-content: space-between; gap: 8px; }
.b__nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b__strike { font-style: normal; color: var(--gold); margin-left: 2px; }
.b__r { font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.b__r b { color: var(--ink); }
.b__bowl { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.b__stand { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.is-follow { background: rgba(242, 194, 48, .1); border-radius: 6px; box-shadow: 0 0 0 3px rgba(242, 194, 48, .1); }
.b__over { margin-top: 8px; }
.b__over .ball { min-width: 30px; height: 30px; }

/* ---------------------------------------------------------------- live */

.sim-tabs { margin-top: 14px; }
.sim-tabs .mtab { min-height: 44px; }
.tab { margin-top: 12px; }
.brk { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding: 18px; border-radius: var(--radius); background: linear-gradient(160deg, rgba(42, 59, 183, .35), rgba(242, 194, 48, .08)); box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 12px; }
.brk b { font-size: 30px; font-weight: 900; letter-spacing: -.02em; }
.brk span { color: var(--ink-2); font-size: 16px; }
.brk .btn { margin-top: 8px; background: var(--gold); color: #1a1205; }

.feed { list-style: none; margin: 0; padding: 0; }
.f { display: grid; grid-template-columns: 44px 1fr; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.45; animation: rise .3s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.f__o { color: var(--muted); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; padding-top: 2px; }
.f__o--tag { color: var(--accent); text-transform: uppercase; letter-spacing: .06em; font-size: 10px; }
.f-quiet .f__t, .f-over .f__t { color: var(--muted); font-size: 14px; }
.f-four .f__t { font-weight: 600; }
.f-six .f__t { font-weight: 700; color: var(--gold); }
.f-wkt .f__t { font-weight: 700; color: #ff8f93; }
.f-drop .f__t { font-weight: 600; color: #ffc48a; }
.f-mile .f__t { font-weight: 800; color: var(--gold); }
.f-big .f__t { font-weight: 700; font-size: 16px; }
.f-follow { background: rgba(242, 194, 48, .07); box-shadow: inset 3px 0 0 var(--gold); }

.moment {
  position: fixed; left: 50%; top: 38%; z-index: 40; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 220px; max-width: calc(100vw - 32px); padding: 18px 26px; border-radius: 22px;
  background: rgba(10, 13, 20, .92); box-shadow: 0 20px 50px rgba(0, 0, 0, .6), inset 0 0 0 1px var(--line);
  text-align: center; pointer-events: none;
  animation: momentIn .25s ease both;
}
@keyframes momentIn { from { opacity: 0; transform: translate(-50%, -40%) scale(.92); } to { opacity: 1; transform: translate(-50%, -50%); } }
.moment b { font-size: 46px; font-weight: 900; letter-spacing: -.02em; line-height: 1; }
.moment span { font-size: 15px; color: var(--ink-2); }
.moment--wkt b { color: #ff6b70; }
.moment--six b, .moment--mile b { color: var(--gold); }
.moment--four b { color: #8ec5ff; }
.moment--drop b { color: #ffc48a; font-size: 34px; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--dock-h) + 18px + env(safe-area-inset-bottom)); z-index: 45; transform: translateX(-50%);
  max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 999px;
  background: var(--gold); color: #1a1205; font-weight: 700; font-size: 14px; text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}

/* ---------------------------------------------------------------- result */

.result { margin-top: 14px; padding: 20px 18px; border-radius: var(--radius); background: linear-gradient(160deg, rgba(42, 59, 183, .4), rgba(242, 194, 48, .1)); box-shadow: inset 0 0 0 1px var(--line); scroll-margin-top: 10px; }
.result__k { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.result__h { margin: 6px 0 4px; font-size: clamp(26px, 6vw, 38px); line-height: 1.1; font-weight: 900; letter-spacing: -.02em; }
.result__mine { margin: 0; font-size: 16px; color: var(--ink-2); }
.result__sc { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-size: 17px; font-variant-numeric: tabular-nums; }
.result__pom { display: flex; flex-direction: column; margin: 16px 0 0; font-size: 15px; color: var(--ink-2); }
.result__pom span { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.result__pom b { font-size: 20px; color: var(--ink); }
.result__f { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: rgba(242, 194, 48, .1); font-size: 15px; }
.result__btns { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 18px; }
.result__btns .btn:first-child { background: var(--gold); color: #1a1205; }
@media (min-width: 640px) { .result__btns { grid-template-columns: repeat(3, auto); justify-content: start; } }
.result__tally { margin: 14px 0 0; font-size: 13px; color: var(--muted); }

/* ---------------------------------------------------------------- scorecard, charts */

.sc-card { margin-bottom: 12px; }
.sc-card .inn-total b { font-size: 30px; }
.sc-x { margin: 8px 2px 0; font-size: 13px; color: var(--ink-2); }
.sc .how { max-width: 220px; }
.sim-chart { display: block; width: 100%; height: auto; margin-top: 12px; overflow: visible; }
.sim-chart text { fill: var(--muted); font-size: 10px; font-family: var(--sans); }
.sim-chart { max-width: 720px; }
.sim-chart .g { stroke: var(--grid); stroke-width: 1; }
.sim-chart .worm { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.sim-chart .worm--blue { stroke: var(--blue-ink); }
.sim-chart .worm--gold { stroke: var(--gold); }
.sim-chart .wk { stroke: var(--page); stroke-width: 1.5; }
.sim-chart .wk--blue { fill: var(--blue-ink); }
.sim-chart .wk--gold { fill: var(--gold); }
.sim-chart .bar--blue { fill: var(--blue-ink); opacity: .85; }
.sim-chart .bar--gold { fill: var(--gold); opacity: .85; }
.legend i.lg--blue { background: var(--blue-ink); }
.legend i.lg--gold { background: var(--gold); }
#tab-charts .card { margin-bottom: 12px; }

/* ---------------------------------------------------------------- dock */

.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(10, 13, 20, .94);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.dock__b { width: 100%; min-height: 44px; border: 0; border-radius: 12px; background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line); font-weight: 700; font-size: 15px; cursor: pointer; }
.dock__play { background: var(--gold); color: #1a1205; box-shadow: none; }
.dock__skip { position: relative; }
.skipmenu { position: absolute; right: 0; bottom: calc(100% + 8px); display: flex; flex-direction: column; min-width: 240px; padding: 6px; border-radius: 14px; background: var(--card); box-shadow: 0 20px 40px rgba(0, 0, 0, .6), inset 0 0 0 1px var(--line); }
.skipmenu button { min-height: 44px; padding: 8px 12px; border: 0; border-radius: 10px; background: none; text-align: left; font-size: 15px; font-weight: 600; cursor: pointer; }
.skipmenu button:hover, .skipmenu button:focus-visible { background: var(--card-2); }
@media (min-width: 700px) { .dock { left: 50%; right: auto; width: 560px; transform: translateX(-50%); bottom: 14px; border-radius: 18px; border: 1px solid var(--line); padding-bottom: 10px; } }

@media (max-width: 380px) {
  .b__score { font-size: 38px; }
  .b__crease { grid-template-columns: 1fr; }
  .side { min-height: 120px; padding: 12px; }
  .side__name { font-size: 19px; }
}

/* ---------------------------------------------------------------- spoken commentary */

/* The Seagulls Live commentary (commentary.js), here to test it on a simulated game. */
.listen {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 48px; margin-bottom: 12px; padding: 0 16px;
  border: 0; border-radius: 12px; cursor: pointer;
  background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line);
  font-size: 15px; font-weight: 700;
}
.listen svg { width: 22px; height: 22px; flex: none; }
.listen[aria-pressed="true"] { background: var(--gold); color: #1a1205; box-shadow: none; }
