/* Tavern Dice UI mockup — visual iteration only. Not used by the Unity project. */

/* ---------- Mockup chrome (not part of the proposed game UI) ---------- */
:root {
  --chrome-bg: #0b0908; --chrome-panel: #16120f; --chrome-line: #2c241d;
  --chrome-ink: #efe6d6; --chrome-ink2: #a99a84;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--chrome-bg); color: var(--chrome-ink); font-family: Inter, system-ui, sans-serif; }
body { display: flex; flex-direction: column; overflow: hidden; }
.chrome-bar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--chrome-line); background: var(--chrome-panel); }
.chrome-bar h1 { font: 600 15px Inter, sans-serif; margin: 0 8px 0 0; }
.chrome-bar h1 small { color: var(--chrome-ink2); font-weight: 500; }
.seg { display: inline-flex; border: 1px solid var(--chrome-line); border-radius: 8px; overflow: hidden; }
.seg button { background: none; border: 0; color: var(--chrome-ink2); padding: 6px 10px; font: 500 13px Inter, sans-serif; cursor: pointer; }
.seg button[aria-pressed="true"] { background: #2a2119; color: #ffd27a; }
.ctl, .chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--chrome-ink2); cursor: pointer; }
.ctl select { background: #0f0c0a; color: var(--chrome-ink); border: 1px solid var(--chrome-line); border-radius: 6px; padding: 4px 6px; font: 13px Inter, sans-serif; }
.stage-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 16px; background: #120f0c; border-bottom: 1px solid var(--chrome-line); font-size: 12.5px; color: var(--chrome-ink2); }
.stage-tools[hidden] { display: none; }
.stage-tools button { background: #1f1914; color: var(--chrome-ink); border: 1px solid var(--chrome-line); border-radius: 999px; padding: 4px 10px; font: 500 12.5px Inter, sans-serif; cursor: pointer; }
.stage-tools button:hover { border-color: #7d6040; color: #ffd27a; }
.chrome-main { flex: 1; display: grid; grid-template-columns: 210px 1fr 330px; min-height: 0; }
.chrome-main.no-notes { grid-template-columns: 210px 1fr; }
.chrome-main.no-notes .notes { display: none; }
.chrome-nav { border-right: 1px solid var(--chrome-line); overflow: auto; padding: 8px; }
.chrome-nav h2 { font: 600 11px Inter, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--chrome-ink2); margin: 14px 8px 6px; }
.chrome-nav button { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--chrome-ink); padding: 7px 10px; border-radius: 6px; font: 13.5px Inter, sans-serif; cursor: pointer; }
.chrome-nav button:hover { background: #1d1814; }
.chrome-nav button[aria-current="true"] { background: #2a2119; color: #ffd27a; }
.stage { position: relative; overflow: hidden; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #1a1512, #0b0908 70%); }
.frame-wrap { position: relative; }
.notes { border-left: 1px solid var(--chrome-line); overflow: auto; padding: 14px 18px; font-size: 13.5px; line-height: 1.55; color: #d9cdb9; }
.notes h3 { font: 600 15px Inter, sans-serif; color: #ffd27a; margin: 4px 0 8px; }
.notes h4 { font: 600 11px Inter, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--chrome-ink2); margin: 16px 0 6px; }
.notes ul { margin: 0; padding-left: 18px; }
.notes li { margin: 0 0 6px; }
.notes b { color: #f3e6cf; }
.notes .tag { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 4px; background: #2a2119; color: #ffd27a; margin-right: 4px; }
@media (max-width: 1150px) { .chrome-main, .chrome-main.no-notes { grid-template-columns: 170px 1fr; } .notes { display: none; } }

/* ---------- Proposed game UI: tokens ---------- */
.frame {
  --ts: 1;
  --bg: #120e0b; --panel: #1e1813; --panel-2: #2a2119; --panel-3: #352a1f;
  --line: #4b3b2b; --line-2: #7d6040;
  --ink: #f5eddf; --ink-2: #d2c4ad; --ink-3: #a89a84;
  --amber: #f4b740; --amber-2: #ffcf6b; --on-amber: #1e1405;
  --good: #7bd9b0; --bad: #ff8a7a; --hot: #ffc24b; --info: #9cc7ff;
  --you: #f4b740; --opp: #8ec5ff;
  --fs-logo: calc(64px * var(--ts)); --fs-title: calc(36px * var(--ts));
  --fs-h2: calc(24px * var(--ts)); --fs-h3: calc(19px * var(--ts));
  --fs-body: calc(16px * var(--ts)); --fs-meta: calc(14px * var(--ts));
  --display: 'Fraunces', Georgia, serif; --serif: 'Lora', Georgia, serif; --sans: 'Inter', system-ui, sans-serif;
  --die: 100px;
  --felt: #1d4a40; --felt-hi: #2a6456; --wood: #6a4428; --wood-2: #4a2e1a;
  position: absolute; top: 0; left: 0; transform-origin: 0 0; overflow: hidden;
  border-radius: 18px; box-shadow: 0 0 0 1px #3a2f25, 0 30px 80px rgba(0,0,0,.6);
  font-family: var(--sans); font-size: var(--fs-body); line-height: 1.45; color: var(--ink);
  font-variant-numeric: tabular-nums;
  background: radial-gradient(120% 90% at 50% 25%, #211912 0%, #120e0b 60%, #0b0806 100%);
}
.frame.f-portrait, .frame.f-landscape { border-radius: 30px; }
.frame.f-portrait { --die: 76px; }
.frame.f-landscape { --die: 66px; }
.frame.f-tablet { --die: 112px; }
.frame.cvd-gray { filter: url(#cvd-gray); }
.frame.cvd-prot { filter: url(#cvd-prot); }
.frame.cvd-deut { filter: url(#cvd-deut); }
.frame.cvd-trit { filter: url(#cvd-trit); }
.frame.scan::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 90; background: repeating-linear-gradient(0deg, rgba(0,0,0,.2) 0 1px, transparent 1px 3px); }
.frame.rm *, .frame.rm *::before, .frame.rm *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
.frame button { font-family: var(--sans); }
.frame :focus-visible { outline: 3px solid var(--amber-2); outline-offset: 3px; }

/* Typography: display font for headers only, sans for everything read in play */
.brand-title { margin: 0; }
.logo { display: block; width: min(100%, 560px); height: auto; margin: 0 auto; }
.title { font: 700 var(--fs-title)/1.1 var(--display); margin: 0; }
.h2 { font: 700 var(--fs-h2)/1.2 var(--serif); margin: 0; }
.h3 { font: 600 var(--fs-h3)/1.25 var(--serif); margin: 0; }
.meta { font-size: var(--fs-meta); color: var(--ink-2); }
.eyebrow { font: 700 var(--fs-meta)/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.num { font-family: var(--sans); font-weight: 800; font-variant-numeric: tabular-nums; }
svg.i { width: 1.25em; height: 1.25em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -0.2em; }
svg.i.fill { fill: currentColor; stroke: none; }

/* 9-slice panel frames (border-image = the CSS equivalent of Unity sliced sprites) */
.panel { border: 12px solid transparent; border-image: var(--nine) 12 fill / 12px / 0 stretch; padding: 6px 8px; }
.panel.raised { border-image-source: var(--nine-2); }
.panel.hot { border-image-source: var(--nine-amber); }

/* Buttons: large primary, quiet secondary, explicit disabled pattern + reason */
.btn { appearance: none; font: 600 var(--fs-body)/1.15 var(--sans); color: var(--ink); background: var(--panel-2); border: 1.5px solid var(--line-2); border-radius: 12px; min-height: 48px; padding: 10px 18px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; transition: translate .12s, box-shadow .12s, background .12s; text-align: center; }
.btn:hover:not([disabled]) { translate: 0 -2px; box-shadow: 0 6px 14px rgba(0,0,0,.35); }
.btn:active:not([disabled]) { translate: 0 1px; }
.btn.primary { background: linear-gradient(#ffc955, #f0ae33); color: var(--on-amber); border-color: #ffd98a; box-shadow: 0 4px 0 #9a6a14, 0 10px 24px rgba(244,183,64,.22); }
.btn.primary:hover:not([disabled]) { box-shadow: 0 6px 0 #9a6a14, 0 14px 30px rgba(244,183,64,.32); }
.btn.primary:active:not([disabled]) { translate: 0 3px; box-shadow: 0 1px 0 #9a6a14; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.danger { border-color: #a94a3f; color: var(--bad); background: #2a1512; }
.btn.block { width: 100%; }
.btn.big { min-height: 64px; font-size: calc(19px * var(--ts)); border-radius: 16px; }
.btn[disabled] { cursor: not-allowed; background: repeating-linear-gradient(135deg, #221b15 0 8px, #1a1410 8px 16px); color: var(--ink-3); border-style: dashed; border-color: #5a4836; box-shadow: none; }
.btn .kbd { font: 700 11px var(--sans); border: 1px solid currentColor; border-radius: 4px; padding: 1px 5px; opacity: .65; }
.btn .sub { display: block; font-weight: 600; font-size: var(--fs-meta); opacity: .85; }
.btn .stack { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.icon-btn { width: 48px; height: 48px; padding: 0; border-radius: 12px; background: var(--panel); border-color: var(--line); color: var(--ink-2); }
.icon-btn:hover { color: var(--ink); }
.icon-btn.labeled { width: auto; padding: 0 12px; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font: 700 var(--fs-meta)/1.3 var(--sans); border: 1.5px solid var(--line-2); color: var(--ink-2); background: #00000030; white-space: nowrap; }
.chip.good { color: var(--good); border-color: #2f6b55; background: #12241d; }
.chip.bad { color: var(--bad); border-color: #8b3a30; background: #2a1310; }
.chip.hot { color: var(--hot); border-color: #8a6420; background: #2a1e08; }
.chip.info { color: var(--info); border-color: #36577e; background: #111d2b; }
.chip.amber { color: var(--on-amber); background: var(--amber); border-color: var(--amber); }

.avatar { --c: #c46a3a; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #160d06; font: 800 20px var(--display); flex: none; box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); }
.avatar.lg { width: 96px; height: 96px; font-size: 44px; }

/* Toggle switch: state shown by knob position AND On/Off text */
.switch { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; color: var(--ink); cursor: pointer; padding: 6px 0; font: 600 var(--fs-meta) var(--sans); min-height: 44px; }
.switch .track { width: 48px; height: 28px; border-radius: 14px; background: #3a2f25; border: 1.5px solid var(--line-2); position: relative; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: var(--ink-2); transition: left .15s; }
.switch[aria-checked="true"] .track { background: var(--amber); border-color: var(--amber-2); }
.switch[aria-checked="true"] .track::after { left: 23px; background: var(--on-amber); }
.switch .state { min-width: 26px; color: var(--ink-2); }

.segmented { display: inline-flex; background: #00000040; border: 1.5px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; }
.segmented button { border: 0; background: none; color: var(--ink-2); font: 600 var(--fs-meta) var(--sans); padding: 8px 14px; border-radius: 9px; min-height: 40px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.segmented button[aria-pressed="true"] { background: var(--panel-3); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--amber); }

/* ---------- Dice ---------- */
.die { --d: #efe4cf; --p: #2a1f17; position: relative; width: var(--die); height: var(--die); border-radius: 19%; border: 0; padding: 0; cursor: pointer; flex: none;
  background: radial-gradient(circle at 30% 24%, color-mix(in srgb, var(--d) 72%, white) 0%, var(--d) 52%, color-mix(in srgb, var(--d) 72%, black) 100%);
  box-shadow: inset calc(var(--die) * -.05) calc(var(--die) * -.07) 0 rgba(0,0,0,.28), inset 2px 2px 0 rgba(255,255,255,.35), 0 calc(var(--die) * .1) calc(var(--die) * .16) rgba(0,0,0,.6);
  translate: var(--jx, 0) var(--jy, 0); rotate: var(--rot, 0deg);
  transition: translate .2s cubic-bezier(.2,.9,.3,1.4), rotate .2s, scale .2s, box-shadow .2s; }
.die .face { position: absolute; inset: 15%; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); place-items: center; pointer-events: none; }
.die .pip { width: 64%; height: 64%; border-radius: 50%; background: var(--p); box-shadow: inset 0 2px 2px rgba(0,0,0,.45); }
.die .dnum { position: absolute; right: 7%; bottom: 3%; font: 800 calc(var(--die) * .17) var(--sans); color: var(--p); display: none; }
.show-nums .die .dnum { display: block; }
.die .badge { position: absolute; top: -13px; right: -13px; width: 30px; height: 30px; border-radius: 50%; display: none; place-items: center; z-index: 2; box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.die .badge svg { width: 18px; height: 18px; stroke-width: 3.2; }
.die:hover:not([disabled]):not(.sel) { translate: var(--jx, 0) calc(var(--jy, 0px) - 4px); }
.die.sel { translate: var(--jx, 0) calc(var(--jy, 0px) - 12px); rotate: 0deg; scale: 1.06;
  box-shadow: inset calc(var(--die) * -.05) calc(var(--die) * -.07) 0 rgba(0,0,0,.28), inset 2px 2px 0 rgba(255,255,255,.35), 0 calc(var(--die) * .32) calc(var(--die) * .3) rgba(0,0,0,.5); }
.die.sel::before { content: ""; position: absolute; inset: -9px; border: 4px solid var(--amber); border-radius: 25%; }
.die.sel .badge.ok { display: grid; background: var(--amber); color: var(--on-amber); }
.die.bad::before { content: ""; position: absolute; inset: -9px; border: 4px dashed var(--bad); border-radius: 25%; }
.die.bad .badge.ok { display: none; }
.die.bad .badge.no { display: grid; background: var(--bad); color: #2a0905; }
.die.bad { animation: shake .34s; }
.die.hint::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: -15px; height: 5px; border-radius: 3px; background: var(--amber); opacity: .8; }
.die.rim { filter: drop-shadow(0 0 1.5px rgba(255,240,205,.95)) drop-shadow(0 0 9px rgba(255,214,140,.45)); }
.die[disabled] { cursor: default; }
.die.rolling { animation: tumble .32s linear infinite; filter: blur(.6px); }
.die.land { animation: land .42s cubic-bezier(.2,1.5,.4,1) both; animation-delay: var(--delay, 0s); }
.die.mini { --die: 30px; cursor: default; translate: none; rotate: none; box-shadow: inset -2px -2px 0 rgba(0,0,0,.25), 0 2px 4px rgba(0,0,0,.5); }
@keyframes shake { 0%, 100% { rotate: var(--rot, 0deg); } 20% { rotate: calc(var(--rot, 0deg) - 9deg); } 40% { rotate: calc(var(--rot, 0deg) + 9deg); } 60% { rotate: calc(var(--rot, 0deg) - 5deg); } 80% { rotate: calc(var(--rot, 0deg) + 3deg); } }
@keyframes tumble { 0% { rotate: 0deg; scale: 1; } 50% { rotate: 180deg; scale: .9; } 100% { rotate: 360deg; scale: 1; } }
@keyframes land { 0% { scale: 1.45; opacity: 0; } 55% { scale: .9; opacity: 1; } 78% { scale: 1.04; } 100% { scale: 1; } }

/* ---------- Gameplay layout ---------- */
.game { position: absolute; inset: 0; display: grid; gap: 14px; padding: 22px 26px; }
.f-desktop .game { grid-template-columns: 340px 1fr 340px; grid-template-rows: auto 1fr auto; grid-template-areas: "score banner top" "tray tray tray" "log actions side"; }
.f-tablet .game { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto auto 1fr auto auto; grid-template-areas: "top top" "score score" "banner banner" "tray tray" "actions actions" "log side"; padding: 22px; }
.f-portrait .game { grid-template-columns: 1fr; grid-template-rows: auto auto auto 1fr auto; grid-template-areas: "top" "score" "banner" "tray" "actions"; padding: 12px 12px 14px; gap: 10px; }
.f-landscape .game { grid-template-columns: 230px 1fr 250px; grid-template-rows: auto 1fr; grid-template-areas: "top banner actions" "score tray actions"; padding: 10px 14px; gap: 10px; }
.f-landscape.lefty .game { grid-template-columns: 250px 1fr 230px; grid-template-areas: "actions banner top" "actions tray score"; }
.f-portrait .g-log, .f-portrait .g-side, .f-landscape .g-log, .f-landscape .g-side { display: none; }

.g-score { grid-area: score; display: flex; flex-direction: column; gap: 8px; }
.f-portrait .g-score, .f-tablet .g-score { flex-direction: row; }
.f-portrait .g-score > *, .f-tablet .g-score > * { flex: 1; min-width: 0; }
.pcard { position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: var(--panel); border: 1.5px solid var(--line); transition: background .25s, border-color .25s; }
.pcard.active { border-color: var(--amber); background: linear-gradient(90deg, #3b2a12, var(--panel) 70%); box-shadow: 0 0 0 3px rgba(244,183,64,.14); }
.pcard.active::before { content: ""; position: absolute; left: -2px; top: 12px; bottom: 12px; width: 5px; border-radius: 3px; background: var(--amber); }
.pcard .who { display: flex; align-items: center; gap: 8px; font-weight: 700; min-width: 0; }
.pcard .who .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .score { font: 800 calc(30px * var(--ts))/1.05 var(--sans); }
.pcard .row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pcard .sub { font-size: var(--fs-meta); color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.pcard .turn-tag { display: none; }
.pcard.active .turn-tag { display: inline-flex; }
.f-portrait .pcard { padding: 8px 10px; gap: 8px; grid-template-columns: auto 1fr; }
.f-portrait .pcard .score { font-size: calc(24px * var(--ts)); }
.f-portrait .pcard .clock { width: 38px; height: 38px; }
.f-portrait .pcard .turn-tag { position: absolute; top: -10px; right: 8px; }
.f-landscape .pcard { padding: 8px 10px; }
.f-landscape .pcard .score { font-size: calc(22px * var(--ts)); }
.f-landscape .pcard .clock { width: 34px; height: 34px; }
.f-landscape .pcard .sub { display: none; }
.clock { width: 48px; height: 48px; }
.shape { font-size: .9em; line-height: 1; }
.shape.you { color: var(--you); }
.shape.opp { color: var(--opp); }
.rulesline { font-size: var(--fs-meta); color: var(--ink-2); padding: 0 4px; display: flex; gap: 10px; flex-wrap: wrap; }
.f-portrait .rulesline, .f-tablet .rulesline, .f-landscape .rulesline { display: none; }

.g-banner { grid-area: banner; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; }
.g-banner .turn { font: 700 calc(30px * var(--ts))/1.1 var(--display); display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }
.g-banner .hint { color: var(--ink-2); max-width: 48ch; }
.f-portrait .g-banner .turn { font-size: calc(24px * var(--ts)); }
.f-portrait .g-banner .hint { font-size: var(--fs-meta); }
.f-landscape .g-banner { flex-direction: row; gap: 12px; }
.f-landscape .g-banner .turn { font-size: calc(20px * var(--ts)); }
.f-landscape .g-banner .hint { font-size: var(--fs-meta); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.g-top { grid-area: top; display: flex; align-items: flex-start; justify-content: flex-end; gap: 8px; }
.g-top .round { margin-right: auto; display: flex; flex-direction: column; font-size: var(--fs-meta); color: var(--ink-2); }
.g-top .round b { color: var(--ink); font-size: var(--fs-body); }
.f-desktop .g-top .round { margin-right: 6px; text-align: right; align-self: center; }
.f-portrait .g-top, .f-landscape .g-top { align-items: center; }
.f-landscape .g-top .icon-btn { width: 44px; height: 44px; min-height: 44px; }
.f-landscape .g-top .round { display: none; }

.g-tray { grid-area: tray; position: relative; min-height: 0; border-radius: 30px; padding: 12px; background: linear-gradient(135deg, var(--wood) 0%, var(--wood-2) 50%, var(--wood) 100%); box-shadow: 0 0 0 2px #00000090, 0 20px 50px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.15); }
.f-portrait .g-tray, .f-landscape .g-tray { border-radius: 22px; padding: 8px; }
.felt { position: absolute; inset: 12px; border-radius: 20px; overflow: hidden; background: radial-gradient(ellipse at 50% 40%, var(--felt-hi), var(--felt) 72%); box-shadow: inset 0 0 50px rgba(0,0,0,.55), inset 0 0 0 2px rgba(0,0,0,.4); transition: filter .3s; }
.f-portrait .felt, .f-landscape .felt { inset: 8px; border-radius: 15px; }
.felt::before { content: ""; position: absolute; inset: 0; opacity: .18; background-image: radial-gradient(rgba(255,255,255,.25) 1px, transparent 1px); background-size: 5px 5px; }
.felt.busted { filter: grayscale(.9) brightness(.62); }
.dice-grid { position: absolute; inset: 0; display: grid; place-items: center; padding: 5% 9%; }
.tray-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #d8efe6; font-size: var(--fs-meta); }
.tray-empty .cup { display: flex; gap: 6px; justify-content: center; margin-bottom: 10px; opacity: .9; }

.g-actions { grid-area: actions; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.f-desktop .g-actions { align-self: end; }
.f-landscape .g-actions { justify-content: flex-end; }
.kept { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-height: 40px; }
.kept .lbl { font-size: var(--fs-meta); color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.kept-group { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px 4px 6px; border-radius: 10px; background: #00000045; border: 1px solid var(--line); }
.kept-group .pts { font-weight: 800; font-size: var(--fs-meta); color: var(--good); margin-left: 4px; }
.f-landscape .kept .die.mini { --die: 22px; }
.stake { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 14px; background: var(--panel); border: 1.5px solid var(--line); }
.stake .v { font: 800 calc(30px * var(--ts))/1 var(--sans); }
.stake .bd { font-size: var(--fs-meta); color: var(--ink-2); text-align: right; }
.f-portrait .stake .v, .f-landscape .stake .v { font-size: calc(24px * var(--ts)); }
.f-landscape .stake { padding: 6px 10px; flex-wrap: wrap; }
.f-landscape .stake .bd { display: none; }
.act-row { display: grid; grid-template-columns: 1fr 1.35fr; gap: 12px; }
.act-row .roll { order: 2; }
.act-row .bank { order: 1; }
.lefty .act-row { grid-template-columns: 1.35fr 1fr; }
.lefty .act-row .roll { order: 1; }
.lefty .act-row .bank { order: 2; }
.f-landscape .act-row { grid-template-columns: 1fr; }
.f-landscape .act-row .roll { order: 1; }
.f-landscape .act-row .bank { order: 2; }
.act-row .btn { min-height: 78px; font-size: calc(21px * var(--ts)); border-radius: 18px; }
.f-portrait .act-row .btn { min-height: 72px; }
.f-landscape .act-row .btn { min-height: 64px; font-size: calc(18px * var(--ts)); }
.act-row .btn .sub { font-size: var(--fs-meta); }
.bank-lock { display: inline-flex; align-items: center; gap: 8px; }
.botbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px; border-radius: 16px; background: var(--panel); border: 1.5px dashed var(--line-2); min-height: 78px; }
.botbar .dots span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--opp); margin-right: 4px; animation: blink 1s infinite; }
.botbar .dots span:nth-child(2) { animation-delay: .15s; } .botbar .dots span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

.g-log, .g-side { align-self: end; }
.g-log ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.g-log li { display: flex; gap: 8px; align-items: center; font-size: var(--fs-meta); color: var(--ink-2); }
.g-log li b { color: var(--ink); }
.g-log li .ic-good { color: var(--good); } .g-log li .ic-bad { color: var(--bad); } .g-log li .ic-hot { color: var(--hot); }
.disclose { width: 100%; display: flex; justify-content: space-between; align-items: center; background: none; border: 0; color: var(--ink); padding: 4px 2px 6px; cursor: pointer; font: 600 var(--fs-body) var(--serif); min-height: 40px; }
.score-table { width: 100%; border-collapse: collapse; font-size: var(--fs-meta); }
.score-table td { padding: 4px 2px; border-top: 1px solid #ffffff12; }
.score-table td:last-child { text-align: right; font-weight: 800; color: var(--ink); }
.score-table .mini-dice { display: inline-flex; gap: 3px; }
.score-table .die.mini { --die: 18px; border-radius: 4px; }
.score-table .x { color: var(--ink-2); }

/* Toast + moments + fx */
.toast { position: absolute; left: 50%; translate: -50% 0; bottom: 14px; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 12px; background: #2a1310; border: 1.5px solid #8b3a30; color: #ffd9d2; font-size: var(--fs-meta); font-weight: 600; white-space: nowrap; box-shadow: 0 8px 20px rgba(0,0,0,.5); animation: pop .25s ease-out; }
.toast.info { background: #1d1711; border-color: var(--line-2); color: var(--ink); }
.toast.hot { background: #2a1e08; border-color: #8a6420; color: #ffe3a6; }
.moment { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 30; }
.moment .card { text-align: center; animation: momentIn .5s cubic-bezier(.2,1.4,.4,1) both; }
.moment .big { font: 800 calc(76px * var(--ts))/1 var(--display); display: flex; align-items: center; gap: 16px; justify-content: center; text-shadow: 0 6px 0 rgba(0,0,0,.45), 0 0 40px rgba(0,0,0,.6); }
.moment .big svg { width: .8em; height: .8em; stroke-width: 2.6; }
.moment .subline { display: inline-block; margin-top: 10px; padding: 8px 16px; border-radius: 12px; background: #120e0bee; border: 1.5px solid var(--line-2); font-weight: 600; }
.moment.bust .big { color: var(--bad); }
.moment.hot .big { color: var(--hot); }
.moment.final .big { color: var(--ink); }
.moment.turn .big { font-size: calc(48px * var(--ts)); color: var(--ink); }
.moment.win .big { color: var(--amber-2); }
.f-portrait .moment .big, .f-landscape .moment .big { font-size: calc(48px * var(--ts)); }
.f-portrait .moment.turn .big, .f-landscape .moment.turn .big { font-size: calc(34px * var(--ts)); }
.moment.out .card { animation: momentOut .3s ease-in forwards; }
@keyframes momentIn { 0% { scale: .55; opacity: 0; } 100% { scale: 1; opacity: 1; } }
@keyframes momentOut { to { scale: 1.08; opacity: 0; } }
@keyframes pop { from { scale: .9; opacity: 0; } to { scale: 1; opacity: 1; } }
.vignette { position: absolute; inset: 0; pointer-events: none; z-index: 20; animation: vig .9s ease-out forwards; }
.vignette.bad { box-shadow: inset 0 0 160px 40px rgba(255,70,50,.55); }
.vignette.hot { box-shadow: inset 0 0 160px 40px rgba(255,190,60,.5); }
@keyframes vig { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }
.fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 25; }
.spark { position: absolute; width: 9px; height: 9px; border-radius: 2px; background: var(--hot); animation: spark var(--t, .9s) cubic-bezier(.1,.7,.3,1) forwards; }
.spark.coin { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffe7a3, #d99a1e); box-shadow: inset 0 0 0 2px #a8700f; }
@keyframes spark { 0% { translate: 0 0; opacity: 1; } 100% { translate: var(--dx) var(--dy); rotate: var(--r); opacity: 0; } }
.flash { animation: flash .16s; }
@keyframes flash { 0% { filter: brightness(1.9) saturate(1.3); } 100% { filter: none; } }
.shake-frame { animation: fshake .32s; }
@keyframes fshake { 0%, 100% { translate: 0 0; } 25% { translate: -6px 3px; } 50% { translate: 5px -4px; } 75% { translate: -3px 2px; } }

/* ---------- Overlays / sheets ---------- */
.overlay { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(8,6,5,.78); padding: 20px; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: min(560px, 100%); max-height: 100%; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.sheet.wide { width: min(760px, 100%); }
.sheet .sheet-h { display: flex; align-items: center; gap: 12px; }
.sheet .sheet-h .title, .sheet .sheet-h .h2 { flex: 1; }
.f-portrait .overlay { place-items: end stretch; padding: 0; }
.f-portrait .overlay .sheet { width: 100%; border-image-width: 12px 12px 0 12px; border-bottom-width: 0; max-height: 92%; padding-bottom: 18px; animation: up .25s ease-out; }
@keyframes up { from { translate: 0 40px; opacity: 0; } }
.f-portrait .title { font-size: calc(30px * var(--ts)); }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1; }
.btn-col { display: flex; flex-direction: column; gap: 10px; }
.steps { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.steps li { display: flex; gap: 10px; align-items: center; }
.steps .s-ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; border: 1.5px solid var(--line-2); }
.steps .done .s-ic { background: #12241d; color: var(--good); border-color: #2f6b55; }
.steps .now .s-ic { color: var(--amber); border-color: var(--amber); }
.steps .now .s-ic svg { animation: spin 1.2s linear infinite; }
.steps .todo { color: var(--ink-3); }
@keyframes spin { to { rotate: 360deg; } }
details.more { border-top: 1px solid #ffffff14; padding-top: 8px; }
details.more summary { cursor: pointer; color: var(--ink-2); font-weight: 600; font-size: var(--fs-meta); min-height: 36px; display: flex; align-items: center; gap: 6px; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more[open] summary svg { rotate: 90deg; }
details.more pre { white-space: pre-wrap; font: 13px/1.5 ui-monospace, monospace; color: var(--ink-2); margin: 6px 0 0; }

/* ---------- Menu screens ---------- */
.screen { position: absolute; inset: 0; overflow: auto; padding: 28px; }
.screen.center { display: grid; place-items: center; }
.backdrop-dice { position: absolute; inset: 0; pointer-events: none; opacity: .14; filter: blur(2px); }
.backdrop-dice .die { position: absolute; --die: 90px; }
.screen-h { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.screen-h .title { flex: 1; }
.f-portrait .screen { padding: 16px 14px; }
.f-portrait .screen-h { margin-bottom: 12px; }

.home { position: relative; width: min(640px, 100%); display: flex; flex-direction: column; gap: 14px; }
.home .brand { text-align: center; margin-bottom: 6px; }
.home .brand .eyebrow { letter-spacing: .35em; margin-top: 8px; color: var(--amber); }
.f-landscape .home { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; align-items: start; }
.f-landscape .home .colA, .f-landscape .home .colB { display: flex; flex-direction: column; gap: 10px; }
.home .colA, .home .colB { display: flex; flex-direction: column; gap: 14px; }
.f-landscape .logo { width: min(100%, 480px); }
.continue { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 16px; border-radius: 18px; background: linear-gradient(120deg, #3b2a12, #221a12 70%); border: 2px solid var(--amber); box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.continue .t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.f-portrait .continue, .f-landscape .continue { grid-template-columns: auto 1fr; }
.f-portrait .continue .btn, .f-landscape .continue .btn { grid-column: 1 / -1; }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.f-portrait .modes, .f-landscape .modes { grid-template-columns: 1fr; gap: 10px; }
.mode { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px; border-radius: 16px; background: var(--panel); border: 1.5px solid var(--line); color: var(--ink); cursor: pointer; text-align: left; position: relative; transition: translate .12s, border-color .12s; min-height: 48px; }
.mode:hover { translate: 0 -2px; border-color: var(--line-2); }
.f-portrait .mode, .f-landscape .mode { flex-direction: row; align-items: center; padding: 12px; }
.mode .mi { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--panel-3); color: var(--amber); flex: none; }
.mode .mt { font-weight: 700; font-size: calc(18px * var(--ts)); }
.mode .ms { font-size: var(--fs-meta); color: var(--ink-2); }
.mode .badge-top { position: absolute; top: 10px; right: 10px; }
.f-portrait .mode .badge-top, .f-landscape .mode .badge-top { position: static; margin-left: auto; }
.util { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.util .btn { flex: 1; min-width: 0; padding: 8px; font-size: var(--fs-meta); flex-direction: column; gap: 4px; min-height: 64px; background: transparent; border-color: var(--line); color: var(--ink-2); }

.opp-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.f-tablet .opp-grid { grid-template-columns: repeat(3, 1fr); }
.f-portrait .opp-grid, .f-landscape .opp-grid { grid-template-columns: 1fr; gap: 8px; }
.f-landscape .opp-grid { grid-template-columns: 1fr 1fr; }
.opp { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; border-radius: 16px; background: var(--panel); border: 1.5px solid var(--line); color: var(--ink); cursor: pointer; text-align: left; min-height: 48px; }
.opp[aria-pressed="true"] { border: 2.5px solid var(--amber); background: linear-gradient(160deg, #3b2a12, var(--panel) 70%); }
.opp .sel-badge { display: none; position: absolute; top: 10px; right: 10px; }
.opp[aria-pressed="true"] .sel-badge { display: inline-flex; }
.f-portrait .opp, .f-landscape .opp { flex-direction: row; align-items: center; padding: 10px 12px; }
.f-portrait .opp .desc, .f-landscape .opp .desc { display: none; }
.opp .on { font: 700 calc(20px * var(--ts)) var(--serif); }
.opp .ep { font-size: var(--fs-meta); color: var(--ink-2); }
.skill { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-meta); color: var(--ink-2); }
.skill i { width: 10px; height: 10px; transform: rotate(45deg); border: 1.5px solid var(--amber); display: inline-block; }
.skill i.on { background: var(--amber); }
.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.f-portrait .presets, .f-landscape .presets { grid-template-columns: 1fr 1fr; gap: 8px; }
.preset { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--panel); border: 1.5px solid var(--line); color: var(--ink); cursor: pointer; text-align: left; min-height: 48px; }
.preset[aria-pressed="true"] { border: 2.5px solid var(--amber); background: #2e2213; }
.preset .pn { font-weight: 700; display: flex; align-items: center; gap: 6px; width: 100%; }
.preset .pn .chip { margin-left: auto; }
.section { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.stepper { display: flex; gap: 6px; align-items: center; font-size: var(--fs-meta); color: var(--ink-3); flex-wrap: wrap; }
.stepper .st { display: inline-flex; align-items: center; gap: 6px; }
.stepper .st b { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line-2); font-size: 12px; }
.stepper .st.on { color: var(--ink); }
.stepper .st.on b { background: var(--amber); color: var(--on-amber); border-color: var(--amber); }
.stepper .st.done b { background: #12241d; color: var(--good); border-color: #2f6b55; }
.footer-bar { position: sticky; bottom: -28px; margin: 10px -28px -28px; padding: 14px 28px; background: linear-gradient(transparent, #0d0a08 30%); display: flex; align-items: center; gap: 14px; }
.f-portrait .footer-bar { bottom: -16px; margin: 10px -14px -16px; padding: 12px 14px; flex-wrap: wrap; }
.footer-bar .sum { flex: 1; font-size: var(--fs-meta); color: var(--ink-2); min-width: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field input { background: #0f0c0a; color: var(--ink); border: 1.5px solid var(--line-2); border-radius: 12px; padding: 12px 14px; font: 600 var(--fs-body) var(--sans); min-height: 48px; }
.field input:focus { outline: 3px solid var(--amber-2); outline-offset: 2px; }

.list { display: flex; flex-direction: column; gap: 8px; }
.row-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--panel); border: 1.5px solid var(--line); }
.row-item.urgent { border-color: var(--amber); }
.row-item .rt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.row-item .rn { font-weight: 700; }
.row-item .acts { display: flex; gap: 8px; }
.f-portrait .row-item { grid-template-columns: auto 1fr; }
.f-portrait .row-item .acts { grid-column: 1 / -1; }
.f-portrait .row-item .acts .btn { flex: 1; }
.tabs { display: flex; gap: 4px; border-bottom: 1.5px solid var(--line); margin-bottom: 12px; overflow-x: auto; }
.tabs button { background: none; border: 0; color: var(--ink-2); font: 600 var(--fs-body) var(--sans); padding: 10px 14px; min-height: 48px; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1.5px; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--amber); }
.count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; display: inline-grid; place-items: center; background: var(--amber); color: var(--on-amber); font: 800 12px var(--sans); }
.count.muted { background: var(--panel-3); color: var(--ink-2); }
.two-col { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; align-items: start; }
.f-portrait .two-col, .f-tablet .two-col { grid-template-columns: 1fr; }
.f-landscape .two-col { gap: 12px; }
.code { font: 800 calc(56px * var(--ts))/1 var(--sans); letter-spacing: .14em; color: var(--amber-2); text-align: center; padding: 18px; border-radius: 16px; background: #0f0c0a; border: 1.5px dashed var(--line-2); }
.f-landscape .code { font-size: calc(38px * var(--ts)); padding: 10px; }
.opt-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px solid #ffffff10; }
.opt-row .ol { display: flex; flex-direction: column; min-width: 0; }
.opt-row .ol span:first-child { font-weight: 600; }
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.f-portrait .opt-grid, .f-landscape .opt-grid { grid-template-columns: 1fr; }
input[type="range"].slider { accent-color: var(--amber); width: 160px; height: 28px; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: 14px; background: var(--panel); border: 1.5px solid var(--line); color: var(--ink-2); cursor: pointer; font: 600 13px var(--sans); position: relative; }
.swatch[aria-pressed="true"] { border: 2.5px solid var(--amber); color: var(--ink); }
.swatch[aria-pressed="true"]::after { content: "✓"; position: absolute; top: 4px; right: 6px; color: var(--amber); font-weight: 800; }
.swatch .die { --die: 44px; translate: none; rotate: none; cursor: inherit; }
.swatch .wood { width: 54px; height: 40px; border-radius: 8px; border: 6px solid; }
.preview-tray { position: relative; height: 260px; border-radius: 26px; padding: 12px; background: linear-gradient(135deg, var(--wood), var(--wood-2) 50%, var(--wood)); box-shadow: 0 18px 40px rgba(0,0,0,.5); }
.preview-tray .felt { display: flex; gap: 22px; align-items: center; justify-content: center; }
.preview-tray .die { --die: 74px; }
.f-portrait .preview-tray { height: 180px; }
.f-portrait .preview-tray .die { --die: 52px; }
.f-landscape .preview-tray { height: 150px; }
.f-landscape .preview-tray .die { --die: 46px; }
.stat-grid { display: grid; grid-template-columns: 1fr auto auto; gap: 0; font-size: var(--fs-body); }
.stat-grid > div { padding: 8px 6px; border-top: 1px solid #ffffff14; }
.stat-grid .hd { color: var(--ink-2); font-weight: 700; border-top: 0; display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.stat-grid .v { text-align: right; font-weight: 700; min-width: 90px; }
.stat-grid .better { color: var(--good); }
.cmp-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: #00000050; }
.cmp-bar .a { background: var(--you); }
.cmp-bar .b { background: repeating-linear-gradient(135deg, var(--opp) 0 6px, #6aa4e0 6px 12px); }
.privacy { position: absolute; inset: 0; z-index: 45; display: grid; place-items: center; text-align: center; padding: 24px; background: radial-gradient(circle at 50% 35%, #2a2014, #0b0806 75%); }
.privacy .inner { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 460px; }
