/* Formicarium. Tactile Naturalist / Specimen Cabinet game chrome: warm walnut surfaces, antique-brass rims, and GPU-fast depth. */
:root {
  --panel: rgba(27, 21, 16, 0.94);
  --panel-solid: #1e1712;
  --surface-slab: linear-gradient(180deg, #2b2119 0%, #1d1611 100%);
  --surface-bar: linear-gradient(180deg, rgba(44, 34, 25, 0.96) 0%, rgba(24, 18, 13, 0.96) 100%);
  --surface-recess: linear-gradient(180deg, rgba(12, 9, 7, 0.62) 0%, rgba(20, 15, 11, 0.48) 100%);
  --brass-edge: rgba(232, 186, 116, 0.34);
  --brass-hi: rgba(255, 228, 182, 0.16);
  --line: rgba(244, 212, 168, 0.14);
  --text: #f3eadc;
  --muted: #c7b8a6;
  --faint: #9b8c7c;
  --accent: #dfa757;
  --accent-hi: #f0be73;
  --accent-deep: #b87e34;
  --sugar: #e4a54c;
  --protein: #cf765c;
  --goal: #adc672;
  --space: #8ea9b5;
  --warn-bg: linear-gradient(180deg, rgba(78, 31, 20, 0.97) 0%, rgba(54, 20, 13, 0.97) 100%);
  --focus: #f4d292;
  --shadow-bar: 0 12px 28px rgba(0, 0, 0, 0.52), inset 0 1px 0 var(--brass-hi), inset 0 -1px 0 rgba(0, 0, 0, 0.45);
  --shadow-card: 0 14px 34px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 232, 194, 0.14);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  /* Bundled fonts (css/fonts.css): Atkinson Hyperlegible Next for the interface, Literata for titles & captions. */
  --ui-font: "Atkinson Hyperlegible Next", -apple-system, "Segoe UI", Roboto, sans-serif;
  --cap-font: Literata, Georgia, serif;
  --ts: 1;   /* text size: More → Text size, or the iPhone's own Text Size (js/ui.js applyTextSize) */
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: #100d0b; color: var(--text);
  font: 500 15px/1.45 var(--ui-font);
  -webkit-font-smoothing: antialiased;
  user-select: none; -webkit-user-select: none;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

canvas#view { position: fixed; inset: 0; display: block; touch-action: none; cursor: grab; }
/* Darkened screen edges, drawn once by the browser instead of every frame. */
#vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(circle farthest-corner at 50% 50%, rgba(0,0,0,0) 35%, rgba(0,0,0,.22) 100%); }
canvas#view:active { cursor: grabbing; }

button {
  font: inherit; color: var(--text);
  background: linear-gradient(180deg, rgba(255, 236, 208, 0.10) 0%, rgba(255, 236, 208, 0.04) 100%);
  border: 1px solid rgba(244, 212, 168, 0.20);
  border-radius: 14px; padding: 8px 16px; min-height: 44px; cursor: pointer; font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 238, 210, 0.10), 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: background .15s, border-color .15s, transform .12s, box-shadow .15s;
  touch-action: manipulation;
}
button:hover { background: linear-gradient(180deg, rgba(255, 236, 208, 0.16) 0%, rgba(255, 236, 208, 0.08) 100%); border-color: var(--brass-edge); }
button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button.primary {
  background: linear-gradient(180deg, var(--accent-hi) 0%, var(--accent) 55%, #cb8f40 100%);
  color: #211408; border: 1px solid rgba(255, 236, 196, 0.45); font-weight: 800; letter-spacing: 0.01em;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 245, 224, 0.55), inset 0 -2px 0 rgba(120, 72, 18, 0.42);
}
button:active { transform: translateY(1px) scale(.97); }
button.primary:hover { background: linear-gradient(180deg, #f5c985 0%, #e7b162 60%, #d4994a 100%); }
button.danger { color: #ffb4a0; border-color: rgba(232,120,96,.55); background: linear-gradient(180deg, rgba(160,46,28,.28), rgba(118,30,18,.24)); }
button.danger:hover { background: linear-gradient(180deg, rgba(176,54,34,.38), rgba(132,36,22,.32)); border-color: rgba(232,120,96,.75); }
button.link { background: none; border-color: transparent; box-shadow: none; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 8px 6px; min-width: 44px; }
a.link { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; padding: 6px; }
button.small { padding: 6px 12px; min-height: 44px; font-size: calc(14px * var(--ts)); border-radius: 9px; }
button:disabled { opacity: .45; cursor: default; }
svg { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
/* Painted icons (js/art/icons.js) carry their own colours. */
body svg.art { fill: none; stroke: none; }

#loading {
  position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; justify-items: center; gap: 14px;
  background: #100d0b; color: var(--muted);
  font-family: var(--cap-font); font-size: 19px; font-style: italic;
  transition: opacity .6s;
}
#loading.done { opacity: 0; pointer-events: none; }
/* Studio card: the Arleon Game Studio logo on black for the first moments of loading (js/platform.js).
   The iPhone app shows the same card itself, so the page skips it there. */
#studio { position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; background: #000; transition: opacity .45s; }
#studio img { display: block; width: 223.33px; height: auto; }   /* the logo's own size, same as the app's launch screen */
#studio.done { opacity: 0; pointer-events: none; }
.ios-app #studio { display: none; }
#loading[hidden] { display: none; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255,232,205,.15); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Top strip ---------- */
#strip {
  position: fixed; z-index: 6;
  top: calc(var(--safe-t) + 12px); left: 50%; transform: translateX(-50%);
  width: min(720px, calc(100% - 24px - var(--safe-l) - var(--safe-r)));
  display: flex; align-items: center; gap: 8px;
  padding: 6px; border-radius: 24px;
  background: var(--surface-bar); border: 1px solid var(--brass-edge);
  box-shadow: var(--shadow-bar);
}
.strip-info {
  flex: 1; min-width: 0; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; text-align: left;
  background: none; border-color: transparent; box-shadow: none; padding: 4px 10px; gap: 0;
}
.strip-info .species-name { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--cap-font); }
.species-name { font-weight: 700; font-size: 19px; line-height: 1.15; letter-spacing: -.15px; }
.strip-sub { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; max-width: 100%; overflow: hidden; }
.chip-stat { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; color: var(--text); }
.chip-stat svg { width: 17px; height: 17px; color: var(--accent); }
.chip-stat svg.art { width: 20px; height: 20px; }
#strip, #dock { border-radius: 24px; }
#strip, #dock, #zoomCtl, #banner, #coach, #choice, #todayBar, #bubbles, #followChip, #decorBar { touch-action: manipulation; }
.goal-btn { display: flex; align-items: center; gap: 8px; padding: 4px 14px 4px 5px; min-height: 50px; border-radius: 20px; }
.ring-wrap { position: relative; width: 38px; height: 38px; flex: none; }
.goal-btn .ring { width: 38px; height: 38px; transform: rotate(-90deg); }
.ring-icon { position: absolute; inset: 0; display: grid; place-items: center; color: var(--goal); }
.ring-icon svg { width: 17px; height: 17px; }
.goal-btn.ready .ring-icon { color: #23170c; }
.ring-bg { stroke: rgba(255,232,205,.14); stroke-width: 3.5; }
.ring-fg { stroke: var(--goal); stroke-width: 3.5; stroke-dasharray: 0 100; transition: stroke-dasharray .6s; }
.goal-label { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.goal-label b { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.goal-label span { font-size: 12.5px; color: var(--muted); }
.goal-btn.ready { background: var(--accent); color: #23170c; border-color: transparent; }
.goal-btn.ready .goal-label span { color: #3a2610; font-weight: 500; }
.goal-btn.ready .ring-bg { stroke: rgba(35,23,12,.2); }
.goal-btn.ready .ring-fg { stroke: #23170c; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; min-width: 46px; padding: 0; position: relative; }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn svg.art { width: 28px; height: 28px; }
.icon-btn.round { border-radius: 50%; width: 46px; height: 46px; }
.icon-btn .badge { position: absolute; top: -4px; right: -4px; }
.icon-btn[hidden] { display: none; }
.badge {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 11px; background: #e88e50; color: #220e04; font: 800 12.5px/1 var(--ui-font);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45), 0 0 0 1.5px rgba(24, 18, 13, 0.9);
}
.badge[hidden] { display: none; }

/* ---------- One alert ---------- */
#banner {
  position: fixed; z-index: 7;
  top: calc(var(--safe-t) + 84px); left: 50%; transform: translateX(-50%);
  width: min(560px, calc(100% - 24px));
  display: flex; align-items: center; gap: 8px;
  padding: 8px 8px 8px 12px; border-radius: 20px;
  background: var(--warn-bg); border: 1px solid rgba(228,140,110,.55);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.48);
}
#banner[hidden] { display: none; }
#banner p { margin: 0; flex: 1; min-width: 0; color: #f6ddd0; font-weight: 600; line-height: 1.3; }
.banner-ico { display: grid; place-items: center; color: #f0ab8e; flex: none; margin-right: 2px; }
.banner-ico svg { width: 26px; height: 26px; }
.banner-ico svg.art { width: 32px; height: 32px; }
#banner button { background: #e8946f; color: #2a120a; border-color: transparent; font-weight: 600; white-space: nowrap; flex: none; }
#banner button.banner-show { background: transparent; color: #f6ddd0; border-color: rgba(246,221,208,.45); }
@media (max-width: 420px) {
  #banner { gap: 6px; padding: 8px 8px 8px 10px; }
  #banner p { font-size: calc(13.5px * var(--ts)); }
  #banner button { padding: 8px 11px; font-size: calc(13.5px * var(--ts)); }
}

/* ---------- Caption pill (auto camera or the ant you follow) ---------- */
#followChip {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 6;
  bottom: calc(var(--safe-b) + 110px);
  display: flex; align-items: center; gap: 10px;
  background: rgba(24,19,15,.82); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 6px 5px 16px; font-size: calc(15px * min(var(--ts), 1.15)); max-width: calc(100% - 24px);
}
#followChip.auto { padding: 6px 18px; color: #e2d6c6; background: rgba(24,19,15,.55); font-family: var(--cap-font); font-style: italic; font-size: calc(16px * min(var(--ts), 1.15)); font-weight: 500; }
#followChip[hidden] { display: none; }
/* Small to look at, but the tap area is the full 44 pt (the ::after reaches past the edges). */
.mini-btn { min-height: 34px; min-width: 34px; width: 34px; height: 34px; border-radius: 50%; position: relative; }
.mini-btn::after { content: ""; position: absolute; inset: -5px; }
.mini-btn svg { width: 18px; height: 18px; }
#followTxt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The ant you follow: who she is (job, age) on top, what she's doing below. */
.follow-lines { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
#followSub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: calc(13px * var(--ts)); color: var(--muted); }
#followSub[hidden] { display: none; }

/* ---------- Bottom dock ---------- */
#dock {
  position: fixed; z-index: 6;
  bottom: calc(var(--safe-b) + 12px); left: 50%; transform: translateX(-50%);
  width: min(520px, calc(100% - 24px - var(--safe-l) - var(--safe-r)));
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 5px;
  padding: 6px; border-radius: 24px;
  background: var(--surface-bar); border: 1px solid var(--brass-edge);
  box-shadow: var(--shadow-bar);
}
.dock-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 64px; padding: 6px 4px; border-radius: 18px;
  background: transparent; border-color: transparent; box-shadow: none;
}
.dock-btn:hover { background: rgba(255,232,196,.09); border-color: rgba(244,212,168,.16); }
.dock-ico { width: 40px; height: 32px; border-radius: 12px; display: grid; place-items: center; }
.dock-ico svg { width: 30px; height: 30px; }
.dock-ico svg.art { width: 34px; height: 34px; }
.dock-btn.sugar .dock-ico { color: var(--sugar); }
.dock-btn.protein .dock-ico { color: var(--protein); }
.dock-label { font-size: calc(13px * min(var(--ts), 1.15)); font-weight: 700; line-height: 1; }
.mini { display: block; width: 58%; height: 5px; border-radius: 3px; background: rgba(0,0,0,.42); box-shadow: inset 0 1px 2px rgba(0,0,0,.55), 0 1px 0 rgba(255,232,196,.08); overflow: hidden; margin-top: 2px; }
.mini i { display: block; height: 100%; width: 0; border-radius: inherit; transition: width .4s; }
#sugarLvl { background: var(--sugar); } #protLvl { background: var(--protein); } #moistLvl { background: #6fa8c8; }
.dock-btn.water .dock-ico { color: #8cc3e0; }
.dock-btn[hidden] { display: none; }
.bar.water i { background: #6fa8c8; }
.bar.leaf i { background: #7fae5a; }
#moistRow[hidden] { display: none; }
.mini.low { outline: 1.5px solid rgba(232,148,111,.8); outline-offset: 1px; }
.dot-on, .dot-off { display: block; width: 6px; height: 6px; border-radius: 50%; margin-top: 4px; }
.phone .keeper-card { gap: 10px; }
#camBtn .dot-on { background: rgba(255,232,205,.2); }
#camBtn.on .dot-on { background: var(--goal); }
#camBtn .dock-ico { opacity: .55; filter: saturate(.4); transition: opacity .2s, filter .2s; }
#camBtn.on .dock-ico { opacity: 1; filter: none; }
.dock-btn.bump .dock-ico { animation: bump .35s ease-out; }
.dock-btn.nope .dock-ico { animation: nope .35s ease-out; }
@keyframes bump { 40% { transform: scale(1.22); } }
@keyframes nope { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* ---------- Zoom ---------- */
#zoomCtl {
  position: fixed; z-index: 6; right: calc(var(--safe-r) + 12px); top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 4px; padding: 5px; border-radius: 26px;
  background: var(--surface-bar); border: 1px solid var(--brass-edge); box-shadow: var(--shadow-bar);
}
#zoomCtl .icon-btn { width: 44px; height: 44px; border-radius: 50%; background: none; border-color: transparent; box-shadow: none; }
#zoomCtl .icon-btn:hover { background: rgba(255,232,196,.12); }
body.replaying #zoomCtl, body.ambient #zoomCtl { display: none !important; }

/* ---------- Compact action-first onboarding bar ---------- */
#coach {
  position: fixed; z-index: 9; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--safe-b) + 92px);
  width: min(460px, calc(100% - 24px));
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; border-radius: 18px;
  background: var(--surface-slab); border: 1px solid rgba(232, 186, 116, 0.52);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 232, 194, 0.20);
}
#coach[hidden] { display: none; }
#coach p { margin: 0; flex: 1 1 200px; font-size: calc(14.5px * min(var(--ts), 1.15)); font-weight: 600; line-height: 1.35; color: var(--text); }
.coach-btns { display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin-left: auto; }
#coachSkip { font-size: calc(13px * var(--ts)); color: var(--faint); min-height: 36px; padding: 4px 8px; }
#coachNext, #coachAlt { min-height: 38px; padding: 6px 14px; border-radius: 999px; font-size: calc(14px * var(--ts)); }
#coachNext[hidden] { display: none; }
body:has(#coach:not([hidden])) #followChip, body:has(#coach:not([hidden])) #zoomCtl,
body:has(#choice.show) #followChip, body:has(#choice.show) #zoomCtl { display: none; }
#choice {
  position: fixed; z-index: 9; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--safe-b) + 96px);
  width: min(460px, calc(100% - 24px));
  padding: 14px 16px 12px; border-radius: 20px;
  background: var(--surface-slab); border: 1px solid var(--brass-edge);
  box-shadow: var(--shadow-card);
  opacity: 0; transition: opacity .25s;
}
#choice[hidden] { display: none; }
#choice.show { opacity: 1; }
#choice p { margin: 0 0 8px; font-size: calc(16px * var(--ts)); line-height: 1.5; }
.choice-btns { display: flex; justify-content: flex-end; gap: 8px; }
.choice-line { margin: 8px 0 0 !important; font-size: calc(13px * var(--ts)) !important; color: var(--faint); }
body[data-coach="pupa"] #helpPupa, body[data-coach="larvae"] #feedLarvae, body[data-coach="care"] #feedSugar, body[data-coach="movein"] #goalBtn {
  background: rgba(223, 167, 87, 0.16);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent), 0 0 18px rgba(223, 167, 87, 0.28);
}
.dock-btn.help .dock-ico { color: var(--accent); }
.dock-btn.larvae .dock-ico { color: var(--protein); }

#toast {
  position: fixed; left: 50%; top: calc(var(--safe-t) + 84px); z-index: 26;   /* below overlays; explicit modal confirmations use .over-modal */
  transform: translateX(-50%); opacity: 0; pointer-events: none;
  background: var(--surface-slab); border: 1px solid var(--brass-edge);
  box-shadow: var(--shadow-card);
  border-radius: 999px; padding: 9px 18px; font-size: calc(15px * var(--ts)); font-weight: 600;
  transition: opacity .25s; width: max-content; max-width: calc(100% - 32px); text-align: center;
}
#toast.over-modal { z-index: 42; top: calc(var(--safe-t) + 16px) !important; }
#toast.show { opacity: 1; }
/* A toast with one button (for example "Show fewer"): the button is tappable while it shows. */
#toast.act { display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 18px; text-align: left; }
#toast.act.show { pointer-events: auto; }
#toast button { position: relative; flex: none; min-height: 36px; min-width: 44px; padding: 6px 14px; border-radius: 999px; border: 0;
  background: var(--accent); color: #241808; font: inherit; font-weight: 700; white-space: nowrap; }
#toast button::after { content: ""; position: absolute; inset: -4px 0; }
#banner:not([hidden]) ~ #toast:not(.over-modal) { top: calc(var(--safe-t) + 152px); }

/* ---------- Panels (Specimen Cabinet sheets) ---------- */
.overlay { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(7, 5, 3, 0.82); }
.overlay[hidden] { display: none; }
.sheet {
  width: min(420px, calc(100% - 24px)); max-height: calc(100% - 40px); overflow-y: auto;
  background:
    linear-gradient(180deg, #2b2119 30%, rgba(43, 33, 25, 0)) center top / 100% 34px no-repeat local,
    linear-gradient(0deg, #1d1611 30%, rgba(29, 22, 17, 0)) center bottom / 100% 34px no-repeat local,
    radial-gradient(farthest-side at 50% 0, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0)) center top / 100% 14px no-repeat scroll,
    radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, 0.52), rgba(0, 0, 0, 0)) center bottom / 100% 16px no-repeat scroll,
    var(--surface-slab);
  border: 1px solid var(--brass-edge); border-radius: 26px; padding: 22px 22px 20px;
  box-shadow: 0 32px 84px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 232, 194, 0.22);
}
.sheet, #coach, #choice, #recap, #fatal { font-size: calc(15px * var(--ts)); }
.sheet h2 { margin: 0; font-family: var(--cap-font); font-weight: 700; font-size: calc(25px * var(--ts)); line-height: 1.15; letter-spacing: -0.015em; }
.sheet .sub { margin: 4px 0 14px; color: var(--muted); }
.sheet p { color: var(--muted); }
.sheet ul { margin: 0 0 18px; padding: 0; list-style: none; display: grid; gap: 8px; }
.sheet li { padding-left: 16px; position: relative; }
.sheet li::before { content: ""; position: absolute; left: 2px; top: 10px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.sheet > button { width: 100%; padding: 11px; }
.sheet.wide { width: min(600px, calc(100% - 24px)); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.sheet-head > div, .sheet-head h2 { flex: 1; min-width: 0; }
.sheet-head .sub { margin-bottom: 0; }
.sheet h3.section { margin: 20px 0 8px; font-weight: 700; font-size: calc(12.5px * var(--ts)); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.sheet .body { margin: 0 0 8px; }

.pop { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 14px; padding: 10px 6px; border-radius: 16px; background: var(--surface-recess); border: 1px solid var(--line); }
.pop div { display: flex; flex-direction: column; align-items: center; }
.pop b { font-size: calc(20px * var(--ts)); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.pop span { font-size: calc(12px * var(--ts)); color: var(--muted); }
.meter { display: grid; grid-template-columns: minmax(84px, auto) 1fr minmax(52px, auto); align-items: center; gap: 10px; font-size: calc(14px * var(--ts)); color: var(--muted); margin-bottom: 8px; }
.meter span { font-variant-numeric: tabular-nums; text-align: right; }
/* Growth chart in colony details: workers (amber) and brood (blue) over the colony's life. */
.growth { margin-bottom: 4px; }
.growth-key { display: flex; gap: 16px; font-size: calc(13px * var(--ts)); color: var(--muted); margin-bottom: 2px; }
.gk::before { content: ""; display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.gk.workers::before { background: #bf862c; }
.gk.brood::before { background: #5591d6; }
.growth-chart { position: relative; height: 150px; overflow: hidden; touch-action: pan-y; cursor: crosshair; -webkit-user-select: none; user-select: none; }
.growth-chart:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 8px; }
.growth-chart svg { display: block; width: 100%; max-width: 100%; overflow: visible; }
.growth-chart text, .ar-chart text { stroke: none; }
.growth-chart text { fill: var(--muted); font-size: 12px; font-weight: 500; font-family: var(--ui-font); font-variant-numeric: tabular-nums; }
.growth-chart text.gv { fill: var(--text); font-weight: 700; font-size: 12.5px; }
.growth-tip { position: absolute; top: 0; display: flex; flex-direction: column; gap: 2px; pointer-events: none; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 13px; color: var(--text); white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.growth-tip[hidden] { display: none; }
.growth-tip b { font-weight: 700; color: var(--muted); font-size: 12px; }
.growth-tip i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.growth-note { margin: 4px 0 0; font-size: calc(13px * var(--ts)); color: var(--faint); }
/* Farm frame finishes: a little frame (wood around sand) per finish. */
.finish-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.finish { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px; border-radius: 14px; font-size: calc(13px * var(--ts)); color: var(--muted); }
.finish[aria-checked="true"] { border-color: var(--accent); color: var(--text); background: rgba(219,166,92,.12); }
.fin-sw { position: relative; display: grid; place-items: center; width: 46px; height: 32px; border-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.5); }
.fin-sw::after { content: ""; position: absolute; inset: 5px; border-radius: 1px; background: linear-gradient(180deg, #a98a5f, #8a6c45); box-shadow: inset 0 0 0 1px rgba(0,0,0,.45); }
.fin-sw svg { position: relative; z-index: 1; width: 16px; height: 16px; fill: none; stroke: #f6e7cf; stroke-width: 2; filter: drop-shadow(0 1px 1px rgba(0,0,0,.6)); }
.finish.locked .fin-sw::after { background: linear-gradient(180deg, rgba(169,138,95,.55), rgba(138,108,69,.55)); }
.finish-note { margin: 6px 0 0; font-size: calc(13px * var(--ts)); color: var(--faint); }
.kp-finishes { display: flex; gap: 8px; margin-top: 8px; }
.bar { height: 8px; border-radius: 4px; background: rgba(255,232,205,.1); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: inherit; transition: width .4s; }
.bar.space i { background: var(--space); } .bar.sugar i { background: var(--sugar); } .bar.protein i { background: var(--protein); }
.hint { font-size: calc(14px * var(--ts)); margin: 4px 0 0; color: #e4c89e !important; }
.hint:empty { display: none; }
#btnConnect, #btnLarge { width: 100%; margin-top: 8px; padding: 11px; }
#btnConnect[hidden], #btnLarge[hidden] { display: none; }

.log-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.sheet .log-list li { padding: 6px 0; display: grid; grid-template-columns: auto 1fr; gap: 12px; color: var(--muted); font-size: calc(14px * var(--ts)); border-bottom: 1px solid var(--line); }
.sheet .log-list li::before { display: none; }
.log-list time { color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.log-list li.milestone span { color: #ecd0a0; }
.log-list li.warn span { color: #f0ab8e; }

.menu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 9px; }
.menu-grid.goto { margin-top: 9px; }
.menu-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 14px 8px; min-height: 88px; min-width: 0; max-width: 100%; border-radius: 18px;
  background: linear-gradient(180deg, rgba(50, 38, 28, 0.72) 0%, rgba(28, 21, 16, 0.85) 100%);
  border: 1px solid rgba(244, 212, 168, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 232, 194, 0.12), 0 4px 12px rgba(0, 0, 0, 0.28);
}
.menu-item svg { width: 30px; height: 30px; color: var(--accent); }
.menu-item svg.art { width: 38px; height: 38px; }
.menu-item b { font-size: calc(14.5px * var(--ts)); font-weight: 700; }
.menu-item.small { min-height: 60px; flex-direction: row; gap: 8px; padding: 10px; }
.menu-item.small svg { width: 22px; height: 22px; color: var(--muted); }
.menu-item[hidden] { display: none; }
.seg { display: inline-flex; padding: 3px; border-radius: 14px; background: var(--surface-recess); border: 1px solid rgba(244, 212, 168, 0.16); box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.45); }
.seg button { border: 0; background: none; box-shadow: none; min-height: 44px; padding: 6px 13px; border-radius: 11px; color: #e2d5c4; }
.seg button[aria-checked="true"], .seg button[aria-selected="true"] {
  background: linear-gradient(180deg, var(--accent-hi) 0%, var(--accent) 100%);
  color: #211408; font-weight: 800;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 245, 224, 0.55);
}
.set-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 10px 0; }
.set-row + .set-row { border-top: 1px solid var(--line); }
.set-row[hidden] { display: none; }
.set-row b { font-size: calc(15px * var(--ts)); }
.set-row p { margin: 2px 0 0; font-size: calc(14px * var(--ts)); }
.set-row button.on { border-color: rgba(169,192,112,.6); color: #d6e6ac; }

.colony-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.colony-list li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,240,220,.03); }
.colony-list li.current { border-color: rgba(219,166,92,.5); }
.colony-acts { display: flex; align-items: center; gap: 2px; }
.homes-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.homes-list li { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: calc(13px * var(--ts)); }
.homes-list li::before { display: none; }
.home-ico svg { width: 18px; height: 18px; display: block; }
.homes-add { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 6px; color: var(--muted); font-size: calc(13px * var(--ts)); }
.colony-acts .retire { font-size: calc(13px * var(--ts)); }
.ar-stats { grid-template-columns: repeat(4, 1fr); }
.ar-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.ar-chart text { fill: var(--faint); font-size: 10px; font-family: var(--ui-font); font-variant-numeric: tabular-nums; }
.colony-list li::before { display: none; }
.colony-list b { display: block; font-size: calc(15px * var(--ts)); }
.colony-list em { font-style: normal; font-weight: 600; color: #e8cfa6; margin-right: 6px; }
.colony-list span { color: var(--muted); font-size: calc(14px * var(--ts)); }
/* Specimen Cabinet Species Cards (Queen Picker + Colonies) */
.species-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 12px; }
.species {
  position: relative; padding: 0; overflow: hidden;
  border: 1px solid var(--brass-edge); border-radius: 20px;
  background: linear-gradient(180deg, #271e17 0%, #19130e 100%);
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column;
}
.sp-stage {
  position: relative; height: 104px; display: grid; place-items: center;
  background: radial-gradient(ellipse 70% 80% at 50% 56%, rgba(223, 167, 87, 0.18) 0%, rgba(18, 13, 10, 0.92) 78%);
  border-bottom: 1px solid rgba(244, 212, 168, 0.14);
}
.sp-stage i { position: static !important; width: 144px; height: 78px; background-size: contain; background-repeat: no-repeat; background-position: center; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.65)); }
.sp-hab {
  position: absolute; top: 10px; right: 10px;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(14, 10, 8, 0.88); border: 1px solid rgba(232, 186, 116, 0.42);
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-hi);
}
.sp-body { padding: 14px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.sp-head { display: flex; flex-direction: column; gap: 1px; }
.species b { font-family: var(--cap-font); font-size: calc(19px * var(--ts)); font-weight: 700; line-height: 1.15; color: var(--text); }
.species em { font-family: var(--cap-font); font-style: italic; font-size: calc(13.5px * var(--ts)); color: var(--accent); }
.sp-traits { display: flex; flex-wrap: wrap; gap: 5px; }
.sp-trait {
  padding: 3px 8px; border-radius: 999px;
  background: rgba(223, 167, 87, 0.11); border: 1px solid rgba(223, 167, 87, 0.26);
  color: #ebd5b4; font-size: 11.5px; font-weight: 700; line-height: 1.25;
}
.species p { margin: 0 0 4px; font-size: calc(13.5px * var(--ts)); line-height: 1.42; color: var(--muted); flex: 1; }
.species button { width: 100%; border-radius: 14px; }
.species.locked { border-style: dashed; border-color: var(--line); background: rgba(255,240,220,.02); }
.species.locked b, .species.locked em { color: var(--muted); }
.species.locked p { color: #a89a8b; }
.species.locked button:disabled { opacity: .68; }
.species.locked .swatch, .species.locked .portrait { filter: grayscale(1) brightness(.6); opacity: .7; }
.species .swatch { width: 52px; height: 26px; border-radius: 12px; }
.species-dots { display: none; justify-content: center; gap: 7px; margin: 10px 0 4px; }
.species-dots[hidden] { display: none !important; }
.sp-dot { width: 7px; height: 7px; border-radius: 999px; background: rgba(244, 212, 168, 0.24); transition: width .2s, background .2s; }
.sp-dot.active { width: 20px; background: var(--accent); }
/* Portrait phone Queen Picker: horizontal snap-scroll Specimen Deck so every card feels like a tactile collectible slide */
.phone:not(.landscape) #coloniesModal.picker-mode .species-list {
  display: flex; flex-direction: row; gap: 12px;
  overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  padding: 2px 2px 6px; scrollbar-width: none;
}
.phone:not(.landscape) #coloniesModal.picker-mode .species-list::-webkit-scrollbar { display: none; }
.phone:not(.landscape) #coloniesModal.picker-mode .species { flex: 0 0 85%; scroll-snap-align: center; }
.phone:not(.landscape) #coloniesModal.picker-mode .species-dots { display: flex; }
#coloniesModal.picker-mode .care-row { padding: 8px 12px; margin-bottom: 4px; border-radius: 16px; background: var(--surface-recess); border: 1px solid var(--line); }
#coloniesModal.picker-mode .sheet-head { border-bottom: 0; padding-bottom: 4px; margin-bottom: 4px; }
/* Compact portrait phones (e.g. iPhone SE 375x667): fit full Specimen Card + Select queen CTA + pager dots cleanly above the fold */
@media (max-height: 700px) {
  .phone:not(.landscape) #coloniesModal.picker-mode .sheet {
    max-height: 94%; padding: 12px 14px calc(var(--safe-b) + 10px);
  }
  .phone:not(.landscape) #coloniesModal.picker-mode .sheet-head { margin-bottom: 2px; padding-bottom: 2px; }
  .phone:not(.landscape) #coloniesModal.picker-mode .sheet h2 { font-size: calc(22px * var(--ts)); }
  .phone:not(.landscape) #coloniesModal.picker-mode .sheet .sub { margin: 2px 0 6px; font-size: calc(13.5px * var(--ts)); line-height: 1.3; }
  .phone:not(.landscape) #coloniesModal.picker-mode .care-row { padding: 6px 10px; margin-bottom: 6px; gap: 8px; }
  .phone:not(.landscape) #coloniesModal.picker-mode .care-row p { font-size: calc(12.5px * var(--ts)); line-height: 1.25; }
  .phone:not(.landscape) #coloniesModal.picker-mode .sp-stage { height: 74px; }
  .phone:not(.landscape) #coloniesModal.picker-mode .sp-stage i { width: 114px; height: 58px; }
  .phone:not(.landscape) #coloniesModal.picker-mode .sp-body { padding: 10px 12px 12px; gap: 5px; }
  .phone:not(.landscape) #coloniesModal.picker-mode .species b { font-size: calc(17.5px * var(--ts)); }
  .phone:not(.landscape) #coloniesModal.picker-mode .species p { font-size: calc(13px * var(--ts)); line-height: 1.32; margin-bottom: 2px; }
  .phone:not(.landscape) #coloniesModal.picker-mode .species-dots { margin: 6px 0 2px; }
  .phone:not(.landscape) #coloniesModal.picker-mode .join-row { margin-top: 4px; }
}
/* Young queen cards keep clean layout inside the new card frame */
.species.young { padding: 14px; gap: 6px; }
.species.young .portrait { position: absolute; right: 12px; top: 12px; width: 64px; height: 38px; }
.swatch.lasius { background: linear-gradient(90deg, #1a1310 45%, #3a2a20 46%, #2a1d16); }
.swatch.messor { background: linear-gradient(90deg, #0e0b0a 40%, #7a2a18 41%, #5a1c10); }
.swatch.fireant { background: linear-gradient(90deg, #2a140d 42%, #8a3a18 43%, #b0582c); }
.swatch.weaver { background: linear-gradient(90deg, #a8521c 45%, #e08a44 46%, #4e7a32); }
.swatch.trapjaw { background: linear-gradient(90deg, #3a1c10 45%, #9c5630 46%, #b06a3a); }
.swatch.crazy { background: linear-gradient(90deg, #1a1716 45%, #4a4442 46%, #2a2624); }
#colonyList[hidden], #coloniesModal h3.section[hidden], #coloniesClose[hidden] { display: none; }

#dev {
  position: fixed; left: 50%; top: calc(var(--safe-t) + 92px); transform: translateX(-50%); z-index: 25;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; align-items: center; max-width: calc(100% - 20px);
  background: rgba(60,20,20,.9); border: 1px solid rgba(255,150,150,.3); border-radius: 10px; padding: 6px 10px; font-size: 13px;
}
#dev[hidden] { display: none; }
#dev select { font: inherit; background: #2a1a1a; color: var(--text); border: 1px solid rgba(255,255,255,.2); border-radius: 6px; }
#dev button { padding: 3px 8px; min-height: 0; font-size: 13px; }

/* ---------- Morning recap ---------- */
#recap {
  position: fixed; inset: 0; z-index: 32;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: calc(var(--safe-t) + 16px) 16px calc(var(--safe-b) + 20px);
  background: radial-gradient(ellipse at center, rgba(16,12,9,.55), rgba(10,8,6,.88));
}
#recap[hidden] { display: none; }
body.recapping #strip, body.recapping #dock, body.recapping #zoomCtl, body.recapping #followChip, body.recapping #banner, body.recapping #coach, body.recapping #choice, body.recapping #todayBar, body.recapping #bubbles, body.recapping #fastBtn, body.recapping #toast, body.recapping #badgeToast { visibility: hidden; }
.recap-card:has(#recapShot:not([hidden])) #recapIco { display: none; }
body.bubble-guide #coach { display: none; }
.recap-top { position: absolute; top: calc(var(--safe-t) + 14px); left: 16px; right: 16px; display: flex; align-items: center; gap: 12px; }
.recap-dots { flex: 1; display: flex; gap: 5px; }
.recap-dots i { flex: 1; height: 4px; border-radius: 2px; background: rgba(255,232,205,.18); transition: background .3s; }
.recap-dots i.on { background: var(--accent); }
.recap-card {
  width: min(380px, 100%); min-height: 300px; padding: 30px 24px 24px; border-radius: 30px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px;
  background: var(--panel-solid); border: 1px solid rgba(255,232,205,.14); box-shadow: 0 30px 80px rgba(0,0,0,.55);
  cursor: pointer;
}
.recap-card.confirm { cursor: default; }
.recap-card.in { animation: cardIn .35s ease-out; }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.recap-ico { width: 84px; height: 84px; border-radius: 26px; display: grid; place-items: center; background: rgba(219,166,92,.14); color: var(--accent); margin-bottom: 6px; }
.recap-ico:has(svg.art) { background: none; }
.recap-ico svg.art { width: 76px; height: 76px; }
.recap-ico svg { width: 46px; height: 46px; stroke-width: 1.6; }
.recap-card.good .recap-ico { background: rgba(169,192,112,.16); color: #c6dc8e; }
.recap-card.warn .recap-ico { background: rgba(232,148,111,.16); color: #f0ab8e; }
.recap-card.soft .recap-ico { background: rgba(196,182,166,.12); color: var(--muted); }
.recap-big { font-size: calc(46px * var(--ts)); font-weight: 700; line-height: 1.05; letter-spacing: -.5px; }
.recap-big[hidden] { display: none; }
.recap-card.story .recap-big { font-size: calc(24px * var(--ts)); letter-spacing: 0; line-height: 1.2; }
.recap-text { margin: 0; color: var(--muted); font-size: calc(17px * var(--ts)); line-height: 1.45; max-width: 300px; }
.recap-card.story .recap-shot, .recap-shot { width: min(100%, 280px); aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; border: 1px solid rgba(255,232,205,.14); background: #241c16 center/cover no-repeat; display: grid; place-items: center; color: #f3c77a; font-weight: 700; }
.recap-card.story .recap-shot[hidden], .recap-shot[hidden] { display: none; }
.recap-colony { margin: 0; color: var(--muted); font-size: calc(13px * var(--ts)); font-weight: 700; }
.recap-colony[hidden] { display: none; }
.phone.landscape .recap-card { min-height: 0; max-height: calc(100vh - var(--safe-t) - var(--safe-b) - 110px); overflow: auto; padding: 16px 16px 12px; }
.phone.landscape .recap-big { font-size: calc(28px * var(--ts)); }
.phone.landscape .recap-ico { width: 48px; height: 48px; margin-bottom: 0; }
/* A short phone (320 or 430 tall, landscape): the photo sits beside the words so the
   caption and the colony line are on screen, not under the fold or under a toast. */
@media (max-height: 440px) {
  .phone.landscape #recap {
    justify-content: flex-start;
    gap: 8px;
    padding: calc(var(--safe-t) + 44px) 12px calc(var(--safe-b) + 8px);
  }
  .phone.landscape .recap-card {
    min-height: 0;
    max-height: none;
    overflow: visible;
    padding: 8px 12px;
    gap: 4px;
  }
  .phone.landscape .recap-card:has(#recapShot:not([hidden])) {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    grid-template-areas:
      "shot big"
      "shot text"
      "shot colony"
      "shot note"
      "shot btns";
    align-content: center;
    align-items: center;
    text-align: left;
    column-gap: 12px;
    row-gap: 2px;
  }
  .phone.landscape .recap-card:has(#recapShot:not([hidden])) .recap-shot { grid-area: shot; width: 128px; margin: 0; }
  .phone.landscape .recap-card:has(#recapShot:not([hidden])) .recap-big { grid-area: big; font-size: calc(18px * var(--ts)); }
  .phone.landscape .recap-card:has(#recapShot:not([hidden])) .recap-text { grid-area: text; font-size: calc(13px * var(--ts)); line-height: 1.3; max-width: none; }
  .phone.landscape .recap-card:has(#recapShot:not([hidden])) .recap-colony { grid-area: colony; font-size: calc(12px * var(--ts)); }
  .phone.landscape .recap-card:has(#recapShot:not([hidden])) .recap-note { grid-area: note; margin: 2px 0 0; text-align: left; }
  .phone.landscape .recap-card:has(#recapShot:not([hidden])) .recap-btns { grid-area: btns; justify-content: flex-start; margin-top: 4px; }
  .phone.landscape .recap-nav .primary { min-height: 40px; min-width: 96px; }
}
#fastBtn {
  position: relative; flex: none; width: 44px; height: 44px; min-width: 44px; min-height: 44px; border-radius: 22px;
  font-weight: 800; font-size: 13px; padding: 0; color: var(--text);
}
@media (max-width: 360px) {
  #fastBtn { width: 36px; min-width: 36px; }
  #fastBtn::after { content: ""; position: absolute; inset: -1px -5px; }
}
.phone.landscape #fastBtn { width: 36px; min-width: 36px; }
.phone.landscape #fastBtn::after { content: ""; position: absolute; inset: -1px -5px; }
#fastBtn.on { background: var(--accent); color: #23170c; border-color: transparent; }
#todayBar {
  position: fixed; z-index: 5;
  top: calc(var(--safe-t) + 78px); left: 50%; transform: translateX(-50%);
  width: min(720px, calc(100% - 24px - var(--safe-l) - var(--safe-r)));
  display: flex; gap: 6px; pointer-events: none;
}
#todayBar[hidden] { display: none; }
.today-item {
  flex: 1 1 0; min-width: 0; padding: 6px 10px; border-radius: 999px;
  background: rgba(24,19,15,.84); border: 1px solid var(--line); color: var(--text);
  font-size: calc(12.5px * min(var(--ts), 1.15)); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
button.today-item {
  min-height: 32px; line-height: 1.35; text-align: left; position: relative; overflow: visible; pointer-events: auto;
}
button.today-item::after { content: ""; position: absolute; inset: -7px 0; }
button.today-item:hover { background: rgba(40,32,25,.92); border-color: rgba(255,232,205,.28); }
.today-txt { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-item.done { color: var(--muted); }
.today-item.guide { color: var(--accent); }
.today-item.paused { flex: none; }
#bubbles {
  position: fixed; z-index: 6;
  left: calc(var(--safe-l) + 12px); top: calc(var(--safe-t) + 118px);
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  max-width: min(260px, 68vw); pointer-events: auto;
}
@media (min-width: 768px) {
  #bubbles:not(.tube-anchor) { left: max(calc(var(--safe-l) + 12px), calc(50% - 360px)); }
}
#bubbles.tube-anchor {
  left: var(--tube-x, 50%); top: var(--tube-y, 44%);
  transform: translateX(-50%); align-items: center;
  max-width: min(280px, calc(100vw - 32px));
}
#bubbles.tube-anchor .bubble {
  position: relative; text-align: center;
  background: var(--surface-slab); border: 1px solid var(--brass-edge);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 232, 194, 0.22);
}
#bubbles.tube-anchor .bubble::after {
  content: ""; position: absolute; left: 50%; bottom: -6px; width: 10px; height: 10px;
  transform: translateX(-50%) rotate(45deg);
  background: #1d1611; border-right: 1px solid var(--brass-edge); border-bottom: 1px solid var(--brass-edge);
}
.bubble {
  display: inline-flex; align-items: center; min-height: 44px; min-width: 44px;
  max-width: 100%; padding: 8px 16px; border-radius: 22px; text-align: left;
  background: var(--surface-bar); border: 1px solid var(--brass-edge); color: var(--text);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.42), inset 0 1px 0 var(--brass-hi);
  font-size: calc(14px * min(var(--ts), 1.15)); font-weight: 700; line-height: 1.22;
  white-space: normal; overflow-wrap: break-word;
}
.bubble.urgent { border-color: var(--accent-hi); color: var(--accent-hi); box-shadow: 0 6px 20px rgba(223, 167, 87, 0.22), inset 0 1px 0 rgba(255, 236, 200, 0.28); }
.phone #todayBar { top: calc(var(--safe-t) + 92px); width: calc(100% - 16px - var(--safe-l) - var(--safe-r)); }
.phone #bubbles { top: calc(var(--safe-t) + 132px); }
.phone.landscape #todayBar {
  left: calc(var(--safe-l) + 8px); transform: none;
  width: min(520px, calc(56% - var(--safe-l) - 12px));
  top: calc(var(--safe-t) + 84px);
}
.phone.landscape #bubbles { top: calc(var(--safe-t) + 122px); max-width: min(220px, 40vw); }
body.ambient #todayBar, body.ambient #bubbles, body.replaying #todayBar, body.replaying #bubbles,
body:has(#banner:not([hidden])) #todayBar, body:has(#lapseChip:not([hidden])) #todayBar, body:has(#factCard:not([hidden])) #todayBar { display: none; }
body:has(#banner:not([hidden])) #bubbles { top: calc(var(--safe-t) + 148px); }
body.phone:not(.landscape):has(#banner:not([hidden])) #bubbles { top: calc(var(--safe-t) + 158px); }
body.phone.landscape:has(#banner:not([hidden])) #bubbles { top: calc(var(--safe-t) + 84px); }
body:has(#factCard:not([hidden])) #bubbles { top: calc(var(--safe-t) + 166px); }
.recap-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.recap-btns:empty { display: none; }
.recap-btns button { min-width: 120px; }
.recap-nav { display: flex; align-items: center; gap: 12px; width: min(380px, 100%); justify-content: space-between; }
.recap-nav .primary { min-width: 140px; min-height: 50px; font-size: calc(16px * var(--ts)); border-radius: 25px; }
.recap-nav .icon-btn { background: rgba(255,240,220,.08); }

/* ---------- Names ---------- */
.name-row { display: flex; gap: 8px; margin: 6px 0 16px; }
#nameInput {
  flex: 1; min-width: 0; font: 700 20px var(--ui-font); color: var(--text);
  background: rgba(255,240,220,.06); border: 1px solid rgba(255,232,205,.2); border-radius: 16px; padding: 10px 14px;
  user-select: text; -webkit-user-select: text;
}
#nameInput:focus { outline: 2px solid var(--focus); outline-offset: 1px; }
.name-btns { display: flex; gap: 8px; }
.name-btns button { flex: 1; }
#followName.named { color: var(--accent); }
.named-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.sheet .named-list li { padding: 6px 6px 6px 10px; display: flex; flex-wrap: wrap; align-items: center; column-gap: 10px; row-gap: 6px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,240,220,.03); }
.sheet .named-list li::before { display: none; }
.named-ico { color: var(--accent); display: grid; place-items: center; }
.named-ico svg { width: 22px; height: 22px; }
.named-list b { font-size: calc(16px * var(--ts)); }
.named-what { flex: 1 1 80px; min-width: 0; color: var(--muted); font-size: calc(13.5px * var(--ts)); }
.named-acts { display: flex; gap: 6px; flex-shrink: 0; margin-left: auto; }
.ant-acts { margin: 8px 0 0; }
.ant-acts button { width: 100%; }
.proj-list { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 6px; }
.sheet .proj-list li { padding: 8px 10px; display: grid; grid-template-columns: 22px 1fr; column-gap: 10px; row-gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,240,220,.03); }
.sheet .proj-list li::before { display: none; }
.pj-ico { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; }
.proj-list li.done .pj-ico { border-color: transparent; color: var(--accent); }
.pj-ico svg { width: 24px; height: 24px; }
.pj-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.proj-list b { font-size: calc(15px * var(--ts)); }
.pj-text { color: var(--muted); font-size: calc(13px * var(--ts)); line-height: 1.35; }
.proj-list li.done b { color: var(--muted); }
.pj-bar { grid-column: 2; height: 6px; border-radius: 3px; background: rgba(255,232,205,.1); overflow: hidden; }
.pj-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .4s; }
.coach-right { display: flex; gap: 8px; }
#coachAlt[hidden] { display: none; }

/* ---------- Keeper and shop ---------- */
.keeper-card {
  display: flex; align-items: center; gap: 14px; padding: 14px; margin-bottom: 12px; border-radius: 20px;
  background: linear-gradient(135deg, rgba(223, 167, 87, 0.16) 0%, rgba(36, 26, 18, 0.92) 72%);
  border: 1px solid var(--brass-edge); box-shadow: var(--shadow-card);
}
.kc-badge { position: relative; width: 52px; height: 52px; flex: none; color: var(--accent); display: grid; place-items: center; }
.kc-badge svg { position: absolute; inset: 0; width: 52px; height: 52px; fill: rgba(219,166,92,.18); stroke-width: 1.4; }
.kc-badge b { position: relative; font-size: 17px; font-weight: 700; color: var(--text); margin-top: 3px; }
.kc-badge:has(svg.art) b { color: #3a2410; margin-top: 9px; }
.kc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.kc-main > b { font-size: calc(16px * var(--ts)); font-weight: 700; }
.bar.xp i { background: linear-gradient(90deg, #c99245, #f0c77c); }
.kc-sub { font-size: calc(13.5px * var(--ts)); color: var(--muted); }
.hd { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: #f0c77c; font-variant-numeric: tabular-nums; }
.hd.big { font-size: 18px; padding: 6px 12px; border-radius: 14px; background: rgba(219,166,92,.12); }
.hd-dot { display: inline-block; width: 10px; height: 12px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: radial-gradient(circle at 35% 35%, #ffe2a0, #d99a3c 70%); vertical-align: -1px; }
.kc-shop { position: relative; }
.new-dot { position: absolute; top: -3px; right: -3px; width: 11px; height: 11px; border-radius: 50%; background: #e0834a; border: 2px solid var(--panel-solid); }
.new-dot[hidden] { display: none; }
#moreDot.new { background: #e0834a; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.shop-item {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
  padding: 16px 12px 12px; border-radius: 20px;
  border: 1px solid rgba(244, 212, 168, 0.18);
  background: linear-gradient(180deg, rgba(44, 34, 25, 0.72) 0%, rgba(24, 18, 13, 0.9) 100%);
  box-shadow: var(--shadow-card);
}
.si-ico { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; background: rgba(219,166,92,.13); color: var(--accent); margin-bottom: 4px; }
.si-ico svg { width: 34px; height: 34px; }
.si-ico:has(svg.art) { background: rgba(255,240,220,.05); }
.si-ico svg.art { width: 48px; height: 48px; }
.shop-item b { font-size: calc(15.5px * var(--ts)); font-weight: 700; }
.si-text { font-size: calc(13.5px * var(--ts)); color: var(--text); }
.si-tip { flex: 1; margin: 2px 0 8px; font-size: calc(12.5px * var(--ts)); line-height: 1.4; color: var(--faint) !important; font-style: italic; }
.shop-item button { width: 100%; }
.shop-item button .hd-dot { margin: 0 3px 0 6px; }
.shop-item.locked { border-style: dashed; background: rgba(255,240,220,.015); }
.shop-item.locked b, .shop-item.locked .si-text { color: var(--muted); }
.shop-item.locked .si-tip { color: #a89a8b !important; }
.shop-item.locked button:disabled { opacity: .68; }
.shop-item.locked .si-ico { filter: grayscale(1); opacity: .55; }
.shop-item.owned { border-color: rgba(169,192,112,.35); }
.shop-item button.toggle.on { background: rgba(169,192,112,.2); border-color: rgba(169,192,112,.5); color: #dbe9b4; }
#xpPop {
  position: fixed; z-index: 8; left: 50%; top: calc(var(--safe-t) + 78px); transform: translate(-50%, 6px);
  padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; color: #2a1a08;
  background: linear-gradient(90deg, #e9b866, #f6d48f); opacity: 0; pointer-events: none;
  transition: opacity .3s, transform .3s;
}
#xpPop.show { opacity: 1; transform: translate(-50%, 0); }
#banner:not([hidden]) ~ #xpPop { top: calc(var(--safe-t) + 168px); }
body:has(#banner:not([hidden])):has(#bubbles:not(.tube-anchor):not(:empty)) #xpPop { top: calc(var(--safe-t) + 216px); }
body.recapping #xpPop, body.ambient #xpPop, body.replaying #xpPop { display: none; }
#redBtn.on { color: #ff8a7a; }
#labelsBtn.on { color: var(--accent); }
#codeInput {
  width: 100%; margin: 4px 0 16px; resize: none; font: 500 13px/1.4 ui-monospace, Menlo, monospace; color: var(--text);
  background: rgba(255,240,220,.06); border: 1px solid rgba(255,232,205,.2); border-radius: 14px; padding: 10px 12px;
  user-select: text; -webkit-user-select: text; word-break: break-all;
}
#codeInput.big { font: 700 22px/1.3 ui-monospace, Menlo, monospace; letter-spacing: 1.5px; text-align: center; text-transform: uppercase; }
#codeInput:focus { outline: 2px solid var(--focus); outline-offset: 1px; }
#codeCancel[hidden], #cloudRow[hidden], #joinRow[hidden] { display: none; }
/* In the iPhone/iPad/Mac app: no "install" or web wallpaper link. */
body.native-app #installRow, body.native-app .set-row:has(#btnWallLink) { display: none !important; }
#codeModal { z-index: 35; }
.join-row { text-align: center; margin: 14px 0 0; }
.menu-links { margin: 18px 0 0; text-align: center; font-size: calc(14px * var(--ts)); color: var(--faint); }
.menu-links a { color: var(--muted); }
.row-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
#trailBtn.on { color: #23170c; background: var(--accent) !important; }
#trailBtn[hidden] { display: none; }
body.trail-mode canvas#view { cursor: crosshair; }
#dragGhost { position: fixed; z-index: 40; width: 44px; height: 44px; margin: -22px 0 0 -22px; pointer-events: none; color: #e7b49f; filter: drop-shadow(0 4px 8px rgba(0,0,0,.6)); }
#dragGhost[hidden] { display: none; }
#dragGhost svg { width: 44px; height: 44px; }
#dragGhostSugar { position: fixed; z-index: 40; width: 44px; height: 44px; margin: -22px 0 0 -22px; pointer-events: none; filter: drop-shadow(0 4px 8px rgba(0,0,0,.6)); }
#dragGhostSugar[hidden] { display: none; }
#dragGhostSugar svg { width: 44px; height: 44px; }
/* Moving in with reduced motion: a quick fade and a cut instead of the camera glide. */
#fadeCut { position: fixed; inset: 0; z-index: 30; background: #100d0b; opacity: 0; transition: opacity .25s ease; pointer-events: none; }
#fadeCut.on { opacity: 1; }
#fadeCut[hidden] { display: none; }
#redBtn[hidden] { display: none; }

/* ---------- Field Journal ---------- */
.menu-item { position: relative; }
.menu-item .new-dot { top: 8px; right: 8px; }
.fj .sheet-head h2 { text-align: left; }
.fj-tabs { display: flex; width: 100%; margin-bottom: 14px; }
.fj-tabs button { flex: 1; }
.fj-tabs[hidden] { display: none; }
#fjBadgeCount { opacity: .75; font-size: 13px; }
.fj-species { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.fj-sp {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; width: 100%; min-width: 0;
  padding: 12px 14px; border-radius: 18px; text-align: left; min-height: 64px;
  background: linear-gradient(180deg, rgba(44, 34, 25, 0.7) 0%, rgba(26, 20, 15, 0.88) 100%);
  border: 1px solid rgba(244, 212, 168, 0.18);
}
.portrait { display: block; flex: none; width: 58px; height: 32px; background: center / contain no-repeat; }
.portrait.big { width: 92px; height: 48px; margin-top: 2px; }
.species.young .portrait { position: absolute; right: 10px; top: 10px; }
.sp-stage .portrait { position: static; width: 148px; height: 80px; margin-top: 0; }
.locked .portrait { filter: grayscale(1) brightness(.55); opacity: .7; }
.fj-sp .swatch { position: static; width: 30px; height: 16px; border-radius: 8px; flex: none; }
.fj-sp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fj-sp-main b { font-size: calc(16px * var(--ts)); font-weight: 700; }
.fj-sp-main em { font-style: normal; font-size: calc(13.5px * var(--ts)); color: #e8cfa6; }
.fj-sp-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.fj-chip { font-size: calc(12px * var(--ts)); padding: 2px 9px; border-radius: 999px; background: rgba(255,240,220,.08); color: var(--muted); white-space: nowrap; }
.fj-chip.care { background: rgba(169,192,112,.18); color: #d6e6ac; }
.fj-notes { display: inline-flex; align-items: center; gap: 4px; font-size: calc(12.5px * var(--ts)); color: var(--faint); }
.fj-notes svg { width: 14px; height: 14px; }
.fj-sp.locked { border-style: dashed; background: rgba(255,240,220,.015); }
.fj-sp.locked .fj-sp-main b, .fj-sp.locked .fj-sp-main em { color: var(--muted); }
.fj-sp.locked .fj-notes { color: #a89a8b; }
.fj-sp.locked .swatch { filter: grayscale(1) brightness(.6); opacity: .7; }
.fj-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 6px; }
.swatch.big { position: static; width: 44px; height: 22px; border-radius: 11px; flex: none; margin-top: 4px; }
.fj-head em { font-style: normal; font-weight: 700; color: #e8cfa6; }
.fj-head p { margin: 4px 0 0; font-size: calc(14.5px * var(--ts)); }
.fj-sec { margin-top: 16px; }
.fj-sec h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: calc(15px * var(--ts)); font-weight: 700; color: var(--accent); }
.fj-sec h4 svg { width: 18px; height: 18px; }
.fj-sec p { margin: 0; font-size: calc(15px * var(--ts)); line-height: 1.5; color: var(--text) !important; }
.sheet .fj-list, .sheet .fj-notes-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.sheet .fj-list li { font-size: calc(14.5px * var(--ts)); color: var(--text); }
.sheet .fj-notes-list li { padding: 10px 12px; border-radius: 14px; background: rgba(219,166,92,.08); border: 1px solid rgba(219,166,92,.2); font-size: calc(14.5px * var(--ts)); line-height: 1.45; color: var(--text); }
.sheet .fj-notes-list li::before { display: none; }
.sheet .fj-notes-list li.locked { background: none; border-style: dashed; border-color: var(--line); color: #a89a8b; font-style: italic; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.badge-item { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 14px 8px 12px; border-radius: 18px; border: 1px dashed var(--line); background: rgba(255,240,220,.015); }
.badge-item:not(.got) .bi-ico { opacity: .55; }
.badge-item:not(.got) b { color: var(--muted); }
.badge-item:not(.got) .bi-text { color: #a89a8b; }
.bi-ico { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,240,220,.06); color: var(--faint); }
.bi-ico svg { width: 28px; height: 28px; }
.badge-item b { font-size: calc(14px * var(--ts)); font-weight: 700; line-height: 1.2; }
.bi-text { font-size: calc(12.5px * var(--ts)); color: var(--muted); line-height: 1.3; }
.badge-item.got { border-style: solid; border-color: rgba(219,166,92,.35); background: rgba(219,166,92,.07); }
.badge-item.got .bi-ico { background: radial-gradient(circle at 35% 30%, #f6d48f, #c98a3a); color: #2a1a08; box-shadow: 0 0 0 3px rgba(219,166,92,.25); }
#badgeToast {
  position: fixed; z-index: 21; left: 50%; top: calc(var(--safe-t) + 80px); transform: translate(-50%, -8px);
  display: flex; align-items: center; gap: 12px; padding: 8px 18px 8px 8px; border-radius: 999px;
  background: var(--surface-slab); border: 1px solid var(--brass-edge); box-shadow: var(--shadow-card);
  opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s;
}
#badgeToast.show { opacity: 1; transform: translate(-50%, 0); }
#banner:not([hidden]) ~ #badgeToast { top: calc(var(--safe-t) + 146px); }
.phone #badgeToast { top: calc(var(--safe-t) + 74px); }
.phone #banner:not([hidden]) ~ #badgeToast { top: calc(var(--safe-t) + 136px); }
.bt-ico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #f6d48f, #c98a3a); color: #2a1a08; }
.bt-ico svg { width: 22px; height: 22px; }
#badgeToast small { display: block; font-size: 12.5px; color: var(--accent); font-weight: 700; }
#badgeToast b { font-size: 15px; }
body.ambient #badgeToast, body.replaying #badgeToast { display: none; }

/* ---------- Did you know? (a short fact now and then, below the top strip) ---------- */
#factCard {
  position: fixed; z-index: 20; left: 50%; top: calc(var(--safe-t) + 80px); transform: translate(-50%, -8px);
  width: min(440px, calc(100% - 24px)); display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 6px 12px 10px; border-radius: 16px; cursor: pointer;
  background: var(--panel-solid); border: 1px solid rgba(219,166,92,.5); box-shadow: 0 10px 30px rgba(0,0,0,.45);
  opacity: 0; transition: opacity .35s, transform .35s;
}
#factCard.show { opacity: 1; transform: translate(-50%, 0); }
#factCard[hidden] { display: none; }
#banner:not([hidden]) ~ #factCard { top: calc(var(--safe-t) + 146px); }
.phone #factCard { top: calc(var(--safe-t) + 74px); }
.phone #banner:not([hidden]) ~ #factCard { top: calc(var(--safe-t) + 136px); }
.phone.landscape #factCard, .phone.landscape #banner:not([hidden]) ~ #factCard { top: calc(var(--safe-t) + 72px); }
.fc-ico { flex: none; width: 36px; height: 36px; margin-top: 2px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #f6d48f, #c98a3a); color: #2a1a08; }
.fc-ico svg { width: 20px; height: 20px; }
.fc-body { flex: 1; min-width: 0; }
#factCard small { display: block; margin: 1px 0 2px; font-size: calc(12.5px * var(--ts)); color: var(--accent); font-weight: 700; }
#factText { display: block; font-size: calc(15px * var(--ts)); line-height: 1.45; }
#factClose { flex: none; }
body.ambient #factCard, body.replaying #factCard, body.recapping #factCard { display: none; }
.phone .badge-grid { grid-template-columns: repeat(3, 1fr); }
.phone .bi-ico { width: 46px; height: 46px; }
.phone .badge-item { padding: 12px 4px 10px; }
.phone .menu-item { min-height: 76px; padding: 10px 4px; }
.phone .menu-item svg { width: 26px; height: 26px; }
.phone .menu-item svg.art { width: 34px; height: 34px; }
.menu-item.small svg.art, .phone .menu-item.small svg.art { width: 30px; height: 30px; }
.phone .menu-item b { font-size: calc(13px * var(--ts)); }

/* ---------- Highlights ---------- */
.hl-list .badge { margin-left: 6px; vertical-align: 2px; }
.hl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sheet .hl-list li, .hl-list li { padding: 0; }
.hl-list li::before { display: none !important; }
.hl-list li {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center;
  padding: 8px 9px !important; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,240,220,.03);
}
.hl-list li.new { border-color: rgba(217,119,63,.55); background: rgba(217,119,63,.08); }
.hl-list li.empty { display: block; color: var(--muted); font-size: calc(12.5px * var(--ts)); }
.hl-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(255,240,220,.06); }
.hl-icon:has(svg.art) { background: none; }
.hl-icon svg.art, .rp-icon svg.art { width: 28px; height: 28px; }
.hl-icon svg, .rp-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.hl-icon.spider { color: #e49a7c; } .hl-icon.mold { color: #c9d6a0; } .hl-icon.chamber { color: #d9b07a; }
.hl-icon.queen { color: #e8c48c; } .hl-icon.day { color: #9fc0cf; }
.hl-text { min-width: 0; }
.hl-text b { display: block; font-size: calc(12.5px * var(--ts)); line-height: 1.3; }
.hl-when { display: block; font-size: calc(11px * var(--ts)); color: #a89a8b; }
.hl-text p { margin: 2px 0 0 !important; font-size: calc(11.5px * var(--ts)); line-height: 1.35; }
.hl-list.big .hl-text b { font-size: calc(14px * var(--ts)); }
.hl-list.big .hl-text p { font-size: calc(12.5px * var(--ts)); }
.hl-acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: center; }
.hl-list .watch { background: var(--accent); color: #23170c; border-color: transparent; font-weight: 500; }
@media (max-width: 380px) {
  .hl-list li { grid-template-columns: auto 1fr; }
  .hl-acts { grid-column: 1 / -1; justify-content: flex-end; }
}

/* ---------- Replay player ---------- */
body.replaying #strip, body.replaying #dock, body.replaying #banner, body.replaying #coach, body.replaying #choice,
body.replaying #followChip, body.replaying #dev { display: none !important; }
#replayUi[hidden] { display: none; }
#replayUi { position: fixed; inset: 0; z-index: 12; pointer-events: none; }
#replayUi button { pointer-events: auto; }
#replayTop {
  position: absolute; left: 50%; transform: translateX(-50%);
  top: calc(env(safe-area-inset-top, 0px) + 12px); width: min(640px, calc(100% - 20px));
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px 8px 12px; border-radius: 14px; background: rgba(20,15,12,.82); border: 1px solid var(--line);
  
}
.rp-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rp-title b { display: block; font-family: var(--cap-font); font-size: 16.5px; font-weight: 500; line-height: 1.15; }
.rp-title span#rpWhen { display: block; font-size: 11.5px; color: var(--muted); }
.rp-icon { color: #e8c48c; display: grid; place-items: center; }
#replayCaption {
  position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 96px);
  transform: translate(-50%, 8px); opacity: 0; max-width: min(680px, calc(100% - 28px)); text-align: center;
  font-family: var(--cap-font); font-size: calc(21px * var(--ts)); font-weight: 500; line-height: 1.3;
  color: #f4ead9; text-shadow: 0 2px 10px rgba(0,0,0,.85), 0 0 2px rgba(0,0,0,.9);
  transition: opacity .5s;
}
#replayCaption.show { opacity: 1; transform: translate(-50%, 0); }
#replayBottom {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); width: min(640px, calc(100% - 20px));
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  padding: 8px 12px; border-radius: 14px; background: rgba(20,15,12,.78); border: 1px solid var(--line);
   pointer-events: auto;
}
#replayBottom[hidden] { display: none; }
#rpPause { min-width: 64px; }
.rp-bar { height: 5px; border-radius: 3px; background: rgba(255,232,205,.12); overflow: hidden; }
.rp-bar i { display: block; height: 100%; width: 0; background: var(--accent); }
#rpClock { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 0; white-space: nowrap; }
#replayEnd {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: min(640px, calc(100% - 20px));
}
#replayEnd[hidden] { display: none; }
#replayEnd button { padding: 10px 16px; background: rgba(30,23,17,.9); }
#replayEnd button.primary { background: var(--accent); }
.phone #replayCaption { font-size: calc(20px * var(--ts)); bottom: calc(env(safe-area-inset-bottom, 0px) + 92px); }

/* ---------- Aquarium / wallpaper mode ---------- */
body.ambient #strip, body.ambient #dock, body.ambient #banner, body.ambient #coach, body.ambient #choice,
body.ambient #followChip, body.ambient #dev, body.ambient #toast, body.ambient #replayUi,
body.ambient .overlay { display: none !important; }
body.ambient canvas#view { cursor: none; }
body.ambient.poked canvas#view { cursor: default; }
#ambientUi[hidden] { display: none; }
#ambientUi { position: fixed; inset: 0; z-index: 12; pointer-events: none; }
#ambInfo, #ambCaption {
  position: absolute; left: calc(env(safe-area-inset-left, 0px) + 28px);
  color: rgba(244,234,217,.62); text-shadow: 0 1px 6px rgba(0,0,0,.8);
  max-width: min(560px, calc(100% - 56px));
}
#ambInfo { bottom: calc(env(safe-area-inset-bottom, 0px) + 22px); font-size: 12px; letter-spacing: .3px; }
#ambCaption {
  bottom: calc(env(safe-area-inset-bottom, 0px) + 44px);
  font-family: var(--cap-font); font-size: 19px; font-weight: 500; color: rgba(244,234,217,.85);
  opacity: 0; transform: translateY(6px); transition: opacity 1.2s, transform 1.2s;
}
#ambCaption.show { opacity: 1; transform: none; }
#ambExit {
  position: absolute; right: calc(env(safe-area-inset-right, 0px) + 16px); top: calc(env(safe-area-inset-top, 0px) + 16px);
  background: rgba(20,15,12,.8); pointer-events: auto; opacity: 0; transition: opacity .4s; visibility: hidden;
}
body.poked #ambExit { opacity: 1; visibility: visible; }


/* ---------- Small screens ---------- */
.phone #strip { top: calc(var(--safe-t) + 8px); width: calc(100% - 16px - var(--safe-l) - var(--safe-r)); padding: 4px; gap: 4px; }
.phone .species-name { font-size: 17px; }
.phone #zoomCtl { right: calc(var(--safe-r) + 8px); top: auto; bottom: calc(var(--safe-b) + 150px); transform: none; }
.phone #zoomCtl .icon-btn { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
.phone .strip-sub { font-size: 13px; }
.phone .goal-btn { padding: 4px 10px 4px 4px; }
.phone .goal-label span { font-size: 12px; }
.phone #dock { bottom: calc(var(--safe-b) + 8px); width: calc(100% - 16px - var(--safe-l) - var(--safe-r)); }
.phone #banner, .phone #toast:not(.over-modal) { top: calc(var(--safe-t) + 74px); }
.phone #banner:not([hidden]) ~ #toast:not(.over-modal) { top: calc(var(--safe-t) + 148px); }
.phone #followChip, .phone #coach, .phone #choice { bottom: calc(var(--safe-b) + 106px); }
.phone .sheet { padding: 18px 16px 16px; }
.phone #dev { top: auto; bottom: calc(var(--safe-b) + 150px); }
.phone .overlay { place-items: end center; }
.phone .overlay .sheet { width: 100%; max-height: 86%; border-radius: 20px 20px 0 0; padding-bottom: calc(var(--safe-b) + 16px); }
.phone.landscape .overlay .sheet { padding-left: calc(16px + var(--safe-l)); padding-right: calc(16px + var(--safe-r)); }
@media (max-width: 480px) {
  .sub-colony { display: none; }
}
@media (max-width: 390px) {
  #strip .demo-chip { display: none; }
  .phone .strip-info { padding: 4px 6px; }
  .strip-sub, .phone .strip-sub { gap: 6px; font-size: 12.5px; }
  .chip-stat svg, .chip-stat svg.art { width: 16px; height: 16px; }
}
@media (max-width: 380px) {
  .strip-sub, .phone .strip-sub { font-size: 12px; }
  .goal-label b { font-size: 14px; }
  .goal-label span { font-size: 11px; line-height: 1.1; white-space: normal; }
}
@media (max-width: 340px) {
  .phone .strip-info { padding: 4px; }
  .strip-sub, .phone .strip-sub { gap: 5px; font-size: 11.5px; }
  .chip-stat svg, .chip-stat svg.art { width: 15px; height: 15px; }
  .goal-btn, .phone .goal-btn { padding: 2px 6px 2px 2px; gap: 4px; flex: 0 1 auto; min-width: 0; }
  .goal-label { display: flex; min-width: 0; }
  .goal-label b { font-size: 13px; }
  .goal-label span { display: block; font-size: 10.5px; line-height: 1.15; white-space: normal; overflow-wrap: anywhere; }
}
@media (max-height: 700px) {
  .phone:not(.landscape) #zoomCtl:has(> button:not([hidden]) ~ button:not([hidden]) ~ button:not([hidden]) ~ button:not([hidden]) ~ button:not([hidden])) {
    display: grid; grid-template-columns: repeat(2, 44px); border-radius: 24px;
  }
}
/* Short landscape phones: the strip and the alert share the top row.
   The dock keeps its words (Sugar, Flies, Water) fully on screen. */
.phone.landscape #strip { left: calc(var(--safe-l) + 8px); transform: none; width: min(520px, calc(56% - var(--safe-l) - 12px)); }
.phone.landscape #banner { top: calc(var(--safe-t) + 8px); left: auto; right: calc(var(--safe-r) + 8px); transform: none; width: calc(44% - var(--safe-r) - 12px); padding: 5px 6px 5px 10px; gap: 8px; }
.phone.landscape #banner p { font-size: calc(14px * var(--ts)); line-height: 1.25; }
.phone.landscape #banner .banner-ico svg.art { width: 26px; height: 26px; }
.phone.landscape #toast, .phone.landscape #badgeToast,
.phone.landscape #banner:not([hidden]) ~ #toast, .phone.landscape #banner:not([hidden]) ~ #badgeToast { top: calc(var(--safe-t) + 72px); }
.phone.landscape #dock { width: min(720px, calc(100% - 16px)); padding: 4px 6px; gap: 4px; }
.phone.landscape .dock-btn { min-height: 52px; gap: 1px; padding: 3px 2px; }
.phone.landscape .dock-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; font-size: 12px; line-height: 1.05; white-space: nowrap; text-align: center; }
.phone.landscape #followChip, .phone.landscape #coach, .phone.landscape #choice { bottom: calc(var(--safe-b) + 84px); }
.phone.landscape #zoomCtl { bottom: calc(var(--safe-b) + 84px); }
.phone.landscape #zoomCtl:has(> button:not([hidden]) ~ button:not([hidden]) ~ button:not([hidden]) ~ button:not([hidden]) ~ button:not([hidden])) {
  bottom: calc(var(--safe-b) + 74px); display: grid; grid-template-columns: repeat(3, 44px); border-radius: 24px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Founding time-lapse label and the watch-speed button */
#lapseChip { position: fixed; left: 50%; top: calc(var(--safe-t) + 78px); transform: translateX(-50%); z-index: 6; padding: 5px 14px; border-radius: 999px; background: var(--surface-bar); border: 1px solid var(--brass-edge); box-shadow: 0 6px 16px rgba(0,0,0,.42), inset 0 1px 0 var(--brass-hi); color: var(--accent-hi); font-size: 12.5px; font-weight: 700; letter-spacing: 0.01em; pointer-events: none; white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; }
.phone #lapseChip { top: calc(var(--safe-t) + 76px); }
.phone.landscape #lapseChip { left: calc(var(--safe-l) + 8px); transform: none; top: calc(var(--safe-t) + 76px); }
#watchBtn.on { color: var(--accent); }
#watchBtn .watch-txt { font-size: 13px; font-weight: 800; letter-spacing: -.3px; line-height: 1; }
body.first-pick #strip, body.first-pick #todayBar, body.first-pick #bubbles,
body.first-pick #zoomCtl, body.first-pick #dock, body.first-pick #lapseChip,
body.first-pick #banner, body.first-pick #followChip { visibility: hidden; pointer-events: none; }
body.ambient #lapseChip, body.replaying #lapseChip, body.recapping #lapseChip,
body:has(#banner:not([hidden])) #lapseChip, body:has(#toast.show) #lapseChip, body:has(#badgeToast.show) #lapseChip { display: none; }

/* Keeper's Edition row in More, the purchase sheet, the supporter mark and the web "Demo" label */
.edition-row {
  display: flex; align-items: center; gap: 12px; width: 100%; margin: 10px 0 2px; padding: 12px 14px;
  border-radius: 18px; text-align: left;
  background: linear-gradient(135deg, rgba(223, 167, 87, 0.14) 0%, rgba(32, 24, 17, 0.9) 80%);
  border: 1px solid var(--brass-edge); box-shadow: var(--shadow-card);
}
.er-ico svg { width: 34px; height: 34px; }
.er-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.er-text b { font-weight: 700; }
.er-text span { font-size: calc(13px * var(--ts)); color: var(--muted); }
.er-cta { font-weight: 700; color: var(--accent); }
.keeper-card.supporter .kc-badge::after { content: ""; position: absolute; right: -2px; bottom: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--goal); box-shadow: 0 0 0 2px var(--panel-solid); }
.kp-art { display: grid; place-items: center; margin: 4px 0 8px; }
.kp-art svg { width: 72px; height: 72px; }
.kp-list { margin: 0 0 12px; padding: 0; list-style: none; display: grid; gap: 8px; }
.kp-list li { padding-left: 22px; position: relative; }
.kp-list li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.kp-note { font-size: calc(14px * var(--ts)); color: var(--muted); margin: 0 0 12px; }
.kp-link {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px;
  margin: 0 0 12px; padding: 10px 18px; border-radius: 16px; text-decoration: none;
  background: linear-gradient(180deg, var(--accent-hi) 0%, var(--accent) 55%, #cb8f40 100%);
  color: #211408; border: 1px solid rgba(255, 236, 196, 0.45); font-weight: 800; letter-spacing: 0.01em;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 245, 224, 0.55), inset 0 -2px 0 rgba(120, 72, 18, 0.42);
}
.kp-link[hidden] { display: none; }
/* Species pack sheet */
.pack-row { margin-top: 6px; }
.pk-species { list-style: none; margin: 4px 0 10px; padding: 0; display: grid; gap: 10px; }
.sheet .pk-species li { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; padding-left: 0; }
.sheet .pk-species li::before { display: none; }
.pk-species li i { width: 56px; height: 40px; }
.pk-species b { display: block; font-weight: 700; }
.pk-species em { font-style: normal; font-size: calc(13px * var(--ts)); color: var(--faint); }
.pk-species p { margin: 2px 0 0; font-size: calc(14px * var(--ts)); color: var(--muted); }
.fj-pack-btn { margin-top: 10px; }
.fj-family { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.fj-family li { display: flex; flex-direction: column; gap: 2px; }
.fj-family em { font-style: normal; color: var(--muted); font-size: calc(13px * var(--ts)); }
.fj-family .fj-child { color: var(--faint); font-size: calc(13px * var(--ts)); }
.recap-note { margin: 10px 0 0; font-size: calc(13px * var(--ts)); color: var(--faint); text-align: center; }
.recap-note[hidden] { display: none; }
.pk-slot { margin: 0 0 12px; font-size: calc(14px * var(--ts)); color: var(--muted); }
.kp-founder { display: grid; gap: 6px; margin: 0 0 14px; padding: 12px 14px; border-radius: 16px; background: rgba(219,166,92,.08); border: 1px solid rgba(219,166,92,.28); }
.kp-founder b { font-size: calc(16px * var(--ts)); }
.kp-founder span { font-size: calc(14px * var(--ts)); color: var(--muted); }
.tip-grid { display: grid; gap: 10px; margin: 0 0 12px; }
.tip-grid button { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border-radius: 16px; text-align: left; background: rgba(219,166,92,.08); border: 1px solid rgba(219,166,92,.28); }
.tip-grid button:disabled { opacity: .6; }
.tip-grid button b { font-weight: 600; }
.kp-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: space-between; }
.kp-btns .primary { flex: 1 1 200px; }
.demo-chip { padding: 0 7px; border-radius: 999px; font-size: 11px; font-weight: 800; line-height: 1.5; color: var(--accent); border: 1.5px solid var(--accent); }

/* A young queen from your own colony, at the top of the Colonies screen */
.species.young { border-color: rgba(219,166,92,.5); background: rgba(219,166,92,.07); }

/* Colony photo sheet */
#photoPanel { z-index: 34; }
body:has(#photoPanel:not([hidden])) #recap { visibility: hidden; pointer-events: none; }
.ph-img { display: block; width: 100%; max-height: 58vh; object-fit: contain; border-radius: 6px; margin: 4px 0 10px; box-shadow: 0 10px 30px rgba(0,0,0,.45); -webkit-touch-callout: default; user-select: auto; -webkit-user-select: auto; }

#phSave { color: var(--accent); font-weight: 700; }

/* Volume sliders in More: 44 pt tall to touch, a thin track to look at. */
input.vol { -webkit-appearance: none; appearance: none; width: 150px; height: 44px; margin: 0; background: none; cursor: pointer; touch-action: pan-y; }
input.vol::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) var(--fill, 100%), rgba(255,232,205,.14) var(--fill, 100%)); }
input.vol::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; background: #f0e7da; border: 0; box-shadow: 0 2px 6px rgba(0,0,0,.45); }
input.vol::-moz-range-track { height: 6px; border-radius: 3px; background: rgba(255,232,205,.14); }
input.vol::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--accent); }
input.vol::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: #f0e7da; border: 0; }
input.vol:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
.seg.three button { padding: 6px 10px; }
@media (max-width: 400px) {
  .set-row.stack { grid-template-columns: 1fr; gap: 8px; }
  .set-row.stack .seg { justify-self: start; }
}

/* Something went wrong: shown instead of a dark screen if the game can't start or keeps failing. */
#fatal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; background: #100d0b; }
#fatal[hidden] { display: none; }
.fatal-box { width: min(380px, 100%); text-align: center; }
.fatal-box h2 { margin: 0 0 8px; font-size: calc(22px * var(--ts)); }
.fatal-box p { margin: 0 0 20px; color: var(--muted); line-height: 1.5; }
.fatal-box .row-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* Room view: every colony on a shelf. The wall and shelves use the plaster and wood textures. */
.overlay.room { display: block; overflow-y: auto; padding: calc(16px + var(--safe-t)) calc(16px + var(--safe-r)) calc(16px + var(--safe-b)) calc(16px + var(--safe-l)); background-color: #17120e;
  background-image: linear-gradient(rgba(23,18,14,0.82), rgba(23,18,14,0.9)), url(../textures/wall.webp); background-size: auto, 512px; }
.overlay.room[hidden] { display: none; }
.room-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; max-width: 820px; margin: 0 auto 10px; }
.room-head h2 { margin: 0; flex: 1; min-width: 0; }
.room-shelves { width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 30px 20px; max-width: 820px; margin: 0 auto; padding-bottom: 24px; }
.room-card { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 8px; position: relative; padding-bottom: 18px; }
.room-card::after { content: ''; position: absolute; left: -10px; right: -10px; bottom: 0; height: 12px; border-radius: 2px;
  background-color: #6a4a2f; background-image: url(../textures/wood.webp); background-blend-mode: multiply; background-size: 512px;
  box-shadow: 0 6px 10px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,225,190,0.18); }
.room-pic { display: block; border-radius: 8px; overflow: hidden; box-shadow: 0 8px 18px rgba(0,0,0,0.45); outline: 1px solid rgba(255,236,210,0.12); }
.room-pic canvas { display: block; width: 100%; height: auto; }
.room-pic.tube { display: grid; place-items: center; min-height: 120px; background: #1c1612; }
.room-pic.tube svg { width: 120px; height: 64px; }
.room-card.watching .room-pic { outline: 2px solid rgba(219,166,92,0.7); }
.room-card:focus-visible .room-pic { outline: 2px solid #e2b45c; }
.room-info { display: flex; flex-direction: column; gap: 3px; }
.room-info b { font-size: calc(15px * var(--ts)); }
.room-info em { font-style: normal; color: var(--muted); font-size: calc(13px * var(--ts)); }
.room-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.room-chips .chip { font-style: normal; font-size: calc(12px * var(--ts)); padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); }
.room-chips .chip.warn { color: #f0b08a; border-color: rgba(240,140,100,0.45); }
.room-chips .chip.good { color: #a8d38e; border-color: rgba(140,200,110,0.45); }
.room-chips .chip.calm { color: var(--muted); }
.room-link { margin: 6px 0 0; }

/* Decorate mode: the dock gives way to a bar of pieces. */
body.decorating #dock { display: none; }
.decor-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 15;
  width: min(760px, calc(100% - 24px - var(--safe-l) - var(--safe-r))); background: rgba(24,19,15,0.94); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; box-shadow: 0 10px 24px rgba(0,0,0,0.45); }
.decor-bar[hidden] { display: none; }
.decor-hint { margin: 0 0 8px; color: var(--muted); font-size: calc(13px * var(--ts)); }
.decor-row { display: flex; align-items: center; gap: 10px; }
.decor-pieces { display: flex; gap: 8px; overflow-x: auto; flex: 1; min-width: 0; padding-bottom: 2px; }
.decor-piece { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 84px; padding: 6px 8px; border-radius: 10px; }
.decor-piece img { height: 26px; width: auto; max-width: 70px; object-fit: contain; }
.decor-piece span { font-size: calc(12px * var(--ts)); white-space: nowrap; }
.decor-piece.picked { border-color: #e2b45c; box-shadow: 0 0 0 1px #e2b45c inset; }
.decor-acts { display: flex; gap: 6px; flex-shrink: 0; }
.si-ico img { width: 100%; height: 100%; object-fit: contain; }

/* First-launch title screen: sculpted walnut-and-brass specimen plaque over the live breathing farm. */
.start-screen {
  position: fixed; inset: 0; z-index: 28;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding: calc(var(--safe-t) + 20px) calc(var(--safe-r) + 16px) calc(var(--safe-b) + 28px) calc(var(--safe-l) + 16px);
  background: linear-gradient(180deg, rgba(12, 9, 7, 0.14) 0%, rgba(12, 9, 7, 0.48) 52%, rgba(10, 7, 5, 0.90) 100%);
}
.start-screen[hidden] { display: none; }
body:has(#codeModal:not([hidden])) .start-screen { visibility: hidden; pointer-events: none; }
.start-card {
  width: min(420px, 100%); max-height: 100%; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
  padding: 28px 24px 20px; border-radius: 28px;
  background: var(--surface-slab); border: 1px solid rgba(238, 194, 126, 0.44);
  box-shadow: 0 36px 84px rgba(0, 0, 0, 0.82), 0 0 0 1px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 232, 194, 0.28);
}
.start-kicker {
  margin: 0; color: var(--accent-hi); font-size: calc(11.5px * var(--ts)); font-weight: 800;
  letter-spacing: 0.14em; text-transform: uppercase;
}
#startTitle {
  margin: 0; font-family: var(--cap-font); font-size: calc(38px * var(--ts)); font-weight: 700;
  line-height: 1.06; letter-spacing: -0.02em; color: var(--text);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}
.start-rule { width: 120px; height: 1px; margin: 2px 0 4px; background: linear-gradient(90deg, transparent, var(--brass-edge), transparent); position: relative; }
.start-rule span { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; transform: translate(-50%, -50%) rotate(45deg); background: var(--accent); box-shadow: 0 0 8px rgba(223, 167, 87, 0.55); }
.start-sub {
  margin: 2px 0 12px; color: var(--muted); font-size: calc(15px * var(--ts)); line-height: 1.48; max-width: 34ch;
}
.big-cta {
  width: 100%; min-height: 52px; padding: 12px 20px; border-radius: 16px; font-size: calc(16.5px * var(--ts));
}
.start-card .link {
  font-size: calc(13.5px * var(--ts)); line-height: 1.35; text-align: center; white-space: normal;
}
@media (max-height: 480px) {
  .start-screen {
    justify-content: center;
    padding-top: calc(var(--safe-t) + 10px);
    padding-bottom: calc(var(--safe-b) + 10px);
  }
  .start-card { padding: 16px 20px 14px; gap: 5px; }
  #startTitle { font-size: calc(28px * var(--ts)); }
  .start-sub { margin: 0 0 6px; font-size: calc(14px * var(--ts)); }
}
