:root {
  color-scheme: light dark;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-solid: #ffffff;
  --soft: #eef2f8;
  --text: #1b2230;
  --muted: #556072;
  --line: rgba(20, 30, 60, 0.13);
  --accent: #b45a00;
  --accent-ink: #ffffff;
  --gold: #b9770a;
  --danger: #b3261e;
  --ok: #1f7a3d;
  --ca-accent: #b45a00; /* the accounts SDK's sheets and chip */
  --glass: rgba(20, 26, 36, 0.5);
  --r: 22px;
}
@media (prefers-color-scheme: dark) {
  :root { --panel: rgba(22, 26, 34, 0.94); --panel-solid: #161a22; --soft: #232a36; --text: #eef1f6; --muted: #aab2c0; --line: rgba(255, 255, 255, 0.14); --gold: #f2c14e; --danger: #ff8a80; --ok: #58c27d; --accent: #f0a52a; --accent-ink: #1d1300; --ca-accent: #f0a52a; }
}
* { box-sizing: border-box; }
/* no double-tap zoom on iOS: js/touch-guard.js adds the same rule plus a JS
   fallback; this copy covers Safari before 16.4 under the strict CSP */
:where(html, body, body *) { touch-action: manipulation; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; height: 100%; overflow: hidden; color: var(--text);
  background: linear-gradient(#6f9fdc, #c4d9ee);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
/* a game page: no text selection or long-press callouts anywhere, HUD and
   menus included; form fields and long text (the help) opt back in */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
input, textarea, .prose p, .prose li { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 22px; height: 22px; flex: none; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------------ the picture */
.stage { position: fixed; inset: 0; }
.view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pad { position: absolute; inset: 0; touch-action: none; }
.names { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.tag-name, .names .tag { position: absolute; left: 0; top: 0; transform: translate(calc(var(--x) - 50%), calc(var(--y) - 100%)); font-weight: 650; font-size: 12px; line-height: 1.2; color: #fff; background: rgba(15, 22, 48, 0.6); padding: 2px 8px; border-radius: 9px; white-space: nowrap; }
.stick-ring, .stick-knob { position: absolute; left: 0; top: 0; border-radius: 50%; pointer-events: none; opacity: 0; transform: translate(calc(var(--x, 0px) - 50%), calc(var(--y, 0px) - 50%)); transition: opacity 0.12s; }
.stick-ring { width: 112px; height: 112px; border: 2px solid rgba(255, 255, 255, 0.6); background: rgba(255, 255, 255, 0.1); }
.stick-knob { width: 46px; height: 46px; background: rgba(255, 255, 255, 0.85); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25); }
.stick-ring.on, .stick-knob.on { opacity: 1; }
/* where the thumbs go: a faint ring in each lower corner while no thumb is down (a stick starts wherever one lands) */
html.touch body[data-screen='play'] .stick-ring:not(.on) { opacity: 0.26; transform: none; top: auto; bottom: calc(env(safe-area-inset-bottom) + 46px); }
html.touch body[data-screen='play'] #ring-l:not(.on) { left: calc(env(safe-area-inset-left) + 28px); }
html.touch body[data-screen='play'] #ring-r:not(.on) { left: auto; right: calc(env(safe-area-inset-right) + 28px); }
@media (max-width: 420px) {
  html.touch body[data-screen='play'] .stick-ring:not(.on) { width: 84px; height: 84px; bottom: calc(env(safe-area-inset-bottom) + 40px); }
  html.touch body[data-screen='play'] #ring-l:not(.on) { left: calc(env(safe-area-inset-left) + 12px); }
  html.touch body[data-screen='play'] #ring-r:not(.on) { right: calc(env(safe-area-inset-right) + 12px); }
}

/* ---------------------------------------------------------------------- the bar */
.bar {
  position: fixed; left: 0; right: 0; top: 0; z-index: 3; display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) calc(env(safe-area-inset-right) + 12px) 10px calc(env(safe-area-inset-left) + 12px);
  pointer-events: none;
}
.bar > * { pointer-events: auto; }
/* both ends are the SDK's (App Standard §4.1), in white over the yard like the rest of the bar (the
   brand's name with the title's shadow), the tools on the game's dark glass; on a site the site's
   name and clock stand between them and the brand's name gives way — its mark and icon stay */
.bar { color: #fff; --ca-tool-bg: var(--glass); --ca-tool-line: transparent; --ca-tool-hover: rgba(20, 26, 36, 0.66); }
#app-brand { text-shadow: 0 2px 10px rgba(10, 16, 28, 0.6); }
.bar > .ca-end { margin-left: auto; }
body[data-screen='play'] .bar .ca-brand-name { display: none; }
body:not([data-screen='play']) .bar-title { display: none; }
.bar-title { flex: 1; min-width: 0; pointer-events: none; }
.title { margin: 0; font-size: 21px; font-weight: 750; letter-spacing: -0.02em; color: #fff; text-shadow: 0 2px 10px rgba(10, 16, 28, 0.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { margin: 0; font-size: 13px; font-weight: 600; color: #fff; text-shadow: 0 1px 6px rgba(10, 16, 28, 0.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 0; }
.sub:empty { display: none; }
/* a phone: the bar a little tighter, so the clock and the time for three stars stay whole (a long
   site name may be cut); the smallest one shows the clock alone (the job is in the goal below it) */
@media (max-width: 420px) {
  .title { font-size: 18px; }
}
@media (max-width: 400px) {
  .bar { gap: 6px; padding-left: calc(env(safe-area-inset-left) + 8px); padding-right: calc(env(safe-area-inset-right) + 8px); }
}
@media (max-width: 359px) {
  body[data-screen='play'] .bar .title { display: none; }
  .sub { font-size: 16px; font-weight: 750; }
  .sub .then { display: none; }
}
.icon-btn { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 0; background: var(--glass); color: #fff; cursor: pointer; }
.icon-btn.ghost { background: transparent; color: var(--muted); }
.icon-btn:focus-visible, .btn:focus-visible, .tile:focus-visible, .seg button:focus-visible, .job:focus-visible, .act:focus-visible, .fleet button:focus-visible { outline: 3px solid #ffd34d; outline-offset: 2px; }

/* --------------------------------------------------------------------- the title */
#main { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
#main > * { pointer-events: none; }
.home { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding: 76px calc(env(safe-area-inset-right) + 12px) calc(env(safe-area-inset-bottom) + 12px) calc(env(safe-area-inset-left) + 12px); }
.home-card { pointer-events: auto; width: min(100%, 440px); max-height: 100%; overflow: auto; overscroll-behavior: contain; background: var(--panel); border-radius: var(--r); padding: 16px; box-shadow: 0 18px 50px -18px rgba(5, 15, 50, 0.6); display: grid; gap: 12px; }
.tag { color: var(--muted); font-size: 14px; }
.stars-line { display: flex; align-items: center; gap: 6px; font-weight: 650; font-size: 14px; color: var(--gold); }
.stars-line .ic { width: 18px; height: 18px; }
.btn { min-height: 46px; padding: 0 18px; border-radius: 14px; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 650; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.soft { background: var(--soft); color: var(--text); }
.btn.danger { color: var(--danger); }
.btn.big { min-height: 62px; width: 100%; justify-content: flex-start; text-align: left; padding: 0 18px; border-radius: 18px; font-size: 18px; }
.btn.big .ic { width: 30px; height: 30px; }
.btn-two { display: grid; text-align: left; line-height: 1.2; min-width: 0; }
.btn-two small { font-size: 13px; font-weight: 550; opacity: 0.92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn:disabled { opacity: 0.5; cursor: default; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
/* a child profile has no "With friends" tile (data-social, App Standard §4.13): Free play takes the last row */
html.ca-kid .tiles > #home-free { grid-column: 1 / -1; }
.tile { min-height: 72px; text-align: left; padding: 10px 12px; border-radius: 16px; border: 0; background: var(--soft); color: var(--text); cursor: pointer; display: grid; grid-template-columns: auto 1fr; column-gap: 9px; align-items: center; }
.tile .ic { grid-row: span 2; width: 26px; height: 26px; color: var(--accent); }
.tile b { font-weight: 650; line-height: 1.2; align-self: end; }
.tile small { color: var(--muted); font-size: 12.5px; line-height: 1.25; align-self: start; }
.open-note { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--soft); font-size: 14px; font-weight: 600; }
@media (min-width: 760px) and (min-height: 520px) {
  .home { align-items: center; justify-content: flex-start; padding-left: calc(env(safe-area-inset-left) + calc(6vw / var(--ca-zoom, 1))); }
  .home-card { width: 360px; }
  .title { font-size: 26px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .home { align-items: stretch; justify-content: flex-start; padding-top: 64px; }
  .home-card { width: min(calc(46vw / var(--ca-zoom, 1)), 340px); align-content: start; gap: 8px; padding: 12px; }
  .tag, .tile small { display: none; }
  .tile { min-height: 48px; }
  .tile b { align-self: center; }
  .btn.big { min-height: 50px; }
}
@media (max-height: 620px) and (orientation: portrait) {
  .tile small, .tag { display: none; }
  .tile { min-height: 50px; }
  .tile b { align-self: center; }
}

/* ----------------------------------------------------------------------- playing */
body[data-screen='play'] .home { display: none; }
.hud { position: absolute; inset: 0; padding: calc(env(safe-area-inset-top) + 62px) calc(env(safe-area-inset-right) + 10px) calc(env(safe-area-inset-bottom) + 10px) calc(env(safe-area-inset-left) + 10px); color: #fff; }
.hud > * { pointer-events: auto; }
/* what has to be done */
.goals { position: absolute; left: calc(env(safe-area-inset-left) + 10px); top: calc(env(safe-area-inset-top) + 70px); width: min(calc(100% - 84px), 330px); display: grid; gap: 5px; pointer-events: none; }
.goal { position: relative; background: var(--glass); border-radius: 13px; padding: 6px 10px 9px 34px; font-size: 13.5px; font-weight: 600; line-height: 1.3; overflow: hidden; }
.goal .ic { position: absolute; left: 9px; top: 6px; width: 18px; height: 18px; opacity: 0.55; }
.goal.done { color: #b9f2c8; }
.goal.done .ic { opacity: 1; }
.goal i { position: absolute; left: 0; bottom: 0; height: 4px; width: 100%; background: #ffd34d; transform-origin: left; transform: scaleX(var(--k, 0)); transition: transform 0.25s; }
.goal.done i { background: #58c27d; }
.goal em { font-style: normal; font-variant-numeric: tabular-nums; opacity: 0.9; margin-left: 6px; white-space: nowrap; }
.goal.note { padding-left: 10px; background: rgba(160, 60, 20, 0.72); }
.goal.note.calm { background: var(--glass); }
/* the machines of the site */
.fleet { position: absolute; right: calc(env(safe-area-inset-right) + 10px); top: calc(env(safe-area-inset-top) + 62px); display: grid; gap: 6px; }
.fleet button { position: relative; width: 56px; height: 50px; padding: 0; border-radius: 14px; border: 2px solid transparent; background: var(--glass); color: #fff; cursor: pointer; display: grid; place-items: center; }
.fleet img { width: 52px; height: 46px; object-fit: contain; pointer-events: none; }
.fleet button[aria-pressed='true'] { border-color: #ffd34d; background: rgba(255, 211, 77, 0.22); }
.fleet button:disabled { opacity: 0.55; cursor: default; }
.fleet u { position: absolute; left: -4px; top: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #fff; color: #1b2230; font-size: 11px; font-weight: 750; line-height: 18px; text-decoration: none; text-align: center; }
.fleet kbd { position: absolute; right: 3px; bottom: 1px; font: 650 10px/1 inherit; opacity: 0.8; }
.rank { position: absolute; right: calc(env(safe-area-inset-right) + 76px); top: calc(env(safe-area-inset-top) + 62px); margin: 0; padding: 6px 10px; list-style: none; background: var(--glass); border-radius: 13px; font-size: 13px; font-weight: 600; width: 150px; display: grid; gap: 5px; pointer-events: none; }
.rank li { display: grid; gap: 2px; }
.rank li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank li i { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.25); position: relative; overflow: hidden; }
.rank li i::after { content: ''; position: absolute; inset: 0; background: #ffd34d; transform-origin: left; transform: scaleX(var(--k, 0)); }
.rank li.me { color: #ffd34d; }
.rank li.out { opacity: 0.55; }
/* the deck at the bottom: what the machine carries, its switches */
.deck { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 10px); transform: translateX(-50%); display: grid; justify-items: center; gap: 7px; pointer-events: none; width: max-content; max-width: calc(100% - 20px); }
.deck > * { pointer-events: auto; }
.acts { display: flex; gap: 8px; align-items: center; }
.act { min-height: 48px; padding: 0 14px; border-radius: 24px; border: 2px solid rgba(255, 255, 255, 0.55); background: var(--glass); color: #fff; font-weight: 650; font-size: 14px; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; touch-action: none; }
.act.round { width: 48px; padding: 0; justify-content: center; }
.act[aria-pressed='true'] { background: #ffd34d; border-color: #ffd34d; color: #1b2230; }
.dash { display: flex; align-items: center; gap: 10px; background: var(--glass); border-radius: 16px; padding: 6px 12px; min-height: 40px; pointer-events: none; }
.gauge { display: grid; grid-template-columns: auto auto; column-gap: 8px; align-items: center; min-width: 92px; }
.gauge small { font-size: 11.5px; font-weight: 600; opacity: 0.92; white-space: nowrap; }
.gauge b { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; justify-self: end; }
.gauge i { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.25); position: relative; overflow: hidden; }
.gauge i::after { content: ''; position: absolute; inset: 0; background: var(--c, #ffd34d); transform-origin: left; transform: scaleX(var(--k, 0)); transition: transform 0.15s; }
.speed { display: grid; justify-items: center; line-height: 1.05; min-width: 38px; }
.speed b { font-size: 18px; font-weight: 750; font-variant-numeric: tabular-nums; }
.speed small { font-size: 10.5px; font-weight: 600; opacity: 0.9; }
.warn { font-size: 12.5px; font-weight: 700; color: #ffd34d; white-space: nowrap; }
.keys { font-size: 12px; font-weight: 600; color: #fff; text-shadow: 0 1px 5px rgba(10, 16, 28, 0.85); text-align: center; pointer-events: none; max-width: 640px; }
html.touch .keys, html[data-ca-pad] .keys { display: none; }
/* where the thumbs go, and what each stick does on this machine */
.caption { position: absolute; bottom: calc(env(safe-area-inset-bottom) + 14px); margin: 0; font-size: 12px; font-weight: 650; text-shadow: 0 1px 5px rgba(10, 16, 28, 0.85); pointer-events: none; display: none; max-width: 30%; }
.caption.left { left: calc(env(safe-area-inset-left) + 14px); }
.caption.right { right: calc(env(safe-area-inset-right) + 14px); text-align: right; }
html.touch .caption { display: block; }
html[data-ca-pad] .caption { display: none; }
@media (max-width: 560px) {
  .act span { display: none; }
  .act { width: 52px; height: 52px; padding: 0; justify-content: center; }
  .dash { gap: 8px; padding: 5px 9px; }
  .gauge { min-width: 70px; }
  .rank { right: auto; left: calc(env(safe-area-inset-left) + 10px); top: auto; bottom: calc(env(safe-area-inset-bottom) + 150px); width: 132px; }
}
@media (max-width: 420px) {
  .dash { gap: 6px; padding: 5px 8px; }
  .gauge { min-width: 62px; column-gap: 4px; }
  .speed small { display: none; }
  .speed { min-width: 24px; }
  .caption { bottom: calc(env(safe-area-inset-bottom) + 132px); max-width: 96px; }
}
@media (max-height: 460px) {
  .hud { padding-top: calc(env(safe-area-inset-top) + 56px); }
  .goals { width: min(42%, 300px); }
  .goal { font-size: 12.5px; padding-top: 4px; padding-bottom: 7px; }
  .fleet { grid-auto-flow: column; grid-template-rows: repeat(3, auto); }
  .fleet button { width: 50px; height: 44px; }
  .fleet img { width: 46px; height: 40px; }
  .deck { gap: 4px; bottom: calc(env(safe-area-inset-bottom) + 6px); }
  .act { min-height: 44px; }
}
@media (max-height: 380px) { .goal:not(.now):not(.note) { display: none; } }

/* ------------------------------------------------------------------------ sheets */
.sheet { border: 0; padding: 0; margin: auto; width: min(calc(94vw / var(--ca-zoom, 1)), 460px); max-height: min(calc(88dvh / var(--ca-zoom, 1)), 720px); border-radius: var(--r); background: var(--panel-solid); color: var(--text); box-shadow: 0 30px 80px -24px rgba(0, 0, 0, 0.6); display: flex; flex-direction: column; overflow: hidden; }
.sheet:not([open]) { display: none; }
.sheet.wide { width: min(calc(94vw / var(--ca-zoom, 1)), 720px); }
.sheet::backdrop { background: rgba(8, 14, 34, 0.5); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 10px 6px 20px; }
.sheet-head h2 { font-size: 19px; font-weight: 720; letter-spacing: -0.01em; }
.sheet.ask .sheet-head { padding: 22px 20px 10px; }
.sheet.ask .sheet-head h2 { font-size: 17px; font-weight: 600; line-height: 1.4; }
/* (a column of blocks, not a grid: a grid's rows measured the wrapping choice rows one line high) */
.sheet-body { padding: 4px 20px 16px; overflow: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 12px; }
.sheet-body > * { flex: none; }
.sheet-body:empty { display: none; }
.sheet-foot { display: flex; gap: 8px; padding: 10px 20px calc(env(safe-area-inset-bottom) + 16px); border-top: 1px solid var(--line); }
.sheet-foot .btn { flex: 1; }
.sheet h3 { font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.note { color: var(--muted); font-size: 14px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; }
.row.choice { flex-direction: column; align-items: flex-start; gap: 6px; }
.row-text { display: grid; }
.row small { color: var(--muted); font-size: 13px; }
.row b { font-weight: 600; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; background: var(--soft); padding: 4px; border-radius: 14px; }
.seg button { min-height: 38px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--text); cursor: pointer; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.seg button[aria-checked='true'] { background: var(--accent); color: var(--accent-ink); }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { width: 48px; height: 28px; border-radius: 14px; background: var(--line); position: relative; flex: none; transition: background 0.15s; }
.switch::after { content: ''; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); transition: transform 0.15s; }
.toggle input:checked + .switch { background: var(--accent); }
.toggle input:checked + .switch::after { transform: translateX(20px); }
.toggle input:focus-visible + .switch { outline: 3px solid #ffd34d; outline-offset: 2px; }
select, input[type='text'] { min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--soft); color: var(--text); padding: 0 12px; font: inherit; max-width: 60%; }
.version { color: var(--muted); font-size: 13px; }
.prose { display: grid; gap: 10px; }
.prose p { font-size: 15px; }
.legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.legend li, .legend div { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.legend img, .thumb { width: 44px; height: 44px; flex: none; object-fit: contain; }
.legend b { font-weight: 650; }
.legend small { color: var(--muted); display: block; font-size: 13px; }
.swatch { width: 36px; height: 36px; margin: 4px; flex: none; border-radius: 9px; background: var(--c); box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.16); }

/* jobs, lessons, yards */
.jobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.job { position: relative; text-align: left; border: 2px solid transparent; border-radius: 18px; background: var(--soft); color: var(--text); padding: 10px 12px; cursor: pointer; display: grid; gap: 4px; justify-items: start; min-height: 96px; }
.job[aria-pressed='true'] { border-color: var(--accent); }
.job.locked { opacity: 0.66; }
.job .n { font-size: 12px; font-weight: 750; color: var(--muted); letter-spacing: 0.04em; }
.job b { font-weight: 680; line-height: 1.2; }
.job small { color: var(--muted); font-size: 12.5px; line-height: 1.3; }
.job .lock { position: absolute; right: 10px; top: 10px; color: var(--muted); }
.job .tick { position: absolute; right: 10px; top: 10px; color: var(--ok); }
.job .kit { display: flex; gap: 2px; margin: 0 0 0 -4px; }
.job .kit img { width: 40px; height: 34px; object-fit: contain; }
.job.wide { grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; min-height: 76px; }
.job.wide > img { grid-row: span 2; width: 72px; height: 60px; object-fit: contain; }
.job.wide b { align-self: end; }
.job.wide small { align-self: start; }
.stars3 { display: flex; gap: 2px; color: var(--line); }
.stars3 .ic { width: 18px; height: 18px; }
.stars3 .on { color: var(--gold); }
.result-stars { display: flex; justify-content: center; gap: 6px; color: var(--line); }
.result-stars .ic { width: 46px; height: 46px; }
.result-stars .on { color: var(--gold); animation: star 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) backwards; animation-delay: calc(var(--i) * 0.18s + 0.15s); }
@keyframes star { from { transform: scale(0.2) rotate(-40deg); opacity: 0; } }
.big-num { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; text-align: center; }
.big-num div { background: var(--soft); border-radius: 14px; padding: 8px 4px; display: grid; }
.big-num b { font-size: 24px; font-weight: 760; font-variant-numeric: tabular-nums; }
.big-num small { color: var(--muted); font-size: 12.5px; }
.badge { align-self: center; background: var(--gold); color: #fff; font-weight: 700; font-size: 13px; padding: 3px 12px; border-radius: 12px; }
@media (prefers-color-scheme: dark) { .badge { color: #1a1300; } }
.list { display: grid; gap: 8px; }
.list .row { background: var(--soft); border-radius: 14px; padding: 8px 12px; }
.board-box { min-height: 150px; }
.machines { display: grid; gap: 10px; }
.machine { display: grid; grid-template-columns: 84px 1fr; gap: 10px; align-items: center; }
.machine img { width: 84px; height: 70px; object-fit: contain; background: var(--soft); border-radius: 14px; }
.machine b { font-weight: 680; }
.machine small { display: block; color: var(--muted); font-size: 13.5px; line-height: 1.4; }
.swatch { width: 36px; height: 36px; margin: 4px; flex: none; border-radius: 9px; background: var(--c); box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.16); }
.legend { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 120px); z-index: 2147483000; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; background: rgba(15, 22, 48, 0.9); color: #fff; padding: 9px 16px; border-radius: 16px; font-weight: 600; font-size: 14.5px; max-width: calc(86vw / var(--ca-zoom, 1)); text-align: center; transition: opacity 0.2s, transform 0.2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
body[data-screen='play'] .toast { bottom: calc(env(safe-area-inset-bottom) + 170px); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation-duration: 0.01s !important; } }

/* ---- the levers: a lever for every function of the tool, at the lower right (levers.js) ---- */
.levers { position: absolute; right: calc(env(safe-area-inset-right) + 10px); bottom: calc(env(safe-area-inset-bottom) + 10px); display: grid; gap: 8px; justify-items: end; pointer-events: none; --lw: 56px; --lh: 148px; --knob: 44px; }
.levers-row { display: flex; gap: 8px; justify-content: flex-end; align-items: flex-end; }
.lever { display: grid; justify-items: center; gap: 3px; }
.lever b { font-size: 12px; font-weight: 700; line-height: 1.15; color: #fff; text-shadow: 0 1px 5px rgba(10, 16, 28, 0.9); white-space: nowrap; }
.lever-track { position: relative; width: var(--lw); height: var(--lh); border-radius: calc(var(--lw) / 2); border: 2px solid rgba(255, 255, 255, 0.55); background: var(--glass); pointer-events: auto; touch-action: none; cursor: grab; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.lever-track::before { content: ''; position: absolute; left: 50%; top: 22px; bottom: 22px; width: 6px; margin-left: -3px; border-radius: 3px; background: rgba(10, 16, 28, 0.45); }
.lever-track::after { content: ''; position: absolute; left: 50%; top: 50%; width: 18px; height: 2px; margin: -1px 0 0 -9px; background: rgba(255, 255, 255, 0.55); }
.lever-track small { position: absolute; left: 0; right: 0; text-align: center; font-size: 10.5px; font-weight: 700; line-height: 1; color: #fff; opacity: 0.9; pointer-events: none; text-shadow: 0 1px 3px rgba(10, 16, 28, 0.9); }
.lever-track .hi { top: 6px; }
.lever-track .lo { bottom: 6px; }
.lever-knob { position: absolute; left: 50%; top: 50%; width: var(--knob); height: var(--knob); margin: calc(var(--knob) / -2) 0 0 calc(var(--knob) / -2); border-radius: 50%; background: rgba(255, 255, 255, 0.9); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 -3px 0 rgba(27, 34, 48, 0.18); pointer-events: none; z-index: 1; transform: translateY(calc(var(--v, 0) * -1 * (var(--lh) - var(--knob) - 10px) / 2)); }
.lever-track.held { border-color: #ffd34d; cursor: grabbing; }
.lever-track.held .lever-knob { background: #ffd34d; }
/* a lever that lies across: the house, a chute */
.lever.h .lever-track { width: calc(var(--lw) * 3 + 16px); height: var(--lw); }
.lever.h .lever-track::before { left: 22px; right: 22px; top: 50%; bottom: auto; width: auto; height: 6px; margin: -3px 0 0; }
.lever.h .lever-track::after { width: 2px; height: 18px; margin: -9px 0 0 -1px; }
.lever.h .lever-track small { left: auto; right: auto; top: 50%; bottom: auto; margin-top: -5px; }
.lever.h .lever-track .lo { left: 9px; }
.lever.h .lever-track .hi { right: 9px; }
.lever.h .lever-knob { transform: translateX(calc(var(--v, 0) * (var(--lw) * 3 + 16px - var(--knob) - 10px) / 2)); }
/* with the levers out the right hand has those: no right stick, no words for it; the excavator's Arm switch is not needed */
body[data-controls='levers'] #ring-r, body[data-controls='levers'] #knob-r, body[data-controls='levers'] #cap-r { display: none; }
html:not([data-ca-pad]) body[data-controls='levers'] #btn-mode { display: none; }
html[data-ca-pad] .levers { display: none; }
/* on a phone held upright the deck is in the middle of the bottom: the levers stand above it */
@media (max-width: 560px) { .levers { bottom: calc(env(safe-area-inset-bottom) + 132px); --lw: 52px; --lh: 136px; gap: 6px; } .levers-row { gap: 6px; } .lever.h .lever-track { width: calc(var(--lw) * 3 + 12px); } .lever.h .lever-knob { transform: translateX(calc(var(--v, 0) * (var(--lw) * 3 + 12px - var(--knob) - 10px) / 2)); } }
@media (max-width: 360px) { .levers { --lw: 46px; --knob: 38px; } }
@media (max-height: 460px) { .levers { --lh: 104px; --lw: 50px; --knob: 40px; gap: 4px; bottom: calc(env(safe-area-inset-bottom) + 6px); } .lever b { font-size: 11px; } .lever.h .lever-track { height: 44px; } }
@media (max-height: 620px) and (orientation: portrait) { .levers { --lh: 112px; } }

/* a game controller in use (the SDK marks <html data-ca-pad>): the glass sticks step aside */
html[data-ca-pad] .stick-ring, html[data-ca-pad] .stick-knob { display: none; }

/* cloud-apps bar 1.30.0 */
:root { --ca-brand-icon-w: 89px; } /* the brand's width with the icon alone (the mark, the divider, the app's icon) */
.ca-start { display: flex; align-items: center; flex: 0 100 auto; min-width: min(var(--ca-brand-icon-w), 100%); }
.ca-brand { display: flex; align-items: center; min-width: 0; height: 40px; color: inherit; font-family: inherit; }
.ca-brand a { display: flex !important; align-items: center !important; box-sizing: border-box !important; color: inherit !important; text-decoration: none !important; border-radius: 12px !important; -webkit-tap-highlight-color: transparent; transition: background-color .15s ease; }
.ca-brand-home { flex: none !important; justify-content: center !important; width: 40px !important; height: 40px !important; padding: 0 !important; margin: 0 0 0 -5px !important; }
.ca-brand-home img { display: block !important; width: 30px !important; height: 30px !important; margin: 0 !important; transition: transform .38s cubic-bezier(.34, 1.56, .64, 1); }
.ca-brand-sep { flex: none; display: block; width: 1.5px; height: 18px; margin: 0 4px; border-radius: 1px; background: currentColor; opacity: .22; transform: rotate(18deg); }
.ca-brand-app { flex: 0 1 auto !important; min-width: 44px !important; height: 40px !important; padding: 0 9px 0 5px !important; margin: 0 !important; }
.ca-brand-in { display: flex; flex-wrap: wrap; align-items: center; align-content: flex-start; column-gap: 9px; min-width: 0; height: 40px; overflow: hidden; }
.ca-brand-in img { flex: none; display: block !important; width: 30px !important; height: 30px !important; margin: 5px 0 !important; border-radius: 8px; }
.ca-brand[data-ca-icon] .ca-brand-name { display: none !important; }
.ca-brand[data-ca-icon] .ca-brand-app { padding-right: 5px !important; }
.ca-brand-name { display: block; height: 40px; margin: 0 !important; padding: 0 !important; line-height: 40px !important; white-space: nowrap; font-family: var(--ca-brand-font, inherit); font-size: 17px !important; font-weight: 700; letter-spacing: -.015em; color: inherit; text-shadow: var(--ca-brand-shadow, none); }
@media (hover: hover) { .ca-brand a:hover { background-color: color-mix(in srgb, currentColor 7%, transparent); } .ca-brand-home:hover img { transform: rotate(-6deg) scale(1.06); } }
.ca-brand a:focus-visible { outline: 3px solid var(--ca-accent, #4f6bff); outline-offset: -3px; }
.ca-end { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex: none; min-width: 0; }
.ca-tools { display: flex; align-items: center; gap: 6px; }
.ca-tools[hidden] { display: none !important; }
.ca-tool { position: relative; flex: none; display: inline-grid; place-items: center !important; box-sizing: border-box !important; width: 36px !important; height: 36px !important; min-width: 0 !important; min-height: 0 !important; max-width: none !important; padding: 0 !important; margin: 0; border-radius: 50% !important;
  border: 1px solid var(--ca-tool-line, color-mix(in srgb, currentColor 16%, transparent)) !important; background: var(--ca-tool-bg, color-mix(in srgb, currentColor 6%, transparent)) !important; color: var(--ca-tool-ink, inherit) !important;
  font: inherit; line-height: 0 !important; letter-spacing: 0; text-decoration: none !important; box-shadow: none; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color .15s ease, transform .12s ease; }
.ca-tool[hidden] { display: none !important; }
.ca-tool::before { content: ""; position: absolute; inset: -4px; }
.ca-tool svg { display: block; width: 20px !important; height: 20px !important; margin: 0 !important; pointer-events: none; }
.ca-tool svg[hidden] { display: none !important; }
@media (hover: hover) { .ca-tool:hover { background: var(--ca-tool-hover, color-mix(in srgb, currentColor 13%, transparent)) !important; } }
.ca-tool:active { transform: scale(.94); }
.ca-tool:focus-visible { outline: 3px solid var(--ca-accent, #4f6bff); outline-offset: 2px; }
.ca-tool-talk { color: var(--ca-accent, #4f6bff) !important; border-color: color-mix(in srgb, var(--ca-accent, #4f6bff) 50%, transparent) !important; background: color-mix(in srgb, var(--ca-accent, #4f6bff) 13%, transparent) !important; }
.ca-tool .ca-tlive { position: absolute; top: 1px; right: 1px; width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 2px color-mix(in srgb, #22c55e 30%, transparent); }
.ca-tool-talk.ca-new::after { content: ""; position: absolute; inset: -1px; border-radius: 50%; pointer-events: none; animation: ca-bar-ring 1.2s ease-out 2; }
@keyframes ca-bar-ring { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ca-accent, #4f6bff) 55%, transparent); } to { box-shadow: 0 0 0 11px transparent; } }
.ca-tool .ca-tcount, .ca-tool .ca-tunread { position: absolute; right: -5px; display: grid; place-items: center; box-sizing: border-box; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; color: #fff; font: 700 10.5px/1 -apple-system, BlinkMacSystemFont, Inter, "Segoe UI", Roboto, sans-serif; font-variant-numeric: tabular-nums; letter-spacing: 0; pointer-events: none; }
.ca-tool .ca-tcount { bottom: -5px; background: #1f9d55; }
.ca-tool .ca-tunread { top: -5px; background: #e5484d; }
@media (max-width: 599.98px), (max-height: 499.98px) { .ca-tools-app { display: none !important; } }
.ca-end[data-ca-cramped] .ca-tools-app { display: none !important; }
.ca-end[data-ca-tight] .ca-tool-friends { display: none !important; }
@media (prefers-reduced-motion: reduce) { .ca-tool, .ca-brand a, .ca-brand-home img { transition: none; } .ca-tool-talk.ca-new::after { animation: none; } }
/* end of the cloud-apps bar */
/* ---- cloud-apps: big screens (App Standard §6.5) — written by `cloud-apps vendor-sdk`; do not edit ---- */
/* Past 1584 × 990 the page is laid out at about 1440 × 900 and zoomed to fill the screen; viewport
   units in this file are divided by --ca-zoom. cloud-kit.js turns it off where the engine has no
   standard zoom (html[data-ca-zoom="off"]). */
@media (min-width: 1585px) and (min-height: 991px) { :root { --ca-zoom: 1.1; } }
@media (min-width: 1656px) and (min-height: 1035px) { :root { --ca-zoom: 1.15; } }
@media (min-width: 1728px) and (min-height: 1080px) { :root { --ca-zoom: 1.2; } }
@media (min-width: 1800px) and (min-height: 1125px) { :root { --ca-zoom: 1.25; } }
@media (min-width: 1872px) and (min-height: 1170px) { :root { --ca-zoom: 1.3; } }
@media (min-width: 1945px) and (min-height: 1215px) { :root { --ca-zoom: 1.35; } }
@media (min-width: 2016px) and (min-height: 1260px) { :root { --ca-zoom: 1.4; } }
@media (min-width: 2088px) and (min-height: 1305px) { :root { --ca-zoom: 1.45; } }
@media (min-width: 2160px) and (min-height: 1350px) { :root { --ca-zoom: 1.5; } }
@media (min-width: 2232px) and (min-height: 1395px) { :root { --ca-zoom: 1.55; } }
@media (min-width: 2304px) and (min-height: 1440px) { :root { --ca-zoom: 1.6; } }
@media (min-width: 2376px) and (min-height: 1485px) { :root { --ca-zoom: 1.65; } }
@media (min-width: 2448px) and (min-height: 1530px) { :root { --ca-zoom: 1.7; } }
@media (min-width: 2520px) and (min-height: 1575px) { :root { --ca-zoom: 1.75; } }
@media (min-width: 2592px) and (min-height: 1620px) { :root { --ca-zoom: 1.8; } }
@media (min-width: 2664px) and (min-height: 1665px) { :root { --ca-zoom: 1.85; } }
@media (min-width: 2736px) and (min-height: 1710px) { :root { --ca-zoom: 1.9; } }
@media (min-width: 2808px) and (min-height: 1755px) { :root { --ca-zoom: 1.95; } }
@media (min-width: 2880px) and (min-height: 1800px) { :root { --ca-zoom: 2; } }
@media (min-width: 2952px) and (min-height: 1845px) { :root { --ca-zoom: 2.05; } }
@media (min-width: 3024px) and (min-height: 1890px) { :root { --ca-zoom: 2.1; } }
@media (min-width: 3096px) and (min-height: 1935px) { :root { --ca-zoom: 2.15; } }
@media (min-width: 3169px) and (min-height: 1981px) { :root { --ca-zoom: 2.2; } }
@media (min-width: 3240px) and (min-height: 2025px) { :root { --ca-zoom: 2.25; } }
@media (min-width: 3312px) and (min-height: 2070px) { :root { --ca-zoom: 2.3; } }
@media (min-width: 3384px) and (min-height: 2115px) { :root { --ca-zoom: 2.35; } }
@media (min-width: 3456px) and (min-height: 2160px) { :root { --ca-zoom: 2.4; } }
@media (min-width: 3529px) and (min-height: 2205px) { :root { --ca-zoom: 2.45; } }
@media (min-width: 3600px) and (min-height: 2250px) { :root { --ca-zoom: 2.5; } }
@media (min-width: 3672px) and (min-height: 2295px) { :root { --ca-zoom: 2.55; } }
@media (min-width: 3744px) and (min-height: 2340px) { :root { --ca-zoom: 2.6; } }
@media (min-width: 3816px) and (min-height: 2385px) { :root { --ca-zoom: 2.65; } }
@media (min-width: 3889px) and (min-height: 2430px) { :root { --ca-zoom: 2.7; } }
@media (min-width: 3960px) and (min-height: 2475px) { :root { --ca-zoom: 2.75; } }
@media (min-width: 4032px) and (min-height: 2520px) { :root { --ca-zoom: 2.8; } }
@media (min-width: 4104px) and (min-height: 2565px) { :root { --ca-zoom: 2.85; } }
@media (min-width: 4176px) and (min-height: 2610px) { :root { --ca-zoom: 2.9; } }
@media (min-width: 4248px) and (min-height: 2655px) { :root { --ca-zoom: 2.95; } }
@media (min-width: 4320px) and (min-height: 2700px) { :root { --ca-zoom: 3; } }
@media (min-width: 4392px) and (min-height: 2745px) { :root { --ca-zoom: 3.05; } }
@media (min-width: 4464px) and (min-height: 2790px) { :root { --ca-zoom: 3.1; } }
@media (min-width: 4536px) and (min-height: 2835px) { :root { --ca-zoom: 3.15; } }
@media (min-width: 4608px) and (min-height: 2880px) { :root { --ca-zoom: 3.2; } }
@media (min-width: 4680px) and (min-height: 2925px) { :root { --ca-zoom: 3.25; } }
@media (min-width: 4752px) and (min-height: 2970px) { :root { --ca-zoom: 3.3; } }
@media (min-width: 4824px) and (min-height: 3015px) { :root { --ca-zoom: 3.35; } }
@media (min-width: 4896px) and (min-height: 3060px) { :root { --ca-zoom: 3.4; } }
@media (min-width: 4968px) and (min-height: 3105px) { :root { --ca-zoom: 3.45; } }
@media (min-width: 5040px) and (min-height: 3150px) { :root { --ca-zoom: 3.5; } }
@media (min-width: 5112px) and (min-height: 3195px) { :root { --ca-zoom: 3.55; } }
@media (min-width: 5184px) and (min-height: 3240px) { :root { --ca-zoom: 3.6; } }
@media (min-width: 5256px) and (min-height: 3285px) { :root { --ca-zoom: 3.65; } }
@media (min-width: 5328px) and (min-height: 3330px) { :root { --ca-zoom: 3.7; } }
@media (min-width: 5400px) and (min-height: 3375px) { :root { --ca-zoom: 3.75; } }
@media (min-width: 5472px) and (min-height: 3420px) { :root { --ca-zoom: 3.8; } }
@media (min-width: 5544px) and (min-height: 3465px) { :root { --ca-zoom: 3.85; } }
@media (min-width: 5616px) and (min-height: 3510px) { :root { --ca-zoom: 3.9; } }
@media (min-width: 5688px) and (min-height: 3555px) { :root { --ca-zoom: 3.95; } }
@media (min-width: 5760px) and (min-height: 3600px) { :root { --ca-zoom: 4; } }
@media (min-width: 5832px) and (min-height: 3645px) { :root { --ca-zoom: 4.05; } }
@media (min-width: 5904px) and (min-height: 3690px) { :root { --ca-zoom: 4.1; } }
@media (min-width: 5977px) and (min-height: 3736px) { :root { --ca-zoom: 4.15; } }
@media (min-width: 6048px) and (min-height: 3780px) { :root { --ca-zoom: 4.2; } }
@media (min-width: 6120px) and (min-height: 3825px) { :root { --ca-zoom: 4.25; } }
@media (min-width: 6192px) and (min-height: 3870px) { :root { --ca-zoom: 4.3; } }
@media (min-width: 6264px) and (min-height: 3915px) { :root { --ca-zoom: 4.35; } }
@media (min-width: 6337px) and (min-height: 3961px) { :root { --ca-zoom: 4.4; } }
@media (min-width: 6408px) and (min-height: 4005px) { :root { --ca-zoom: 4.45; } }
@media (min-width: 6480px) and (min-height: 4050px) { :root { --ca-zoom: 4.5; } }
@media (min-width: 6552px) and (min-height: 4095px) { :root { --ca-zoom: 4.55; } }
@media (min-width: 6624px) and (min-height: 4140px) { :root { --ca-zoom: 4.6; } }
@media (min-width: 6697px) and (min-height: 4185px) { :root { --ca-zoom: 4.65; } }
@media (min-width: 6768px) and (min-height: 4230px) { :root { --ca-zoom: 4.7; } }
@media (min-width: 6840px) and (min-height: 4275px) { :root { --ca-zoom: 4.75; } }
@media (min-width: 6912px) and (min-height: 4320px) { :root { --ca-zoom: 4.8; } }
@media (min-width: 6984px) and (min-height: 4365px) { :root { --ca-zoom: 4.85; } }
@media (min-width: 7057px) and (min-height: 4410px) { :root { --ca-zoom: 4.9; } }
@media (min-width: 7128px) and (min-height: 4455px) { :root { --ca-zoom: 4.95; } }
@media (min-width: 7200px) and (min-height: 4500px) { :root { --ca-zoom: 5; } }
@media (min-width: 1585px) and (min-height: 991px) {
  html { zoom: var(--ca-zoom, 1); }
  html[data-ca-zoom='off'] { --ca-zoom: 1 !important; }
}
/* ---- end of big screens ---- */
