/* Sweet Lands app styles. Starts from the sketch (sketch/sketch.css) and keeps its look. */
/* Fonts, self-hosted for offline play (SIL Open Font License, see fonts/OFL-*.txt). Latin only: the UI has no Japanese text. */
@font-face { font-family: "Bodoni Moda"; font-style: normal; font-weight: 600 800; font-display: swap; src: url(../fonts/bodoni-moda-latin.woff2) format("woff2"); }
@font-face { font-family: "Zen Maru Gothic"; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/zen-maru-gothic-500.woff2) format("woff2"); }
@font-face { font-family: "Zen Maru Gothic"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/zen-maru-gothic-700.woff2) format("woff2"); }
@font-face { font-family: "Zen Maru Gothic"; font-style: normal; font-weight: 900; font-display: swap; src: url(../fonts/zen-maru-gothic-900.woff2) format("woff2"); }
:root {
  --table: #2a1d16;
  --table-2: #3a281e;
  --paper: #f6ecdc;
  --paper-2: #ecdcc2;
  --ink: #3a2a20;
  --ink-2: #6b5443;
  --berry: #b8433b;
  --gold: #e3b04b;
  --picked: #2e6f66;
  --orange: #e49a5b;
  --green: #6fae86;
  --grey: #8f989e;
  --sky: #8fcbe0;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --num: "Bodoni Moda", "Didot", Georgia, serif;
  --ui: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  background:
    radial-gradient(120% 90% at 50% 40%, #4a3326 0%, var(--table) 60%, #1b120d 100%);
  font: 500 15px/1.35 var(--ui);
  color: var(--ink);
  -webkit-user-select: none; user-select: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
img { max-width: 100%; }
[hidden] { display: none !important; }

#stage {
  position: fixed; left: 50%; top: 50%; overflow: hidden; overflow: clip;
  width: 1600px; height: 1000px;
  transform-origin: 0 0;
}

/* ---------- top ---------- */
.top {
  position: absolute; inset: 0 0 auto 0; height: 64px;
  display: flex; align-items: center; gap: 18px; padding: 0 16px;
}
.logo { width: 118px; filter: brightness(0) invert(.93) sepia(.35); }
.rounds { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.rounds li {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font: 800 15px var(--num); color: #c9b49a;
  border: 2px solid #5a4334;
}
.rounds li.done { color: #a89079; border-color: #4a372b; }
.rounds li.now { background: var(--paper); color: var(--ink); border-color: var(--gold); box-shadow: 0 0 0 3px rgba(227,176,75,.25); }
.prompt {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%);
  min-width: 300px; height: 40px; padding: 0 26px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--paper); border-radius: 20px;
  box-shadow: 0 0 0 2px #c9a97f inset, 0 6px 16px rgba(0,0,0,.4);
  font-size: 16px; white-space: nowrap;
}
.prompt b { font: 800 18px var(--num); color: var(--berry); letter-spacing: .01em; }
.prompt img { height: 26px; vertical-align: middle; }
.prompt .cost { display: inline-flex; align-items: center; gap: 3px; font: 800 17px var(--num); color: var(--berry); }
.points { margin-left: auto; display: flex; gap: 14px; }
.pt { display: flex; align-items: center; gap: 4px; color: var(--paper); }
.pt img { height: 34px; }
.pt b { font: 800 24px var(--num); min-width: 1.4em; font-variant-numeric: tabular-nums; }

/* ---------- rail ---------- */
.rail {
  position: absolute; left: 16px; top: 76px; width: 320px; bottom: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.who { display: flex; gap: 12px; align-items: center; color: var(--paper); }
.portrait {
  width: 74px; height: 86px; border-radius: 37px 37px 8px 8px; overflow: hidden;
  border: 3px solid #a3644a; background: #f2d5c4; flex: none;
  box-shadow: 0 6px 14px rgba(0,0,0,.4);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.name { font: 800 21px var(--num); letter-spacing: .01em; }
.clock { display: flex; align-items: center; gap: 4px; font-size: 13px; color: #cdb79c; margin-top: 2px; }
.clock img { height: 30px; }
.clock img + span + img { height: 24px; }

.res {
  list-style: none; margin: 0; padding: 8px 10px;
  background: var(--paper); border-radius: 12px;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px;
  box-shadow: 0 8px 18px rgba(0,0,0,.35);
}
.res li { display: grid; justify-items: center; gap: 0; position: relative; }
.res img { height: 38px; width: 46px; object-fit: contain; }
.res b { font: 800 26px/1 var(--num); font-variant-numeric: tabular-nums; }
.res i { font: 700 12px var(--ui); font-style: normal; color: var(--ink-2); height: 15px; }
.res li.tick b { animation: tick .7s var(--ease-out); }
.res li.short b { color: var(--berry); }
@keyframes tick { 0% { transform: scale(1.5); color: var(--berry); } 100% { transform: none; } }

.pros {
  background: var(--paper); border-radius: 12px; padding: 10px 12px 10px;
  box-shadow: 0 8px 18px rgba(0,0,0,.35);
}
.pros h2 { margin: 0 0 6px; font: 800 17px var(--num); display: flex; justify-content: space-between; align-items: baseline; }
.pros h2 span { font: 700 12px var(--ui); color: var(--ink-2); }
.pros ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.track {
  display: grid; grid-template-columns: 38px 1fr 62px; align-items: center; gap: 8px;
  padding: 4px 6px 4px 4px; border-radius: 8px;
  background: color-mix(in srgb, var(--c) 24%, transparent);
}
.track.moved { animation: moved 1.2s var(--ease-out); }
@keyframes moved { 0% { background: color-mix(in srgb, var(--c) 60%, transparent); } }
.track > img { height: 32px; width: 38px; object-fit: contain; }
.pips { display: flex; gap: 7px; align-items: center; }
.seg { display: flex; gap: 2px; padding: 2px 3px; border-radius: 6px; position: relative; }
.seg.on { background: #fff8; box-shadow: 0 0 0 1.5px var(--c) inset; }
.pip { width: 10px; height: 10px; border-radius: 50%; background: #0000; border: 1.5px solid color-mix(in srgb, var(--c) 70%, #3a2a20); }
.pip.at { background: var(--c); border-color: var(--ink); box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--ink); }
.rate { font: 700 12px var(--ui); color: var(--ink-2); white-space: nowrap; }
.track .vp { text-align: right; font: 800 20px var(--num); font-variant-numeric: tabular-nums; }
.track .vp small { display: block; font: 700 11px var(--ui); color: var(--ink-2); }
.forecast {
  margin-top: 8px; padding-top: 8px; border-top: 1.5px dashed #c9b394;
  display: flex; align-items: center; gap: 6px; justify-content: flex-end;
}
.forecast span { margin-right: auto; font-weight: 700; color: var(--ink-2); }
.forecast b { font: 800 30px var(--num); font-variant-numeric: tabular-nums; }
.forecast img { height: 30px; }
.forecast.bump b { animation: tick .8s var(--ease-out); }

.drawers { margin-top: auto; margin-right: 58px; display: grid; grid-template-columns: 1fr; gap: 8px; }
.drawers button, .tabs button {
  height: 40px; border-radius: 20px; border: 0;
  background: #4f3a2c; color: var(--paper); font-weight: 700;
  box-shadow: 0 0 0 2px #7b5b44 inset, 0 4px 10px rgba(0,0,0,.35);
}
.drawers .pass { height: 48px; border-radius: 24px; background: var(--berry); box-shadow: 0 0 0 2px #e08a7c inset, 0 4px 10px rgba(0,0,0,.35); }

/* ---------- map ---------- */
.table { position: absolute; left: 352px; top: 72px; width: 1232px; height: 704px; overflow: hidden; border-radius: 14px; }
.cam { position: absolute; left: 0; top: 0; width: 1600px; height: 1323px; transform-origin: 0 0; }
.cam svg { position: absolute; left: 0; top: 0; overflow: visible; }
.boardbg { position: absolute; left: 46px; top: 46px; width: 1508px; height: 1232px; border-radius: 12px; background: var(--table); box-shadow: 0 14px 34px rgba(0,0,0,.5); }
#fx { pointer-events: none; }
#fx [role=button] { pointer-events: auto; }
.table.moving .cam { will-change: transform; }
.table.moving #fx * { animation-play-state: paused; }
.tshadow { fill: rgba(42,29,22,.45); }
.oshadow { fill: rgba(42,29,22,.38); }
#map image { image-rendering: auto; }
.tile { transform-box: fill-box; transform-origin: center; }
.tile .edge { fill: none; stroke: rgba(255,248,234,.55); stroke-width: 3; }
.legal { cursor: pointer; }
.legal .hit { stroke: transparent; stroke-width: 40; stroke-linecap: round; }
.legal .line { stroke: #3a2a20; stroke-width: 15; stroke-linecap: round; opacity: .55; }
.legal .core { stroke: var(--gold); stroke-width: 9; stroke-linecap: round; stroke-dasharray: 1 16; animation: breathe 1.6s ease-in-out infinite; }
.legal:hover .core, .legal:focus-visible .core { stroke-dasharray: none; stroke: #ffe39a; animation: none; }
@keyframes breathe { 50% { opacity: .45; } }
.road rect.body { fill: #e5b27a; stroke: #4e321f; stroke-width: 3.5; }
.road rect.shine { fill: #f6d3a5; }
.road.ghost { opacity: .92; }
.road.ghost rect.body { fill: #f3cf9f; stroke: #fff; }
.road.ghost rect.body { stroke-dasharray: 8 5; animation: march 1s linear infinite; }
@keyframes march { to { stroke-dashoffset: -26; } }
.road.drop { animation: drop .5s var(--ease-out) both; transform-box: fill-box; transform-origin: center; }
@keyframes drop { from { transform: translateY(-40px) scale(1.15); opacity: 0; } }
.willflip { fill: rgba(255,240,200,.18); stroke: #fff6e0; stroke-width: 5; stroke-dasharray: 3 10; stroke-linecap: round; animation: march 1.4s linear infinite; }
.lhex { cursor: pointer; outline: none; }
.lhex .shape { fill: rgba(255,240,200,.14); stroke: var(--gold); stroke-width: 7; stroke-dasharray: 1 15; stroke-linecap: round; animation: breathe 1.6s ease-in-out infinite; }
.lhex .peekTile { opacity: 0; transition: opacity .15s; }
.lhex:hover .peekTile, .lhex:focus-visible .peekTile { opacity: .55; }
.lhex:hover .shape, .lhex:focus-visible .shape { stroke-dasharray: none; animation: none; }
.gtile { cursor: pointer; }
.gtile image.art { opacity: .82; }
.gtile .outline { fill: none; stroke: #fff6e0; stroke-width: 5; stroke-dasharray: 10 8; animation: march 1.2s linear infinite; }
.gtile .tag circle, .gtile .tag rect { fill: var(--paper); stroke: var(--ink); stroke-width: 3; }
.gtile .tag text { font: 800 22px var(--num); fill: var(--ink); text-anchor: middle; dominant-baseline: central; }
.tile.drop { animation: tdrop .5s var(--ease-out) both; }
@keyframes tdrop { from { transform: translateY(-50px) scale(1.12); opacity: 0; } }
.stamp { cursor: pointer; }
.stamp circle.ring { fill: none; stroke: var(--gold); stroke-width: 5; animation: pulse 1.5s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes pulse { from { transform: scale(1); opacity: .9; } to { transform: scale(1.45); opacity: 0; } }
.stamp circle.disc { fill: var(--berry); stroke: #f3d2c4; stroke-width: 5; }
.stamp text { fill: #fff6ea; font: 800 26px var(--num); text-anchor: middle; dominant-baseline: central; }
.stamp:hover circle.disc { fill: #cc5248; }
.chip { cursor: pointer; }
.chip circle { fill: var(--paper); stroke: var(--ink); stroke-width: 4; }
.chip:hover circle { stroke: var(--picked); stroke-width: 6; }
.chip text { font: 800 22px var(--num); fill: var(--ink); text-anchor: middle; }
.chipbg { fill: rgba(42,29,22,.55); }
.city { fill: none; stroke: #fff; stroke-width: 6; stroke-dasharray: 2 12; stroke-linecap: round; opacity: .9; }

/* ---------- cabinet ---------- */
.cabinet {
  position: absolute; left: 1120px; top: 76px; width: 464px;
  display: grid; gap: 10px;
  transition: transform .7s var(--ease-out), opacity .5s;
}
.mode-place .cabinet, .mode-bonus .cabinet { transform: translateX(520px); opacity: 0; pointer-events: none; }
.case {
  position: relative; width: 459px; height: 346px; border-radius: 10px;
  background: url(../assets/main.jpg) no-repeat;
  background-size: 1173px 463.7px; background-position: -403.6px -81.4px;
  box-shadow: 0 14px 30px rgba(0,0,0,.5);
}
.cell {
  position: absolute; border: 0; padding: 0; background: transparent; border-radius: 6px;
  transition: box-shadow .2s, background .2s, opacity .2s;
}
.cell.can:hover, .cell.can:focus-visible { background: rgba(255,240,200,.18); box-shadow: 0 0 0 4px var(--gold), 0 6px 14px rgba(0,0,0,.35); outline: none; }
.cell.cant { cursor: not-allowed; }
.cell.cant::after { content: ""; position: absolute; inset: 0; border-radius: 5px; background: rgba(42,29,22,.5); }
.cell.full { background: rgba(42,29,22,.25); cursor: default; }
.cell .adv { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 5px; object-fit: cover; }
.cell .lock { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(246,236,220,.55); border-radius: 5px; font: 800 13px var(--ui); color: var(--ink-2); }
.disc { position: absolute; width: 34px; height: 28px; pointer-events: none; filter: drop-shadow(0 3px 2px rgba(0,0,0,.5)); }
.disc.mio { filter: drop-shadow(0 3px 2px rgba(0,0,0,.5)) hue-rotate(170deg) saturate(.6) brightness(.9); }
.disc.land { animation: land .6s var(--ease-out) both; }
@keyframes land { from { transform: translateY(-60px) scale(1.4); opacity: 0; } }
.slotcost {
  position: absolute; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; pointer-events: none;
  background: var(--berry); color: #fff; font: 800 13px var(--num);
  box-shadow: 0 2px 5px rgba(0,0,0,.4); opacity: 0; transition: opacity .15s;
}
.cell:hover .slotcost, .cell:focus-visible .slotcost { opacity: 1; }
.why {
  position: absolute; z-index: 4; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%);
  background: var(--ink); color: var(--paper); padding: 4px 10px; border-radius: 12px;
  font: 700 12px var(--ui); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s;
  display: flex; gap: 4px; align-items: center;
}
.why img { height: 18px; }
.cell.cant:hover .why { opacity: 1; }
.free {
  width: 464px; height: 127px; border-radius: 10px;
  background: url(../assets/main.jpg) no-repeat;
  background-size: 1752.7px 692.8px; background-position: -1283.6px -43.3px;
  box-shadow: 0 10px 22px rgba(0,0,0,.45);
}
.skills {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  padding: 8px; border-radius: 10px; background: #2f4a45;
  box-shadow: 0 0 0 3px #6b4a35 inset, 0 10px 22px rgba(0,0,0,.45);
}
.skills img { width: 100%; border-radius: 6px; display: block; box-shadow: 0 2px 4px rgba(0,0,0,.4); transition: transform .15s var(--ease-out); }
.skills img:hover { transform: scale(1.9); position: relative; z-index: 5; box-shadow: 0 10px 20px rgba(0,0,0,.6); }

.chosen {
  position: absolute; right: 16px; top: 80px; width: 168px; height: 112px; border-radius: 10px;
  background-image: url(../assets/main.jpg); background-repeat: no-repeat;
  box-shadow: 0 0 0 3px var(--picked), 0 12px 24px rgba(0,0,0,.5);
  transform: translateX(220px); transition: transform .6s var(--ease-out) .15s;
}
.chosen.on { transform: none; }

/* ---------- hand ---------- */
.hand { position: absolute; left: 590px; right: 130px; top: 800px; height: 200px; }
/* The button is the hit area and never moves on hover; only its face lifts. */
.card {
  position: absolute; top: 18px; width: 150px; height: 205px; border: 0; padding: 0;
  background: none; border-radius: 9px;
  transform-origin: 50% 120%;
  transition: transform .35s var(--ease-out), opacity .3s;
}
.card:hover, .card:focus-visible { z-index: 20; outline: none; }
.card .face {
  display: block; width: 100%; height: 100%; border-radius: 9px; overflow: hidden; position: relative;
  box-shadow: 0 8px 18px rgba(0,0,0,.55);
  transition: transform .25s var(--ease-out), box-shadow .25s;
}
.card .face img { width: 100%; height: 100%; display: block; }
.card:hover .face, .card:focus-visible .face { transform: translateY(-34px); box-shadow: 0 18px 30px rgba(0,0,0,.6); }
.card:focus-visible .face { outline: 3px solid var(--paper); outline-offset: 2px; }
.mode-discard .card:not(.marked) .face { outline: 4px solid var(--gold); outline-offset: 2px; }
.card.marked .face { box-shadow: 0 0 0 5px var(--berry), 0 8px 18px rgba(0,0,0,.55); }
.card.marked .face::after { content: "✕"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 64px; color: #fff; background: rgba(184,67,59,.35); }
.card.gone { transform: translate(-300px, -420px) rotate(-30deg) scale(.4) !important; opacity: 0; }
.card.leaving { opacity: 0; }

/* Hover preview: a large copy above the hand, so the hovered card itself stays still. */
.peek {
  position: absolute; z-index: 30; width: 300px; height: 410px; top: 372px; border-radius: 14px; overflow: hidden;
  box-shadow: 0 24px 50px rgba(0,0,0,.65); pointer-events: none;
  opacity: 0; transform: translateY(14px) scale(.97); transition: opacity .16s, transform .22s var(--ease-out);
}
.peek.on { opacity: 1; transform: none; }
.peek img { width: 100%; height: 100%; display: block; }
.mode-place .peek, .mode-bonus .peek { display: none; }

/* Inspecting a card, and playing it */
.inspect { position: absolute; inset: 0; z-index: 45; background: rgba(27,18,13,.6); animation: fade .25s; }
.inspect .big {
  position: absolute; left: 600px; top: 150px; width: 360px; height: 492px; border-radius: 16px; overflow: hidden;
  box-shadow: 0 28px 60px rgba(0,0,0,.7);
}
.inspect .big img { width: 100%; height: 100%; display: block; }
.inspect .ability {
  position: absolute; left: 13%; top: 36%; width: 74%; height: 24%; border-radius: 10px;
  box-shadow: 0 0 0 4px var(--gold) inset; opacity: 0;
}
.inspect .ability.on { animation: fire 1.4s var(--ease-out) forwards; }
.inspect .side { position: absolute; left: 990px; top: 300px; width: 300px; display: grid; gap: 12px; }
.inspect .side .name { font: 800 26px var(--num); color: var(--paper); margin-bottom: 4px; }
.pill {
  height: 52px; border-radius: 26px; border: 0; padding: 0 22px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: #4f3a2c; color: var(--paper); font: 700 17px var(--ui);
  box-shadow: 0 0 0 2px #7b5b44 inset, 0 6px 14px rgba(0,0,0,.4);
}
.pill img { height: 30px; }
.pill b { font: 800 22px var(--num); }
.pill.go { background: var(--berry); box-shadow: 0 0 0 2px #e08a7c inset, 0 6px 14px rgba(0,0,0,.4); }
.pill.go:hover { background: #cc5248; }
.pill.teal { background: var(--picked); box-shadow: 0 0 0 2px #7fc0b4 inset, 0 6px 14px rgba(0,0,0,.4); }
.pill:disabled { opacity: .5; cursor: not-allowed; }
.pill .why { position: static; transform: none; opacity: 1; background: none; padding: 0; font-size: 14px; color: #f3d2c4; }
.flycard { position: absolute; z-index: 55; border-radius: 12px; overflow: hidden; box-shadow: 0 20px 40px rgba(0,0,0,.6); pointer-events: none; }
.flycard img { width: 100%; height: 100%; display: block; }
.badge {
  position: absolute; top: -8px; right: -8px; min-width: 24px; height: 24px; border-radius: 12px; padding: 0 6px;
  background: var(--berry); color: #fff; font: 800 14px/24px var(--num); text-align: center;
}
.drawers button { position: relative; }
.deck { position: absolute; right: 16px; bottom: 20px; color: #cdb79c; font-size: 13px; text-align: right; }
.deck b { display: block; font: 800 26px var(--num); color: var(--paper); }
.undo {
  position: absolute; left: 288px; bottom: 16px; width: 48px; height: 48px; border-radius: 50%; border: 0;
  background: #4f3a2c; color: var(--paper); font-size: 24px; box-shadow: 0 0 0 2px #7b5b44 inset;
}

/* ---------- drawer ---------- */
.drawer {
  position: absolute; left: 610px; right: 16px; bottom: 0; height: 624px; z-index: 40;
  background: var(--paper-2); border-radius: 18px 18px 0 0;
  box-shadow: 0 -10px 40px rgba(0,0,0,.6);
  animation: rise .55s var(--ease-out);
  padding: 14px 18px;
}
@keyframes rise { from { transform: translateY(100%); } }
.tabs { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; }
.dtitle { margin: 0 8px 0 4px; font: 800 22px var(--num); color: var(--ink); }
.aidpane .aid { zoom: .914; }

/* ---------- board dock ---------- */
.dock { position: absolute; left: 350px; top: 792px; z-index: 41; display: flex; gap: 2px; }
.dock button {
  position: relative; width: 74px; padding: 6px 0 4px; border: 0; border-radius: 14px; background: transparent;
  display: grid; justify-items: center; gap: 4px; color: var(--paper);
}
.dock button:hover .thumb { transform: translateY(-3px); }
.dock .thumb {
  width: 60px; height: 60px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: var(--paper); box-shadow: 0 0 0 3px #7b5b44, 0 6px 12px rgba(0,0,0,.45);
  transition: transform .2s var(--ease-out), box-shadow .2s;
}
.dock .thumb img { width: 100%; height: 100%; object-fit: cover; }
.dock .portrait-t img { object-position: 50% 15%; }
.dock .thumb:not(.portrait-t):not(.tile-t) img { width: 76%; height: 76%; object-fit: contain; }
.dock .tile-t img { transform: scale(1.25); }
.dock .lbl { font: 700 12px/1.15 var(--ui); text-align: center; }
.dock button.on .thumb { box-shadow: 0 0 0 4px var(--picked), 0 0 0 7px #7fc0b4, 0 6px 12px rgba(0,0,0,.45); }
.dock button.on .lbl { color: #9fe0d3; }
.dock .badge { top: 0; right: 4px; }
.dock button:focus-visible { outline: 3px solid var(--paper); outline-offset: 2px; }
.tabs button { padding: 0 18px; }
.tabs button.on { background: var(--picked); box-shadow: 0 0 0 2px #7fc0b4 inset; }
.tabs .x { margin-left: auto; width: 40px; padding: 0; }
.pane { display: none; }
.pane.on { display: block; }
.pane.board { display: none; grid-template-columns: 760px 1fr; gap: 20px; }
.pane.board.on { display: grid; }
.pboard { position: relative; width: 760px; height: 530px; }
.pboard > img { width: 760px; border-radius: 8px; box-shadow: 0 8px 18px rgba(0,0,0,.35); display: block; position: relative; z-index: 1; }
.cols { position: absolute; left: 0; top: 342px; width: 760px; }
.col { position: absolute; top: 0; width: 165px; }
.col .head { height: 41px; position: relative; z-index: 2; border-radius: 4px; }
.col .tuck { height: 84px; overflow: hidden; border-radius: 0 0 8px 8px; position: relative; box-shadow: 0 6px 10px rgba(0,0,0,.3); }
.col .tuck img { width: 100%; display: block; transform: translateY(-62%); }
.played h3 { margin: 0 0 8px; font: 800 18px var(--num); }
.played img { width: 150px; border-radius: 8px; margin: 0 8px 8px 0; box-shadow: 0 6px 12px rgba(0,0,0,.35); }
.col .tuck.fire::after, .col .head.fire::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: 0 0 0 4px var(--gold) inset; background: rgba(227,176,75,.25);
  animation: fire 1s var(--ease-out) forwards;
}
.col .head { height: 10px; position: relative; }
@keyframes fire { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }
.gain {
  position: absolute; z-index: 60; pointer-events: none;
  display: flex; align-items: center; gap: 4px;
  font: 800 22px var(--num); color: var(--ink);
  background: var(--paper); padding: 4px 10px 4px 6px; border-radius: 20px;
  box-shadow: 0 6px 14px rgba(0,0,0,.45);
  animation: fly 1.3s var(--ease-out) forwards;
}
.gain img { height: 28px; }
@keyframes fly { 0% { opacity: 0; transform: translateY(10px) scale(.8); } 20% { opacity: 1; transform: none; } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-50px); } }
.iboard { position: relative; width: 1200px; max-width: 100%; }
.iboard > img:first-child { width: 100%; border-radius: 8px; display: block; box-shadow: 0 8px 18px rgba(0,0,0,.35); }
.iboard .tok { position: absolute; filter: drop-shadow(0 4px 3px rgba(0,0,0,.5)); }
.iboard .cart { width: 70px; left: 20.5%; top: 9%; }
.iboard .food { width: 54px; left: 38%; top: 66%; }

/* ---------- pass overlay ---------- */
.overlay { position: absolute; inset: 0; z-index: 50; background: rgba(27,18,13,.72); display: grid; place-items: center; animation: fade .4s; }
@keyframes fade { from { opacity: 0; } }
.passcard { width: 1080px; background: var(--paper); border-radius: 18px; padding: 22px 26px 18px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.passcard h2 { margin: 0 0 12px; font: 800 26px var(--num); color: var(--berry); }
.gains { list-style: none; margin: 0 0 14px; padding: 0; display: flex; gap: 10px; flex-wrap: wrap; }
.gains li {
  display: flex; align-items: center; gap: 6px; padding: 6px 14px 6px 8px; border-radius: 24px;
  background: var(--paper-2); font: 800 22px var(--num);
  animation: pop .5s var(--ease-out) both;
}
.gains li img { height: 34px; }
.gains li span { font: 700 13px var(--ui); color: var(--ink-2); }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.9); } }
.aid { position: relative; width: 1028px; aspect-ratio: 1000 / 421; }   /* the board keeps its size before aid.jpg loads */
.aid > img { width: 100%; display: block; border-radius: 10px; }
.aidtile { position: absolute; border-radius: 6px; box-shadow: 0 3px 6px rgba(0,0,0,.4); }
.spot {
  position: absolute; width: 50px; height: 50px; border-radius: 50%; border: 0; padding: 0;
  background: transparent; transition: transform .5s var(--ease-out);
}
.spot.open { box-shadow: 0 0 0 3px var(--gold), 0 0 0 6px rgba(255,248,234,.7); cursor: pointer; }
.spot.open:hover { background: rgba(255,240,200,.35); }
.token {
  position: absolute; width: 50px; height: 50px; border-radius: 50%; overflow: hidden;
  border: 3px solid var(--paper); box-shadow: 0 4px 8px rgba(0,0,0,.5);
  transition: left .7s var(--ease-out), top .7s var(--ease-out);
  pointer-events: none;
}
.token img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.token.mio { background: #5b6e74; display: grid; place-items: center; font: 800 14px var(--ui); color: #fff; }
.hint { margin: 10px 0 0; text-align: center; color: var(--ink-2); font-weight: 700; }

/* ---------- sketch nav ---------- */

.mode-place .hand, .mode-bonus .hand { transform: translateY(70px); transition: transform .5s var(--ease-out); }
.hand { transition: transform .5s var(--ease-out); }
.mode-discard .hand { transform: translateY(-40px); }

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

/* ---------- properties, rabbits, cities ---------- */
.city { fill: none; stroke: #fff8ea; stroke-width: 7; stroke-dasharray: 1 13; stroke-linecap: round; opacity: .95; }
.city.grow { animation: citygrow 1.4s var(--ease-out); }
@keyframes citygrow { 0% { stroke: var(--gold); stroke-width: 14; } }
.ghostcity { stroke: var(--gold); stroke-dasharray: 14 10; animation: march 1.2s linear infinite; }
.tok { transform-box: fill-box; transform-origin: 50% 100%; }
.tok.drop { animation: tdrop .5s var(--ease-out) both; }
.tok.hop { animation: hop .65s var(--ease-out) both; }
@keyframes hop { 0% { transform: translateY(-120px) scale(.6); opacity: 0; } 60% { transform: translateY(-14px); opacity: 1; } 100% { transform: none; } }
.gtok { cursor: pointer; }
.gtok image { opacity: 1; }
.gtok .ring { fill: rgba(42,29,22,.38); stroke: #fff6e0; stroke-width: 5; stroke-dasharray: 10 8; animation: march 1.2s linear infinite; }
.tray {
  position: absolute; left: 368px; top: 86px; z-index: 30;
  display: flex; gap: 8px; padding: 10px; border-radius: 16px;
  background: var(--paper); box-shadow: 0 0 0 2px #c9a97f inset, 0 12px 26px rgba(0,0,0,.45);
  animation: pop .4s var(--ease-out);
}
.slotx {
  position: relative; width: 92px; padding: 6px 4px 8px; border: 0; border-radius: 12px;
  display: grid; justify-items: center; gap: 4px; background: var(--paper-2);
}
.slotx:hover:not(:disabled) { background: #e3cfae; }
.slotx.on { box-shadow: 0 0 0 4px var(--picked); background: #e2efe9; }
.slotx:disabled { opacity: .45; cursor: not-allowed; }
.slotx .tokimg { width: 58px; height: 58px; object-fit: contain; filter: drop-shadow(0 3px 2px rgba(0,0,0,.35)); }
.slotx .costs { display: flex; gap: 4px; font: 800 16px var(--num); color: var(--berry); }
.slotx .costs span { display: flex; align-items: center; }
.slotx .costs img { height: 20px; }
.slotx .left { position: absolute; top: 4px; right: 6px; font: 800 13px var(--num); color: var(--ink-2); }
.slotx .gets { display: flex; align-items: center; gap: 2px; font: 800 18px var(--num); }
.slotx .gets img { height: 26px; }
div.slotx { width: 110px; }

/* ---------- map gestures ---------- */
.table { touch-action: none; }
body { touch-action: none; overscroll-behavior: none; }
.phone .rail { touch-action: pan-y; }

/* ---------- rotate prompt (phones held upright) ---------- */
.safe { position: fixed; inset: 0; visibility: hidden; pointer-events: none;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
.rotate {
  display: none; position: fixed; inset: 0; z-index: 100; background: var(--table); color: var(--paper);
  place-items: center; align-content: center; gap: 22px; text-align: center; font: 700 18px var(--ui);
}
.rotate p { margin: 0; }
.phoneicon { width: 46px; height: 80px; border: 4px solid var(--paper); border-radius: 10px; animation: turn 2.6s var(--ease-out) infinite; }
@keyframes turn { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }
@media (orientation: portrait) and (max-width: 600px) { .rotate { display: grid; } }

/* ---------- phone (844 x 390 stage) ---------- */
.phone .top { height: 44px; padding: 0 8px; gap: 8px; }
.phone .logo, .phone .top .rounds { display: none; }
.phone .top .res { background: none; box-shadow: none; padding: 0; display: flex; gap: 10px; }
.phone .top .res li { display: grid; grid-template-columns: 24px auto; column-gap: 2px; align-items: center; justify-items: start; }
.phone .top .res img { grid-row: span 2; height: 22px; width: 24px; }
.phone .top .res b { font-size: 17px; color: var(--paper); }
.phone .top .res i { font-size: 10px; height: auto; line-height: 1; color: #cdb79c; }
.phone .top .res li.short b { color: #f08a7f; }
.phone .prompt { top: 7px; left: 56%; height: 30px; min-width: 190px; padding: 0 16px; font-size: 13px; gap: 6px; }
.phone .prompt b { font-size: 15px; }
.phone .prompt img { height: 20px; }
.phone .prompt .cost { font-size: 14px; }
.scorebtn {
  margin-left: auto; height: 40px; padding: 0 12px 0 14px; border: 0; border-radius: 20px;
  display: flex; align-items: center; gap: 4px; background: #4f3a2c; color: var(--paper);
  box-shadow: 0 0 0 2px #7b5b44 inset;
}
.scorebtn b { font: 800 18px var(--num); font-variant-numeric: tabular-nums; }
.scorebtn img { height: 22px; }
.phone .undo { left: auto; right: 100px; top: 2px; bottom: auto; width: 44px; height: 40px; border-radius: 20px; font-size: 18px; z-index: 5; }
.phone .deck { display: none; }

.phone .table { left: 0; right: 0; top: 44px; width: auto; height: 346px; border-radius: 0; overflow: clip; }
.phone .legal .hit { stroke-width: 70; }

.phone .cabinet { left: auto; right: 14px; top: 46px; width: 392px; gap: 6px; }
.phone .cabinet:not(.more) .free, .phone .cabinet:not(.more) .skills, .phone .cabinet.more .case { display: none; }
.phone .free { width: 392px; height: 107px; background-size: 1480.7px 585.3px; background-position: -1084.4px -36.6px; }
.phone .skills { padding: 6px; gap: 5px; }
.ctabs { display: flex; gap: 6px; }
.ctabs button {
  flex: 1; height: 40px; border: 0; border-radius: 20px; background: #4f3a2c; color: var(--paper);
  font: 700 13px var(--ui); box-shadow: 0 0 0 2px #7b5b44 inset;
}
.ctabs button.on { background: var(--picked); box-shadow: 0 0 0 2px #7fc0b4 inset; }
.phone .chosen { right: 8px; top: 50px; width: 120px; height: 80px; transform: translateX(150px); }

.phone .hand { left: 6px; right: auto; width: 416px; top: 354px; height: 160px; }
.phone .card { top: 0; width: 96px; height: 131px; transform-origin: 50% 130%; }
.phone .card .face { border-radius: 7px; }
.phone .card:hover .face { transform: none; }
.phone .hand.up, .phone .mode-discard .hand { transform: translateY(-150px); }
.phone .card.marked .face::after { font-size: 40px; }

.phone .rail {
  left: 0; top: 0; bottom: 0; width: 330px; padding: 12px; z-index: 47; overflow-y: auto;
  background: var(--table); box-shadow: 8px 0 30px rgba(0,0,0,.5);
  transform: translateX(-105%); transition: transform .35s var(--ease-out);
}
.phone .rail.open { transform: none; }
.phone .rail .points { margin: 0; justify-content: space-around; flex: none; }
.phone .rail .drawers { margin-top: 0; }
.scrim { position: absolute; inset: 0; z-index: 46; background: rgba(27,18,13,.5); }

/* zoom scales the offsets too, so they are written pre-zoom */
.phone .tray { left: 92px; top: 68px; zoom: .72; }
.phone .inspect .big { left: calc(50% - 282px); top: 46px; width: 244px; height: 334px; }
.phone .inspect .side { left: calc(50% - 2px); top: 130px; width: 260px; }

.phone .drawer { left: 58px; right: 0; top: 0; bottom: 0; height: auto; border-radius: 0; padding: 8px 12px; }
.phone .dock { left: 4px; top: 52px; flex-direction: column; gap: 10px; z-index: 48; }
/* With a board open, the dock is the sheet's own tab strip. */
body.drawer-open.phone .dock { left: 0; top: 0; bottom: 0; width: 58px; padding: 52px 0 0 4px; background: var(--table); }
.phone .dock button { width: 50px; padding: 0; }
.phone .dock .thumb { width: 46px; height: 46px; }
.phone .dock .lbl { display: none; }
.phone .dock .badge { top: -4px; right: -4px; }
.phone .dtitle { font-size: 18px; }
.phone .aidpane .aid { zoom: .72; }
.phone .tabs { margin-bottom: 6px; }
.phone .pane.board.on, .phone .pane.industry.on { zoom: .62; }

.phone .passcard { position: relative; width: 100%; height: 390px; padding: 0; border-radius: 0; background: var(--table); display: grid; place-items: center; }
.phone .passcard h2 { display: none; }
.phone .gains { position: absolute; top: 30px; left: 50%; transform: translateX(-50%); z-index: 2; margin: 0; flex-wrap: nowrap; width: max-content; }
.phone .gains li { font-size: 16px; padding: 4px 10px 4px 6px; white-space: nowrap; }
.phone .gains li img { height: 24px; }
.phone .aid { zoom: .8; }
.phone .spot { width: 60px; height: 60px; margin: -5px 0 0 -5px; }
.phone .hint { position: absolute; bottom: 2px; left: 0; right: 0; margin: 0; color: var(--paper); font-size: 13px; }

/* ======================================================================
   App additions: pieces the sketch faked or didn't have.
   ====================================================================== */
.phone .chosen.on { transform: none; }
.drawers button:hover, .tabs button:hover { background: #604735; }
.drawers .pass:hover { background: #cc5248; }
.drawers .menu { height: 36px; font-size: 13px; background: #3b2b21; }

/* busy: a sequence is playing; taps hurry it and nothing else answers */
#stage.busy .cell, #stage.busy .fa, #stage.busy .card, #stage.busy #fx [role=button], #stage.busy .picker, #stage.busy .pbtn { pointer-events: none; }

/* prompt buttons (Skip, Done, Back) */
.prompt { pointer-events: auto; z-index: 44; }
.prompt .pbtn {
  height: 30px; padding: 0 14px; margin-left: 4px; border: 0; border-radius: 15px;
  background: #4f3a2c; color: var(--paper); font: 700 14px var(--ui);
  box-shadow: 0 0 0 2px #7b5b44 inset;
}
.prompt .pbtn:hover { background: #604735; }
.prompt span { color: var(--ink-2); font-weight: 700; }
.phone .prompt .pbtn { height: 24px; font-size: 12px; padding: 0 10px; }

/* rail: held discs, own skill tiles, character free actions */
.held { display: inline-flex; align-items: center; gap: 2px; margin-left: 8px; }
.held img { height: 22px !important; }
.held b { font: 800 16px var(--num); color: var(--paper); }
.mine { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.mine .sk { width: 74px; height: 44px; padding: 0; border: 0; border-radius: 6px; overflow: hidden; background: none; box-shadow: 0 3px 6px rgba(0,0,0,.4); }
.mine .sk img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mine .sk.down { filter: grayscale(.8) brightness(.7); }
.mine .sk.can, .charfree.can { box-shadow: 0 0 0 3px var(--gold), 0 4px 10px rgba(0,0,0,.4); cursor: pointer; }
.mine .sk:disabled, .charfree:disabled { cursor: default; }
.charfree {
  height: 40px; min-width: 52px; padding: 0 10px; border: 0; border-radius: 20px;
  display: inline-flex; align-items: center; gap: 4px; background: #4f3a2c; color: var(--paper);
  box-shadow: 0 0 0 2px #7b5b44 inset;
}
.charfree img { height: 22px; filter: invert(.9) sepia(.3); }
.charfree b { font: 800 18px var(--num); }
.charfree.used { opacity: .45; }
.charfree.can { background: var(--picked); }
.track.can { cursor: pointer; box-shadow: 0 0 0 3px var(--gold); }
.track.can:hover { background: color-mix(in srgb, var(--c) 50%, transparent); }
.track .first { width: 10px; height: 10px; margin-left: 4px; border-radius: 2px; background: var(--gold); transform: rotate(45deg); }

/* cabinet */
.cell { cursor: pointer; }
.cell.can { box-shadow: 0 0 0 3px rgba(227,176,75,.75) inset; }
.cell.later:not(.full):not(.cant) { cursor: pointer; }
.cell[aria-disabled="true"] { cursor: not-allowed; }
.cell .adv.reveal { animation: reveal .9s var(--ease-out) both; }
@keyframes reveal { 0% { transform: rotateY(90deg); opacity: 0; } 100% { transform: none; } }
.free { position: relative; }
.fa { position: absolute; border: 0; padding: 0; background: transparent; border-radius: 8px; }
.fa.can { box-shadow: 0 0 0 3px var(--gold) inset; cursor: pointer; }
.fa.can:hover, .fa.can:focus-visible { background: rgba(255,240,200,.3); outline: none; }
.fa:disabled { cursor: default; }
.skills { grid-template-columns: repeat(6, 1fr); }
.skills .stack { position: relative; padding: 0; border: 0; background: none; border-radius: 6px; }
.skills .stack img { width: 100%; border-radius: 6px; display: block; box-shadow: 0 2px 4px rgba(0,0,0,.4); }
.skills .stack img:hover { transform: none; }
.skills .stack b { position: absolute; right: -4px; bottom: -4px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--paper); font: 800 13px/20px var(--num); text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.skills .stack.empty { opacity: .3; }
.skills .stack.can { box-shadow: 0 0 0 3px var(--gold); cursor: pointer; }

/* map extras */
.xdraw circle { fill: rgba(42,29,22,.45); stroke: #fff6e0; stroke-width: 4; stroke-dasharray: 4 8; }
.xdraw image { opacity: .55; }
.xdraw.on circle { fill: var(--paper); stroke: var(--gold); stroke-dasharray: none; stroke-width: 6; }
.xdraw.on image { opacity: 1; }
.legal.taken .hit { cursor: pointer; }
#tray .tileimg { width: 70px; height: 80px; object-fit: contain; }
#tray .slotx.spec { width: 86px; }
#tray .slotx.skip { width: 80px; font: 700 15px var(--ui); color: var(--ink); justify-items: center; align-content: center; }
#tray .gets .bit { display: inline-flex; align-items: center; }
#tray .gets .ic { height: 26px; }

/* hand */
.card.pick .face { outline: 4px solid var(--gold); outline-offset: 2px; }
.card.dim .face { filter: brightness(.55); }
.card.playable .face::before { content: ""; position: absolute; left: 6px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px var(--paper); z-index: 2; }
.card.drawn { animation: drawin .5s var(--ease-out) both; }
@keyframes drawin { from { transform: translate(420px, 80px) rotate(14deg) scale(.6); opacity: 0; } }
.phone .card.drawn { animation-name: drawin-p; }
@keyframes drawin-p { from { transform: translate(200px, 40px) scale(.6); opacity: 0; } }
.mode-discard .card:not(.marked) .face { outline: none; }
.mode-discard .card.pick .face { outline: 4px solid var(--gold); }

/* card view */
.inspect .side .pill.part { justify-content: flex-start; gap: 6px; min-height: 60px; height: auto; padding: 6px 16px; flex-wrap: wrap; background: var(--paper); color: var(--ink); box-shadow: 0 0 0 3px var(--gold) inset, 0 6px 14px rgba(0,0,0,.4); }
.inspect .side .pill.part:hover { background: #fff6e6; }
.inspect .pill.colour { background: color-mix(in srgb, var(--c) 70%, #3a281e); }
.ic { height: 30px; vertical-align: middle; }
.bit { display: inline-flex; align-items: center; gap: 2px; }
.bit .n { font: 800 20px var(--num); }
.plus, .or { font: 800 18px var(--num); margin: 0 4px; color: var(--ink-2); }
.pay { display: inline-flex; gap: 2px; padding: 2px 6px; border-radius: 10px; background: #f3d2c4; }

/* pickers: a cream card under the prompt */
.picker {
  position: absolute; z-index: 46; left: 50%; top: 66px; transform: translateX(-50%);
  max-width: 1100px; padding: 12px 14px; border-radius: 16px;
  background: var(--paper); box-shadow: 0 0 0 2px #c9a97f inset, 0 16px 36px rgba(0,0,0,.55);
  animation: pop .3s var(--ease-out);
}
.picker h3 { margin: 0 0 8px; font: 800 18px var(--num); }
.picker .opts { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.picker .opt {
  min-width: 84px; min-height: 64px; padding: 6px 12px; border: 0; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap;
  background: var(--paper-2); color: var(--ink); font: 700 15px var(--ui);
}
.picker .opt:hover, .picker .opt:focus-visible { background: #e3cfae; box-shadow: 0 0 0 3px var(--gold); outline: none; }
.picker .opt img { height: 40px; }
.picker .opt b { font: 800 22px var(--num); }
.picker .opt.colour { background: color-mix(in srgb, var(--c) 45%, var(--paper)); }
.picker .opt.go { background: var(--berry); color: #fff; }
.picker .opt .skimg { height: 70px; border-radius: 6px; }
.picker.cards .opt { padding: 4px; background: none; }
.picker.cards .opt .cimg { height: 220px; width: 161px; border-radius: 8px; box-shadow: 0 6px 12px rgba(0,0,0,.35); }
.phone .picker { top: 44px; max-width: 96%; padding: 8px; }
.phone .picker .opt { min-width: 64px; min-height: 48px; }
.phone .picker .opt img { height: 30px; }
.phone .picker.cards .opts { flex-wrap: nowrap; }
.phone .picker.cards .opt .cimg { height: 124px; width: 91px; }

/* sheet header actions */
.dacts { display: flex; gap: 8px; }
.pill.small { height: 40px; padding: 0 18px; font-size: 15px; }

/* player board */
.pboard .ptok { position: absolute; z-index: 2; width: 51px; height: 51px; object-fit: contain; filter: drop-shadow(0 3px 2px rgba(0,0,0,.4)); }
.col .head { height: 41px; }
.col .head .shop { position: absolute; right: 6px; top: -30px; width: 34px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.4)); }
.col .tuck { margin-top: -50px; }
.col .tuck:first-of-type { margin-top: 0; }
.pboard.plain { background: var(--paper); border-radius: 10px; padding: 14px; height: 530px; }
.pboard.plain .ptitle { display: flex; align-items: center; gap: 12px; font: 800 22px var(--num); }
.pboard.plain .ptitle img { width: 64px; height: 74px; object-fit: cover; object-position: 50% 15%; border-radius: 32px 32px 8px 8px; }
.pboard.plain .stacks { display: flex; gap: 18px; margin: 14px 0; }
.stack-k { display: flex; align-items: center; gap: 4px; font: 800 24px var(--num); }
.stack-k img { height: 52px; }
.pboard.plain .cols { top: 230px; left: 14px; }
.pboard.plain .col .head { background: color-mix(in srgb, var(--c) 70%, var(--paper)); border-radius: 8px; }
.played { overflow-y: auto; max-height: 560px; }
.played .none { color: var(--ink-2); }
.played .sktile { width: 110px; border-radius: 6px; }
.played .sktile.down { filter: grayscale(.8) brightness(.7); }

/* industry board */
.iboard { position: relative; width: 100%; max-width: 1200px; }
.iboard .ib { width: 100%; display: block; border-radius: 8px; box-shadow: 0 8px 18px rgba(0,0,0,.35); }
.iboard .mk, .iboard .lab, .iboard .rab { position: absolute; transform: translate(-50%, -50%); }
.iboard .mk { width: 64px; height: 64px; padding: 0; border: 0; border-radius: 50%; background: transparent; display: grid; place-items: center; }
.iboard .mk img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 3px rgba(0,0,0,.5)); }
.iboard .mk.food { width: 52px; height: 52px; }
.iboard .mk.can { cursor: pointer; background: rgba(255,240,200,.5); box-shadow: 0 0 0 4px var(--gold), 0 0 0 8px rgba(255,248,234,.6); animation: breathe-b 1.4s ease-in-out infinite; }
@keyframes breathe-b { 50% { box-shadow: 0 0 0 4px var(--gold), 0 0 0 12px rgba(255,248,234,.2); } }
.iboard .mk.hop img { animation: hop .5s var(--ease-out); }
.iboard .lab { width: 54px; filter: drop-shadow(0 3px 2px rgba(0,0,0,.5)); }
.iboard .rab { width: 34px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.45)); }
.mk:disabled { cursor: default; }

/* round aid */
.spot:disabled { cursor: default; }
.passcard .aid { margin: 0 auto; }

/* banner */
.banner {
  position: absolute; z-index: 58; left: 50%; top: 40%; transform: translate(-50%, -50%);
  padding: 14px 40px; border-radius: 40px; background: var(--paper); color: var(--berry);
  font: 800 44px var(--num); box-shadow: 0 0 0 3px #c9a97f inset, 0 20px 50px rgba(0,0,0,.6);
  pointer-events: none;
}
.banner.run { animation: bannerin .9s var(--ease-out) both; }
@keyframes bannerin { 0% { opacity: 0; transform: translate(-50%, -40%) scale(.9); } 20%, 80% { opacity: 1; transform: translate(-50%, -50%); } 100% { opacity: 0; } }
.phone .banner { font-size: 28px; padding: 8px 26px; }

/* Mio's cards */
.mioov { background: rgba(27,18,13,.55); }
.mio { display: grid; justify-items: center; gap: 16px; }
.mioname { display: flex; align-items: center; gap: 10px; color: var(--paper); font: 800 26px var(--num); }
.mioname .token { position: static; }
.miocards { display: flex; gap: 22px; }
.miocard {
  width: 170px; height: 232px; border-radius: 14px; padding: 14px; display: grid; align-content: center; justify-items: center; gap: 10px;
  background: #5b6e74; color: #fff; box-shadow: 0 0 0 4px #c8d3d6 inset, 0 18px 36px rgba(0,0,0,.6);
  animation: mioflip .7s var(--ease-out) both;
}
.miocard .deck { font: 700 12px var(--ui); color: #d6e0e3; }
.miocard b { font: 800 20px var(--num); text-align: center; padding: 6px 10px; border-radius: 10px; background: rgba(255,255,255,.14); }
@keyframes mioflip { from { transform: rotateY(90deg); } }
.phone .miocard { width: 130px; height: 170px; }

/* end screen */
.endcard { width: 560px; background: var(--paper); border-radius: 18px; padding: 22px 26px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.endcard h2 { margin: 0 0 10px; font: 800 28px var(--num); color: var(--berry); }
.endcard .rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.endcard .rows li { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 10px; padding: 4px 8px; border-radius: 10px; opacity: .25; }
.endcard .rows li.in { opacity: 1; background: var(--paper-2); animation: pop .4s var(--ease-out); }
.endcard .rows img { height: 34px; width: 40px; object-fit: contain; }
.endcard .rows span { font-weight: 700; }
.endcard .rows b { font: 800 24px var(--num); font-variant-numeric: tabular-nums; }
.endcard .total { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-top: 12px; padding-top: 10px; border-top: 2px dashed #c9b394; }
.endcard .total span { margin-right: auto; font: 800 20px var(--num); }
.endcard .total b { font: 800 40px var(--num); }
.endcard .total img { height: 40px; }
.endcard .total.in b { animation: tick .8s var(--ease-out); }
.endbtns { display: flex; gap: 10px; margin-top: 14px; justify-content: flex-end; }
.phone .endcard { width: 780px; padding: 10px 16px; zoom: .74; }
.phone .endcard h2 { margin-bottom: 6px; }
.phone .endcard .rows { grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.phone .endcard .total { margin-top: 6px; padding-top: 6px; }
.phone .endbtns { margin-top: 8px; }

/* menu */
.menucard { width: 360px; background: var(--paper); border-radius: 18px; padding: 20px; display: grid; gap: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.menucard h2 { margin: 0; font: 800 24px var(--num); }
.menucard .saved { margin: 0; color: var(--ink-2); font-weight: 700; }

/* title screen */
.mode-title > :not(.title):not(.overlay) { visibility: hidden; }
.title { position: absolute; inset: 0; z-index: 80; display: grid; place-items: center; background: radial-gradient(120% 90% at 50% 40%, #4a3326 0%, var(--table) 60%, #1b120d 100%); }
.tcard { display: grid; justify-items: center; gap: 18px; }
.tlogo { width: 420px; filter: brightness(0) invert(.93) sepia(.35); }
.tsub { margin: -8px 0 0; color: #cdb79c; font: 700 18px var(--ui); }
.tchars { display: flex; gap: 18px; }
.tchar { width: 170px; padding: 10px 8px 12px; border: 0; border-radius: 18px; background: #3b2b21; color: var(--paper); display: grid; justify-items: center; gap: 8px; box-shadow: 0 0 0 2px #5a4334 inset; }
.tchar .tp { width: 132px; height: 154px; border-radius: 66px 66px 10px 10px; overflow: hidden; border: 3px solid #a3644a; background: #f2d5c4; }
.tchar .tp img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.tchar .tn { font: 800 17px var(--num); text-align: center; }
.tchar.on { background: #2e4a45; box-shadow: 0 0 0 4px var(--picked), 0 0 0 7px #7fc0b4; }
.tchar:hover:not(.on) { background: #4a3529; }
.tbtns { display: flex; gap: 12px; }
.tbtns .pill { min-width: 170px; }
.tseed { color: #a58d76; font: 700 13px var(--ui); display: flex; gap: 8px; align-items: center; }
.tseed input { width: 120px; height: 32px; border-radius: 16px; border: 0; padding: 0 12px; background: #3b2b21; color: var(--paper); font: 700 14px var(--ui); box-shadow: 0 0 0 2px #5a4334 inset; }
.phone .tcard { gap: 10px; }
.phone .tlogo { width: 240px; }
.phone .tchars { gap: 10px; }
.phone .tchar { width: 130px; padding: 6px; }
.phone .tchar .tp { width: 84px; height: 98px; }
.phone .tchar .tn { font-size: 14px; }
.phone .tbtns .pill { min-width: 140px; height: 44px; }

/* phone top bar: End turn / Pass */
.phonego {
  height: 36px; padding: 0 14px; border: 0; border-radius: 18px; margin-left: 6px;
  background: var(--berry); color: #fff; font: 700 13px var(--ui); box-shadow: 0 0 0 2px #e08a7c inset;
}
.tright { margin-left: auto; display: flex; gap: 6px; align-items: center; flex: none; }
.phone .top .undo { position: static; flex: none; }
.phone .scorebtn { margin-left: 0; flex: none; }
.phone .phonego { margin-left: 0; }
.phone .prompt { left: 52%; max-width: 290px; overflow: hidden; }
.phone .prompt span { overflow: hidden; text-overflow: ellipsis; }
.phone .top .points { display: none; }
.phone .rail .points { display: flex; }
.phone .mine .sk { width: 60px; height: 36px; }
.phone .undo[hidden] { display: none !important; }
.phone .iboard { zoom: 1; }
.legal rect.hit { fill: transparent; stroke: none; pointer-events: all; }
.stampring { fill: none; stroke: var(--gold); stroke-width: 5; pointer-events: none; animation: pulse 1.5s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.drawer { height: auto; max-height: 624px; }
.phone .drawer { max-height: none; }
#tray .slotx[data-kind^="shop"] { box-shadow: inset 0 -5px 0 var(--c, transparent); }
#tray .slotx[data-kind="shop0"] { --c: var(--orange); }
#tray .slotx[data-kind="shop1"] { --c: var(--green); }
#tray .slotx[data-kind="shop2"] { --c: var(--grey); }
#tray .slotx.on[data-kind^="shop"] { box-shadow: 0 0 0 4px var(--picked), inset 0 -5px 0 var(--c); }
/* long searches scroll inside the picker */
.picker.cards { max-height: 900px; }
.picker.cards .opts { max-height: 820px; overflow-y: auto; touch-action: pan-y; }
.phone .picker.cards { left: 66px; right: 8px; transform: none; max-width: none; animation: none; }
.phone .picker.cards .opts { overflow-x: auto; overflow-y: hidden; justify-content: flex-start; touch-action: pan-x; padding-bottom: 4px; }
.phone .picker.cards .opt { flex: none; }

/* ---------- loading screen: up until every picture and font is in ---------- */
.boot {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(120% 90% at 50% 40%, #4a3326 0%, var(--table) 60%, #1b120d 100%);
  transition: opacity .45s ease, visibility .45s;
}
.boot.out { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-inner { display: grid; justify-items: center; gap: clamp(16px, 5vh, 30px); width: min(420px, 100%); opacity: 0; animation: boot-in .5s var(--ease-out) .15s forwards; }
@keyframes boot-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.boot-logo { margin: 0; line-height: 0; }
.boot-logo img { width: min(360px, 72vw); filter: brightness(0) invert(.93) sepia(.35); }
.boot-pieces { display: flex; gap: clamp(6px, 2vw, 12px); margin: 0; padding: 0; list-style: none; }
.boot-pieces li {
  width: clamp(44px, 12vh, 62px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: var(--table-2); box-shadow: 0 0 0 2px #5a4334 inset;
  transition: background .35s ease, box-shadow .35s ease, transform .35s var(--ease-out);
}
.boot-pieces img { width: 80%; opacity: .3; filter: grayscale(1) brightness(1.5); transition: opacity .35s ease, filter .35s ease; }
.boot-pieces li.lit { background: var(--paper); box-shadow: 0 0 0 2px var(--gold) inset, 0 6px 12px rgba(0,0,0,.35); transform: translateY(-3px); }
.boot-pieces li.lit img { opacity: 1; filter: none; }
.boot-bar { display: flex; align-items: center; gap: 12px; width: 100%; }
.boot-track { flex: 1; height: 8px; border-radius: 4px; background: var(--table-2); box-shadow: 0 0 0 1px #5a4334 inset; overflow: hidden; }
.boot-fill { display: block; height: 100%; transform: scaleX(var(--p, 0)); transform-origin: 0 50%; background: var(--gold); transition: transform .2s linear; }
.boot-n { min-width: 2.2em; text-align: right; font: 800 22px var(--num); color: var(--paper); font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) {
  .boot-inner { animation: none; opacity: 1; }
  .boot-pieces li, .boot-pieces img, .boot-fill { transition: none; }
}

/* ---------- a new version is ready ---------- */
.update-note {
  position: fixed; z-index: 95; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 10px); transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px); padding: 6px 6px 6px 18px;
  background: var(--paper); color: var(--ink); border-radius: 22px; font: 700 15px var(--ui);
  box-shadow: 0 0 0 2px #c9a97f inset, 0 6px 16px rgba(0,0,0,.4);
}
.update-note button { height: 40px; border: 0; border-radius: 20px; padding: 0 16px; }
.update-note .go { background: var(--berry); color: #fff; }
.update-note .later { width: 40px; padding: 0; background: transparent; color: var(--ink-2); }
