/* Layout and motion shared by every era. Colors, fonts and each era's own
   shapes live in themes.css. */

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
body {
  background: var(--page); color: var(--ink); font-family: var(--font-b); line-height: 1.35;
  -webkit-tap-highlight-color: transparent; overscroll-behavior: none; transition: background .5s; touch-action: manipulation;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; text-align: inherit; touch-action: manipulation; }
button:disabled { cursor: default; opacity: .45; }
button:focus-visible, g[data-act]:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, p, ul, dl, dd { margin: 0; padding: 0; }
ul { list-style: none; }
.ico { width: 1.5em; height: 1.5em; flex: none; }
small { font-size: .8125rem; }

#app { height: 100vh; height: 100dvh; max-width: 30rem; margin: 0 auto; position: relative; overflow: hidden; background: var(--bg); box-shadow: 0 0 60px rgba(0, 0, 0, .35); }

/* ---------- title ---------- */
.title { height: 100%; overflow-y: auto; padding: calc(env(safe-area-inset-top) + 1.75rem) 1.125rem calc(env(safe-area-inset-bottom) + 1.5rem); display: flex; flex-direction: column; gap: 1.25rem; position: relative; }
.title header { text-align: center; }
.logo { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 700; font-size: 3rem; line-height: 1; letter-spacing: .01em; }
.title header p { color: var(--ink-2); margin-top: .375rem; font-size: 1.0625rem; }
.eras { display: flex; flex-direction: column; gap: 1rem; }
.era-card, .game { font-family: var(--font-b); }
.era-card { display: block; width: 100%; background: var(--bg); color: var(--ink); border-radius: 1.125rem; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); animation: card-in .6s both cubic-bezier(.2, .8, .2, 1); transition: transform .15s; }
.era-card:nth-child(2) { animation-delay: .08s; }
.era-card:nth-child(3) { animation-delay: .16s; }
.era-card:active { transform: scale(.98); }
.era-art .scene { height: 7.5rem; min-height: 0; }
.era-art .rider { width: 5.5rem; }
.era-body { padding: .875rem 1.125rem 1.125rem; }
.era-body h2 { font-family: var(--font-d); font-size: 2rem; line-height: 1.1; }
.era-body p { color: var(--ink-2); margin-top: .125rem; }
.era-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .375rem .75rem; margin-top: .75rem; }
.era-foot .go { display: inline-flex; align-items: center; gap: .25rem; background: var(--accent); color: var(--accent-ink); padding: .5rem .625rem .5rem .875rem; border-radius: var(--r-btn); font-weight: 700; min-height: 2.75rem; }
.era-foot .go .ico { width: 1.125em; height: 1.125em; }
.era-foot .best { font-size: .875rem; color: var(--ink-2); }
.title footer { text-align: center; margin-top: auto; }
.link { color: var(--ink-2); text-decoration: underline; min-height: 2.75rem; padding: 0 .5rem; }

/* ---------- game frame ---------- */
.game { height: 100%; display: flex; flex-direction: column; position: relative; background: var(--bg); color: var(--ink); overflow: hidden; }
.hud { flex: none; padding: calc(env(safe-area-inset-top) + .875rem) 1.125rem .625rem; position: relative; z-index: 2; }
.hud-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.eyebrow { font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); }
.hud h1 { font-family: var(--font-d); font-size: 2.5rem; line-height: 1.02; font-weight: var(--w-d); }
.blurb { color: var(--ink-2); font-size: .9375rem; }
.crest { width: 3.375rem; height: 3.375rem; flex: none; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); border-radius: .375rem; }
.crest .veh { width: 2.375rem; --scene-bg: var(--accent); --accent: var(--accent-ink); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: .75rem; }
.stat { display: flex; flex-direction: column; gap: .0625rem; min-width: 0; }
.stat .k { font-size: .6875rem; letter-spacing: .15em; text-transform: uppercase; color: var(--ink-2); }
.stat .v { font-family: var(--font-d); font-weight: var(--w-d); font-size: 1.5rem; line-height: 1.15; white-space: nowrap; }
.stat .v small { font-size: .9375rem; font-weight: 500; color: var(--ink-2); }
.stat.debt .v { color: var(--warn); }
.v .rise, .v.rise { color: var(--up-hud); }
.v .fall, .v.fall { color: var(--warn); }
[data-num] { display: inline-block; transition: color .3s; }
.gauges { display: flex; gap: 1rem; margin-top: .5rem; }
.gauge { flex: 1; display: flex; align-items: center; gap: .5rem; font-size: .75rem; color: var(--ink-2); min-width: 0; }
.gauge span { white-space: nowrap; letter-spacing: .06em; }
.gauge em { font-style: normal; white-space: nowrap; }
.bar { flex: 1; height: .375rem; background: var(--track); border-radius: 1rem; overflow: hidden; display: block; }
.bar b { display: block; height: 100%; background: var(--fill); border-radius: 1rem; transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.gauge.low .bar b { background: var(--warn); }
.gauge.wide { margin: .75rem 0; font-size: .875rem; }
.gauge.wide .bar { height: .5rem; }

.view { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 1.125rem 1.25rem; position: relative; }
.view.enter > * { animation: view-in .35s both cubic-bezier(.2, .8, .2, 1); }
.view.enter > *:nth-child(2) { animation-delay: .05s; }
.view.enter > *:nth-child(3) { animation-delay: .1s; }
.view.enter > *:nth-child(n+4) { animation-delay: .15s; }
.view-head { display: flex; justify-content: space-between; align-items: baseline; padding: .75rem 0 .5rem; position: sticky; top: 0; background: var(--bg); z-index: 1; }
.view-head h2 { font-family: var(--font-d); font-weight: var(--w-d); font-size: 1.5rem; }
.hint { font-size: .8125rem; color: var(--ink-2); }

.tabs { flex: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .25rem; padding: .375rem .625rem calc(env(safe-area-inset-bottom) + .5rem); position: relative; z-index: 2; }
.tabs button { display: flex; flex-direction: column; align-items: center; gap: .125rem; padding: .375rem 0; min-height: 3.25rem; font-size: .8125rem; transition: color .2s, background .2s, transform .15s; }
.tabs button:active { transform: scale(.94); }

/* ---------- market ---------- */
.goods { display: flex; flex-direction: column; gap: var(--row-gap); }
.item { display: grid; grid-template-columns: 2rem minmax(0, 1fr) 4.5rem auto; align-items: center; gap: .625rem; width: 100%; min-height: 3.5rem; padding: var(--row-pad); background: var(--row-bg); color: var(--row-ink); border-radius: var(--r-row); transition: transform .15s, background .3s; }
.item:active { transform: scale(.985); }
.gi { display: grid; place-items: center; color: var(--row-ink); opacity: .85; }
.gi.lg { width: 3rem; height: 3rem; border-radius: 50%; background: var(--track); opacity: 1; flex: none; color: inherit; }
.gn { display: flex; flex-direction: column; min-width: 0; }
.gn b { font-family: var(--font-d); font-weight: var(--w-d); font-size: 1.25rem; line-height: 1.15; }
.gn small { color: var(--row-ink-2); line-height: 1.25; }
.item.low .tag { color: var(--good); }
.item.high .tag { color: var(--bad); }
.own { font-style: italic; }
.gp { font-family: var(--font-d); font-weight: var(--w-d); font-size: 1.5rem; text-align: right; min-width: 3.25rem; }
.meter { position: relative; height: 1rem; display: block; }
.meter::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; background: var(--row-ink); opacity: .3; }
.meter i { position: absolute; left: var(--pos); top: 50%; width: .625rem; height: .625rem; margin: -.3125rem 0 0 -.3125rem; background: var(--row-ink); transform: rotate(45deg); border-radius: 2px; transition: left .5s cubic-bezier(.2, .8, .2, 1); }
.item.low .meter i { background: var(--good); }
.item.high .meter i { background: var(--bad); }
.item.flash { animation: flash .9s; }

/* ---------- sheets ---------- */
.layer { position: absolute; inset: 0; z-index: 20; }
#over { z-index: 30; }
.scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); animation: fade .2s both; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 90%; overflow-y: auto; background: var(--panel); color: var(--panel-ink); border-radius: var(--r-sheet) var(--r-sheet) 0 0; padding: 1.375rem 1.125rem calc(env(safe-area-inset-bottom) + 1.125rem); display: flex; flex-direction: column; gap: .875rem; border-top: var(--sheet-edge); --row-ink: var(--panel-ink); }
.sheet.in { animation: rise .3s both cubic-bezier(.2, .8, .2, 1); }
.closing .sheet { transform: translateY(100%); transition: transform .2s ease-in; }
.closing .scrim { opacity: 0; transition: opacity .2s; }
.x { position: absolute; top: .625rem; right: .625rem; width: 2.75rem; height: 2.75rem; display: grid; place-items: center; opacity: .7; }
.sheet-head { display: flex; align-items: center; gap: .75rem; padding-right: 2.5rem; }
.sheet-head h3 { font-family: var(--font-d); font-weight: var(--w-d); font-size: 1.75rem; line-height: 1.1; }
.sheet-head p { color: var(--panel-ink-2); font-size: .9375rem; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: .25rem; padding: .25rem; background: var(--track); border-radius: var(--r-btn); }
.seg button { min-height: 2.75rem; text-align: center; font-weight: 700; border-radius: calc(var(--r-btn) - 2px); transition: background .2s, color .2s; }
.seg button.on { background: var(--accent-p); color: var(--accent-p-ink); }
.qty { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.qty output { font-family: var(--font-d); font-weight: var(--w-d); font-size: 3.25rem; line-height: 1; }
.rnd { width: 3rem; height: 3rem; flex: none; display: grid; place-items: center; border-radius: var(--r-btn); border: 2px solid currentColor; transition: transform .1s; }
.rnd:active { transform: scale(.9); }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 2.75rem; background: transparent; margin: -.5rem 0; }
input[type=range]::-webkit-slider-runnable-track { height: .5rem; background: var(--track); border-radius: 1rem; }
input[type=range]::-moz-range-track { height: .5rem; background: var(--track); border-radius: 1rem; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 2rem; height: 2rem; margin-top: -.75rem; border-radius: var(--r-thumb); background: var(--accent-p); border: 3px solid var(--panel); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
input[type=range]::-moz-range-thumb { width: 1.75rem; height: 1.75rem; border-radius: var(--r-thumb); background: var(--accent-p); border: 3px solid var(--panel); }
.chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.chips button { min-height: 2.75rem; text-align: center; border: 1.5px solid currentColor; border-radius: var(--r-btn); font-weight: 600; opacity: .85; }
.sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.sum div { display: flex; flex-direction: column; gap: .0625rem; padding: .5rem .625rem; background: var(--track); border-radius: var(--r-row); min-width: 0; }
.sum dt { font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase; color: var(--panel-ink-2); }
.sum dd { font-family: var(--font-d); font-weight: var(--w-d); font-size: 1.25rem; overflow-wrap: anywhere; line-height: 1.2; }
.up { color: var(--up); }
.down { color: var(--down); }
.note { color: var(--panel-ink-2); font-size: .9375rem; min-height: 1.3em; }
.cta, .btn { display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; min-height: 3.25rem; padding: .5rem 1rem; text-align: center; font-weight: 700; font-size: 1.0625rem; border-radius: var(--r-btn); transition: transform .12s, opacity .2s; }
.cta { background: var(--accent-p); color: var(--accent-p-ink); }
.btn { border: 2px solid currentColor; min-height: 2.875rem; font-size: 1rem; }
.btn.ghost { border-color: transparent; text-decoration: underline; }
.cta:active, .btn:active { transform: scale(.97); }
.field { display: flex; flex-direction: column; gap: .25rem; }
.field input { min-height: 3rem; padding: 0 .75rem; font-size: 1.25rem; letter-spacing: .1em; background: var(--track); border: 2px solid currentColor; border-radius: var(--r-btn); }

.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.facts div { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .125rem; padding: .625rem .25rem; background: var(--track); border-radius: var(--r-row); }
.facts b { font-size: .9375rem; }
.facts small, .choice small { color: var(--panel-ink-2); }
.facts .good, .risk.good, .odds.item { color: var(--up); }
.facts .bad, .risk.bad, .odds.bad { color: var(--down); }
.supply { display: flex; align-items: center; gap: .625rem; }
.supply .st { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.supply small { color: var(--panel-ink-2); }
.tidings { display: flex; flex-direction: column; gap: .375rem; }
.tidings li { padding: .5rem .75rem; border-left: 3px solid var(--accent-p); background: var(--track); font-size: .9375rem; text-align: left; }
.know { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.know th { text-align: left; font-weight: 600; padding: .3125rem 0; }
.know th em { font-style: normal; font-size: .75rem; padding: 0 .375rem; border: 1px solid currentColor; border-radius: 1rem; margin-left: .25rem; }
.know td { text-align: right; padding: .3125rem 0 .3125rem .5rem; font-variant-numeric: tabular-nums; }
.know td:last-child { width: 1.5rem; }
.know td .ico { width: 1em; height: 1em; vertical-align: -.125em; }
.know thead th, .know thead td { font-size: .75rem; font-weight: 400; color: var(--panel-ink-2); letter-spacing: .06em; }
.know tbody tr { border-top: 1px solid var(--track); }

/* ---------- map ---------- */
.mapwrap { overflow: auto; border-radius: var(--r-row); border: var(--map-edge); -webkit-overflow-scrolling: touch; max-height: 21.25rem; background: var(--map-bg); }
.map { display: block; max-width: none; }
.map .hit { fill: transparent; }
.map .place { cursor: pointer; }
.map .place.far { opacity: .5; }
.map .pulse { fill: none; stroke: var(--map-here); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: pulse 1.8s ease-out infinite; }
.map .route { fill: none; }
.dests { display: flex; flex-direction: column; gap: var(--row-gap); margin-top: .75rem; }
.dest-card { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: .75rem; width: 100%; min-height: 3.5rem; padding: var(--row-pad); background: var(--row-bg); color: var(--row-ink); border-radius: var(--r-row); }
.dest-card:active { transform: scale(.985); }
.dn { display: flex; flex-direction: column; min-width: 0; }
.dn b { font-family: var(--font-d); font-weight: var(--w-d); font-size: 1.25rem; line-height: 1.15; }
.dn small { color: var(--row-ink-2); display: flex; align-items: center; gap: .25rem; }
.dn small .ico { width: 1em; height: 1em; }
.dd { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.dd b { font-family: var(--font-d); font-weight: var(--w-d); font-size: 1.5rem; }
.dd small { color: var(--row-ink-2); }
.risk { font-size: .75rem; font-weight: 700; letter-spacing: .04em; padding: .1875rem .5rem; border: 1.5px solid currentColor; border-radius: 1rem; white-space: nowrap; }
.dest-card.closed { opacity: .6; }

/* ---------- travel ---------- */
.travel { position: absolute; inset: 0; background: var(--bg); display: flex; flex-direction: column; animation: fade .4s both; }
.scene { position: relative; height: 50%; min-height: 13rem; overflow: hidden; background: var(--scene-bg); transition: filter .6s; }
.band { position: absolute; left: 0; bottom: 0; width: 200%; height: 100%; animation: slide var(--t, 30s) linear infinite; }
.band path, .band circle { fill: var(--c); }
.rider { position: absolute; left: 50%; width: 7.5rem; margin-left: -3.75rem; color: var(--veh); animation: bob 3.2s ease-in-out infinite; }
.rider.train { display: flex; width: 13rem; margin-left: -6.5rem; gap: .25rem; }
.rider.train .veh { animation: step 1.1s ease-in-out infinite; }
.rider.train .veh:nth-child(2) { animation-delay: .35s; }
.rider.train .veh:nth-child(3) { animation-delay: .7s; }
.veh { display: block; width: 100%; height: auto; }
.foe { position: absolute; right: -8rem; width: 5.5rem; color: var(--down); opacity: 0; transform: scaleX(-1); transition: right 1s cubic-bezier(.2, .8, .2, 1), opacity .6s; }
.is-hostile .foe { right: 6%; opacity: 1; }
.rain { position: absolute; inset: -20% 0; opacity: 0; transition: opacity .6s; pointer-events: none; }
.is-weather .rain { opacity: 1; animation: rain .5s linear infinite; }
.is-weather { filter: saturate(.6) brightness(.82); }
.is-weather .rider { animation-duration: 1.1s; }
.trip { padding: 1.125rem 1.125rem 0; }
.trip h2 { font-family: var(--font-d); font-weight: var(--w-d); font-size: 1.75rem; line-height: 1.15; margin-top: .125rem; }
.trip h2 span { font-size: .6em; color: var(--ink-2); font-weight: 400; }
.track { height: .5rem; background: var(--track); border-radius: 1rem; margin-top: .875rem; overflow: hidden; }
.track i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 1rem; transition: width .7s linear; }
.daycount { margin-top: .5rem; color: var(--ink-2); font-size: .9375rem; }
#enc { position: absolute; left: 0; right: 0; bottom: 0; padding: .875rem .875rem calc(env(safe-area-inset-bottom) + .875rem); }
.enc-card, .arrive-card { background: var(--panel); color: var(--panel-ink); border-radius: var(--r-sheet); padding: 1.25rem 1.125rem; display: flex; flex-direction: column; gap: .75rem; border: var(--card-edge); box-shadow: 0 12px 40px rgba(0, 0, 0, .45); --row-ink: var(--panel-ink); }
.enc-card.in, .arrive-card.in { animation: pop .4s both cubic-bezier(.2, 1.1, .3, 1); }
.enc-card h3 { font-family: var(--font-d); font-weight: var(--w-d); font-size: 1.75rem; line-height: 1.1; }
.enc-ico { width: 2.75rem; height: 2.75rem; display: grid; place-items: center; background: var(--accent-p); color: var(--accent-p-ink); border-radius: 50%; }
.choices { display: flex; flex-direction: column; gap: .5rem; }
.choice { display: flex; justify-content: space-between; align-items: center; gap: .75rem; min-height: 3.25rem; padding: .5rem .875rem; border: 2px solid currentColor; border-radius: var(--r-btn); width: 100%; }
.choice:active { transform: scale(.98); }
.odds { font-weight: 700; white-space: nowrap; }
.deltas { display: flex; flex-wrap: wrap; gap: .375rem; }
.deltas span { padding: .25rem .625rem; border: 1.5px solid currentColor; border-radius: 1rem; font-size: .875rem; font-weight: 700; }
.tone-bad { animation: pop .4s both, shake .5s .1s; }

.arrive { position: absolute; inset: 0; display: flex; align-items: center; padding: 1.125rem; background: var(--veil); animation: fade .3s both; overflow-y: auto; }
.arrive-card { width: 100%; text-align: center; align-items: stretch; margin: auto 0; }
.arrive-card h2 { font-family: var(--font-d); font-weight: var(--w-d); font-size: 2.5rem; line-height: 1.05; }
.arrive-card .eyebrow, .arrive-card .blurb { color: var(--panel-ink-2); }
.big { font-family: var(--font-d); font-weight: var(--w-d); font-size: 3rem; line-height: 1.15; }
.big.neg { color: var(--down); }
.how { display: flex; align-items: center; justify-content: center; gap: .5rem; padding: .5rem 0; }
.how div { display: flex; flex-direction: column; align-items: center; gap: .25rem; flex: 1; }
.how div > .ico { width: 2.25rem; height: 2.25rem; }
.how > .ico { opacity: .5; width: 1.125rem; }
.how.tips { align-items: flex-start; gap: 1rem; }
.how small { color: var(--panel-ink-2); }

/* ---------- port and ledger ---------- */
.cards { display: flex; flex-direction: column; gap: .75rem; }
.card { background: var(--card-bg); color: var(--card-ink); border: var(--card-edge); border-radius: var(--r-card); padding: 1rem; position: relative; --row-ink: var(--card-ink); }
.v-ledger .card { margin-bottom: .75rem; }
.card h3 { font-family: var(--font-d); font-weight: var(--w-d); font-size: 1.375rem; }
.card p { color: var(--card-ink-2); font-size: .9375rem; }
.card.off { opacity: .6; }
.card .gauge { color: var(--card-ink-2); }
.card-art { position: absolute; right: 1rem; top: .875rem; width: 4.5rem; color: var(--card-ink); opacity: .9; --scene-bg: var(--card-bg); }
.specs { display: flex; flex-wrap: wrap; gap: .375rem 1rem; margin-top: .625rem; font-size: .875rem; }
.specs span { display: inline-flex; align-items: center; gap: .25rem; }
.specs .ico, .guards .ico, .fine .ico { width: 1.125em; height: 1.125em; }
.fine { display: flex; align-items: center; gap: .25rem; font-size: .875rem !important; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .75rem; }
.row2.pad { margin: .25rem 0 1rem; }
.card > .btn { margin-top: .75rem; }
.offers { display: flex; flex-direction: column; gap: .5rem; margin: .75rem 0; }
.offer { display: flex; justify-content: space-between; align-items: center; gap: .75rem; width: 100%; padding: .625rem .75rem; border: 1.5px solid currentColor; border-radius: var(--r-row); min-height: 3.5rem; }
.offer span { display: flex; flex-direction: column; min-width: 0; }
.offer .oc { align-items: flex-end; text-align: right; flex: none; }
.offer b { font-family: var(--font-d); font-weight: var(--w-d); font-size: 1.125rem; }
.offer small { color: var(--card-ink-2); }
.guards { display: flex; flex-direction: column; gap: .5rem; }
.guards span { display: flex; align-items: center; gap: .375rem; }
.worth { text-align: center; }
.spark { width: 100%; height: 4.5rem; margin-top: .5rem; }
.spark polyline { fill: none; stroke: var(--accent-c); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.goalbar { height: .5rem; background: var(--track); border-radius: 1rem; overflow: hidden; margin: .5rem 0 .375rem; }
.goalbar i { display: block; height: 100%; background: var(--accent-c); transition: width .8s; }
.worth .fine { justify-content: center; }
.plain { display: flex; flex-direction: column; margin-top: .5rem; }
.plain li { display: flex; justify-content: space-between; gap: 1rem; padding: .4375rem 0; border-top: 1px solid var(--track); text-align: left; }
.plain span { text-align: right; }
.news { display: flex; flex-direction: column; gap: .5rem; margin-top: .5rem; }
.news li { font-size: .9375rem; padding-left: .75rem; border-left: 2px solid var(--track); }
.news li.live { border-left-color: var(--accent-c); }
.news em { display: block; font-style: normal; font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase; color: var(--card-ink-2); }
.code { font-family: ui-monospace, 'IBM Plex Mono', monospace; font-size: 1.5rem; letter-spacing: .12em; text-align: center; padding: .625rem; margin-top: .625rem; background: var(--track); border-radius: var(--r-row); user-select: all; }

/* ---------- toasts and coins ---------- */
#toasts { position: absolute; left: 0; right: 0; top: calc(env(safe-area-inset-top) + .75rem); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: .375rem; pointer-events: none; }
.toast { background: var(--toast-bg); color: var(--toast-ink); padding: .5rem 1rem; border-radius: 2rem; font-weight: 700; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); animation: toast-in .3s both cubic-bezier(.2, 1.2, .3, 1); max-width: 90%; text-align: center; }
.toast.item { background: var(--up-solid); color: #fff; }
.toast.bad { background: var(--down-solid); color: #fff; }
.toast.out { opacity: 0; transform: translateY(-.5rem); transition: all .4s; }
.coin { position: absolute; top: 6.5rem; left: 22%; width: .875rem; height: .875rem; border-radius: 50%; background: #F2B93B; box-shadow: inset 0 0 0 2px #C8891A; animation: coin 1.1s var(--d) both cubic-bezier(.2, .7, .3, 1); }

/* ---------- first-game guide ---------- */
.tut { position: absolute; inset: 0; z-index: 50; pointer-events: none; opacity: 0; transition: opacity .25s; overflow: hidden; }
.tut.on { opacity: 1; }
.tut-hole { position: absolute; border-radius: .875rem; box-shadow: 0 0 0 200vmax rgba(0, 0, 0, .6); outline: 3px solid #fff; transition: left .25s, top .25s, width .25s, height .25s; }
.tut-hand { position: absolute; width: 2.75rem; animation: tap 1.5s ease-in-out infinite; transform-origin: 30% 10%; transition: left .25s, top .25s; }
.hand { width: 100%; display: block; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5)); }
.tut-cap { position: absolute; left: 1rem; right: 1rem; pointer-events: auto; display: flex; flex-direction: column; align-items: center; gap: .25rem; }
.tut-cap span { background: #fff; color: #15171c; padding: .625rem 1rem; border-radius: .875rem; font-weight: 700; font-size: 1.0625rem; text-align: center; box-shadow: 0 6px 20px rgba(0, 0, 0, .4); font-family: system-ui, sans-serif; }
.tut-cap button { color: #fff; text-decoration: underline; font-size: .875rem; min-height: 2.75rem; padding: 0 .75rem; font-family: system-ui, sans-serif; }

/* ---------- motion ---------- */
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(100%); } }
@keyframes pop { from { opacity: 0; transform: translateY(1.5rem) scale(.96); } }
@keyframes view-in { from { opacity: 0; transform: translateY(.75rem); } }
@keyframes card-in { from { opacity: 0; transform: translateY(1.5rem); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-1rem) scale(.9); } }
@keyframes flash { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 30% { box-shadow: 0 0 0 4px var(--accent); } }
@keyframes slide { to { transform: translateX(-50%); } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-5%) rotate(1.5deg); } }
@keyframes step { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4%); } }
@keyframes pulse { from { transform: scale(1); opacity: 1; } to { transform: scale(2.6); opacity: 0; } }
@keyframes rain { to { background-position: -40px 80px; } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes tap { 0%, 100% { transform: translate(0, 0) scale(1); } 45% { transform: translate(-6px, -8px) scale(.9); } 60% { transform: translate(0, 0) scale(1); } }
@keyframes coin { from { opacity: 1; transform: translate(0, 0) scale(.5); } 70% { opacity: 1; } to { opacity: 0; transform: translate(var(--x), -5.5rem) scale(1.1); } }
@keyframes flicker { 50% { opacity: .5; transform: scaleX(.8); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .band { animation: none; }
}
