:root {
  color-scheme: dark;
  --bg: #0d1822;
  --panel: #142331;
  --raise: #1b2e3f;
  --tile: #223a4f;
  --line: #253c50;
  --text: #eef4fa;
  --soft: #cfdae4;
  --muted: #8ea3b5;
  --accent: #2f8cff;
  --good: #22e08e;
  --warn: #ffc233;
  --bad: #ff5470;
  --display: "Lilita One", "Arial Black", system-ui, sans-serif;
  --body: "Manrope", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--body); min-height: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Built for a phone. Wider screens get the same column in the middle. */
.app { max-width: 480px; margin: 0 auto; padding-inline: 16px; padding-block: 18px 48px; }

h1 { font: 400 34px/1 var(--display); margin: 0; text-transform: uppercase; letter-spacing: .4px; }
h1 small { display: block; font-size: 16px; color: var(--warn); letter-spacing: 1px; margin-bottom: 4px; }
.lead { color: var(--muted); margin: 10px 0 0; font-size: 14.5px; }

.counts { display: flex; gap: 6px; margin: 16px -16px 14px; padding-inline: 16px; overflow-x: auto; scrollbar-width: none; }
.counts::-webkit-scrollbar { display: none; }
.count { flex: none; display: flex; align-items: center; gap: 7px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px 5px 6px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.count i { font: 800 12px var(--mono); font-style: normal; color: #0b1520; border-radius: 999px; padding: 2px 8px; }

.tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-bottom: 12px; }
.tools input, .tools select { min-height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); font-size: 16px; font-weight: 600; padding: 0 12px; }
.tools input:focus, .tools select:focus { outline: none; border-color: var(--accent); }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { position: relative; display: block; padding: 0; border: 0; border-radius: 14px; overflow: hidden; aspect-ratio: 3 / 4; background: var(--raise); text-align: left; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile .shade { position: absolute; inset: auto 0 0 0; height: 50%; background: linear-gradient(to top, rgba(6, 12, 18, .94), rgba(6, 12, 18, .55) 55%, transparent); }
.tile .txt { position: absolute; left: 10px; right: 10px; bottom: 9px; display: grid; gap: 2px; }
.tile .nm { font: 400 17px/1.05 var(--display); text-transform: uppercase; letter-spacing: .3px; color: #fff; }
.tile .row { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.tile b { font: 800 20px/1.1 var(--mono); }
.tile small { font: 600 11px var(--mono); color: #c9d6e2; }
@media (prefers-reduced-motion: no-preference) {
  .tile, .m, .k, .step { transition: transform .12s ease; }
  .tile:active, .m:active, .k:active { transform: scale(.95); }
}
.none { grid-column: 1 / -1; color: var(--muted); padding: 24px 0; text-align: center; }
.foot { color: var(--muted); font-size: 13px; margin: 18px 0 0; }

/* game screen */
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 3; display: flex; align-items: center; gap: 10px; margin: -18px -16px 0; padding: 10px 16px; background: rgba(13, 24, 34, .97); border-bottom: 1px solid var(--line); }
.bar button { flex: none; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); font-size: 20px; line-height: 1; }
.bar .t { font: 400 20px/1 var(--display); text-transform: uppercase; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .e { font: 800 16px var(--mono); }

.jump { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 10px 16px 0; }
.jump::-webkit-scrollbar { display: none; }
.jump a { flex: none; text-decoration: none; color: var(--soft); font-size: 13px; font-weight: 700; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 6px 12px; }

.hero { position: relative; margin: 12px 0 0; border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 8; background: var(--raise); }
.hero img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block; }
.hero .over { position: absolute; inset: auto 0 0 0; padding: 34px 14px 12px; background: linear-gradient(to top, rgba(6, 12, 18, .92), transparent); display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.hero .big { font: 800 32px/1 var(--mono); }
.hero .rtp { font: 800 20px/1 var(--mono); }
.hero .lbl { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: #d5e0ea; margin-bottom: 4px; }
.hero .r { text-align: right; }
.badge { position: absolute; top: 10px; left: 10px; font: 800 11.5px var(--body); letter-spacing: .04em; padding: 5px 9px; border-radius: 8px; background: rgba(6, 12, 18, .78); }

@media (prefers-reduced-motion: no-preference) {
  .enter { animation: enter .22s ease-out; }
  @keyframes enter { from { opacity: 0; transform: translateY(10px); } }
}

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-top: 12px; scroll-margin-top: 76px; }
.card h2 { font: 400 17px var(--display); text-transform: uppercase; letter-spacing: .4px; margin: 0 0 10px; }
.card h3 { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 16px 0 6px; }
.card > p { margin: 0 0 10px; color: var(--soft); font-size: 14.5px; }
.card > p:last-child { margin-bottom: 0; }

.fields { display: grid; gap: 12px; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.lab { display: block; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 5px; }
.num { display: flex; align-items: center; min-height: 50px; padding: 0 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.num:focus-within { border-color: var(--accent); }
.num span { font: 800 16px var(--mono); color: var(--muted); }
.num span:first-child { margin-right: 6px; }
.num span:last-child:not(:first-child) { margin-left: 6px; }
.num input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font: 800 18px var(--mono); font-variant-numeric: tabular-nums; }
.chips { display: flex; gap: 6px; margin-top: 8px; }
.chips button { flex: 1 1 0; min-width: 0; min-height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--raise); font: 700 13px var(--mono); padding: 0 8px; }
.chips button:active { background: var(--line); }
.fields select { width: 100%; min-height: 50px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); padding: 0 12px; font-size: 16px; font-weight: 700; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.seg button { flex: 1; min-height: 42px; border: 0; border-radius: 9px; background: none; font-weight: 800; font-size: 13.5px; color: var(--muted); padding: 0 4px; }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.seg button { text-transform: capitalize; }
.hint { display: block; color: var(--muted); font-size: 12.5px; margin-top: 6px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2px 0; }

/* game boards */
.readout { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.readout div { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.readout b { display: block; font: 800 17px/1.3 var(--mono); color: var(--text); letter-spacing: 0; font-variant-numeric: tabular-nums; }
.btnrow { display: flex; gap: 6px; margin-top: 10px; }
.btnrow button { flex: 1; min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--raise); font-weight: 800; font-size: 13.5px; }

.mgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; padding: 10px; border-radius: 14px; background: var(--bg); }
.m { position: relative; aspect-ratio: 1; border: 0; border-radius: 10px; background: var(--tile); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .28); }
.m.on { background: radial-gradient(circle at 50% 40%, #1f6e4c, #123a2b); box-shadow: inset 0 0 0 2px var(--good), inset 0 -4px 0 rgba(0, 0, 0, .3); }
.m.on::after { content: ""; position: absolute; left: 50%; top: 50%; width: 38%; height: 38%; transform: translate(-50%, -50%) rotate(45deg); border-radius: 3px; background: linear-gradient(135deg, #b8ffd9, #22e08e 45%, #0d8f55); box-shadow: 0 0 12px rgba(34, 224, 142, .55); }
.m .n { position: absolute; top: 4px; left: 6px; font: 700 10px var(--mono); color: rgba(255, 255, 255, .35); }

.kgrid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 5px; padding: 8px; border-radius: 14px; background: var(--bg); }
.k { aspect-ratio: 1; border: 0; border-radius: 8px; background: var(--tile); font: 800 13px var(--mono); color: var(--soft); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .28); padding: 0; }
.k.on { background: #7b3cff; color: #fff; box-shadow: inset 0 0 0 2px #c7a6ff, inset 0 -3px 0 rgba(0, 0, 0, .3); }

.tower { display: flex; flex-direction: column-reverse; gap: 5px; padding: 8px; border-radius: 14px; background: var(--bg); }
.trow { display: grid; grid-template-columns: minmax(0, 1fr) 76px; gap: 8px; align-items: center; border: 0; background: none; padding: 0; text-align: left; }
.trow .cells { display: grid; gap: 5px; }
.trow .cells i { height: 26px; border-radius: 7px; background: var(--tile); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .28); }
.trow.in .cells i { background: #3a2a14; }
.trow.in .cells i.egg { background: radial-gradient(circle at 50% 45%, #ffe38a, #ffb72e 55%, #a0620c); }
.trow.at .cells i.egg { box-shadow: 0 0 0 2px #fff; }
.trow b { font: 800 13px var(--mono); text-align: right; color: var(--muted); }
.trow.in b { color: var(--warn); }
.trow.at b { color: #fff; }

.strip { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 2px 14px 4px; scroll-snap-type: x proximity; }
.strip::-webkit-scrollbar { display: none; }
.step { flex: none; min-width: 74px; scroll-snap-align: center; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); padding: 8px 8px 7px; text-align: center; }
.step span { display: block; font-size: 10.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.step b { display: block; font: 800 15px var(--mono); margin: 2px 0; }
.step em { display: block; font: 600 11px var(--mono); font-style: normal; color: var(--muted); }
.step.in { background: #16304a; }
.step.at { background: var(--accent); border-color: var(--accent); }
.step.at span, .step.at em { color: #dce9ff; }

.tgt { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dicebar { position: relative; height: 16px; border-radius: 8px; overflow: hidden; margin-top: 14px; background: var(--bad); }
.dicebar i { position: absolute; top: 0; bottom: 0; right: 0; background: var(--good); }
.dicescale { display: flex; justify-content: space-between; font: 700 11px var(--mono); color: var(--muted); margin-top: 5px; }

.plk { display: block; width: 100%; height: auto; border-radius: 14px; background: var(--bg); }
.buckets { display: grid; gap: 2px; margin-top: 6px; }
.buckets span { border-radius: 4px; padding: 4px 0; text-align: center; font: 800 9px var(--mono); color: #0b1520; overflow: hidden; }

.wheel { width: min(230px, 70%); aspect-ratio: 1; margin: 4px auto 0; border-radius: 50%; position: relative; }
.wheel::after { content: ""; position: absolute; inset: 22%; border-radius: 50%; background: var(--panel); }
.wheel::before { content: ""; position: absolute; top: -6px; left: 50%; transform: translateX(-50%); border: 9px solid transparent; border-top: 14px solid #fff; z-index: 1; }
.legend2 { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.legend2 span { display: flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px 4px 5px; font: 700 12px var(--mono); }
.legend2 i { width: 14px; height: 14px; border-radius: 50%; }

.outs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.outs span { border-radius: 10px; padding: 6px 9px; background: var(--bg); border: 1px solid var(--line); font: 700 12px var(--mono); }
.outs b { font-weight: 800; }

/* analysis */
.verdict { display: grid; gap: 8px; padding: 14px; border-radius: 14px; margin-top: 12px; border: 1px solid; }
.verdict.good { background: rgba(34, 224, 142, .08); border-color: rgba(34, 224, 142, .35); }
.verdict.warn { background: rgba(255, 194, 51, .08); border-color: rgba(255, 194, 51, .35); }
.verdict.bad { background: rgba(255, 84, 112, .08); border-color: rgba(255, 84, 112, .35); }
.tag { justify-self: start; display: inline-block; font: 800 11.5px var(--body); text-transform: uppercase; letter-spacing: .06em; padding: 4px 10px; border-radius: 999px; color: #0b1520; }
.verdict p { margin: 0; font-size: 14.5px; color: #dbe4ec; }

.headline { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.headline div { background: var(--raise); border-radius: 14px; padding: 12px; }
.headline span { display: block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.headline b { display: block; font: 800 26px/1.2 var(--mono); margin-top: 2px; overflow-wrap: anywhere; }
.headline em { display: block; font-style: normal; font-size: 12px; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.stat { background: var(--raise); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.stat > span { display: block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.stat b { display: block; font: 800 18px/1.3 var(--mono); font-variant-numeric: tabular-nums; margin-top: 2px; overflow-wrap: anywhere; }
.stat em { display: block; font-style: normal; font-size: 12px; color: var(--muted); }

.hist { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 120px; margin-top: 8px; padding-bottom: 1px; border-bottom: 1px solid var(--line); }
.hist i { flex: 1; border-radius: 3px 3px 0 0; min-height: 1px; }
.hist .zero { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--warn); border-radius: 1px; }
.axis { position: relative; height: 16px; display: flex; justify-content: space-between; font: 700 11px var(--mono); color: var(--muted); margin-top: 5px; }
.pcts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin-top: 12px; }
.pcts div { text-align: center; background: var(--raise); border-radius: 10px; padding: 7px 2px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.pcts b { display: block; font: 800 12.5px var(--mono); letter-spacing: 0; margin-top: 2px; }
.small { color: var(--muted); font-size: 13px; margin: 10px 0 0; }

.list { display: grid; }
.li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.li:first-child { border-top: 0; padding-top: 0; }
.li .k2 { font-weight: 800; min-width: 0; }
.li .k2 em { font-style: normal; font-weight: 600; color: var(--muted); font-size: 13px; margin-left: 4px; }
.li .v { font: 800 15px var(--mono); text-align: right; font-variant-numeric: tabular-nums; }
.li .sub { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); }
.meter { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--bg); overflow: hidden; margin-top: 4px; }
.meter i { display: block; height: 100%; border-radius: 3px; }
.li.me .k2 { color: var(--accent); }

.grid3 { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 0 8px; font-variant-numeric: tabular-nums; }
.grid3 > * { padding: 8px 0; border-top: 1px solid var(--line); font: 700 14px var(--mono); }
.grid3 > :nth-child(3n+2), .grid3 > :nth-child(3n) { text-align: right; }
.grid3 .h { font: 800 11px var(--body); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-top: 0; padding-top: 0; }
.grid3 .me { color: var(--accent); }
.scrollbox { max-height: 360px; overflow-y: auto; margin-right: -6px; padding-right: 6px; }

.strat { border-top: 1px solid var(--line); padding: 14px 0; }
.strat:first-of-type { border-top: 0; padding-top: 2px; }
.strat .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.strat h4 { margin: 0; font-size: 15.5px; font-weight: 800; }
.strat p { margin: 6px 0 0; font-size: 14px; color: var(--soft); }
.strat p b { color: var(--text); }
.strat .nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.strat .nums div { background: var(--raise); border-radius: 10px; padding: 7px 8px; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.strat .nums b { display: block; font: 800 15px var(--mono); letter-spacing: 0; color: var(--text); margin-top: 1px; }
.use { flex: none; min-height: 34px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--accent); background: none; color: var(--accent); font-weight: 800; font-size: 13px; }
.use:active { background: rgba(47, 140, 255, .15); }

.checks .li .v { color: var(--good); }
.checks .li .v.off { color: var(--warn); }
.myth { padding: 10px 0; border-top: 1px solid var(--line); }
.myth:first-of-type { border-top: 0; padding-top: 0; }
.myth b { display: block; font-size: 14.5px; }
.myth span { display: block; color: var(--soft); font-size: 14px; margin-top: 2px; }
.src { font-size: 12.5px; color: var(--muted); padding-left: 18px; margin: 0; }
.src li { margin: 4px 0; overflow-wrap: anywhere; }
.aside { border-left: 3px solid var(--warn); padding-left: 12px; color: var(--muted); font-size: 14px; margin: 10px 0 0; }
.chart { overflow-x: auto; margin: 0 -14px; padding: 0 14px; }
.chart table { border-collapse: collapse; font: 700 12px var(--mono); }
.chart th, .chart td { width: 30px; height: 26px; text-align: center; border: 1px solid var(--bg); }
.chart th { color: var(--muted); font-weight: 800; }
.chart td.H { background: #7d2a3a; } .chart td.S { background: #1e6b4a; } .chart td.D { background: #2a5aa0; }
.chart td.P { background: #7a5a14; } .chart td.R { background: #55326e; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; }

/* simpler result layout */
.split { display: flex; height: 38px; border-radius: 12px; overflow: hidden; font: 800 13px var(--body); }
.split span { display: grid; place-items: center; min-width: 0; white-space: nowrap; color: #0b1520; }
.split .w { background: var(--good); }
.split .e { background: #8ea3b5; }
.split .l { background: var(--bad); color: #fff; }
.lead2 { font-size: 15.5px; line-height: 1.5; margin: 12px 0 0; color: var(--text); }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.two div { border-radius: 14px; padding: 12px; }
.two .win { background: rgba(34, 224, 142, .1); border: 1px solid rgba(34, 224, 142, .35); }
.two .lose { background: rgba(255, 84, 112, .1); border: 1px solid rgba(255, 84, 112, .35); }
.two span { display: block; font-size: 12px; font-weight: 800; color: var(--soft); }
.two b { display: block; font: 800 24px/1.25 var(--mono); margin-top: 2px; }
.two .win b { color: var(--good); } .two .lose b { color: var(--bad); }
.two em { font-style: normal; font-size: 12px; color: var(--muted); }
.avg { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; padding: 12px; border-radius: 14px; background: var(--raise); }
.avg span { display: block; font-size: 13px; font-weight: 800; }
.avg em { display: block; font-style: normal; font-size: 12px; color: var(--muted); }
.avg b { font: 800 20px var(--mono); white-space: nowrap; }
.curve { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding: 8px 4px 0; }
.cb { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; min-width: 0; }
.cb b { font: 800 12px var(--mono); }
.cb .col { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.cb .col i { display: block; width: 100%; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #4be9a6, #1aa56a); }
.cb em { font: 700 11px var(--mono); font-style: normal; color: var(--muted); }
.cb.me .col i { background: linear-gradient(180deg, #7cb6ff, var(--accent)); }
.cb.me em, .cb.me b { color: var(--accent); }
.facts { margin-top: 14px; }
.facts .tag { margin-left: 6px; vertical-align: 1px; font-size: 10px; padding: 2px 7px; }

details.more { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
details.more > summary, details.fold > summary, details.strat > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details.more > summary { font-weight: 800; font-size: 14px; color: var(--accent); padding: 4px 0; }
details.more > summary::after { content: " +"; }
details.more[open] > summary::after { content: " -"; }
details.more[open] > summary { margin-bottom: 8px; }
details.fold > summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
details.fold > summary h2 { margin: 0; }
details.fold > summary::after { content: "+"; font: 800 22px/1 var(--mono); color: var(--muted); }
details.fold[open] > summary::after { content: "-"; }
details.fold[open] > summary { margin-bottom: 12px; }

details.strat { border-top: 1px solid var(--line); padding: 12px 0; }
details.strat:first-of-type { border-top: 0; padding-top: 0; }
details.strat > summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
details.strat .sn { font-weight: 800; font-size: 15px; }
details.strat .sn::before { content: "+ "; color: var(--muted); font-family: var(--mono); }
details.strat[open] .sn::before { content: "- "; }
details.strat .sv { flex: none; font-size: 12px; color: var(--muted); }
details.strat p { margin: 8px 0 0; font-size: 14px; color: var(--soft); }
details.strat p b { color: var(--text); }
details.strat .nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
details.strat .nums div { background: var(--raise); border-radius: 10px; padding: 7px 8px; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
details.strat .nums b { display: block; font: 800 15px var(--mono); letter-spacing: 0; color: var(--text); margin-top: 1px; }
details.strat .use { margin-top: 10px; width: 100%; min-height: 42px; }

/* cleaner type: one font for words and money in lists, mono only for big numbers */
.li .v { font: 800 15px var(--body); font-variant-numeric: tabular-nums; }
.li .k2 { font-weight: 700; }
.li .k2 em { font-weight: 600; }
.facts .li { padding: 11px 0; }
.small.center { text-align: center; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; font-variant-numeric: tabular-nums; }
.grid2 > * { padding: 9px 0; border-top: 1px solid var(--line); font: 700 14px var(--body); }
.grid2 > :nth-child(2n) { text-align: right; }
.grid2 .h { font: 800 11px var(--body); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-top: 0; padding-top: 0; }
.grid2 .me { color: var(--accent); }
.grid3 > * { font-family: var(--body); }
details.strat .sv { font-size: 13px; font-weight: 700; color: var(--soft); }
details.strat .nums b { font-family: var(--body); }
.lead2 b { white-space: nowrap; }

/* play mode */
.boardhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.boardhead h2 { margin: 0; }
.boardhead .seg { flex: none; width: 170px; }
.boardhead .seg button { min-height: 34px; }
.pbal { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); margin-bottom: 12px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pbal b { display: block; font: 800 22px/1.2 var(--mono); color: var(--text); letter-spacing: 0; }
.pbal button { min-height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--raise); font-weight: 800; font-size: 13px; }
@media (prefers-reduced-motion: no-preference) {
  .shake { animation: shake .35s; }
  @keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
}
.stage { margin-bottom: 12px; }
.plive { font: 700 13px var(--mono); color: var(--soft); margin-bottom: 8px; min-height: 18px; }
.pbtns { display: flex; gap: 8px; }
.pbtn { flex: 1; min-height: 52px; border: 0; border-radius: 12px; background: var(--good); color: #062014; font-weight: 800; font-size: 16px; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .2); }
.pbtn.cash { background: var(--warn); color: #2a1c00; }
.pbtn.go { background: var(--accent); color: #fff; }
.pbtn:disabled { opacity: .45; }
.pbtn:active:not(:disabled) { transform: translateY(1px); }
.m.bomb { background: radial-gradient(circle at 50% 45%, #4a1420, #2a0b12); box-shadow: inset 0 0 0 2px var(--bad); }
.m.bomb::after { content: ""; position: absolute; inset: 30%; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #555, #111); }
.m.dim { opacity: .45; }
.m:disabled { cursor: default; }
.ptower { display: flex; flex-direction: column-reverse; gap: 5px; padding: 8px; border-radius: 14px; background: var(--bg); }
.prow { display: grid; grid-template-columns: minmax(0, 1fr) 70px; gap: 8px; align-items: center; }
.prow .cells { display: grid; gap: 5px; }
.prow b { font: 800 13px var(--mono); text-align: right; color: var(--muted); }
.prow.live b { color: #fff; }
.tc { height: 30px; border: 0; border-radius: 7px; background: var(--tile); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .28); padding: 0; }
.tc.live { background: #2f5270; box-shadow: inset 0 0 0 1px #6f9bc2; }
.tc.egg { background: radial-gradient(circle at 50% 45%, #ffe38a, #ffb72e 55%, #a0620c); opacity: .55; }
.tc.egg.me { opacity: 1; box-shadow: 0 0 0 2px #fff; }
.tc.bomb { background: var(--bad); }
.step.fail { background: rgba(255, 84, 112, .2); border-color: var(--bad); }
.k.hit { background: var(--good); color: #062014; box-shadow: inset 0 0 0 2px #c9ffe6; }
.k.drawn { box-shadow: inset 0 0 0 2px var(--warn); color: var(--warn); }
span.k { display: grid; place-items: center; }
.bigres { font: 800 52px/1.1 var(--mono); text-align: center; padding: 18px 0 4px; }
.dicebar .mark { position: absolute; top: -3px; bottom: -3px; width: 4px; margin-left: -2px; background: #fff; border-radius: 2px; }
.dicebar { overflow: visible; }
.pstats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 14px; }
.pstats div { background: var(--raise); border-radius: 10px; padding: 7px 9px; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); min-width: 0; }
.pstats b { display: block; font: 800 14px var(--mono); color: var(--text); letter-spacing: 0; overflow-wrap: anywhere; }
.spark { display: block; width: 100%; height: 60px; margin-top: 10px; background: var(--bg); border-radius: 10px; }

/* real-looking game pieces for play mode */
.plive.good { color: var(--good); } .plive.bad { color: var(--bad); } .plive.warn { color: var(--warn); }
.pbtns { flex-wrap: wrap; }
.pbtns3 { flex: 1 1 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pbtns4 { flex: 1 1 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pbtns3 + .pbtn.cash { flex-basis: 100%; }
.pbtn small { display: block; font: 700 11px var(--mono); opacity: .85; margin-top: 2px; }
.pbtn.ghost { background: var(--raise); color: var(--soft); border: 1px solid var(--line); }
.bigmult { font: 800 30px/1.1 var(--mono); text-align: center; margin-top: 6px; font-variant-numeric: tabular-nums; }
.bigmult.huge { font-size: 44px; }
.bigmult.giant { font-size: 58px; padding: 22px 0 10px; }

.pc { position: relative; display: inline-block; width: 58px; height: 82px; border-radius: 8px; background: #f7f9fc; color: #14202b; box-shadow: 0 3px 0 rgba(0, 0, 0, .35), 0 6px 14px rgba(0, 0, 0, .3); flex: none; }
.pc b { position: absolute; top: 5px; left: 7px; font: 800 17px/1 var(--body); }
.pc i { position: absolute; top: 24px; left: 7px; font-style: normal; font-size: 13px; line-height: 1; }
.pc em { position: absolute; right: 7px; bottom: 5px; font-style: normal; font-size: 30px; line-height: 1; }
.pc.red { color: #d6243f; }
.pc.back { background: repeating-linear-gradient(45deg, #2f5aa8 0 6px, #2a4f94 6px 12px); border: 3px solid #f7f9fc; }
.pc.big { width: 104px; height: 146px; border-radius: 12px; }
.pc.big b { font-size: 30px; top: 9px; left: 12px; }
.pc.big i { top: 44px; left: 12px; font-size: 22px; }
.pc.big em { font-size: 58px; right: 12px; bottom: 8px; }
.pc.mini { width: 34px; height: 48px; border-radius: 5px; box-shadow: none; }
.pc.mini b { font-size: 12px; top: 3px; left: 4px; }
.pc.mini i { display: none; }
.pc.mini em { font-size: 16px; right: 3px; bottom: 2px; }
.pc.skip { opacity: .4; }
@media (prefers-reduced-motion: no-preference) {
  .pc.new { animation: dealin .25s ease-out; }
  @keyframes dealin { from { transform: translateY(-14px) rotate(-6deg); opacity: 0; } }
}
.felt { padding: 14px; border-radius: 16px; background: radial-gradient(120% 90% at 50% 0%, #1d6b4c, #0f3d2d); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .06); }
.felt .lab { color: #bfe8d4; }
.bjrow { display: flex; flex-wrap: wrap; min-height: 82px; }
.bjrow .pc + .pc { margin-left: -16px; }
.bjhands { display: flex; gap: 14px; flex-wrap: wrap; }
.bjhand { padding: 6px; border-radius: 12px; }
.bjhand.act { box-shadow: 0 0 0 2px var(--warn); }
.bjhand .score { display: block; margin-top: 6px; font: 800 13px var(--mono); color: #eafff4; }
.felt.bac { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.felt.bac .bjrow { min-height: 68px; }
.felt.bac .pc { width: 48px; height: 68px; }
.felt.bac .pc em { font-size: 24px; }

.vprow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.vpc { display: grid; justify-items: center; gap: 4px; border: 0; background: none; padding: 0; }
.vpc .pc { width: 100%; max-width: 64px; height: auto; aspect-ratio: 5 / 7; }
.vpc > span:last-child { font: 800 11px var(--body); color: var(--warn); text-transform: uppercase; letter-spacing: .06em; min-height: 14px; }
.vpc.held .pc { transform: translateY(-6px); box-shadow: 0 0 0 3px var(--warn), 0 6px 14px rgba(0, 0, 0, .3); }
.paytab { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 12px; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--bg); font-size: 12.5px; color: var(--muted); }
.paytab span { display: flex; justify-content: space-between; gap: 6px; }
.paytab b { font-family: var(--mono); color: var(--soft); }
.paytab .on, .paytab .on b { color: var(--warn); font-weight: 800; }

.road { position: relative; display: flex; overflow-x: auto; scrollbar-width: none; height: 132px; border-radius: 14px; background: #1b2530; }
.road::-webkit-scrollbar { display: none; }
.curb { flex: none; width: 56px; background: #3b4a58; }
.lane { position: relative; flex: none; width: 64px; border-left: 2px dashed rgba(255, 255, 255, .25); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px; }
.lane b { font: 800 12px var(--mono); color: var(--muted); background: rgba(0, 0, 0, .35); padding: 2px 5px; border-radius: 6px; }
.lane.done { background: rgba(34, 224, 142, .08); }
.lane.done b { color: var(--good); }
.lane.hit { background: rgba(255, 84, 112, .18); }
.car { position: absolute; top: 30px; left: 12px; width: 40px; height: 56px; border-radius: 10px; background: linear-gradient(#ff4d6a, #b8243c); box-shadow: inset 0 10px 0 rgba(255, 255, 255, .25), inset 0 -10px 0 rgba(0, 0, 0, .25); }
.hen { position: absolute; top: 28px; left: calc(6px + var(--lane) * 64px); width: 44px; height: 58px; object-fit: cover; object-position: 50% 30%; border-radius: 12px; box-shadow: 0 4px 10px rgba(0, 0, 0, .4); }
.hen.flat { filter: grayscale(1) brightness(.6); transform: rotate(80deg); }

.pumpsvg { display: block; width: 180px; height: 190px; margin: 0 auto; }
@media (prefers-reduced-motion: no-preference) {
  .balloon { transition: transform .2s ease; transform-origin: 100px 124px; }
  .balloon.squeeze { transform: scale(1.07, .93); }
}

.coinwrap { perspective: 600px; display: grid; place-items: center; padding: 12px 0; }
.coin { position: relative; width: 120px; height: 120px; transform-style: preserve-3d; transition: transform .6s ease-out; }
.coin span { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%; font: 400 48px var(--display); color: #6b4a00; backface-visibility: hidden; background: radial-gradient(circle at 35% 30%, #ffe79a, #ffc233 45%, #b77b00); box-shadow: inset 0 0 0 6px rgba(107, 74, 0, .35); }
.coin .t { transform: rotateY(180deg); }
.coin.tails { transform: rotateY(180deg); }
.coin.spin.to-h { transform: rotateY(1440deg); }
.coin.spin.to-t { transform: rotateY(1620deg); }
.trail { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; min-height: 26px; }
.trail span.ok, .trail span.no { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 800 11px var(--mono); }
.trail span.ok { background: rgba(34, 224, 142, .2); color: var(--good); }
.trail span.no { background: rgba(255, 84, 112, .2); color: var(--bad); }
.trail.cards { gap: 4px; margin-top: 10px; }

.holes { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; padding: 16px 12px; border-radius: 14px; background: radial-gradient(120% 100% at 50% 0%, #3c5a2c, #243a1a); }
.hole { grid-column: span 2; position: relative; aspect-ratio: 1; border: 0; border-radius: 50%; background: radial-gradient(circle at 50% 62%, #0b0f08 54%, #4a3520 56%, #5d4428); overflow: hidden; padding: 0; }
.hole:nth-child(5) { grid-column: 2 / span 2; }
.hole .mole { position: absolute; left: 20%; right: 20%; bottom: -75%; height: 72%; border-radius: 46% 46% 22% 22%; background: radial-gradient(circle at 50% 35%, #d8a26a, #9a6a3c); transition: bottom .18s ease-out; }
.hole .mole::before, .hole .mole::after { content: ""; position: absolute; top: 28%; width: 12%; height: 12%; border-radius: 50%; background: #1a1008; }
.hole .mole::before { left: 30%; }
.hole .mole::after { right: 30%; }
.hole.up .mole { bottom: 6%; }
.hole.hit { box-shadow: 0 0 0 3px var(--good); }
.hole.miss { box-shadow: 0 0 0 3px var(--bad); }
.hole:disabled { cursor: default; }

.rps { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; text-align: center; }
.rps > b { font: 400 20px var(--display); color: var(--muted); }
.hand { display: grid; place-items: center; width: 96px; height: 96px; margin: 0 auto; border-radius: 20px; background: var(--bg); font: 800 36px var(--mono); color: var(--muted); }
.hand svg { width: 64px; height: 64px; }

.hilo { display: grid; place-items: center; padding: 8px 0; }

.dice2 { display: flex; justify-content: center; gap: 14px; padding: 6px 0 12px; }
.die { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); width: 58px; height: 58px; padding: 8px; border-radius: 12px; background: #f7f9fc; box-shadow: inset 0 -4px 0 #c9d4de; }
.die i { width: 10px; height: 10px; border-radius: 50%; background: #14202b; place-self: center; }
.d1 i { grid-area: 2 / 2; }
.d2 i:nth-child(1) { grid-area: 1 / 1; } .d2 i:nth-child(2) { grid-area: 3 / 3; }
.d3 i:nth-child(1) { grid-area: 1 / 1; } .d3 i:nth-child(2) { grid-area: 2 / 2; } .d3 i:nth-child(3) { grid-area: 3 / 3; }
.d4 i:nth-child(1) { grid-area: 1 / 1; } .d4 i:nth-child(2) { grid-area: 1 / 3; } .d4 i:nth-child(3) { grid-area: 3 / 1; } .d4 i:nth-child(4) { grid-area: 3 / 3; }
.d5 i:nth-child(1) { grid-area: 1 / 1; } .d5 i:nth-child(2) { grid-area: 1 / 3; } .d5 i:nth-child(3) { grid-area: 2 / 2; } .d5 i:nth-child(4) { grid-area: 3 / 1; } .d5 i:nth-child(5) { grid-area: 3 / 3; }
.d6 i:nth-child(1) { grid-area: 1 / 1; } .d6 i:nth-child(2) { grid-area: 2 / 1; } .d6 i:nth-child(3) { grid-area: 3 / 1; } .d6 i:nth-child(4) { grid-area: 1 / 3; } .d6 i:nth-child(5) { grid-area: 2 / 3; } .d6 i:nth-child(6) { grid-area: 3 / 3; }
.squares { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.sq { border-radius: 8px; background: var(--bg); border: 1px solid var(--line); padding: 4px 2px; text-align: center; min-width: 0; }
.sq em { display: block; font: 700 10px var(--mono); font-style: normal; color: var(--muted); }
.sq b { font: 800 11px var(--mono); }
.sq.snake { background: rgba(255, 84, 112, .15); border-color: rgba(255, 84, 112, .4); }
.sq.snake b { color: var(--bad); font-family: var(--body); font-size: 10px; }
.sq.hot { box-shadow: 0 0 0 2px #fff; }

.rball { width: 120px; height: 120px; margin: 6px auto 12px; border-radius: 50%; display: grid; place-items: center; font: 800 46px var(--mono); background: var(--raise); color: #fff; box-shadow: inset 0 -8px 0 rgba(0, 0, 0, .25), 0 0 0 6px #3a2a14, 0 0 0 9px #7a5a2a; }
.rball.red { background: #d6243f; } .rball.black { background: #1a1f24; } .rball.green { background: #139a4e; }
.rhist { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; min-height: 26px; }
.rn { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font: 800 11px var(--mono); color: #fff; }
.rn.red { background: #d6243f; } .rn.black { background: #1a1f24; border: 1px solid var(--line); } .rn.green { background: #139a4e; }

.gems { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; padding: 14px 8px; border-radius: 14px; background: var(--bg); }
.gem { aspect-ratio: 1; position: relative; }
.gem::before { content: ""; position: absolute; inset: 18%; transform: rotate(45deg); border-radius: 6px; background: linear-gradient(135deg, #fff, var(--c) 40%, #111 130%); box-shadow: 0 0 14px var(--c); }
.gem.empty::before { background: var(--tile); box-shadow: none; }
.gem.match::after { content: ""; position: absolute; left: 20%; right: 20%; bottom: -8px; height: 3px; border-radius: 2px; background: #fff; }

.board { display: block; width: min(240px, 80%); margin: 0 auto; }

.wheelwrap { position: relative; width: min(240px, 72%); margin: 4px auto 0; }
.wheelwrap .wheel { width: 100%; margin: 0; }
.wheelwrap .wheel::before { display: none; }
.pointer { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); border: 10px solid transparent; border-top: 16px solid #fff; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5)); z-index: 2; }
.buckets span.lit { outline: 2px solid #fff; outline-offset: 1px; }

.crash { position: relative; height: 190px; border-radius: 14px; background: linear-gradient(180deg, #13263a, #0d1822); overflow: hidden; }
.crash svg { position: absolute; left: 10px; top: 14px; width: calc(100% - 20px); height: calc(100% - 24px); }
.crash .bigmult { position: relative; }

.slide { position: relative; overflow: hidden; padding: 16px 0; border-radius: 14px; background: var(--bg); }
.ribbon { display: flex; gap: 6px; width: max-content; padding-left: calc(50% - 34px); will-change: transform; }
.ribbon span { flex: none; width: 68px; height: 86px; border-radius: 10px; display: grid; place-items: center; font: 800 13px var(--mono); color: #0b1520; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .2); }
.marker { position: absolute; top: 4px; bottom: 4px; left: 50%; width: 3px; margin-left: -1.5px; background: #fff; border-radius: 2px; box-shadow: 0 0 10px rgba(255, 255, 255, .6); }

.shaft { position: relative; height: 200px; border-radius: 14px; background: linear-gradient(180deg, #6b4a2a 0 10%, #4d3520 10% 40%, #3a2818 40% 70%, #2a1d12 70%); overflow: hidden; }
.goal { position: absolute; left: 0; right: 0; top: calc(12px + var(--d) * 170px); border-top: 2px dashed #ffc233; }
.goal b { position: absolute; right: 8px; top: -20px; font: 800 12px var(--mono); color: var(--warn); }
.bit { position: absolute; left: 50%; top: 0; width: 26px; margin-left: -13px; height: calc(20px + var(--d) * 170px); background: linear-gradient(90deg, #9aa7b3, #e6ecf1, #9aa7b3); border-radius: 0 0 13px 13px; }
.bit::after { content: ""; position: absolute; left: -4px; right: -4px; bottom: -14px; height: 22px; clip-path: polygon(0 0, 100% 0, 50% 100%); background: #ffc233; }

/* feedback and small motions */
.stage { position: relative; }
.toast { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); z-index: 4; pointer-events: none; padding: 10px 18px; border-radius: 14px; background: #0f2a1f; border: 2px solid var(--good); color: var(--good); font: 800 20px var(--mono); white-space: nowrap; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); opacity: 0; }
.pbtn, .chips button, .seg button, .use, .btnrow button, .pbal button { transition: transform .08s ease, background-color .15s ease; }
.chips button:active, .seg button:active, .use:active, .btnrow button:active, .pbal button:active { transform: scale(.96); }
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toast 1.5s ease-out forwards; }
  @keyframes toast { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.8); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); } 25% { transform: translate(-50%, -50%) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -70%); } }
  .pop { animation: pop .24s ease-out; }
  @keyframes pop { from { transform: scale(.55); opacity: .2; } }
  #result, #strats { transition: opacity .15s ease; }
}
@media (prefers-reduced-motion: reduce) { .toast { opacity: 1; } }

.good { color: var(--good); } .warn { color: var(--warn); } .bad { color: var(--bad); }
.busy { opacity: .5; transition: opacity .12s; }
.loading { color: var(--muted); padding: 30px 0; text-align: center; }
