/* One visual language for every screen (round 11): toy cards in cream with a white rim and a soft drop, chunky pill
   buttons that press down, white key caps, see-through dark pills for the in-game bits. */
:root {
  --round: "Arial Rounded MT Bold", ui-rounded, "SF Pro Rounded", "Nunito", "Trebuchet MS", system-ui, sans-serif;
  --ink: #2b2b30;
  --ink2: #4b4b55;
  --muted: #736d61;
  --cream: #fff8e8;
  --paper: #fffaf0;
  --line: #efe6d2;
  --red: #e63b2e;
  --yellow: #ffc61f;
  --green: #3cb44a;
  --green-d: #23802f;
  --blue: #2a86e6;
  --purple: #8b5bd8;
  --glass: rgba(24, 32, 26, .42);
  --card-shadow: 0 18px 50px rgba(20, 30, 20, .3), inset 0 -6px 0 rgba(0, 0, 0, .05);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #bfe2fb; font-family: var(--round); color: var(--ink); }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
#ui { position: fixed; inset: 0; pointer-events: none; user-select: none; }

/* ---------- boot + title ---------- */
#boot { position: fixed; inset: 0; display: grid; place-content: center; text-align: center; background: linear-gradient(#7cc6ff, #cfeeff 60%, #8fd463 60.2%, #6cbf47); z-index: 30; }
#boot .bt { font-size: 54px; color: #fff; text-shadow: 0 4px 0 #e63b2e, 0 8px 18px rgba(0,0,0,.18); letter-spacing: 1px; }
#boot small { display: block; margin-top: 14px; font-size: 18px; color: #2f5d2a; }

/* round 11: the logo stands on the farm at the top, the card sits low, so the 3D farm shows in between */
#title { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 10px; padding: 2.6vh 16px 2.6vh; z-index: 20;
  background: radial-gradient(ellipse 52% 34% at 50% 0%, rgba(255,255,255,.4), rgba(255,255,255,0) 72%), linear-gradient(rgba(255,255,255,0) 46%, rgba(20,50,30,.26) 100%); }
#title[hidden] { display: none; }
#title.leaving { pointer-events: none; animation: title-out .55s ease forwards; }
#title.leaving .card { animation: card-out .45s ease forwards; }
#title.leaving .brand { animation: brand-out .4s ease forwards; }
@keyframes title-out { to { opacity: 0; } }
@keyframes card-out { to { transform: translateY(40px) scale(.97); opacity: 0; } }
@keyframes brand-out { to { transform: translateY(-30px); opacity: 0; } }
#title .brand { flex: none; pointer-events: none; filter: drop-shadow(0 6px 0 rgba(120, 30, 20, .25)) drop-shadow(0 14px 20px rgba(20, 40, 20, .25)); animation: brand-in .9s cubic-bezier(.3, 1.45, .5, 1) both; }
@keyframes brand-in { from { transform: translateY(-24px) scale(.92); opacity: 0; } }
#title .brand svg { display: block; height: clamp(84px, 20vh, 196px); width: auto; overflow: visible; }
#title .brand text { font-family: var(--round); text-anchor: middle; paint-order: stroke; stroke: #fff; stroke-linejoin: round; }
#title .brand .l1 { font-size: 58px; fill: var(--green); stroke-width: 12px; letter-spacing: 3px; }
#title .brand .l2 { font-size: 124px; fill: var(--red); stroke-width: 18px; letter-spacing: 1px; }
#title .brand .tr .halo { fill: #fff; stroke: #fff; stroke-width: 14px; stroke-linejoin: round; }
#title .brand .l2s { font-size: 124px; fill: #a8241a; stroke: #a8241a; stroke-width: 18px; letter-spacing: 1px; }
/* solid card: no backdrop-filter (it re-composited the whole farm every frame) */
#title .card { position: relative; text-align: center; padding: 30px 46px 26px; border-radius: 34px; background: rgba(255, 250, 236, .96); box-shadow: 0 18px 50px rgba(30, 60, 30, .25), inset 0 -6px 0 rgba(0,0,0,.06);
  animation: card-up .55s cubic-bezier(.3, 1.3, .5, 1) .05s both; }
@keyframes card-up { from { transform: translateY(30px); opacity: 0; } }
.logo { line-height: .9; }
.logo .l1 { display: block; font-size: 40px; color: var(--green); letter-spacing: 2px; }
.logo .l2 { display: block; font-size: 82px; color: var(--red); text-shadow: 0 5px 0 #a8241a, 0 10px 22px rgba(0,0,0,.18); letter-spacing: 1px; }
.tag { margin: 12px 0 18px; font-size: 18px; color: #5a6b4a; }
.play { pointer-events: auto; font-family: var(--round); font-size: 34px; color: #fff; background: var(--green); border: 0; border-radius: 999px; padding: 14px 46px 16px 40px; cursor: pointer; box-shadow: 0 7px 0 #23802f, 0 14px 26px rgba(0,0,0,.2); transition: transform .12s, box-shadow .12s; display: inline-flex; align-items: center; gap: 14px; text-shadow: 0 2px 0 rgba(0,0,0,.12); }
.play:hover { transform: translateY(-2px) scale(1.03); }
.play:active { transform: translateY(5px); box-shadow: 0 2px 0 #23802f, 0 6px 14px rgba(0,0,0,.2); }
.play .tri { width: 0; height: 0; border-left: 22px solid #fff; border-top: 14px solid transparent; border-bottom: 14px solid transparent; }
.how { margin: 22px 0 0; font-size: 14px; color: #6b6b6b; }
.playkeys { display: none; }
.pickrow, .days { display: none; }

/* ---------- the day-picking title menu (ui/menu.js adds .menu) ---------- */
#title .card.menu { width: min(1080px, 100%); padding: 14px 26px 12px; border-radius: 32px; display: grid; gap: 8px 22px; text-align: left;
  grid-template-columns: 1fr auto; grid-template-areas: "modes modes" "pick pick" "days days" "info play" "how how";
  border: 4px solid #fff; box-shadow: 0 18px 50px rgba(30, 60, 30, .28), inset 0 -6px 0 rgba(0,0,0,.05); }
.card.menu .logo { display: none; }
.card.menu .pickrow { grid-area: pick; display: flex; align-items: center; justify-content: space-between; padding: 0 4px; min-height: 28px; }
.card.menu .pick { font-size: 15px; color: #6a7a58; letter-spacing: .4px; }
.card.menu .dice { pointer-events: auto; cursor: pointer; font-size: 14px; color: #5b4a8a; background: #efe9ff; padding: 6px 13px 6px 9px; border-radius: 999px; box-shadow: 0 2px 0 #d3c8f2; display: inline-flex; align-items: center; gap: 5px; transition: transform .12s; }
.card.menu .modes .dice { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); }
.card.menu .modes .dice:hover { transform: translateY(calc(-50% - 1px)); }
.card.menu.adv .modes .dice { display: none; }
.card.menu .dice .die { display: inline-block; transition: transform .3s; }
.card.menu .dice.roll .die { animation: roll .45s linear infinite; }
@keyframes roll { to { transform: rotate(360deg); } }
.card.menu .days { grid-area: days; display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; padding: 6px 8px 6px; }
.day { pointer-events: auto; cursor: pointer; border-radius: 20px; background: #fff; padding: 4px; box-shadow: 0 4px 0 rgba(0,0,0,.10), 0 8px 16px rgba(40,60,30,.12);
  transition: transform .16s cubic-bezier(.3,1.6,.6,1), box-shadow .16s; position: relative; outline: none; }
.day:hover { transform: translateY(-3px); }
.day .art { border-radius: 16px 16px 6px 6px; overflow: hidden; aspect-ratio: 120 / 80; background: #cfeeff; }
.day .art svg { display: block; width: 100%; height: 100%; }
.day .band { margin-top: 4px; border-radius: 6px 6px 16px 16px; background: var(--c); color: #fff; text-align: center; padding: 5px 4px 6px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.12); }
.day.lt .band { color: #4a3a10; }
.day .band b { display: block; font-size: 19px; letter-spacing: 1px; line-height: 1.05; text-shadow: 0 2px 0 rgba(0,0,0,.14); }
.day.lt .band b { text-shadow: 0 2px 0 rgba(255,255,255,.4); }
.day .band span { display: block; font-size: 11px; opacity: .95; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day.sel { transform: translateY(-6px) scale(1.05); box-shadow: 0 0 0 4px var(--c), 0 0 0 8px #fff, 0 12px 0 rgba(0,0,0,.08), 0 18px 28px rgba(40,60,30,.25); z-index: 1; }
/* a little life in the chosen card's picture */
.day.sel .a-bob { animation: bob 1.1s ease-in-out infinite; }
.day.sel .a-puff { animation: puff 1.6s ease-in-out infinite; }
.day.sel .a-spin { animation: spin 1.4s linear infinite; }
.day.sel .a-ball { animation: kick 1.3s ease-in-out infinite; }
.day.sel .a-jump { animation: hop 1.4s ease-in-out infinite; }
.day.sel .a-flag { animation: flag .8s ease-in-out infinite alternate; }
.day.sel .a-wobble { animation: wob .9s ease-in-out infinite; }
.day.sel .a-ring { animation: ring .7s ease-in-out infinite alternate; }
@keyframes bob { 50% { transform: translateY(-1.6px); } }
@keyframes puff { 0% { transform: translate(0, 2px) scale(.92); opacity: .7; } 50% { opacity: 1; } 100% { transform: translate(-3px, -3px) scale(1.06); opacity: .75; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes kick { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(8px, -5px); } }
@keyframes hop { 0%, 100% { transform: translate(0, 2px); } 50% { transform: translate(2px, -3px); } }
@keyframes flag { from { transform: skewY(-6deg); } to { transform: skewY(5deg) scaleX(.9); } }
@keyframes wob { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-2.5deg); } 75% { transform: rotate(2.5deg); } }
@keyframes ring { from { opacity: .3; transform: scale(.9); } to { opacity: 1; transform: scale(1.05); } }

.card.menu .dayinfo { grid-area: info; min-height: 88px; padding: 10px 16px 10px; border-radius: 20px; background: #fff; box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--c, #3cb44a) 35%, #fff); }
.dayinfo .tag { margin: 6px 0; }
.dayinfo .dname { display: flex; align-items: baseline; gap: 10px; }
.dayinfo .dicon { font-size: 26px; transform: translateY(3px); }
.dayinfo .dn { font-size: 26px; color: var(--c); text-shadow: 0 2px 0 rgba(0,0,0,.08); filter: saturate(1.1) brightness(.9); }
.dayinfo .dt { font-size: 16px; color: #6b6b6b; }
.dayinfo .blurb { margin: 4px 0 8px; font-size: 14.5px; line-height: 1.4; color: #4b4b52; }
.dayinfo .evs { display: flex; gap: 8px; flex-wrap: wrap; }
.dayinfo .ev { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #3b3b42; background: #f6f1e4; border-radius: 999px; padding: 3px 11px 3px 6px; }
.dayinfo .ev i { font-style: normal; font-size: 15px; }
.dayinfo .ev b { font-size: 13px; color: #2b2b30; }
.dayinfo .ev b small { font-size: 10px; margin-left: 1px; color: #77777f; }
.card.menu .playbox { grid-area: play; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding-right: 4px; min-width: 230px; }
.card.menu .play { font-size: 38px; padding: 16px 50px 18px 42px; }
.card.menu .playkeys { display: block; font-size: 12px; color: #75757a; }
/* Kid / Grown-up, for every game (game.mg.level) */
.card.menu .lvbox { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.card.menu .lvbox small { font-size: 11.5px; color: #8a8478; letter-spacing: .3px; padding-right: 8px; }
.card.menu .lvbox .lv [data-level] { font-size: 14px; padding: 6px 13px 7px; }
.card.menu .how { grid-area: how; text-align: center; margin: 0; font-size: 12.5px; color: #77776f; }
.card.menu .how .kc { box-shadow: 0 0 0 1.5px #e3d9c2, 0 2px 0 #d3c8b0; }
/* the two modes */
.card.menu .modes { grid-area: modes; position: relative; display: flex; justify-content: center; gap: 14px; margin: 0 0 2px; }
.card.menu .mode { pointer-events: auto; cursor: pointer; display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  padding: 7px 22px 8px 12px; border-radius: 20px; background: #fff; box-shadow: 0 3px 0 rgba(0,0,0,.09), 0 6px 14px rgba(40,60,30,.10); transition: transform .16s cubic-bezier(.3,1.6,.6,1), box-shadow .16s; outline: none; }
.card.menu .mode:hover { transform: translateY(-2px); }
.card.menu .mode i { grid-row: 1 / 3; font-style: normal; font-size: 28px; }
.card.menu .mode b { font-size: 20px; color: #3b3b42; line-height: 1.05; font-weight: normal; }
.card.menu .mode b em { font-style: normal; font-size: 11px; vertical-align: 3px; margin-left: 4px; padding: 1px 7px 2px; border-radius: 999px; background: #8b5bd8; color: #fff; letter-spacing: .5px; }
.card.menu .mode small { font-size: 12px; color: #75757a; }
.card.menu .mode.open.sel { box-shadow: 0 0 0 3px #3cb44a, 0 0 0 6px #fff, 0 6px 16px rgba(40,60,30,.2); transform: translateY(-2px); }
.card.menu .mode.adv.sel { box-shadow: 0 0 0 3px #8b5bd8, 0 0 0 6px #fff, 0 6px 16px rgba(60,40,90,.22); transform: translateY(-2px); }
.card.menu .mode.open.sel b { color: #2f8f3a; }
.card.menu .mode.adv.sel b { color: #6a44b8; }
#title .card.menu.has-modes { grid-template-areas: "modes modes" "pick pick" "days days" "info play" "how how"; }
#title .card.menu.has-modes.adv { grid-template-areas: "modes modes" "adv play" "how how"; }
.card.menu .advbox { display: none; }
.card.menu.adv .pickrow, .card.menu.adv .days, .card.menu.adv .dayinfo { display: none; }
.card.menu.adv .advbox { grid-area: adv; display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 18px; align-items: center; padding: 10px; border-radius: 24px; background: #fff;
  box-shadow: inset 0 0 0 3px color-mix(in srgb, #8b5bd8 30%, #fff); }
.advbox .advart { border-radius: 18px; overflow: hidden; aspect-ratio: 160 / 100; box-shadow: 0 4px 0 rgba(0,0,0,.08); }
.advbox .advart svg { display: block; width: 100%; height: 100%; }
.card.menu.adv .advart .a-ring { animation: ring 1.4s ease-in-out infinite alternate; }
.advbox .advday { display: flex; flex-direction: column; gap: 2px; }
.advbox .adn { font-size: 34px; color: #e2508f; text-shadow: 0 2px 0 rgba(0,0,0,.08); line-height: 1; }
.advbox .adt { font-size: 21px; color: #4a3a6a; }
.advbox .advblurb { margin: 8px 0 10px; font-size: 14.5px; line-height: 1.4; color: #4b4b52; max-width: 46ch; }
.advbox .advsave { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.advbox .sv { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 13.5px; color: #3b3b42; background: #f3eefc; border-radius: 999px; padding: 4px 12px 4px 7px; }
.advbox .sv i { font-style: normal; font-size: 15px; }
.advbox .sv small { color: #8a8a8a; font-size: 12px; }
.advbox .newadv { pointer-events: auto; cursor: pointer; font-size: 13.5px; color: #6a44b8; background: #fff; padding: 4px 12px; border-radius: 999px; box-shadow: inset 0 0 0 2px #d9ccf5; transition: transform .12s; }
.advbox .newadv:hover { transform: translateY(-1px); }
.advsave.ask .newadv { color: #fff; background: #e2508f; box-shadow: 0 2px 0 #b8336c; }
.card.menu.adv .play { background: #8b5bd8; box-shadow: 0 7px 0 #5f3aa6, 0 14px 26px rgba(0,0,0,.2); }
.card.menu.adv .play:active { box-shadow: 0 2px 0 #5f3aa6, 0 6px 14px rgba(0,0,0,.2); }
/* smaller screens: everything a step smaller so the farm still shows */
@media (max-height: 760px) {
  #title { padding: 2vh 12px 2vh; gap: 6px; }
  #title .card.menu { gap: 6px 18px; padding: 10px 20px 9px; }
  .card.menu .days { gap: 10px; padding-top: 4px; }
  .day .art { aspect-ratio: 120 / 66; }
  .day .band { padding: 3px 4px 4px; }
  .day .band b { font-size: 16px; }
  .card.menu .mode { padding: 5px 16px 6px 10px; } .card.menu .mode i { font-size: 22px; } .card.menu .mode b { font-size: 17px; }
  .card.menu .play { font-size: 32px; padding: 12px 40px 14px 34px; }
  .card.menu .dayinfo { min-height: 0; padding: 8px 14px; }
  .dayinfo .dn { font-size: 22px; } .dayinfo .blurb { font-size: 13.5px; margin: 2px 0 6px; }
  .card.menu .pickrow { min-height: 22px; }
  .card.menu .pickrow:not(:has(.wanted)) { display: none; }
  .card.menu.adv .advbox { grid-template-columns: minmax(180px, 230px) 1fr; padding: 8px; gap: 14px; }
  .advbox .adn { font-size: 28px; } .advbox .adt { font-size: 18px; } .advbox .advblurb { font-size: 13.5px; margin: 6px 0 8px; }
}
@media (max-width: 1000px) {
  .day .band span { display: none; }
  .card.menu .playbox { min-width: 200px; }
}
@media (max-width: 860px) {
  .card.menu .modes { justify-content: flex-start; }
  .card.menu .modes .dice { display: none; }
  .card.menu .how { display: none; }
}
/* ---------- keycaps ---------- */
.kc { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; margin: 0 1px; border-radius: 7px; background: #fff; color: var(--ink); font-size: 11px; font-weight: 700; box-shadow: 0 2px 0 rgba(0,0,0,.25); vertical-align: middle; }
.kc.wide { min-width: 44px; font-size: 10px; letter-spacing: .5px; }
.kc.pad { border-radius: 50%; font-size: 12px; }

/* ---------- control chips (bottom left) ---------- */
#hints { position: absolute; left: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 6px; transition: opacity 1.2s ease; }
#hints.dim { opacity: .22; }
/* (round 11: the name sits in its own pill so it reads on snow and sky too; no backdrop blur: it re-composites the farm) */
#hints .who { display: flex; align-items: center; gap: 7px; width: fit-content; padding: 5px 15px 6px 10px; margin-bottom: 1px; border-radius: 999px; background: rgba(255, 250, 240, .9); color: var(--ink); font-size: 17px; box-shadow: 0 3px 10px rgba(0,0,0,.14); }
#hints .who:empty { display: none; }
#hints .who .icon { font-size: 18px; }
#hints .chip { display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 7px; border-radius: 999px; background: var(--glass); color: #fff; font-size: 13px; width: fit-content; text-shadow: 0 1px 2px rgba(0,0,0,.3); }
#hints .chip .kc { text-shadow: none; }

/* ---------- hop-in prompt (bottom centre) ---------- */
#prompt { position: absolute; left: 50%; bottom: 34px; transform: translate(-50%, 20px); opacity: 0; transition: opacity .25s, transform .25s; display: flex; align-items: center; gap: 10px; padding: 9px 18px 9px 10px; border-radius: 999px; background: rgba(255, 250, 236, .92); font-size: 20px; box-shadow: 0 8px 22px rgba(0,0,0,.18); }
#prompt.show { opacity: 1; transform: translate(-50%, 0); }
#prompt .kc { height: 30px; min-width: 64px; font-size: 13px; background: var(--yellow); }

/* ---------- tally (top right, only for a moment) ---------- */
#tally { position: absolute; right: 18px; top: 16px; display: flex; gap: 8px; opacity: 0; transform: translateY(-8px); transition: opacity .4s, transform .4s; }
#tally.show { opacity: 1; transform: none; }
body.mg-on #tally { top: 62px; } /* below a mini-game's Leave button */
#tally .t { display: flex; align-items: center; gap: 4px; padding: 5px 11px; border-radius: 999px; background: rgba(255, 250, 236, .88); font-size: 18px; box-shadow: 0 4px 12px rgba(0,0,0,.12); }
#tally .t b { font-size: 16px; }
#tally .t.pop { animation: pop .5s ease; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* ---------- click to look pill ---------- */
#lockpill { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); padding: 6px 14px; border-radius: 999px; background: rgba(30, 40, 30, .4); color: #fff; font-size: 13px; opacity: 0; transition: opacity .4s; }
#lockpill.show { opacity: 1; }

/* ---------- grown-up help (H): a key reference in three columns ---------- */
#help { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(1180px, 95vw); max-height: 94vh; overflow-y: auto; padding: 16px 24px 12px; border-radius: 30px;
  background: var(--paper); border: 4px solid #fff; box-shadow: var(--card-shadow); font-size: 13px; color: var(--ink2); pointer-events: auto; animation: card-in .28s cubic-bezier(.3,1.4,.6,1); scrollbar-width: thin; }
#help[hidden] { display: none; }
@keyframes card-in { from { opacity: 0; transform: translate(-50%, -48%) scale(.96); } }
#help .hh { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
#help h2 { margin: 0; color: var(--red); font-size: 27px; font-weight: normal; text-shadow: 0 2px 0 rgba(0,0,0,.06); }
#help h2 small { font-size: 14px; color: var(--muted); margin-left: 8px; text-shadow: none; }
#help .hx { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 5px 12px 5px 6px; background: #f1eadb; color: #6b5a3a; font: 14px/1 var(--round); cursor: pointer; box-shadow: 0 2px 0 #e0d4ba; }
#help .hx:hover { background: #fff; }
#help .cols { display: grid; grid-template-columns: 1.05fr 1fr 1fr; gap: 0 22px; }
#help section { margin-top: 8px; }
#help h3 { margin: 0 0 4px; color: var(--green-d); font-size: 13px; font-weight: normal; letter-spacing: 1.2px; text-transform: uppercase; }
#help .hr { display: grid; grid-template-columns: 98px 1fr; gap: 9px; align-items: center; padding: 3px 0; border-bottom: 1px solid var(--line); line-height: 1.3; }
#help .hr:last-child { border-bottom: 0; }
#help .hk { display: flex; flex-wrap: wrap; gap: 2px; justify-content: flex-end; align-items: center; }
#help .hk .kc { margin: 0; }
#help .ht b { color: var(--ink); font-weight: normal; }
#help .kc, #mg .mg-card .kc, #talk .kc { box-shadow: 0 0 0 1.5px #e3d9c2, 0 2px 0 #d3c8b0; }
#help p { margin: 3px 0; line-height: 1.45; }
#help p .kc { margin-top: -2px; }
#help .hlv { display: flex; align-items: center; gap: 8px; margin: 2px 0 6px; font-size: 12.5px; color: var(--muted); }
#help .hgl { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
#help .hg b { display: block; font-weight: normal; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: #a08a5e; margin-top: 2px; }
#help .hg span { display: block; font-size: 13px; color: var(--ink); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#help .hs { font-size: 12px; color: var(--muted); }
#help .small { color: var(--muted); font-size: 12px; margin: 8px 0 0; text-align: center; }
@media (max-width: 1100px) { #help .cols { grid-template-columns: 1fr 1fr; } #help .cols > div:nth-child(3) { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; } }
@media (max-height: 700px) {
  #help { font-size: 12px; padding: 12px 20px 10px; }
  #help h2 { font-size: 23px; }
  #help .hr { padding: 2px 0; line-height: 1.22; grid-template-columns: 96px 1fr; }
  #help section { margin-top: 5px; }
  #help .kc { height: 20px; min-width: 20px; }
}
.kc.two { font-size: 7px; letter-spacing: -1px; min-width: 26px; }
/* a Kid / Grown-up switch (the title, the help card; the mini-game cards draw their own in ui/mg.js) */
.lv { display: inline-flex; padding: 3px; border-radius: 999px; background: #efe8d8; gap: 3px; box-shadow: inset 0 2px 0 rgba(0,0,0,.05); }
.lv [data-level] { pointer-events: auto; cursor: pointer; padding: 5px 12px 6px; border-radius: 999px; font-size: 13px; color: #7a7262; white-space: nowrap; transition: background .15s, color .15s, box-shadow .15s; }
.lv [data-level]:hover { color: var(--ink); }
.lv [data-level].on { background: #fff; color: var(--ink); box-shadow: 0 2px 0 #d9cfb8, 0 0 0 2px var(--lvc, var(--green)); }
.lv [data-level="grown"] { --lvc: var(--blue); }

/* ---------- calendar chip (bottom right, barely there) ---------- */
#cal { position: absolute; right: 14px; bottom: 12px; display: flex; align-items: center; gap: 7px; transition: opacity .6s; }
#cal.off { opacity: 0; }
#cal .cal-chip { display: flex; align-items: center; gap: 5px; padding: 4px 10px 4px 9px; border-radius: 999px; background: rgba(22, 32, 22, .38); color: #fff; font-size: 12.5px; letter-spacing: .5px; opacity: .88; text-shadow: 0 1px 2px rgba(0,0,0,.4); transition: opacity .4s; }
#cal .cal-chip b { font-size: 11px; letter-spacing: 1px; }
#cal .cal-chip .ic { font-style: normal; font-size: 12px; text-shadow: none; }
#cal .cal-chip .t { font-variant-numeric: tabular-nums; }
#cal .cal-note { order: -1; white-space: nowrap; font-size: 14px; color: var(--ink); padding: 5px 13px 6px; border-radius: 999px; background: rgba(255, 250, 236, .92); box-shadow: 0 4px 14px rgba(0,0,0,.14); opacity: 0; transform: translateX(26px) scale(.92); transform-origin: right center; transition: opacity .35s ease, transform .5s cubic-bezier(.3,1.45,.6,1); }
#cal.noting .cal-note { opacity: 1; transform: none; }
#cal.noting .cal-chip { opacity: 1; }

/* ---------- Tab map ---------- */
#map { position: fixed; inset: 0; z-index: 40; background: rgba(28, 44, 30, .5); user-select: none; -webkit-user-select: none; animation: map-fade .2s ease-out; }
#map[hidden] { display: none; }
#map .map-sheet { animation: map-in .3s cubic-bezier(.3, 1.3, .6, 1); }
@keyframes map-fade { from { opacity: 0; } }
@keyframes map-in { from { transform: translateY(10px) scale(.985); } }
#map .map-sheet { position: absolute; inset: 16px; display: flex; gap: 14px; }
#map .map-view { position: relative; flex: 1; min-width: 0; border-radius: 26px; overflow: hidden; background: #e9dcbc; border: 5px solid #fffaf0; box-shadow: 0 18px 50px rgba(0,0,0,.35), inset 0 0 0 2px rgba(150,120,70,.25); cursor: grab; }
#map .map-view.dragging { cursor: grabbing; }
#map .map-cv { position: absolute; left: 0; top: 0; display: block; }
#map .map-mk { position: absolute; inset: 0; pointer-events: none; }
#map .mk { position: absolute; left: 0; top: 0; pointer-events: auto; will-change: transform; }
/* places: a round badge on the spot, the name under it */
#map .mk.pl { width: 0; height: 0; cursor: pointer; z-index: 3; }
/* (round 11: bigger badges, easy to hit on a trackpad; an invisible ring round each makes the target bigger still) */
#map .mk.pl .b { position: absolute; left: -15px; top: -15px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 16px; background: #fff; box-shadow: 0 0 0 2.5px var(--ring, #3cb44a), 0 3px 6px rgba(60,40,10,.35); transition: transform .15s; }
#map .mk.pl .b::before { content: ""; position: absolute; inset: -7px; border-radius: 50%; }
#map .mk.pl .l { position: absolute; left: 0; top: 17px; white-space: nowrap; font-size: 12.5px; color: #3b2f1e; text-shadow: 0 0 3px #fff8e6, 0 0 3px #fff8e6, 0 0 2px #fff8e6, 0 1px 0 #fff8e6; letter-spacing: .2px; }
#map .mk.pl.nl .l { display: none; }
#map .mk.pl:hover { z-index: 6; }
#map .mk.pl:hover .b { transform: scale(1.18); }
#map .mk.pl:hover .l { display: block; }
#map .mk.pl.place { --ring: #3cb44a; }
#map .mk.pl.station { --ring: #2a86e6; }
#map .mk.pl.home { --ring: #ff7fb2; }
/* the games stand out: bigger gold badge, a yellow name tag with "play" */
#map .mk.pl.game { z-index: 4; }
#map .mk.pl.game .b, #map .mk.pl.goal .b { left: -20px; top: -20px; width: 40px; height: 40px; font-size: 21px; background: #fffbe8; box-shadow: 0 0 0 3px #ffc61f, 0 0 0 5.5px #fff, 0 4px 8px rgba(60,40,10,.4); }
#map.compact .mk.pl .b { left: -12px; top: -12px; width: 24px; height: 24px; font-size: 13px; }
#map.compact .mk.pl.game .b, #map.compact .mk.pl.goal .b { left: -16px; top: -16px; width: 32px; height: 32px; font-size: 17px; }
#map.compact .mk.pl .l { top: 14px; font-size: 11.5px; }
#map.compact .map-title { display: none; }
#map .mk.pl.game .l { font-size: 12.5px; color: #3b2f1e; background: #ffc61f; text-shadow: none; padding: 2px 8px 3px; border-radius: 999px; box-shadow: 0 2px 0 #d39a00, 0 3px 6px rgba(0,0,0,.2); }
#map .mk.pl.game .l em { font-style: normal; font-size: 10px; margin-left: 5px; padding: 0 5px; border-radius: 999px; background: #e63b2e; color: #fff; vertical-align: 1px; letter-spacing: .5px; text-transform: uppercase; }
#map .mk.pl.on .b::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 3px solid #ff5a3c; animation: mappulse 1.4s ease-out infinite; }
@keyframes mappulse { from { transform: scale(.75); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
/* people */
#map .mk.dot { width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: #ff6f91; box-shadow: 0 0 0 1.2px #fff; pointer-events: none; z-index: 1; }
#map .mk.dot.crew { background: #3cb44a; }
#map .mk.crowd { z-index: 2; display: flex; align-items: center; gap: 2px; transform-origin: 0 0; margin: -11px 0 0 -18px; padding: 2px 6px 2px 4px; border-radius: 999px; background: rgba(255,255,255,.93); box-shadow: 0 2px 5px rgba(60,40,10,.3); font-size: 11px; color: #5a3a4a; pointer-events: none; }
#map .mk.crowd .hd { display: inline-flex; }
#map .mk.crowd .hd i { width: 7px; height: 7px; border-radius: 50%; margin-right: -1.5px; box-shadow: 0 0 0 1px #fff; }
#map .mk.crowd .hd i:nth-child(1) { background: #e63b2e; } #map .mk.crowd .hd i:nth-child(2) { background: #2a86e6; } #map .mk.crowd .hd i:nth-child(3) { background: #ffc61f; }
/* rides */
#map .mk.ride { z-index: 2; cursor: pointer; }
#map .mk.ride span { position: absolute; left: -10px; top: -10px; width: 20px; height: 20px; border-radius: 7px; display: grid; place-items: center; font-size: 12px; background: rgba(255,255,255,.92); box-shadow: 0 2px 4px rgba(60,40,10,.3); transition: transform .15s; }
#map .mk.ride:hover span { transform: scale(1.25); }
/* you are here */
#map .mk.you { z-index: 5; pointer-events: none; }
#map .mk.you .cone { position: absolute; left: -22px; top: -22px; width: 44px; height: 44px; border-radius: 50%; background: conic-gradient(from -32deg, rgba(230,59,46,.55) 0deg, rgba(230,59,46,.0) 64deg, transparent 64deg); -webkit-mask: radial-gradient(circle, #000 60%, transparent 62%); mask: radial-gradient(circle, #000 60%, transparent 62%); }
#map .mk.you .dotme { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; background: #e63b2e; box-shadow: 0 0 0 3px #fff, 0 3px 8px rgba(0,0,0,.4); display: grid; place-items: center; font-size: 10px; }
#map .mk.you .dotme::after { content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 3px solid #e63b2e; animation: mappulse 1.6s ease-out infinite; }
#map .mk.you .yl { position: absolute; left: 0; top: 14px; transform: translateX(-50%); font-size: 11px; color: #fff; background: #e63b2e; padding: 1px 7px 2px; border-radius: 999px; box-shadow: 0 2px 0 #a8241a; letter-spacing: .5px; }
/* chrome on the map */
#map .map-title { position: absolute; left: 18px; top: 16px; padding: 7px 16px 8px 12px; border-radius: 999px; background: rgba(255,250,236,.94); color: #6b4a22; font-size: 17px; box-shadow: 0 3px 0 rgba(150,110,50,.25), 0 6px 14px rgba(0,0,0,.12); pointer-events: none; }
#map .map-compass { position: absolute; right: 66px; top: 14px; width: 58px; height: 58px; pointer-events: none; filter: drop-shadow(0 3px 4px rgba(0,0,0,.18)); }
#map .map-legend { position: absolute; left: 16px; bottom: 14px; display: flex; gap: 12px; padding: 6px 12px; border-radius: 999px; background: rgba(255,250,236,.9); font-size: 12px; color: #5a4a32; pointer-events: none; box-shadow: 0 3px 10px rgba(0,0,0,.1); }
#map .map-legend span { display: inline-flex; align-items: center; gap: 5px; }
#map .map-legend i { font-style: normal; font-size: 12px; }
#map .map-legend .lg-you { width: 10px; height: 10px; border-radius: 50%; background: #e63b2e; box-shadow: 0 0 0 2px #fff; }
#map .map-legend .lg-crowd { width: 7px; height: 7px; border-radius: 50%; background: #ff6f91; box-shadow: 0 0 0 1.5px #fff, 5px 0 0 0 #2a86e6; margin-right: 5px; }
#map .map-zoom { position: absolute; right: 14px; bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
#map .map-zoom button { width: 36px; height: 36px; border: 0; border-radius: 12px; background: rgba(255,250,236,.95); color: #5a4a32; font: 20px/1 var(--round); cursor: pointer; box-shadow: 0 3px 0 rgba(150,110,50,.3), 0 5px 10px rgba(0,0,0,.12); }
#map .map-zoom button:hover { background: #fff; }
#map .map-tip { position: absolute; left: 0; top: 0; z-index: 10; width: max-content; max-width: 260px; padding: 10px 13px 9px; border-radius: 16px; background: rgba(255,252,244,.98); color: #3b3b42; box-shadow: 0 10px 26px rgba(0,0,0,.25); pointer-events: none; font-size: 13px; }
#map .map-tip b { font-size: 15px; color: #2b2b30; }
#map .map-tip p { margin: 4px 0; line-height: 1.35; }
#map .map-tip p.st { color: #2f7d2f; }
#map .map-tip ul { margin: 6px 0 4px; padding: 0; list-style: none; }
#map .map-tip li { margin: 2px 0; }
#map .map-tip li.done { opacity: .5; text-decoration: line-through; }
#map .map-tip li em { font-style: normal; font-size: 10px; color: #fff; background: #e63b2e; border-radius: 999px; padding: 0 6px; }
#map .map-tip small { color: #8a7a5a; }
#map .map-close { position: absolute; right: 14px; top: 16px; z-index: 5; width: 42px; height: 42px; border: 0; border-radius: 50%; background: #fffaf0; color: #6b4a22; font: 18px/1 var(--round); cursor: pointer; box-shadow: 0 3px 0 rgba(150,110,50,.35), 0 6px 14px rgba(0,0,0,.25); }
/* the side panel */
#map .map-panel { width: 340px; flex: none; display: flex; flex-direction: column; border-radius: 26px; background: #fffaf0; box-shadow: 0 18px 50px rgba(0,0,0,.3); overflow: hidden; color: #3b3b42; }
#map .mp-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px 11px; background: var(--c); color: #fff; box-shadow: inset 0 -4px 0 rgba(0,0,0,.12); }
#map .mp-icon { font-size: 30px; width: 46px; height: 46px; display: grid; place-items: center; background: rgba(255,255,255,.92); border-radius: 50%; box-shadow: 0 3px 0 rgba(0,0,0,.15); }
#map .mp-dn { flex: 1; line-height: 1.1; }
#map .mp-dn b { display: block; font-size: 22px; text-shadow: 0 2px 0 rgba(0,0,0,.15); }
#map .map-panel .mp-dn small { display: block; font-size: 13px; color: #fff; opacity: .95; margin: 1px 0 0; }
#map .mp-time { font-size: 24px; text-shadow: 0 2px 0 rgba(0,0,0,.15); font-variant-numeric: tabular-nums; }
#map .map-panel .mp-time small { display: inline; font-size: 12px; margin-left: 2px; color: #fff; }
#map .mp-body { flex: 1; overflow-y: auto; padding: 4px 14px 6px; scrollbar-width: thin; }
#map .mp-blurb { margin: 8px 2px 10px; font-size: 13px; line-height: 1.4; color: #55555c; }
#map .mp-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
#map .mp-week button { border: 0; border-radius: 11px; padding: 4px 0 3px; background: #f1eadb; color: #5a5a62; font: 10px/1.1 var(--round); letter-spacing: .5px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px; box-shadow: 0 2px 0 #ddd3bd; }
#map .mp-week button i { font-style: normal; font-size: 15px; }
#map .mp-week button:hover { background: #fff; }
#map .mp-week button.cur { background: var(--c); color: #fff; box-shadow: 0 2px 0 rgba(0,0,0,.2), 0 0 0 2px #fff, 0 0 0 4px var(--c); }
#map .mp-tbtn { display: flex; gap: 6px; margin: 10px 0 4px; }
#map .mp-tbtn button { border: 0; border-radius: 12px; padding: 7px 8px; background: #ffc61f; color: #3b2f1e; font: 13px/1.15 var(--round); cursor: pointer; box-shadow: 0 3px 0 #d39a00; white-space: nowrap; }
#map .mp-tbtn button:active { transform: translateY(2px); box-shadow: 0 1px 0 #d39a00; }
#map .mp-tbtn button.nx { flex: 1; overflow: hidden; text-overflow: ellipsis; background: #fff1b8; box-shadow: 0 3px 0 #e6c862; }
#map .map-panel .mp-tbtn button small { display: inline; font-size: 10.5px; color: #7a6a3a; }
#map h4 { margin: 12px 2px 5px; font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; color: #8c764a; font-weight: normal; }
#map .map-panel ul { margin: 0; padding: 0; list-style: none; }
#map .mp-tl li, #map .mp-ppl li, #map .mp-games li { display: flex; align-items: flex-start; gap: 8px; padding: 6px 8px; border-radius: 12px; font-size: 13px; line-height: 1.25; }
#map .mp-tl li[data-place]:hover, #map .mp-ppl li[data-place]:hover, #map .mp-games li:hover { background: #f4ecd9; cursor: pointer; }
#map .mp-tl .tm { width: 40px; flex: none; font-size: 13px; color: #2b2b30; font-variant-numeric: tabular-nums; }
#map .map-panel .mp-tl .tm small { display: block; font-size: 9.5px; color: #8a8a8a; margin: 0; }
#map .mp-tl .ic, #map .mp-games .ic { font-size: 15px; width: 18px; text-align: center; }
#map .mp-tl li > div, #map .mp-ppl li > div, #map .mp-games li > div { flex: 1; min-width: 0; }
#map .map-panel small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
#map .mp-tl li.done { opacity: .5; }
#map .mp-tl li.on { background: color-mix(in srgb, var(--c) 14%, #fff); }
#map .map-panel em { font-style: normal; font-size: 10px; letter-spacing: .4px; flex: none; color: #7a7a82; background: #efe8d8; border-radius: 999px; padding: 2px 7px; margin-top: 1px; white-space: nowrap; }
#map .map-panel em.on { color: #fff; background: #e63b2e; }
#map .mp-ppl .n { width: 44px; flex: none; font-size: 12.5px; color: #b0436a; white-space: nowrap; }
/* the games, by area (round 11): one big row each, the whole line readable */
#map .mp-games { display: flex; flex-direction: column; gap: 5px; }
#map .mp-games li { min-width: 0; min-height: 48px; background: #fffdf6; box-shadow: inset 0 0 0 2px #f3e3b0, 0 2px 0 #f0e2bc; padding: 6px 10px 6px 7px; align-items: center; gap: 10px; transition: transform .12s, background .12s; }
#map .mp-games li:hover { transform: translateX(2px); }
#map .mp-games li.ga { min-height: 0; background: none; box-shadow: none; padding: 7px 4px 0; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: #b39a6a; cursor: default; }
#map .mp-games li.ga:hover { background: none; transform: none; }
#map .mp-games li.on { box-shadow: inset 0 0 0 2px #ff8a70, 0 2px 0 #f3c4b4; background: #fff4ef; }
#map .mp-games li .ic { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 19px; background: #fff; box-shadow: 0 0 0 2.5px #ffc61f, 0 2px 4px rgba(60,40,10,.2); }
#map .mp-games li b { font-size: 14px; color: #2b2b30; }
#map .map-panel .mp-games small { font-size: 11.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#map h4 .hint { text-transform: none; letter-spacing: 0; font-size: 11px; color: #a8946a; margin-left: 4px; }
#map .mp-foot { margin: 0; padding: 8px 14px 10px; font-size: 11.5px; color: #847456; border-top: 1px solid #efe6d2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#map .mp-foot .kc { box-shadow: 0 0 0 1.5px #e3d9c2, 0 2px 0 #d3c8b0; }
@media (max-width: 1100px) { #map .map-panel { width: 300px; } }

/* ---------- the night (ui/sleep.js) ---------- */
#ui { transition: opacity .8s; }
body.sleeping #ui { opacity: 0; }
#sleep { position: fixed; inset: 0; z-index: 36; pointer-events: none; overflow: hidden; }
#sleep[hidden] { display: none; }
#sleep .sl-veil { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse 80% 75% at 50% 62%, rgba(20, 30, 90, 0) 38%, rgba(12, 18, 64, .62) 100%), linear-gradient(rgba(14, 22, 72, .92), rgba(20, 30, 88, .55) 22%, rgba(22, 32, 92, 0) 52%); }
#sleep .sl-sky { position: absolute; inset: 0; opacity: 0; -webkit-mask: linear-gradient(#000 18%, transparent 40%); mask: linear-gradient(#000 18%, transparent 40%); }
#sleep .st { position: absolute; width: calc(14px * var(--s)); height: calc(14px * var(--s)); margin: calc(-7px * var(--s)); background: #fff7d6; clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); filter: drop-shadow(0 0 4px rgba(255, 240, 180, .9)); animation: twinkle 2.4s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: .35; transform: scale(.7) rotate(0deg); } 50% { opacity: 1; transform: scale(1.1) rotate(12deg); } }
#sleep .moon { position: absolute; right: 12%; top: 9%; width: 64px; height: 64px; border-radius: 50%; box-shadow: 15px -8px 0 0 #fff4c8; transform: translateY(var(--rise, 0)) rotate(-18deg); filter: drop-shadow(0 0 16px rgba(255, 236, 170, .75)); }
#sleep .shoot { position: absolute; left: 18%; top: 8%; width: 120px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, rgba(255,255,255,0), #fffbe6); opacity: 0; transform: rotate(18deg); }
#sleep .sl-sky.shooting .shoot { animation: shoot 1.1s ease-out 1 forwards; }
@keyframes shoot { 0% { opacity: 0; transform: translate(0, 0) rotate(18deg); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(300px, 98px) rotate(18deg); } }
#sleep .sl-dawn { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse 90% 60% at 50% 100%, rgba(255, 186, 120, .75), rgba(255, 170, 130, 0) 70%), linear-gradient(rgba(255, 214, 170, .25), rgba(255, 214, 170, 0) 40%); }
#sleep .sl-z { position: absolute; inset: 0; }
#sleep .zz { position: absolute; color: #fff; font-family: var(--round); line-height: 1; text-shadow: 0 2px 0 #6a7fd0, 0 0 14px rgba(140, 160, 255, .65); animation: zfloat 2.8s cubic-bezier(.25, .7, .4, 1) forwards; }
@keyframes zfloat {
  0% { transform: translate(-50%, 0) scale(.35) rotate(0deg); opacity: 0; }
  15% { opacity: 1; }
  60% { opacity: .95; }
  100% { transform: translate(calc(-50% + var(--dx)), -130px) scale(1.15) rotate(var(--rot)); opacity: 0; }
}
#sleep .sl-card { position: absolute; left: 50%; top: 17%; display: flex; align-items: center; gap: 12px; padding: 9px 24px 9px 9px; border-radius: 999px; background: rgba(255, 250, 236, .95); border: 3px solid #fff; box-shadow: 0 10px 30px rgba(0,0,0,.2); opacity: 0; transform: translate(-50%, -12px) scale(.9); transition: opacity .35s ease, transform .5s cubic-bezier(.3, 1.5, .6, 1); }
#sleep.carded .sl-card { opacity: 1; transform: translate(-50%, 0) scale(1); }
#sleep .sc-icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 27px; background: var(--c); box-shadow: inset 0 -3px 0 rgba(0,0,0,.15); }
#sleep .sc-txt { display: flex; flex-direction: column; line-height: 1.1; }
#sleep .sc-day { font-size: 23px; color: color-mix(in srgb, var(--c) 72%, #2b2b30); }
#sleep .sc-theme { font-size: 14px; color: #6b6b6b; }

/* ---------- round 4: trouble (hud.js, map.js, gameover.js, menu.js) ---------- */
/* hearts · pitchforks · arrows: a small see-through pill beside the calendar chip, only while it matters */
#trouble { display: flex; align-items: center; gap: 7px; padding: 3px 9px 3px 8px; border-radius: 999px; background: rgba(22, 32, 22, .3); color: #fff; font-size: 12px; opacity: .92; transition: opacity .4s; }
#trouble:not(.incal) { position: absolute; right: 14px; bottom: 40px; }
#trouble.off { opacity: 0; }
#trouble [hidden] { display: none !important; }
#trouble .hearts, #trouble .forks { display: inline-flex; align-items: center; gap: 1px; }
#trouble .ht svg { display: block; width: 13px; height: 12px; fill: rgba(255,255,255,.18); stroke: rgba(255,255,255,.75); stroke-width: 1.6; }
#trouble .ht.full svg { fill: #ff4d5e; stroke: #fff; filter: drop-shadow(0 1px 1px rgba(0,0,0,.3)); }
#trouble .hearts.low .ht.full svg { animation: beat 1.1s ease-in-out infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.22); } 30% { transform: scale(1); } 45% { transform: scale(1.12); } }
#trouble .fk svg { display: block; width: 10px; height: 16px; fill: none; stroke: rgba(255,255,255,.25); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
#trouble .fk.on svg { stroke: #ffd23a; filter: drop-shadow(0 1px 0 rgba(90,40,0,.55)); }
#trouble .forks.seen .fk.on svg { stroke: #ff7a2e; animation: forkpulse .9s ease-in-out infinite alternate; }
#trouble .forks:not(.seen) .fk.on svg { stroke: #ffe28a; opacity: .78; }
#trouble .forks.up .fk.on svg { animation: forkup .5s cubic-bezier(.3,1.8,.6,1) 2; }
#trouble .forks.lostcue { animation: lostcue 1.5s ease; }
@keyframes forkpulse { from { transform: translateY(0); opacity: .85; } to { transform: translateY(-1px); opacity: 1; } }
@keyframes forkup { 0% { transform: scale(1); } 50% { transform: scale(1.5) translateY(-2px); } 100% { transform: scale(1); } }
@keyframes lostcue { 0% { filter: none; } 30% { filter: saturate(0) brightness(1.4); } 100% { filter: none; } }
#trouble .quiv { display: inline-flex; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; }
#trouble .quiv .qi { font-size: 12px; }
#trouble .quiv b { font-size: 12px; min-width: 14px; }
#trouble .quiv.none { color: #ffb0a8; }
#trouble .quiv.pop { animation: pop .45s ease; }

/* the red edge when hurt */
#hurt { position: absolute; inset: 0; opacity: 0; pointer-events: none; background: radial-gradient(ellipse closest-side at center, rgba(255,40,40,0) 62%, rgba(220,30,40,.38) 86%, rgba(190,0,25,.78) 100%); }
#hurt.throb { animation: hurt-throb 1.96s ease-in-out infinite; }
@keyframes hurt-throb { 0%, 100% { opacity: .42; } 25% { opacity: .52; } 75% { opacity: .32; } }

/* the field bow's crosshair + hit marker */
#xh { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
#xh .ring { position: absolute; left: -15px; top: -15px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255,255,255,.75); box-shadow: 0 0 0 1.5px rgba(30,20,10,.35); opacity: 0; transition: opacity .15s, transform .06s linear, border-color .12s; }
#xh .dot { position: absolute; left: -2.5px; top: -2.5px; width: 5px; height: 5px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1.5px rgba(30,20,10,.5); opacity: 0; transition: opacity .15s; }
#xh.on .dot { opacity: 1; }
#xh.on .ring { opacity: .45; }
#xh.on.drawing .ring { opacity: 1; }
#xh.full .ring { border-color: #fff; box-shadow: 0 0 0 2px #ff9a00, 0 0 8px 2px rgba(255,200,40,.55); }
#xh.over .ring { border-color: #ff4a3a; }
#xh.over .dot { background: #ff4a3a; }
#xh.empty .ring { border-style: dashed; border-color: rgba(255,255,255,.45); }
#xh .hm { position: absolute; left: 0; top: 0; opacity: 0; }
#xh .hm i { position: absolute; width: 2.5px; height: 8px; margin: -4px 0 0 -1.25px; border-radius: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(30,20,10,.45); }
#xh .hm i:nth-child(1) { transform: rotate(45deg) translateY(-14px); }
#xh .hm i:nth-child(2) { transform: rotate(135deg) translateY(-14px); }
#xh .hm i:nth-child(3) { transform: rotate(225deg) translateY(-14px); }
#xh .hm i:nth-child(4) { transform: rotate(315deg) translateY(-14px); }
#xh .hm.kill i { background: #ff4a3a; height: 10px; }
#xh .hm.go { animation: hitmark .38s ease-out; }
@keyframes hitmark { 0% { opacity: 1; transform: scale(.7); } 40% { opacity: 1; transform: scale(1.1); } 100% { opacity: 0; transform: scale(1.25); } }

/* Tab map: trouble */
#map .mp-trouble { margin: 10px 0 4px; padding: 10px 12px 11px; border-radius: 16px; background: #fff3ec; box-shadow: inset 0 0 0 2px #ffc8b0; }
#map .mp-trouble.lv0 { background: #f6f3ea; box-shadow: inset 0 0 0 2px #e6dcc4; }
#map .mp-trouble.lv3, #map .mp-trouble.lv4, #map .mp-trouble.lv5 { background: #ffece6; box-shadow: inset 0 0 0 2px #ff9a80; }
#map .mt-head { display: flex; align-items: center; gap: 8px; }
#map .mt-head b { font-size: 16px; color: #c0392b; letter-spacing: .3px; }
#map .mp-trouble.lv0 .mt-head b { color: #7a6a4a; }
#map .mt-forks { display: inline-flex; gap: 2px; padding: 3px 7px; border-radius: 999px; background: #3b2f2a; }
#map .mt-forks i svg { display: block; width: 10px; height: 16px; fill: none; stroke: rgba(255,255,255,.25); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
#map .mt-forks i.on svg { stroke: #ffc61f; }
#map .mt-line { margin: 7px 0 3px; font-size: 13.5px; line-height: 1.35; color: #4a3530; }
#map .mt-seen, #map .mt-tally { margin: 3px 0; font-size: 12px; color: #8a6a5e; }
#map .mt-h { color: #c0392b; white-space: nowrap; }
#map .mt-slate { margin-top: 8px; border: 0; border-radius: 12px; padding: 8px 14px; background: #fff; color: #3b2f1e; font: 14px/1 var(--round); cursor: pointer; box-shadow: 0 3px 0 #e0c8b8, inset 0 0 0 2px #ffc8b0; }
#map .mt-slate:hover { background: #fffaf5; }
#map .mt-slate:active { transform: translateY(2px); box-shadow: 0 1px 0 #e0c8b8, inset 0 0 0 2px #ffc8b0; }
#map .mk.hunter { z-index: 4; pointer-events: auto; }
#map .mk.hunter span { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; background: #e63b2e; box-shadow: 0 0 0 2px #fff, 0 2px 5px rgba(0,0,0,.35); }
#map .mk.hunter span svg { width: 8px; height: 12px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
#map .mk.seen { z-index: 4; pointer-events: auto; }
#map .mk.seen span { position: absolute; left: -11px; top: -11px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: rgba(255,250,236,.95); box-shadow: 0 0 0 2px #e63b2e, 0 2px 6px rgba(0,0,0,.3); }
#map .map-confirm { position: absolute; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(28, 24, 20, .35); }
#map .mc-card { width: min(420px, 90vw); padding: 20px 24px 18px; border-radius: 24px; background: #fffaf0; border: 4px solid #fff; box-shadow: 0 20px 50px rgba(0,0,0,.35); text-align: center; color: #3b3b42; }
#map .mc-card h3 { margin: 0 0 8px; font-size: 22px; color: #c0392b; }
#map .mc-card p { margin: 6px 0; font-size: 14px; line-height: 1.4; }
#map .mc-card .mc-small { font-size: 12.5px; color: #8a8478; }
#map .mc-row { display: flex; gap: 10px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
#map .mc-row button { border: 0; border-radius: 999px; padding: 11px 18px; font: 15px/1 var(--round); cursor: pointer; }
#map .mc-yes { background: #3cb44a; color: #fff; box-shadow: 0 3px 0 #23802f; }
#map .mc-no { background: #e9e4d8; color: #3b3b42; box-shadow: 0 3px 0 #c9c2b2; }

/* ---------- the end of a run (ui/gameover.js) ---------- */
#gameover { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
#gameover[hidden] { display: none; }
#gameover .go-fade { position: absolute; inset: 0; background: #14161c; opacity: 0; }
body.go-on #hints, body.go-on #prompt, body.go-on #tally, body.go-on #xh, body.go-on #lockpill, body.go-on #trouble, body.go-on #cal, body.go-on #grabm { opacity: 0 !important; transition: opacity .3s; }
#gameover .go-card { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -46%) scale(.92); opacity: 0; transition: opacity .45s ease, transform .55s cubic-bezier(.3,1.5,.6,1); pointer-events: auto;
  width: min(460px, 90vw); padding: 22px 30px 24px; border-radius: 30px; background: #fffaf0; border: 5px solid #fff; box-shadow: 0 24px 70px rgba(0,0,0,.5), inset 0 -6px 0 rgba(0,0,0,.05); text-align: center; color: #3b3b42; }
#gameover .go-card[hidden] { display: none; }
#gameover .go-card.in { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#gameover .go-icon { font-size: 46px; line-height: 1; margin-top: -48px; width: 76px; height: 76px; margin-left: auto; margin-right: auto; display: grid; place-items: center; border-radius: 50%; background: #fff; box-shadow: 0 6px 16px rgba(0,0,0,.25), 0 0 0 5px var(--goc, #e63b2e); }
#gameover .go-card.caught { --goc: #2a86e6; }
#gameover .go-card.ko { --goc: #8b5bd8; }
#gameover h2 { margin: 12px 0 2px; font-size: 38px; color: var(--goc); text-shadow: 0 3px 0 rgba(0,0,0,.12); letter-spacing: .5px; }
#gameover .go-card.ko h2 { font-size: 31px; }
#gameover .go-sub { margin: 4px 0 2px; font-size: 14px; color: #77777f; }
#gameover .go-when { margin: 10px 0 12px; font-size: 18px; color: #3b3b42; }
#gameover .go-stats { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
#gameover .go-stats span { display: flex; flex-direction: column; align-items: center; min-width: 96px; padding: 8px 10px 9px; border-radius: 16px; background: #f6f1e4; font-size: 12px; color: #6b6b72; }
#gameover .go-stats b { font-size: 28px; line-height: 1.05; color: #2b2b30; }
#gameover .go-forks { display: inline-flex; gap: 3px; margin: 12px 0 0; padding: 4px 10px; border-radius: 999px; background: #3b2f2a; }
#gameover .go-forks svg { display: block; width: 11px; height: 18px; fill: none; stroke: rgba(255,255,255,.25); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
#gameover .go-forks i.on svg { stroke: #ffc61f; }
#gameover .go-back { display: block; margin: 18px auto 0; border: 0; border-radius: 999px; padding: 14px 30px; background: #3cb44a; color: #fff; font: 22px/1 var(--round); cursor: pointer; box-shadow: 0 5px 0 #23802f, 0 10px 20px rgba(0,0,0,.18); transition: transform .12s; }
#gameover .go-back:hover { transform: translateY(-2px) scale(1.03); }
#gameover .go-back:active { transform: translateY(4px); box-shadow: 0 1px 0 #23802f; }
#gameover .go-keys { display: block; margin-top: 10px; font-size: 12px; color: var(--muted); }
#gameover .go-keys .kc { box-shadow: 0 0 0 1.5px #e3d9c2, 0 2px 0 #d3c8b0; }
#gameover .go-stats span { box-shadow: inset 0 0 0 2px #efe6d2; }

/* the title menu: a run still going from last time */
.card.menu .wanted { display: inline-flex; align-items: center; gap: 10px; padding: 4px 6px 4px 6px; border-radius: 999px; background: #fff0ea; box-shadow: inset 0 0 0 2px #ffc8b0; font-size: 15px; color: #8a3a2a; transition: opacity .3s, transform .3s; }
.card.menu .wanted.bye { opacity: 0; transform: scale(.9); }
.card.menu .wanted .wf { display: inline-flex; gap: 2px; padding: 3px 8px; border-radius: 999px; background: #3b2f2a; }
.card.menu .wanted .wf svg { display: block; width: 10px; height: 16px; fill: none; stroke: rgba(255,255,255,.25); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.card.menu .wanted .wf i.on svg { stroke: #ffc61f; }
.card.menu .wanted small { color: #a8705e; font-size: 13px; }
.card.menu .wanted .fresh { pointer-events: auto; cursor: pointer; font-size: 14px; color: #fff; background: #3cb44a; padding: 5px 13px; border-radius: 999px; box-shadow: 0 2px 0 #23802f; transition: transform .12s; }
.card.menu .wanted .fresh:hover { transform: translateY(-1px); }
#map .mk.pl.game.shut .b { filter: grayscale(.7); opacity: .8; }
#map .mk.pl.game .l em.shut { background: #6b6b72; }
#map .mp-games li.shut { opacity: .55; box-shadow: inset 0 0 0 2px #e0dccf; }

/* round 5: someone holding on (grapple.js): three hands and a struggle bar, low in the middle */
#grabm { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); display: flex; align-items: center; gap: 9px; padding: 5px 11px; border-radius: 999px; background: rgba(22, 32, 22, .38); transition: opacity .25s; pointer-events: none; }
#grabm.off { opacity: 0; }
#grabm .hands { display: inline-flex; gap: 4px; }
#grabm .hands i { width: 15px; height: 15px; border-radius: 50% 50% 45% 45%; border: 2px solid rgba(255,255,255,.55); background: transparent; }
#grabm .hands i.on { background: #ffb35c; border-color: #fff; box-shadow: 0 1px 1px rgba(0,0,0,.3); }
#grabm.pinned .hands i.on { background: #ff4d5e; }
#grabm .bar { width: 92px; height: 8px; border-radius: 6px; background: rgba(255,255,255,.22); overflow: hidden; }
#grabm .bar b { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffd23a, #8fe36b); border-radius: 6px; }
#trouble .mel { font-size: 13px; opacity: .7; filter: grayscale(.3); }
#trouble .mel.out { opacity: 1; filter: none; }
/* round 7: small quiet pills by the clock (the battery saver) */
.badge { display: flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; background: rgba(22, 32, 22, .3); color: #fff; font-size: 11px; letter-spacing: .5px; opacity: .7; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.badge .ic { font-style: normal; font-size: 11px; text-shadow: none; }
.badge.solo { position: absolute; right: 14px; bottom: 68px; }

/* round 11: a Mac set to "reduce motion" gets the screens without the looping and sliding bits (the game itself is unchanged) */
@media (prefers-reduced-motion: reduce) {
  #title *, #title, #help, #mg .mg-card, #map, #map .map-sheet, #sleep .st, #sleep .zz, .day.sel * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
