:root {
  --ink: #3a2a3d;
  --ink-soft: #6f5d70;
  --ink-faint: #a2939f;
  --cream: #fffaf1;
  --cream-2: #fff3e0;
  --cream-3: #f7e8d0;
  --line: rgba(90, 60, 80, 0.12);
  --pink: #ff7aa2;
  --lilac: #9b87f5;
  --lilac-2: #8f78f0;
  --mint: #3fbf8a;
  --coin: #f2b233;
  --wood: #b07a4f;
  --vit: #ff6f91;
  --bad: #e5484d;
  --shadow: 0 10px 30px rgba(80, 50, 70, 0.18), 0 2px 6px rgba(80, 50, 70, 0.12);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #fde6c8; color: var(--ink);
  font-family: 'Fredoka', ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', sans-serif; }
body { overscroll-behavior: none; touch-action: none; user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; }
/* Inline icons default to text size; places like the HUD and cost rows size them up. */
.ic { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }
input, select { font: inherit; color: var(--ink); }
#scene { position: fixed; inset: 0; width: 100vw; height: 100dvh; display: block; touch-action: none; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui .agechip, #ui .tabbar, #ui .sheet, #ui .panel, #ui .res, #ui .heart, #ui .helpbtn { pointer-events: auto; }
#ui .modal.on, #ui .scrim.on { pointer-events: auto; }

/* ---------- HUD ---------- */
.hud { position: absolute; top: calc(var(--safe-t) + 10px); left: 10px; right: 10px; display: flex; gap: 8px; align-items: flex-start; pointer-events: none; }
.res-row { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; pointer-events: none; }
.res { background: rgba(255, 250, 241, 0.92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-radius: 999px; padding: 5px 11px 5px 6px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 15px; min-height: 34px; border: 0; }
.res .ic { width: 22px; height: 22px; flex: none; }
.res small { font-weight: 500; color: var(--ink-soft); font-size: 11.5px; margin-left: -2px; }
.res.bump { animation: bump .45s cubic-bezier(.3,1.8,.5,1); }
@keyframes bump { 30% { transform: scale(1.14); } }
.res[hidden] { display: none; }
/* the Timber + Stone toggle: closed, a small chip with two tiny icons; open, the same chip shows both amounts (one compact
   chip, so the top bar never grows a row) */
.res-more { padding: 5px 8px 5px 7px; gap: 3px; cursor: pointer; }
.res-more .mini { display: flex; }
.res-more .mini .ic { width: 16px; height: 16px; }
.res-more .mini .ic + .ic { margin-left: -5px; }
.res-more .vals { display: none; gap: 7px; font-size: 13.5px; }
.res-more .rx { display: flex; align-items: center; gap: 3px; }
.res-more .rx[hidden] { display: none; }
.res-more .rx .ic { width: 18px; height: 18px; }
.res-more i { font-style: normal; font-size: 10px; color: var(--ink-soft); transition: transform .2s; }
.res-more.on { padding-right: 7px; }
.res-more.on .mini { display: none; }
.res-more.on .vals { display: flex; animation: pop-in .2s ease-out; }
.res-more.on i { transform: rotate(180deg); }
@keyframes pop-in { from { transform: scale(.85); opacity: 0; } }
.heart { width: 58px; height: 58px; border-radius: 50%; background: rgba(255, 250, 241, 0.92); box-shadow: var(--shadow); display: grid; place-items: center; position: relative; border: 0; padding: 0; flex: none; }
.heart svg { position: absolute; inset: 4px; width: 50px; height: 50px; transform: rotate(-90deg); }
.heart b { font-size: 13px; font-weight: 700; line-height: 1; }
.heart small { display: block; font-size: 9.5px; color: var(--ink-soft); font-weight: 600; text-align: center; }
.agechip { position: absolute; top: calc(var(--safe-t) + 92px); translate: 0 var(--hud-push, 0px); transition: translate .2s; left: 10px; border: 0; background: rgba(255, 250, 241, 0.85); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); box-shadow: var(--shadow); }
.agechip.ready { background: linear-gradient(90deg, #ffe29a, #ffc2dc); color: var(--ink); animation: glow 1.6s infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 6px rgba(255, 194, 220, .45), var(--shadow); } }

/* ---------- tab bar ---------- */
.tabbar { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-b) + 12px); display: flex; gap: 8px; align-items: center; background: rgba(255, 250, 241, 0.94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 6px; border-radius: 26px; box-shadow: var(--shadow); }
.tab { border: 0; background: transparent; border-radius: 20px; min-width: 64px; height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 600; color: var(--ink-soft); gap: 1px; padding: 0 10px; cursor: pointer; }
.tab svg { width: 22px; height: 22px; }
.tab.on { color: var(--ink); background: var(--cream-2); }
.tab.move { background: linear-gradient(180deg, #ff9ab8, #ff6f91); color: #fff; min-width: 96px; height: 54px; font-size: 13px; border-radius: 22px; box-shadow: 0 6px 16px rgba(255, 111, 145, .35); }
.tab.move svg { width: 24px; height: 24px; }
.tab:active { transform: scale(.95); }

/* ---------- buttons ---------- */
.btn { border: 0; border-radius: 16px; min-height: 48px; padding: 0 18px; font-weight: 600; font-size: 16px; background: var(--cream-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .12s; }
.btn:active { transform: scale(.96); }
.btn.primary { background: linear-gradient(180deg, #b9a7ff, var(--lilac-2)); color: #fff; box-shadow: 0 6px 14px rgba(143, 120, 240, .3); }
.btn.pink { background: linear-gradient(180deg, #ff9ab8, #ff6f91); color: #fff; box-shadow: 0 6px 14px rgba(255, 111, 145, .3); }
.btn.gold { background: linear-gradient(180deg, #ffe29a, #f7b733); color: #5a3d00; box-shadow: 0 6px 14px rgba(247, 183, 51, .3); }
.btn.small { min-height: 38px; font-size: 14px; padding: 0 12px; border-radius: 12px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .45; box-shadow: none; }
.link { border: 0; background: none; color: var(--lilac-2); font-weight: 600; padding: 6px 0; cursor: pointer; }

/* ---------- sheets ---------- */
.scrim { position: absolute; inset: 0; background: rgba(58, 42, 61, .18); opacity: 0; transition: opacity .25s; pointer-events: none; }
.scrim.on { opacity: 1; pointer-events: auto; }
.sheet { position: absolute; left: 8px; right: 8px; bottom: calc(var(--safe-b) + 8px); max-width: 480px; margin: 0 auto; max-height: 74dvh; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
  background: var(--cream); border-radius: 26px; box-shadow: var(--shadow); padding: 16px 18px 18px; transform: translateY(calc(100% + 60px)); transition: transform .35s cubic-bezier(.2,1.2,.4,1); }
.sheet.open { transform: translateY(0); }
.sheet h2 { margin: 0; font-size: 22px; line-height: 1.15; }
.sheet .sub { color: var(--ink-soft); font-size: 14px; margin: 3px 0 0; }
.sheet .close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--cream-2); color: var(--ink-soft); font-size: 18px; cursor: pointer; }
.sheet p { margin: 8px 0; font-size: 14.5px; line-height: 1.4; color: var(--ink-soft); }
.stat { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; margin: 12px 0; padding: 12px 14px; background: var(--cream-2); border-radius: 16px; font-size: 14.5px; }
.stat dt { color: var(--ink-soft); } .stat dd { margin: 0; font-weight: 600; text-align: right; }
.stat .gain { color: var(--mint); }
.cost { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-weight: 600; font-size: 15px; margin: 6px 0 12px; }
.cost span { display: inline-flex; align-items: center; gap: 4px; }
.cost .ic { width: 18px; height: 18px; }
.cost .short { color: var(--bad); }
.row { display: flex; gap: 8px; }
.row .btn { flex: 1; }
.note { font-size: 13.5px; color: var(--ink-soft); background: var(--cream-2); border-radius: 14px; padding: 10px 12px; margin: 10px 0; }
.note.warn { background: #fff0f0; color: #8a3540; }
.levelbar { height: 8px; border-radius: 99px; background: var(--cream-3); overflow: hidden; margin-top: 10px; }
.levelbar i { display: block; height: 100%; background: linear-gradient(90deg, #b9a7ff, #ff9ab8); border-radius: 99px; }
.build-list { display: grid; gap: 8px; margin-top: 12px; }
.build-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 12px 14px; border-radius: 16px; background: var(--cream-2); align-items: center; }
.build-item b { font-size: 16px; } .build-item p { margin: 0; font-size: 13px; grid-column: 1; }
.build-item .cost { margin: 2px 0 0; font-size: 13.5px; grid-column: 1; }
.build-item .btn { grid-row: 1 / span 3; grid-column: 2; }
.build-item.locked { opacity: .55; }
.build-item .fam { grid-column: 1; font-size: 12px; font-weight: 700; color: var(--ink-soft); } .build-item .fam.full { color: #c0605a; }
.research-list { display: grid; gap: 8px; margin-top: 10px; }
.research { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 11px 14px; border-radius: 16px; background: linear-gradient(180deg, #fff6e0, #fdeccb); align-items: center; }
.research b, .research p, .research small { grid-column: 1; }
.research b { font-size: 15.5px; } .research p { margin: 0; font-size: 13px; }
.research.locked, .research.done { grid-template-columns: 1fr; }
.research .cost { margin: 2px 0 0; font-size: 13px; grid-column: 1; }
.research .btn { grid-row: 1 / span 3; grid-column: 2; }
.research small { font-size: 12px; color: var(--ink-soft); grid-column: 1; }
.research.locked { background: var(--cream-2); opacity: .7; }
.research.done { background: #e9f7e4; } .research.done b { color: #3d8a4c; }
.dots { display: flex; gap: 8px; margin: 12px 0; }
.dots i { flex: 1; height: 10px; border-radius: 99px; background: var(--cream-3); }
.dots i.on { background: linear-gradient(90deg, #ffb3cf, #ff6f91); }
.checklist { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 6px; font-size: 14.5px; }
.checklist li { display: flex; gap: 8px; align-items: center; }
.checklist li::before { content: '○'; color: var(--ink-faint); font-weight: 700; }
.checklist li.ok::before { content: '●'; color: var(--mint); }

/* ---------- full-screen panels ---------- */
.panel { position: absolute; inset: 0; background: var(--cream); transform: translateY(100%); transition: transform .38s cubic-bezier(.2,1.1,.4,1); display: flex; flex-direction: column; }
.panel.open { transform: translateY(0); }
.panel header { padding: calc(var(--safe-t) + 14px) 18px 8px; display: flex; align-items: center; gap: 10px; }
.panel header h1 { font-size: 24px; margin: 0; flex: 1; }
.panel .iconbtn { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--cream-2); font-size: 20px; cursor: pointer; display: grid; place-items: center; }
.panel .body { flex: 1; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; padding: 6px 18px calc(var(--safe-b) + 28px); }
.body h3 { font-size: 15px; color: var(--ink-soft); margin: 18px 0 8px; font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 10px; }
.tile { border: 0; border-radius: 20px; background: var(--cream-2); padding: 14px 8px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 600; font-size: 14.5px; cursor: pointer; }
.tile .blob { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; }
.tile .blob svg { width: 30px; height: 30px; }
.tile:active { transform: scale(.96); }
.field { margin: 14px 0; }
.field label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.field .hint { font-size: 12.5px; color: var(--ink-soft); font-weight: 500; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 48px; height: 48px; border-radius: 14px; border: 0; background: var(--cream-2); font-size: 22px; font-weight: 700; cursor: pointer; }
.stepper input { flex: 1; min-width: 0; height: 48px; border-radius: 14px; border: 2px solid var(--line); background: #fff; text-align: center; font-size: 22px; font-weight: 700; }
.stepper .unit { font-weight: 600; color: var(--ink-soft); width: 34px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { border: 0; background: var(--cream-2); border-radius: 999px; padding: 6px 12px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.chip.on { background: var(--ink); color: #fff; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg button { border: 2px solid transparent; border-radius: 16px; background: var(--cream-2); padding: 10px 6px; text-align: center; cursor: pointer; }
.seg button b { display: block; font-size: 15px; }
.seg button span { display: block; font-size: 11.5px; color: var(--ink-soft); margin-top: 2px; line-height: 1.2; }
.seg button.on { border-color: var(--pink); background: #fff0f5; }
.estimate { position: sticky; bottom: 0; background: linear-gradient(180deg, rgba(255,250,241,0), var(--cream) 22%); padding: 18px 0 4px; }
.estimate .big { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.estimate .big b { font-size: 34px; }
.estimate .big span { color: var(--ink-soft); font-weight: 600; }
.estimate .est-note { color: var(--bad); font-size: 13.5px; margin-bottom: 8px; min-height: 18px; }
.history { display: grid; gap: 8px; }
.hist { display: grid; grid-template-columns: 1fr auto; align-items: center; background: var(--cream-2); border-radius: 16px; padding: 10px 12px; gap: 2px 8px; }
.hist b { font-size: 15px; } .hist small { color: var(--ink-soft); font-size: 12.5px; }
.hist .pts { font-weight: 700; color: var(--vit); text-align: right; }
.hist .del { grid-column: 2; border: 0; background: none; color: var(--ink-faint); font-size: 12px; text-decoration: underline; cursor: pointer; padding: 0; }
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.res-card { border: 0; background: var(--cream-2); border-radius: 20px; padding: 6px 6px 10px; display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.res-card img { width: 92px; height: 101px; }
.res-card b { font-size: 14px; text-align: center; line-height: 1.15; }
.res-card small { font-size: 11.5px; color: var(--ink-soft); }
.res-card.empty { border: 2px dashed var(--cream-3); background: transparent; justify-content: center; color: var(--ink-faint); font-weight: 600; font-size: 13px; min-height: 150px; }

/* resident card */
.rcard { display: grid; grid-template-columns: 112px 1fr; gap: 4px 14px; }
.rcard .portrait { grid-row: 1 / span 3; width: 112px; height: 124px; border-radius: 20px; background: radial-gradient(ellipse at 50% 30%, #fffdf6, #f3ead6); }
.rcard h2 { padding-right: 30px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag { font-size: 12.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--cream-2); color: var(--ink-soft); }
.tag.shiny { background: linear-gradient(90deg, #ffe29a, #ffb3d9, #b9e6ff); color: #5a3d00; }
.facts { margin: 6px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; font-size: 14px; }
.facts dt { color: var(--ink-soft); } .facts dd { margin: 0; font-weight: 600; }

/* ---------- modal cards ---------- */
.modal { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(58, 42, 61, .28); opacity: 0; pointer-events: none; transition: opacity .25s; }
.modal.on { opacity: 1; pointer-events: auto; }
.mcard { max-height: calc(100dvh - 40px); overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; width: min(380px, 100%); background: var(--cream); border-radius: 28px; box-shadow: var(--shadow); padding: 22px 20px 18px; text-align: center; transform: scale(.9) translateY(12px); transition: transform .35s cubic-bezier(.2,1.5,.4,1); }
.modal.on .mcard { transform: none; }
.mcard h2 { margin: 6px 0 4px; font-size: 26px; }
.mcard p { color: var(--ink-soft); margin: 6px 0 14px; line-height: 1.4; }
.mcard canvas, .mcard img.pic { width: 150px; height: 165px; display: block; margin: -6px auto 0; }
.mcard .btn + .btn { margin-top: 8px; }
.receipt { text-align: left; background: #fff; border-radius: 18px; padding: 12px 14px; margin: 10px 0 14px; box-shadow: inset 0 0 0 1.5px var(--line); }
.receipt .line { display: grid; grid-template-columns: 1fr auto; gap: 6px; font-size: 14px; padding: 5px 0; opacity: 0; transform: translateY(6px); transition: all .3s; }
.receipt .line.in { opacity: 1; transform: none; }
.receipt .line small { display: block; color: var(--ink-faint); font-size: 11.5px; }
.receipt .line b { font-weight: 700; }
.receipt .line.total { border-top: 2px dashed var(--line); margin-top: 6px; padding-top: 10px; font-size: 17px; }
.receipt .line.total b { color: var(--vit); font-size: 24px; }
.receipt .line .neg { color: var(--ink-soft); }
.gains { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; font-weight: 600; margin-bottom: 14px; font-size: 15px; }
.gains span { display: inline-flex; gap: 5px; align-items: center; }
.gains .ic { width: 20px; height: 20px; }
.big-num { font-size: 56px; font-weight: 700; color: var(--vit); line-height: 1; margin: 4px 0; }
.shimmer { height: 12px; border-radius: 99px; background: linear-gradient(90deg, var(--cream-3), #ffd6e4, var(--cream-3)); background-size: 200% 100%; animation: sh 1s linear infinite; margin: 14px 0; }
@keyframes sh { to { background-position: -200% 0; } }

.orb { position: absolute; width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 20%, #ff9ec0 45%, #ff4f8e 100%); box-shadow: 0 0 14px 4px rgba(255, 111, 160, .55); pointer-events: none !important; }
.float { position: absolute; font-weight: 700; font-size: 18px; pointer-events: none !important; text-shadow: 0 2px 0 #fff, 0 0 8px #fff; animation: rise 1.6s ease-out forwards; }
@keyframes rise { from { transform: translate(-50%, 0); opacity: 1; } to { transform: translate(-50%, -60px); opacity: 0; } }

.toast { position: absolute; left: 50%; top: calc(var(--safe-t) + 164px); transform: translate(-50%, -20px); opacity: 0; background: var(--ink); color: #fff; border-radius: 16px; padding: 9px 16px; font-weight: 600; font-size: 14px; transition: all .3s; pointer-events: none !important; max-width: min(92vw, 420px); text-align: center; }
.toast.show { opacity: .94; transform: translate(-50%, 0); }
.toast.bad { background: #8a3540; }

/* ---------- the loading screen: a real progress bar, a slime hopping along it (CSS only: it keeps going while the phone is
   busy building the camp), and tips that change every few seconds ---------- */
/* 1 Nov: the loading screen is a picture (public/art/: load-tall.webp for portrait, load-wide.webp for landscape, both with
   the Pepplets logo in the art). A tiny blurred copy is inlined in index.html so the screen is never blank, and the full
   picture fades in over it. The bar, step and tip sit at the bottom, over the picture's cream fade. */
#loading { position: fixed; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; overflow: hidden; background: #fff2e0; transition: opacity .5s; z-index: 100; padding: 0 20px calc(22px + var(--safe-b)); }
#loading.gone { opacity: 0; pointer-events: none; }
.ld-art { position: absolute; inset: 0 0 auto 0; pointer-events: none; }
.ld-art img { display: block; width: 100%; height: auto; }   /* portrait: fit the width, pinned to the top; cream fills below */
.ld-ph img { filter: blur(14px); transform: scale(1.06); }
.ld-full { opacity: 0; transition: opacity .45s; }
.ld-full.in { opacity: 1; }
.ld-card { position: relative; z-index: 1; width: min(340px, 100%); display: flex; flex-direction: column; align-items: center; text-align: center; }
.ld-card::before { content: ''; position: absolute; left: -50vw; right: -50vw; top: -36px; bottom: calc(-22px - var(--safe-b)); background: linear-gradient(rgba(255, 242, 224, 0), #fff2e0 36px); z-index: -1; }   /* a soft cream backing, for screens where the art reaches the bar */
.ld-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }   /* the logo is in the picture: the title stays for screen readers */
.ld-sub { font-weight: 600; font-size: 13px; color: var(--ink-faint); margin-bottom: 58px; }   /* room for the Pepplet hopping on the bar */
@media (orientation: portrait) {
  /* Jack, 1 Nov: the picture as big as it can be. It's sized between the screen's width and 1.35× that (so the logo, which
     spans the middle ~70%, is never cut), grows with the screen's height, and is centred and pinned to the top.
     The bar, step and tip sit at the very bottom and overlap the picture's cream fade (a soft cream backing behind them). */
  .ld-art { left: 50%; right: auto; width: clamp(100vw, (100dvh - 217px) / 1.26, 135vw); transform: translateX(-50%); }   /* sized so the art's cream fade (its bottom 16%) lands where the bar strip starts: 217px is the strip's height */
  .ld-sub { order: 9; margin: 8px 0 0; }   /* the tagline moves under the tip, so the bar can sit lower */
  .ld-bar { margin-top: 44px; }   /* room for the Pepplet hopping on the bar */
  .ld-card::before { top: -70px; background: linear-gradient(rgba(255, 242, 224, 0), rgba(255, 242, 224, .92) 60px, #fff2e0 90px); }
}
@media (orientation: portrait) and (max-height: 760px) {   /* shorter phones: a compact strip, so the front Pepplet's face stays clear */
  #loading { padding-bottom: calc(14px + var(--safe-b)); }
  .ld-art { width: clamp(100vw, (100dvh - 139px) / 1.26, 135vw); }   /* 139px: the compact strip */
  .ld-sub { display: none; } .ld-bar { margin-top: 40px; } .ld-step { margin-top: 8px; font-size: 13px; }
  .ld-tip { margin-top: 6px; min-height: 2.8em; font-size: 14px; line-height: 1.38; }
  .ld-card::before { top: -46px; bottom: calc(-14px - var(--safe-b)); background: linear-gradient(rgba(255, 242, 224, 0), rgba(255, 242, 224, .92) 40px, #fff2e0 60px); }
}
@media (orientation: portrait) and (min-aspect-ratio: 13/20) {   /* tablets: the picture may be narrower than the screen, edges faded into the cream */
  .ld-art { width: clamp(60vw, (100dvh - 217px) / 1.26, 135vw); -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
}
.ld-bar { position: relative; width: 100%; height: 14px; border-radius: 99px; background: #f3dcbd; box-shadow: inset 0 2px 3px rgba(120, 80, 60, .12); }
.ld-fill { position: absolute; inset: 0; border-radius: 99px; background: linear-gradient(90deg, #9fe3c4, #7fd3b3 40%, #ff9ab8); transform: scaleX(.02); transform-origin: 0 50%; will-change: transform; }
.ld-runner { position: absolute; left: 0; right: 0; bottom: 6px; height: 0; transform: translateX(2%); will-change: transform; pointer-events: none; }
.ld-slime { position: absolute; left: -22px; bottom: 0; width: 44px; height: 38px; animation: ld-hop .62s infinite cubic-bezier(.3,.9,.5,1); transform-origin: 50% 100%; will-change: transform; }
.ld-slime::before { content: ''; position: absolute; inset: 0; border-radius: 50% 50% 44% 44% / 62% 62% 38% 38%; background: radial-gradient(circle at 34% 28%, #fff 0 9%, #b9f0d6 11%, #7fd3b3 70%, #5cbf9a 100%); box-shadow: inset 0 -4px 0 rgba(40, 120, 90, .18); }
.ld-slime::after { content: ''; position: absolute; left: 13px; top: 15px; width: 4px; height: 6px; border-radius: 3px; background: #3a2a3d; box-shadow: 13px 0 0 #3a2a3d; }
@keyframes ld-hop { 0%,100% { transform: translateY(0) scale(1.12, .86); } 45% { transform: translateY(-18px) scale(.93, 1.08); } 75% { transform: translateY(0) scale(1.08, .9); } }
.ld-step { margin: 16px 0 0; font-weight: 600; font-size: 14px; color: var(--ink-soft); min-height: 1.3em; }
.ld-tip { margin: 14px 0 0; min-height: 3.6em; max-width: 300px; font-size: 15px; line-height: 1.4; color: var(--ink); opacity: 0; transform: translateY(4px); transition: opacity .35s, transform .35s; }
.ld-tip.on { opacity: .92; transform: none; }
@media (orientation: landscape) {   /* the wide picture fills the screen, logo kept in view at the top */
  .ld-art { height: calc(100% - var(--ld-band) - var(--safe-b)); -webkit-mask-image: linear-gradient(#000 86%, transparent); mask-image: linear-gradient(#000 86%, transparent); }
  .ld-art img { height: 100%; object-fit: cover; object-position: 50% 18%; }   /* the picture stops above the bar, so the Pepplets' faces aren't covered */
  #loading { --ld-band: 190px; } .ld-card::before { display: none; }
  .ld-card { width: min(440px, 100%); }
}
@media (orientation: landscape) and (max-height: 520px) {
  #loading { padding-bottom: calc(12px + var(--safe-b)); }
  .ld-sub { display: none; } .ld-card { width: min(560px, 100%); } .ld-step { margin-top: 6px; font-size: 13px; } .ld-tip { margin-top: 2px; min-height: 1.4em; max-width: 560px; font-size: 13px; line-height: 1.35; }
  #loading { --ld-band: 64px; }
}
.err { position: fixed; inset: auto 12px 12px 12px; background: #fff; border-radius: 16px; padding: 14px; box-shadow: var(--shadow); font-size: 14px; z-index: 9; }

@media (min-width: 700px) {
  .sheet { left: auto; right: 20px; bottom: 20px; width: 440px; }
  .panel { left: auto; width: 480px; right: 0; box-shadow: var(--shadow); }
}
@media (prefers-reduced-motion: reduce) {
  .sheet, .panel, .toast, .modal, .mcard { transition: none; }
  .ld-slime, .agechip.ready { animation: none; }
  .ld-fill, .ld-runner, .ld-tip { transition: none !important; }
}

/* ---------- landscape phones ---------- */
@media (orientation: landscape) and (max-height: 560px) {
  .hud { top: 8px; left: calc(var(--safe-l) + 10px); right: calc(var(--safe-r) + 10px); }
  .res { min-height: 30px; font-size: 14px; padding: 3px 10px 3px 5px; }
  .res .ic { width: 20px; height: 20px; }
  .heart { width: 50px; height: 50px; }
  .heart svg { inset: 3px; width: 44px; height: 44px; }
  .agechip { top: 48px !important; left: calc(var(--safe-l) + 10px); font-size: 12px; padding: 4px 10px; }
  .agechip.goal { top: 78px !important; }
  .tabbar { left: calc(var(--safe-l) + 10px); transform: none; bottom: 8px; padding: 4px; gap: 4px; border-radius: 22px; }
  .tab { height: 42px; min-width: 56px; font-size: 11px; }
  .tab.move { height: 46px; min-width: 84px; }
  .toast { top: 60px; }
  .sheet { top: 8px; bottom: 8px; right: calc(var(--safe-r) + 8px); left: auto; width: min(400px, 52vw); max-height: none; margin: 0;
    transform: translateX(calc(100% + 40px)); }
  .sheet.open { transform: translateX(0); }
  .panel { left: auto; right: 0; width: min(540px, 66vw); box-shadow: var(--shadow); transform: translateX(100%); }
  .panel.open { transform: translateX(0); }
  .panel header { padding: 10px calc(var(--safe-r) + 16px) 4px 18px; }
  .panel header h1 { font-size: 20px; }
  .panel .body { padding: 4px calc(var(--safe-r) + 16px) 20px 18px; }
  .modal { padding: 10px; }
  .mcard { max-height: calc(100dvh - 20px); overflow-y: auto; padding: 14px 18px; width: min(460px, 100%); }
  .mcard canvas, .mcard img.pic { width: 96px; height: 106px; margin-top: -4px; }
  .mcard h2 { font-size: 22px; margin: 2px 0; }
  .mcard p { margin: 4px 0 10px; }
  .receipt { margin: 6px 0 10px; padding: 8px 12px; }
  .receipt .line { padding: 3px 0; }
  .gains { margin-bottom: 10px; }
  .big-num { font-size: 40px; }
  .field { margin: 10px 0; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
  .tile { padding: 10px 6px 8px; }
  .tile .blob { width: 44px; height: 44px; }
  .estimate { position: static; padding-top: 8px; }
  .estimate .big b { font-size: 28px; }
}
.movebar { position: absolute; left: 50%; top: calc(var(--safe-t) + 60px); transform: translate(-50%, -20px); opacity: 0; pointer-events: none; display: flex; gap: 10px; align-items: center; background: var(--ink); color: #fff; border-radius: 18px; padding: 8px 8px 8px 16px; font-weight: 600; font-size: 14px; transition: all .25s; white-space: nowrap; box-shadow: var(--shadow); }
.movebar.on { opacity: .96; transform: translate(-50%, 0); pointer-events: auto; }
.movebar .btn { min-height: 34px; color: var(--ink); }

/* ---------- rarity ---------- */
:root { --r-common: #8d9a8f; --r-rare: #3f8fd8; --r-epic: #a052e0; --r-legendary: #e39a00; --ess: #8f78f0; }
.rtag { display: inline-flex; align-items: center; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; color: #fff; background: var(--r-common); }
.rtag.r-rare { background: var(--r-rare); }
.rtag.r-epic { background: linear-gradient(90deg, #a052e0, #e05ab4); }
.rtag.r-legendary { background: linear-gradient(90deg, #f2b233, #ff8a3d); box-shadow: 0 0 0 2px #ffe7a8; }
.rtag.unk, .tag.unk { background: var(--cream-3) !important; color: var(--ink-faint) !important; box-shadow: none; }
.res-card { position: relative; border: 2px solid transparent; }
.res-card.r-rare { border-color: color-mix(in srgb, var(--r-rare) 55%, transparent); background: #eef5ff; }
.res-card.r-epic { border-color: color-mix(in srgb, var(--r-epic) 55%, transparent); background: #f6eeff; }
.res-card.r-legendary { border-color: #f2b233; background: linear-gradient(180deg, #fff6d8, #ffe9c2); box-shadow: 0 0 0 3px rgba(242, 178, 51, .18); }
.res-card small { font-weight: 600; }
.res-card.r-rare small { color: var(--r-rare); } .res-card.r-epic small { color: var(--r-epic); } .res-card.r-legendary small { color: #b87400; }
.res-card .lk { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; background: rgba(255,255,255,.9); color: var(--ink-soft); display: grid; place-items: center; }
.res-card .lk svg { width: 12px; height: 12px; }
.res-grid.pick { margin: 6px 0 12px; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); max-height: 46dvh; overflow-y: auto; }
.res-grid.pick img { width: 74px; height: 81px; }
.res-grid.five { grid-template-columns: repeat(3, 1fr); }
.res-grid.gal { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.res-grid.gal img { width: 80px; height: 88px; }

/* ---------- Summoning Stone ---------- */
.odds-wrap { margin: 12px 0 4px; }
.odds { display: flex; height: 14px; border-radius: 99px; overflow: hidden; gap: 2px; background: var(--cream-3); }
.odds i { display: block; min-width: 4px; }
.odds i.r-common { background: var(--r-common); } .odds i.r-rare { background: var(--r-rare); }
.odds i.r-epic { background: var(--r-epic); } .odds i.r-legendary { background: var(--r-legendary); }
.odds.dim { opacity: .55; height: 9px; }
.odds-key { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.odds-key span { display: inline-flex; align-items: center; gap: 5px; }
.odds-key b { width: 9px; height: 9px; border-radius: 50%; background: var(--r-common); }
.odds-key .r-rare b { background: var(--r-rare); } .odds-key .r-epic b { background: var(--r-epic); } .odds-key .r-legendary b { background: var(--r-legendary); }
.stat.compact { font-size: 13.5px; padding: 10px 12px; }
.sheet .sub.small, .sub.small { font-size: 12.5px; margin-top: 6px; }
.sub a, .sheet a { color: var(--lilac-2); font-weight: 600; }
h3.sec { margin: 20px 0 2px; font-size: 17px; }
.gift { display: grid; gap: 4px; padding: 12px 14px; margin: 10px 0; border-radius: 18px; background: linear-gradient(135deg, #fff3c4, #ffe0ef); }
.gift b { font-size: 16px; } .gift span { font-size: 13.5px; color: var(--ink-soft); }
.gift .btn { margin-top: 6px; }

/* ---------- resident card ---------- */
.rcard .where { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; margin-top: 6px; }
.rcard .portrait { background: radial-gradient(ellipse at 50% 30%, #fffdf6, #f3ead6); }
.rc-rare .portrait { background: radial-gradient(ellipse at 50% 30%, #f6faff, #d9e9ff); }
.rc-epic .portrait { background: radial-gradient(ellipse at 50% 30%, #fbf6ff, #ead8ff); }
.rc-legendary .portrait { background: radial-gradient(ellipse at 50% 30%, #fffbe8, #ffdf94); }
.lockic { display: inline-grid; vertical-align: middle; width: 20px; height: 20px; color: var(--ink-faint); }
.lockic svg { width: 16px; height: 16px; }
.sig { display: grid; gap: 2px; margin: 10px 0 0; padding: 10px 12px; border-radius: 14px; background: linear-gradient(90deg, #fff1c9, #ffe3cf); font-size: 13.5px; }
.sig span { color: var(--ink-soft); }
.stats3 { display: grid; gap: 6px; margin: 12px 0 4px; }
.sbar { display: grid; grid-template-columns: 52px 1fr 26px; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.sbar i { height: 9px; border-radius: 99px; background: var(--cream-3); overflow: hidden; }
.sbar b { display: block; height: 100%; border-radius: 99px; background: var(--r-common); }
.sbar b.r-rare { background: var(--r-rare); } .sbar b.r-epic { background: var(--r-epic); } .sbar b.r-legendary { background: var(--r-legendary); }
.sbar em { font-style: normal; color: var(--ink); text-align: right; }
.facts dd .q { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: var(--cream-3); color: var(--ink-soft); font-size: 11px; text-decoration: none; vertical-align: 1px; }
.facts dd.muted { color: var(--ink-faint); font-weight: 500; }
.row.wrap { flex-wrap: wrap; margin-top: 12px; }
.row.wrap .btn { flex: 1 1 auto; }
.btn .ic, .btn svg { width: 16px; height: 16px; }
.btn.danger { color: #a33a4a; }
.legend-card .pic { margin: 6px auto !important; }
.legend-card .rtag { margin-top: 4px; }

/* ---------- Slimes panel ---------- */
.ess-chip { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 15px; padding: 5px 10px; border-radius: 99px; background: #efe9ff; color: #5b47c9; }
.ess-chip .ic { width: 18px; height: 18px; }
.segs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 16px; background: var(--cream-2); position: sticky; top: 0; z-index: 2; }
.segs button { border: 0; background: transparent; border-radius: 12px; min-height: 40px; font-weight: 600; font-size: 14px; color: var(--ink-soft); cursor: pointer; }
.segs button small { font-weight: 500; font-size: 12px; opacity: .8; }
.segs button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 6px rgba(80,50,70,.12); }
.body h3 small { font-weight: 500; color: var(--ink-faint); margin-left: 4px; }
.dex-top { margin-top: 12px; }
.rar-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.dex-legs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.dex-leg { display: flex; flex-direction: column; align-items: center; padding: 4px 2px 8px; border-radius: 16px; background: linear-gradient(180deg, #fff6d8, #ffe9c2); text-align: center; }
.dex-leg img { width: 64px; height: 70px; }
.dex-leg b { font-size: 12.5px; } .dex-leg small { font-size: 10.5px; color: var(--ink-soft); line-height: 1.15; }
.dex-leg.unk { background: var(--cream-2); }
.dex-leg.unk img { filter: brightness(0) opacity(.22); }
.dex-leg.unk b, .dex-leg.unk small { color: var(--ink-faint); }
.sws { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px 6px; }
.sw { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--ink-soft); text-align: center; line-height: 1.1; }
.sw i { width: 34px; height: 30px; border-radius: 50% 50% 44% 44% / 60% 60% 40% 40%; box-shadow: inset 0 -4px 0 rgba(0,0,0,.08); }
.sw.unk i { background: var(--cream-3); box-shadow: none; }
.sw.unk em { color: var(--ink-faint); }
.sw em { font-style: normal; }
.chip.on-soft { background: #e9f7e4; color: #3d8a4c; }
.chip.unk { color: var(--ink-faint); min-width: 30px; text-align: center; }

/* ---------- Guide ---------- */
details { background: var(--cream-2); border-radius: 16px; margin: 8px 0; }
details summary { padding: 13px 14px; font-weight: 600; font-size: 16px; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: '+'; color: var(--ink-faint); font-weight: 700; }
details[open] summary::after { content: '−'; }
.gbody { padding: 0 14px 12px; font-size: 14.5px; line-height: 1.45; color: var(--ink-soft); }
.gbody p { margin: 0 0 8px; } .gbody ul { margin: 0 0 8px; padding-left: 18px; } .gbody li { margin: 3px 0; }
.gbody b { color: var(--ink); }
.gbody h4 { margin: 10px 0 4px; font-size: 13.5px; color: var(--ink); }
.tscroll { overflow-x: auto; }
.gt { border-collapse: collapse; width: 100%; font-size: 13px; margin: 6px 0 10px; }
.gt th, .gt td { padding: 5px 6px; text-align: left; border-bottom: 1px solid var(--line); }
.gt th { color: var(--ink-faint); font-weight: 600; font-size: 12px; }
.odds-t td { text-align: right; font-variant-numeric: tabular-nums; }
.odds-t td:first-child, .odds-t td:nth-child(2), .odds-t th:first-child, .odds-t th:nth-child(2) { text-align: left; }
.odds-t .r-rare { color: var(--r-rare); } .odds-t .r-epic { color: var(--r-epic); } .odds-t .r-legendary { color: #b87400; font-weight: 700; }

/* tab bar fits five tabs on narrow phones */
@media (max-width: 420px) {
  .tabbar { gap: 2px; padding: 5px; }
  .tab { min-width: 54px; padding: 0 6px; font-size: 11px; }
  .tab.move { min-width: 78px; }
}

/* recovery code */
.reccode { display: grid; gap: 4px; justify-items: start; margin: 10px 0; padding: 12px 14px; border-radius: 16px; background: linear-gradient(135deg, #efe9ff, #ffe9f2); }
.reccode span { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.reccode b { font-size: 21px; letter-spacing: 1.5px; font-variant-numeric: tabular-nums; user-select: all; -webkit-user-select: all; }
.reccode small { font-size: 12.5px; color: var(--ink-soft); line-height: 1.35; }

/* daily steps */
.steps-card { background: var(--cream-2); border-radius: 20px; padding: 14px; margin: 4px 0 6px; }
.steps-head { display: flex; gap: 10px; align-items: center; }
.steps-head b { font-size: 17px; display: block; }
.steps-head small { color: var(--ink-soft); font-size: 13px; line-height: 1.35; display: block; }
.steps-head .icon, .gains .icon { vertical-align: -2px; }
.steps-card .foot { width: 44px; height: 44px; flex: none; border-radius: 50%; background: #ffe1ea; display: grid; place-items: center; }
.steps-card .foot svg { width: 26px; height: 26px; }
.steps-bar { height: 12px; border-radius: 999px; background: #fff; margin: 12px 0 6px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.steps-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #ffb3c8, var(--pink)); transition: width .5s; }
.steps-bar.met i { background: linear-gradient(90deg, #8fe0b8, var(--mint)); }
.steps-today { font-size: 14px; color: var(--ink-soft); }
.steps-today b { color: var(--ink); font-size: 16px; }
.steps-card .stepper input { background: #fff; }
.steps-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0 6px; min-height: 40px; font-size: 14px; }
.steps-card .hint { font-size: 12.5px; color: var(--ink-soft); }
.steps-card .row-btns { display: flex; gap: 8px; }
.steps-card .btn:not(.pink) { background: #fff; }
.steps-card .stepper button, .steps-card .chip:not(.on) { background: #fff; }

.orb.coin { background: radial-gradient(circle at 35% 30%, #fff 0 18%, #ffe27a 42%, #f2a91f 100%); box-shadow: 0 0 10px 3px rgba(255, 196, 60, .5); }
.orb.log { border-radius: 6px; width: 20px; height: 12px; background: linear-gradient(90deg, #a8673a 70%, #e8b878 70%); box-shadow: 0 0 8px 2px rgba(168, 103, 58, .35); }

/* ---------- Racing Paddock page ---------- */
.pd-tix { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; background: var(--cream-2); border-radius: 16px; padding: 8px 12px; margin-bottom: 8px; }
.pd-tix .tix { grid-row: span 2; display: flex; gap: 4px; }
.pd-tix .tix i { width: 18px; height: 26px; border-radius: 5px; background: var(--cream-3); border: 2px dashed rgba(90, 60, 80, .2); }
.pd-tix .tix i.on { background: linear-gradient(160deg, #ffd166, #ff9f43); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(240, 140, 40, .35); }
.pd-tix b { font-size: 15px; } .pd-tix small { color: var(--ink-soft); font-size: 12.5px; }
.pd-cups { margin: 0 0 8px; } .pd-cups small { opacity: .7; font-weight: 500; font-size: 11px; }
.pd-grades { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; padding: 4px; border-radius: 16px; background: var(--cream-2); margin-bottom: 8px; }
.pd-grades button { border: 0; background: transparent; border-radius: 12px; padding: 8px 4px; font: inherit; font-weight: 700; font-size: 14px; color: var(--ink-soft); display: inline-flex; gap: 4px; align-items: center; justify-content: center; cursor: pointer; }
.pd-grades button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 6px rgba(80, 50, 70, .12); }
.pd-grades button.lk { color: var(--ink-faint); } .pd-grades button svg { width: 14px; height: 14px; }
.pd-course { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 10px 2px 6px; }
.pd-course b { font-size: 17px; } .pd-course span { font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.pd-field { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pd-opp, .pd-you { display: flex; gap: 8px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 6px 8px; min-width: 0; }
.pd-opp img { width: 40px; height: 44px; object-fit: contain; flex: none; }
.pd-opp div, .pd-you div { min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 13px; }
.pd-opp b { font-size: 13.5px; } .pd-opp .rtag { font-size: 10px; padding: 1px 6px; align-self: flex-start; }
.pd-opp small, .pd-you small { color: var(--ink-soft); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-st { display: flex; gap: 6px; font-size: 11.5px; color: var(--ink-soft); font-weight: 600; }
.pd-st .lean { color: var(--ink); background: #ffe9a8; border-radius: 6px; padding: 0 4px; }
.pd-you { margin-top: 8px; border: 2px solid #ffc2d3; background: #fff7fa; padding: 8px 10px; }
.pd-you img { width: 58px; height: 64px; object-fit: contain; flex: none; }
.pd-you div { flex: 1; } .pd-you b { font-size: 16px; } .pd-you .rtag { font-size: 10.5px; padding: 1px 7px; }
.pd-chance { align-self: flex-start; margin-top: 3px; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--cream-3); color: var(--ink-soft); }
.pd-chance.fav { background: #e2f6e7; color: #2f8a52; } .pd-chance.shot { background: #e6f0ff; color: #3166b8; } .pd-chance.out { background: #fff1d6; color: #b07413; } .pd-chance.long { background: #f3e9f1; color: #8d5a80; }
.pd-prizes { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; margin: 10px 0; font-size: 13.5px; }
.pd-prizes span { display: inline-flex; gap: 4px; align-items: center; } .pd-prizes .ic { width: 16px; height: 16px; }
@media (max-width: 360px) { .pd-field { grid-template-columns: 1fr; } }

/* ---------- the race ---------- */
#ui.racing .tabbar, #ui.racing .agechip, #ui.racing .heart, #ui.racing .movebar { display: none !important; }
.race-ov { position: absolute; inset: 0; pointer-events: auto; touch-action: none; user-select: none; -webkit-user-select: none; }
.race-top { position: absolute; top: calc(var(--safe-t) + 62px); left: 50%; transform: translateX(-50%); background: rgba(255, 250, 241, .9); border-radius: 18px; padding: 6px 14px; text-align: center; box-shadow: var(--shadow); white-space: nowrap; }
.race-top b { display: block; font-size: 16px; } .race-top span { font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.race-count { position: absolute; top: 38%; left: 50%; transform: translate(-50%, -50%); font-size: 96px; font-weight: 700; color: #fff; text-shadow: 0 4px 0 #ff6f91, 0 8px 24px rgba(80, 50, 70, .35); pointer-events: none; }
.race-count.go { color: #ffd166; text-shadow: 0 4px 0 #e0960f, 0 8px 24px rgba(80, 50, 70, .35); }
.race-count.pop { animation: racepop .6s ease-out; }
@keyframes racepop { 0% { transform: translate(-50%, -50%) scale(.4); opacity: 0; } 35% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1); } }
.race-bar { position: absolute; left: 16px; right: 16px; bottom: calc(var(--safe-b) + 64px); display: flex; align-items: center; gap: 10px; background: rgba(255, 250, 241, .92); border-radius: 18px; padding: 10px 14px; box-shadow: var(--shadow); }
.race-track { position: relative; flex: 1; height: 8px; border-radius: 4px; background: var(--cream-3); margin: 0 6px; }
.race-track em { position: absolute; right: -4px; top: -6px; width: 8px; height: 20px; border-radius: 2px; background: repeating-linear-gradient(0deg, #3a2a3d 0 4px, #fff 4px 8px); }
.race-track i { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #b9a9b6; border: 2px solid #fff; left: 0; transition: left .1s linear; }
.race-track i.me { width: 18px; height: 18px; margin: -9px 0 0 -9px; background: var(--pink); z-index: 2; box-shadow: 0 0 0 3px rgba(255, 122, 162, .3); }
.race-bar b { min-width: 38px; text-align: right; font-size: 18px; }
.race-foot { position: absolute; left: 16px; right: 16px; bottom: calc(var(--safe-b) + 14px); display: flex; justify-content: space-between; align-items: center; }
.race-foot span { background: rgba(58, 42, 61, .55); color: #fff; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; }
.race-ov.done .race-bar, .race-ov.done .race-foot { display: none; }
.race-res .big-num { font-size: 48px; margin-bottom: 0; }
.race-list { list-style: none; margin: 8px 0 12px; padding: 0; text-align: left; font-size: 14px; }
.race-list li { display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: 10px; }
.race-list li span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; background: var(--cream-2); flex: none; }
.race-list li:nth-child(1) span { background: #ffd166; } .race-list li:nth-child(2) span { background: #d9dde6; } .race-list li:nth-child(3) span { background: #e8b88a; }
.race-list li div { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .race-list li small { color: var(--ink-faint); }
.race-list li em { font-style: normal; color: var(--ink-soft); font-size: 12.5px; }
.race-list li.me { background: #fff0f5; }
@media (orientation: landscape) and (max-height: 560px) {
  .race-top { top: 52px; } .race-count { font-size: 72px; }
  .race-bar { left: auto; right: calc(var(--safe-r) + 12px); width: 46%; bottom: 10px; padding: 7px 12px; }
  .race-foot { left: calc(var(--safe-l) + 12px); right: auto; bottom: 12px; gap: 8px; }
}
.race-foot [data-skip] { visibility: hidden; } .race-ov.skip-ok .race-foot [data-skip] { visibility: visible; }
.race-say { position: absolute; top: calc(var(--safe-t) + 118px); left: 50%; transform: translate(-50%, -8px); max-width: min(92vw, 460px); background: var(--ink); color: #fff; font-weight: 600; font-size: 15px; padding: 8px 16px; border-radius: 16px; text-align: center; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; }
.race-say.on { opacity: 1; transform: translate(-50%, 0); }
.race-say.mine { background: var(--pink); }
.race-ov.slowmo::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 90px 30px rgba(255, 250, 241, .55); }
.race-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.race-flash.on { animation: raceflash .5s ease-out; }
@keyframes raceflash { 0% { opacity: .9; } 100% { opacity: 0; } }
.race-photo { position: absolute; right: 14px; top: 34%; pointer-events: none; opacity: 0; transform: rotate(6deg) scale(.6); transition: opacity .3s, transform .35s cubic-bezier(.3, 1.4, .5, 1); }
.race-photo.on { opacity: 1; transform: rotate(-4deg) scale(1); }
.race-photo div { background: #fff; padding: 6px 6px 4px; border-radius: 6px; box-shadow: var(--shadow); width: min(42vw, 220px); }
.race-photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 3px; }
.race-photo b { display: block; text-align: center; font-size: 13px; margin-top: 3px; }
@media (orientation: landscape) and (max-height: 560px) { .race-say { top: 104px; font-size: 14px; } .race-photo { top: 18%; } }
.shelf { background: linear-gradient(#f6e6cf, #f1dcbd); border-radius: 16px; padding: 6px 10px; box-shadow: inset 0 -6px 0 #d9b98a; }
.shelf-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 3px solid #d9b98a; }
.shelf-row:last-child { border-bottom: 0; }
.shelf-row > span { width: 78px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.shelf-row > div { display: flex; gap: 10px; flex: 1; }
.shelf-row i { display: flex; flex-direction: column; align-items: center; font-style: normal; }
.shelf-row i small { font-size: 10.5px; color: var(--ink-faint); }
.shelf-row .tro { width: 30px; height: 30px; } .shelf-row .tro.on { filter: drop-shadow(0 2px 2px rgba(150, 90, 20, .35)); }
.shelf-row.lk { opacity: .5; } .shelf-row em { font-size: 11px; color: var(--ink-faint); font-style: normal; }
.race-hist { list-style: none; padding: 0; margin: 4px 0 0; font-size: 13px; }
.race-hist li { display: flex; gap: 8px; align-items: center; padding: 5px 2px; border-bottom: 1px solid var(--line); }
.race-hist li b { width: 34px; } .race-hist li span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .race-hist small { color: var(--ink-faint); }
.race-hist li em { font-style: normal; display: inline-flex; gap: 3px; align-items: center; color: var(--ink-soft); } .race-hist .ic { width: 14px; height: 14px; }
.res-card .ros { position: absolute; top: 4px; right: 6px; font-size: 15px; }
.pd-label { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; margin: 10px 2px 4px; }
.pd-label small { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--ink-faint); }
.pd-label + .pd-you { margin-top: 0; }
.pd-tix .tix i.bonus { background: linear-gradient(160deg, #ff9ec0, #ff6f91); box-shadow: 0 2px 6px rgba(255, 111, 145, .4); }
.pd-items { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.pd-items button { flex: none; border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 6px 10px; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-soft); display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 70px; cursor: pointer; }
.pd-items button span { font-size: 20px; line-height: 1.1; } .pd-items button small { font-size: 11px; color: var(--ink-faint); }
.pd-items button.on { border-color: var(--pink); background: #fff3f7; color: var(--ink); }
.pd-items button.r-rare.on { border-color: var(--r-rare); } .pd-items button.r-epic.on { border-color: var(--r-epic); }
.pd-itemdesc { margin: 4px 2px 0; }
.pk-list { display: flex; flex-direction: column; gap: 6px; max-height: min(60vh, 520px); overflow-y: auto; margin: 6px 0 10px; text-align: left; }
.pk-row { display: flex; gap: 10px; align-items: center; border: 2px solid transparent; background: var(--cream-2); border-radius: 16px; padding: 6px 10px 6px 6px; font: inherit; color: var(--ink); cursor: pointer; text-align: left; }
.pk-row.on { border-color: var(--pink); background: #fff3f7; }
.pk-row img { width: 56px; height: 62px; object-fit: contain; flex: none; }
.pk-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pk-name { display: flex; align-items: center; gap: 6px; } .pk-name b { font-size: 15px; } .pk-name .rtag { font-size: 10px; padding: 1px 6px; } .pk-name small { font-size: 11px; color: var(--ink-faint); }
.pk-bar { display: grid; grid-template-columns: 44px 1fr 24px; gap: 6px; align-items: center; font-size: 11.5px; color: var(--ink-soft); }
.pk-bar i { height: 6px; border-radius: 3px; background: rgba(90, 60, 80, .1); overflow: hidden; } .pk-bar i b { display: block; height: 100%; border-radius: 3px; background: var(--r-common); }
.pk-bar i b.r-rare { background: var(--r-rare); } .pk-bar i b.r-epic { background: var(--r-epic); } .pk-bar i b.r-legendary { background: var(--r-legendary); }
.pk-bar em { font-style: normal; font-weight: 700; text-align: right; color: var(--ink); }
.pk-bar.lean span, .pk-bar.lean em { color: #b07413; } .pk-bar.lean { background: #fff4cc; border-radius: 6px; }
.pk-foot { display: flex; gap: 8px; align-items: center; margin-top: 2px; } .pk-foot small { font-size: 11px; color: var(--ink-faint); } .pk-foot .pd-chance { margin-top: 0; }
.pd-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; } .pd-you .pd-name small { white-space: nowrap; }

/* ---------- Explorers' Lodge ---------- */
.ex-party { display: flex; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 8px 10px; margin-bottom: 6px; }
.ex-party.home { border: 2px solid #f2b233; background: #fffaf0; }
.ex-pics { display: flex; flex: none; } .ex-pics img { width: 40px; height: 44px; object-fit: contain; margin-left: -10px; } .ex-pics img:first-child { margin-left: 0; }
.ex-pics.big { justify-content: center; margin: -4px 0 4px; } .ex-pics.big img { width: 76px; height: 84px; margin-left: -16px; }
.ex-pmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; } .ex-pmain b { font-size: 15px; } .ex-pmain small { color: var(--ink-soft); font-size: 12px; }
.ex-pmain .levelbar { margin: 2px 0 0; } .ex-pmain .btn { align-self: flex-start; margin-top: 2px; }
.ex-dests { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.ex-dest { position: relative; border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 6px 4px 7px; font: inherit; color: var(--ink); display: flex; flex-direction: column; align-items: center; gap: 1px; cursor: pointer; min-width: 0; }
.ex-dest .ex-ic { font-size: 22px; line-height: 1.15; } .ex-dest .ex-ic svg { width: 16px; height: 16px; color: var(--ink-faint); margin: 3px 0; }
.ex-dest b { font-size: 12.5px; text-align: center; line-height: 1.15; } .ex-dest small { font-size: 11px; color: var(--ink-soft); font-weight: 600; }
.ex-dest em { font-style: normal; font-size: 10px; color: #b07413; }
.ex-dest.on { border-color: var(--pink); background: #fff3f7; } .ex-dest.lk { background: var(--cream-2); color: var(--ink-faint); cursor: default; } .ex-dest.lk small { color: var(--ink-faint); }
.ex-blurb { margin: 6px 2px 0; line-height: 1.35; }
.ex-lens button { flex-direction: column; gap: 0; } .ex-lens small { font-weight: 500; font-size: 11px; opacity: .8; }
.ex-mem { margin-top: 6px; } .ex-mem .iconbtn { flex: none; width: 34px; height: 34px; }
.pd-label + .ex-mem { margin-top: 0; }
.ex-like { color: #d4456f !important; font-weight: 600; }
.ex-fc { margin-top: 8px; background: #f0f8ec; border: 1px solid #cfe7c4; border-radius: 14px; padding: 8px 12px; font-size: 13.5px; }
.ex-fc b { color: #2f7a45; } .ex-fc div { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 3px; color: var(--ink-soft); font-size: 12.5px; }
.ex-lunch { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 8px 2px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.ex-lunch .cost { margin: 0; }
.mcard .ex-lunch { justify-content: center; margin-bottom: 14px; }
.ex-wait > div { display: flex; gap: 8px; align-items: center; } .ex-wait img { width: 46px; height: 50px; object-fit: contain; flex: none; }
.ex-wait span { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; } .ex-wait .rtag { align-self: flex-start; font-size: 10px; padding: 1px 6px; }
.ex-story { font-style: italic; color: var(--ink-soft); font-size: 14px; line-height: 1.45; margin: 4px 0 10px; text-align: left; }
.ex-finds { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; margin-bottom: 12px; }
.ex-find { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 4px; border-radius: 14px; background: var(--cream-2); border: 2px solid transparent; opacity: 0; transform: scale(.4) translateY(10px); animation: exPop .45s cubic-bezier(.3, 1.6, .5, 1) forwards; }
.ex-find .ex-fic { font-size: 26px; line-height: 1.1; height: 32px; display: grid; place-items: center; } .ex-find .ex-fic .ic { width: 28px; height: 28px; } .ex-find .ex-fic img { width: 40px; height: 44px; object-fit: contain; margin-top: -8px; }
.ex-find b { font-size: 12px; text-align: center; line-height: 1.15; } .ex-find small { font-size: 11px; color: var(--ink-soft); display: inline-flex; gap: 2px; align-items: center; text-align: center; } .ex-find small .ic { width: 12px; height: 12px; }
.ex-find.r-rare { border-color: color-mix(in srgb, var(--r-rare) 55%, transparent); background: #eef5ff; }
.ex-find.r-epic { border-color: color-mix(in srgb, var(--r-epic) 55%, transparent); background: #f6eeff; }
.ex-find.r-legendary { border-color: #f2b233; background: linear-gradient(180deg, #fff6d8, #ffe9c2); box-shadow: 0 0 0 3px rgba(242, 178, 51, .18); }
@keyframes exPop { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ex-find { animation: none; opacity: 1; transform: none; } }
.ex-res .mcard, .ex-res { max-height: none; }
.race-hist i.r-rare { color: var(--r-rare); font-style: normal; } .race-hist i.r-epic { color: var(--r-epic); font-style: normal; } .race-hist i.r-legendary { color: #b87400; font-style: normal; }
.sat { display: flex; flex-direction: column; gap: 6px; }
.sat-row { display: flex; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 7px 10px; }
.sat-row.r-rare { border-color: color-mix(in srgb, var(--r-rare) 45%, transparent); } .sat-row.r-epic { border-color: color-mix(in srgb, var(--r-epic) 45%, transparent); } .sat-row.r-legendary { border-color: #f2b233; background: #fffaf0; }
.sat-ic { font-size: 24px; width: 30px; text-align: center; flex: none; }
.sat-row div { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13.5px; } .sat-row b small { color: var(--ink-faint); font-weight: 600; } .sat-row div > small { color: var(--ink-soft); font-size: 12px; line-height: 1.3; }
.sat-row .btn { flex: none; }
.sat-on { margin: 0 0 6px; font-size: 13.5px; }
.res-card .awaytag { position: absolute; top: 6px; left: 6px; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: #e2f6e7; color: #2f8a52; }
.pk-tick { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--cream-3); color: transparent; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.pk-row.on .pk-tick { background: var(--pink); border-color: var(--pink); color: #fff; }
.mcard:has(.ex-res) { width: min(440px, 100%); }
@media (orientation: landscape) and (max-height: 560px) {
  .mcard:has(.ex-res) { width: min(640px, 100%); }
  .ex-pics.big img { width: 56px; height: 62px; }
  .ex-story { font-size: 13.5px; margin-bottom: 8px; }
}
/* Stage 3: hunts, strays, keepsakes, journal */
.ex-hunt { width: 100%; display: flex; gap: 10px; align-items: center; text-align: left; border: 2px dashed #f2b233; background: #fffaf0; border-radius: 14px; padding: 8px 12px; margin: -2px 0 6px; font: inherit; color: var(--ink); cursor: pointer; }
.ex-hunt > span { font-size: 26px; } .ex-hunt div { display: flex; flex-direction: column; } .ex-hunt b { font-size: 14.5px; } .ex-hunt small { font-size: 12px; color: var(--ink-soft); line-height: 1.3; }
.ex-hunt.on { border-style: solid; background: linear-gradient(180deg, #fff6d8, #ffe9c2); box-shadow: 0 0 0 3px rgba(242, 178, 51, .2); }
.ex-stray { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: #fff; border: 2px solid #c3e6cf; border-radius: 16px; padding: 8px 10px; margin-bottom: 6px; }
.ex-stray img { width: 56px; height: 62px; object-fit: contain; flex: none; }
.ex-sm { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 1px; font-size: 13px; } .ex-sm .rtag { font-size: 10px; padding: 1px 6px; } .ex-sm small { color: var(--ink-soft); font-size: 11.5px; } .ex-sm .ex-left { color: #2f8a52; font-weight: 600; }
.ex-sbtn { display: flex; gap: 6px; width: 100%; } .ex-sbtn .btn { flex: 1; }
.cu-row { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 7px 8px 8px; margin-bottom: 6px; }
.cu-row.done { border: 2px solid #f2b233; background: #fffaf0; }
.cu-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; flex-wrap: wrap; margin: 0 2px 5px; } .cu-head b { font-size: 14px; } .cu-head small { font-size: 11.5px; color: var(--ink-soft); }
.cu-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.cu { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; border-radius: 12px; background: var(--cream-2); min-width: 0; }
.cu span { font-size: 22px; line-height: 1.1; filter: grayscale(1) brightness(.4); opacity: .35; } .cu.on span { filter: none; opacity: 1; }
.cu:not(.on) span { font-weight: 800; color: var(--ink); filter: none; opacity: .3; }
.cu small { font-size: 10.5px; text-align: center; line-height: 1.15; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cu.on small { color: var(--ink); font-weight: 600; } .cu.rare { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--r-epic) 35%, transparent); }
.cu em { position: absolute; top: 2px; right: 5px; font-style: normal; font-size: 10px; color: var(--ink-faint); font-weight: 700; }
.cu-set { display: flex; justify-content: center; gap: 6px; font-size: 34px; margin: 2px 0 2px; }
.ex-journal { display: flex; flex-direction: column; gap: 4px; }
.ex-jrow { display: flex; gap: 8px; align-items: flex-start; padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: left; }
.ex-jic { font-size: 20px; width: 26px; text-align: center; flex: none; } .ex-jrow div { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; } .ex-jrow small { color: var(--ink-faint); font-size: 11.5px; } .ex-jrow span { color: var(--ink-soft); }
.ex-jrow i { font-style: normal; font-weight: 600; } .ex-jrow i.r-rare { color: var(--r-rare); } .ex-jrow i.r-epic { color: var(--r-epic); } .ex-jrow i.r-legendary { color: #b87400; }
.ex-jlong { max-height: min(55vh, 480px); overflow-y: auto; margin-bottom: 10px; }
.ex-tot { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: center; font-size: 12.5px; color: var(--ink-soft); margin-bottom: 8px; }
/* special event: lost slime + rescue */
.ex-lost { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; background: #fff4f0; border: 2px solid #ffb59c; border-radius: 16px; padding: 10px; margin: 4px 0 8px; }
.ex-lost img { width: 58px; height: 64px; object-fit: contain; flex: none; }
.ex-lost > div { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 2px; } .ex-lost b { font-size: 15px; } .ex-lost small { font-size: 12.5px; color: var(--ink-soft); line-height: 1.35; }
.ex-party.rescue { border: 2px solid #ffb59c; background: #fff8f5; }
.res-card .awaytag.lost { background: #ffe5dc; color: #c4532c; }
.res-card .awaytag.job { background: #fff1d6; color: #9a6a1c; }
.ex-gains { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.ex-gains span { background: var(--cream-2); border-radius: 12px; padding: 6px 10px; font-size: 14px; color: var(--ink-soft); }
.ex-gains span b { color: var(--ink); } .ex-gains em { font-style: normal; color: #2f8a52; font-weight: 700; } .ex-gains span.big { background: #e2f6e7; }
/* tap a find / keepsake for info */
button.ex-find { font: inherit; color: var(--ink); cursor: pointer; }
.ex-find.sel { outline: 3px solid var(--pink); outline-offset: 1px; }
.ex-info { text-align: left; font-size: 13px; color: var(--ink-faint); background: var(--cream-2); border-radius: 14px; padding: 8px 12px; margin: -4px 0 12px; min-height: 20px; }
.ex-info.on { color: var(--ink); background: #fff; border: 1px solid var(--line); }
.ex-info b { font-size: 14.5px; } .ex-info .rtag { font-size: 10px; padding: 1px 6px; vertical-align: 2px; }
.ex-info p { margin: 4px 0 0 !important; color: var(--ink-soft); font-size: 13px; line-height: 1.4; } .ex-info .ex-isub { color: var(--ink-faint); font-size: 12px; }
button.cu { border: 0; font: inherit; cursor: pointer; }
.cu-pop { margin-top: 4px; }

/* ---------- Goals ---------- */
.tab { position: relative; }
.tab .badge { position: absolute; top: 2px; right: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ff4f6d; color: #fff; font-size: 11px; font-weight: 800; font-style: normal; line-height: 18px; text-align: center; box-shadow: 0 2px 6px rgba(255, 79, 109, .4); transform: scale(0); transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.tab .badge.on { transform: scale(1); }
@media (max-width: 420px) { .tab.move { min-width: 78px; } .tab .badge { right: 2px; } }
.orb.gem { border-radius: 4px; transform-origin: center; background: linear-gradient(160deg, #e3d8ff, #9d7bff 60%, #6f4fe0); box-shadow: 0 0 12px 3px rgba(157, 123, 255, .5); clip-path: polygon(50% 0, 100% 40%, 50% 100%, 0 40%); }
.g-row { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 9px 10px; margin-bottom: 6px; }
.g-row.ready { border: 2px solid #f2b233; background: #fffaf0; }
.g-row.done { opacity: .6; }
.g-row.bonus { background: #fdf6ff; }
.g-ic { font-size: 22px; width: 28px; text-align: center; flex: none; line-height: 1.3; }
.g-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.g-main b { font-size: 14.5px; } .g-main > span { font-size: 12.5px; color: var(--ink-soft); line-height: 1.35; }
.g-main .levelbar { margin: 4px 0 0; height: 7px; } .g-prog { font-size: 11px; color: var(--ink-faint); font-weight: 600; }
.g-rew { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 3px; font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.g-rew span { display: inline-flex; align-items: center; gap: 2px; } .g-rew .ic { width: 14px; height: 14px; }
.g-act { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.g-act .g-show { font-size: 12.5px; white-space: nowrap; }
.g-done { font-size: 12px; color: #2f8a52; font-weight: 700; white-space: nowrap; }
.g-tut .g-row { border: 2px solid #ffc2d3; background: #fff7fa; }
.g-tut .g-row.ready { border-color: #f2b233; background: #fffaf0; }
.g-readyhead { display: flex; justify-content: space-between; align-items: center; }
.g-filter { margin: 2px 0 8px; }
.g-stickers { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 6px; }
.g-stickers .st { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 14px; background: var(--cream-2); font-size: 24px; color: var(--ink-faint); font-weight: 800; }
.g-stickers .st small { font-size: 10.5px; font-weight: 600; text-align: center; line-height: 1.15; }
.g-stickers .st.on { background: #fff; border: 2px solid #e7dcff; color: var(--ink); }
/* "▼ Race!" chip when a page's main button is below the fold */
.scroll-hint { position: sticky; bottom: 4px; display: block; margin: -40px auto 0; height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: #3a2a3d; color: #fff; font: inherit; font-size: 13.5px; font-weight: 700; box-shadow: 0 6px 16px rgba(58, 42, 61, .3); opacity: 0; pointer-events: none; transition: opacity .25s; cursor: pointer; z-index: 3; }
.scroll-hint.on { opacity: .92; pointer-events: auto; animation: hintBob 1.6s ease-in-out infinite; }
@keyframes hintBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .scroll-hint.on { animation: none; } }
.pd-pick { border-style: dashed; }
.pd-pick > div { flex: 1; }
.bld-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.bld-tools .turn { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.bld-tools .turn .btn { min-width: 40px; padding: 6px 10px; font-size: 18px; line-height: 1; }
.book { max-height: 52dvh; overflow-y: auto; margin: 10px 0 12px; padding-right: 2px; text-align: left; }
.book-day { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-faint); margin: 12px 0 4px; }
.book-day:first-child { margin-top: 0; }
.book-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; background: var(--cream-2); border-radius: 12px; margin-bottom: 6px; font-size: 14px; line-height: 1.35; }
.book-row .ic { font-size: 18px; line-height: 1.1; }
.wardrobe-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 2px; padding: 10px 12px; background: var(--cream-2); border-radius: 14px; font-size: 14px; }
.wardrobe-row span { flex: 1 1 60%; }
.wd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin: 12px 0; max-height: 52dvh; overflow-y: auto; }
.wd-hat { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px 8px; border: 2px solid transparent; border-radius: 14px; background: var(--cream-2); font: inherit; color: var(--ink); cursor: pointer; }
.wd-hat img { width: 72px; height: 79px; object-fit: contain; }
.wd-hat b { font-size: 12.5px; line-height: 1.15; text-align: center; }
.wd-hat small { font-size: 11px; color: var(--ink-soft); text-align: center; }
.wd-hat.on { border-color: var(--mint, #3fbf8a); background: #eaf8ef; }
.wd-hat:disabled { opacity: .5; cursor: default; }
.decorbar { position: absolute; left: 8px; right: 8px; top: calc(var(--safe-t, 0px) + 8px); max-width: 480px; margin: 0 auto; display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--cream); border-radius: 18px; box-shadow: var(--shadow); font-size: 14px; z-index: 6; transform: translateY(-140%); transition: transform .3s; pointer-events: auto; }
.decorbar.on { transform: translateY(0); }
.decorbar > span { flex: 1; line-height: 1.25; }
.decorbar .cz small { display: block; color: var(--ink-soft); font-size: 12px; }
.tab[hidden] { display: none; }
/* six or seven tabs on a narrow phone: let them share the space */
@media (max-width: 430px) {
  .tabbar { left: 8px; right: 8px; transform: none; gap: 2px; }
  .tab { min-width: 0; flex: 1 1 0; padding: 0 4px; font-size: 11px; }
  .tab.move { min-width: 0; flex: 1.4 1 0; padding: 0 6px; }
}
.sh-meta { font-size: 13px; color: var(--ink-soft); margin: 6px 0 10px; }
.sh-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.sh-tile { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; padding: 12px 8px 10px; background: var(--cream-2); border-radius: 16px; }
.sh-tile.feat { grid-column: 1 / -1; background: linear-gradient(180deg, #fff3d6, #ffe7b8); }
.sh-tile b { font-size: 14px; line-height: 1.2; } .sh-tile small { font-size: 11.5px; color: var(--ink-soft); line-height: 1.25; }
.sh-tile .cost { justify-content: center; margin: 2px 0; font-size: 13px; }
.sh-pic { height: 64px; display: flex; align-items: center; justify-content: center; }
.sh-pic img { height: 64px; } .sh-emoji { font-size: 40px; line-height: 1; }
.sh-flag { position: absolute; top: 8px; left: 10px; font-size: 11px; font-weight: 800; color: #b5651d; text-transform: uppercase; letter-spacing: .04em; }
.sh-tile.sold { opacity: .75; } .sh-tile.sold .sh-pic { filter: grayscale(.6); }
.sh-stamp { display: inline-block; margin-top: 4px; padding: 3px 12px; border: 3px solid #e2556f; color: #e2556f; border-radius: 10px; font-weight: 900; transform: rotate(-8deg); font-size: 15px; letter-spacing: .05em; }
.sh-wished { font-size: 11.5px; color: #e2556f; font-weight: 700; }
.sh-wish { margin-top: 12px; padding: 10px 12px; background: var(--cream-2); border-radius: 14px; } .sh-wish summary { font-weight: 800; cursor: pointer; }
.chip.wish.on { background: #ffe3ea; color: #c23a58; }
/* ---- polish: help buttons ---- */
.helpbtn { position: absolute; top: calc(var(--safe-t) + 72px); right: 16px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255, 250, 241, .94); box-shadow: var(--shadow); color: var(--ink-soft); font-family: inherit; font-weight: 800; font-size: 17px; line-height: 1; cursor: pointer; z-index: 2; }
.sheet-help { position: absolute; top: 12px; right: 56px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--cream-2); color: var(--ink-soft); font-size: 17px; font-weight: 800; cursor: pointer; }
.sheet-help[hidden] { display: none; }
.tab .badge.dot { min-width: 10px; width: 10px; height: 10px; padding: 0; top: 6px; right: 14px; }
.b-what { margin: 10px 0 12px; padding: 12px 14px; background: var(--cream-2); border-radius: 16px; font-size: 16px; display: flex; align-items: center; gap: 4px; }
.b-what svg, .b-what img { width: 20px; height: 20px; }
.b-up { margin-top: 10px; } .b-up .row { margin-top: 10px; }
.b-up.small { margin-top: 18px; padding-top: 6px; border-top: 1px dashed rgba(58, 42, 61, .12); }
.b-cap { margin-top: 8px; font-size: 14px; color: var(--ink-soft); display: flex; justify-content: space-between; align-items: center; }
.ci { display: inline-flex; align-items: center; gap: 2px; margin-left: 8px; font-weight: 700; }
.ci svg { width: 16px; height: 16px; }
.ci.short { opacity: .55; }

/* ---- P1 calm screens: Paddock ---- */
.stars { color: #f5a623; font-size: 15px; letter-spacing: 1px; white-space: nowrap; }
.stars em { font-style: normal; font-size: 12px; color: var(--ink-soft); letter-spacing: 0; font-weight: 600; margin-left: 2px; }
.pd-hero { margin-top: 8px; }
.pd-racer { display: flex; gap: 12px; align-items: center; width: 100%; border: 2px solid #ffc2d3; background: #fff7fa; border-radius: 18px; padding: 8px 12px; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.pd-racer img { width: 72px; height: 78px; object-fit: contain; flex: none; }
.pd-racer div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pd-racer b { font-size: 18px; }
.pd-racer small { color: var(--ink-faint); font-size: 12px; }
.pd-racer.empty { border-style: dashed; background: #fff; }
.pd-plus { width: 58px; height: 58px; border-radius: 50%; background: var(--cream-2); display: grid; place-items: center; font-size: 26px; color: var(--ink-soft); flex: none; }
.pd-chips .chip.lk { opacity: .55; }
.pd-chips + .pd-chips { margin-top: 6px; }
.b-up .row .btn[data-times]:not([data-times="1"]) { white-space: nowrap; font-size: 14px; }
.pd-chips .chip svg { width: 12px; height: 12px; vertical-align: -1px; }
.pd-line { display: flex; justify-content: space-between; gap: 8px; margin: 12px 2px 6px; font-size: 13.5px; color: var(--ink-soft); flex-wrap: wrap; }
.pd-line span:last-child { font-weight: 700; color: var(--ink); }
.pd-go { display: flex; justify-content: center; align-items: center; gap: 10px; }
.pd-tix2 { font-size: 12.5px; font-weight: 600; background: rgba(255,255,255,.55); border-radius: 999px; padding: 2px 9px; }
.pd-tix2.none { background: transparent; }
details.fold { background: transparent; border-top: 1px dashed rgba(58, 42, 61, .12); border-radius: 0; margin: 10px 0 0; }
details.fold > summary { padding: 10px 2px; font-size: 14px; color: var(--ink-soft); }
details.fold[open] > summary { color: var(--ink); }
details.fold .pd-field { margin-bottom: 6px; }
.race-res details.fold { text-align: left; }

/* ---- P1 calm screens: Lodge ---- */
.ex-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 8px; }
.ex-tile { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 2px solid transparent; background: #fff; border-radius: 16px; padding: 10px 6px 8px; font: inherit; color: inherit; cursor: pointer; box-shadow: 0 1px 0 var(--line); }
.ex-tile span { font-size: 28px; line-height: 1.1; }
.ex-tile span svg { width: 22px; height: 22px; }
.ex-tile b { font-size: 12.5px; text-align: center; line-height: 1.2; }
.ex-tile small { font-size: 10.5px; color: var(--ink-faint); }
.ex-tile.on { border-color: #f5a623; background: #fff8e6; }
.ex-tile.lk { opacity: .5; cursor: default; }
.ex-lens2 { margin-top: 12px; }
.ex-seats { display: flex; justify-content: center; gap: 16px; margin: 16px 0 4px; }
.ex-seat { position: relative; width: 74px; display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; padding: 0; }
.ex-seat img, .ex-seat > span { width: 64px; height: 64px; border-radius: 50%; background: #fff; border: 2px solid #ffc2d3; object-fit: contain; }
.ex-seat.empty > span { display: grid; place-items: center; font-size: 24px; color: var(--ink-faint); border: 2px dashed rgba(58, 42, 61, .2); background: transparent; }
.ex-seat.empty:disabled { opacity: .4; }
.ex-seat small { font-size: 12px; font-weight: 600; min-height: 15px; }
.ex-seat em { position: absolute; top: -2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--cream-2); font-style: normal; font-size: 11px; display: grid; place-items: center; color: var(--ink-soft); }
.ex-love { position: absolute; top: 44px; left: 4px; font-style: normal; font-size: 14px; }
.ex-team { text-align: center; margin: 4px 0 10px; min-height: 20px; }
.ex-team small { color: var(--ink-faint); }
.ex-go { display: flex; justify-content: center; align-items: center; gap: 10px; }
.ex-cost { font-size: 13px; background: rgba(255,255,255,.55); border-radius: 999px; padding: 2px 9px; }
.ex-bookbtn { margin-top: 12px; }

/* ---- P1 calm screens: Stone and build list ---- */
.st-row { margin-top: 12px; }
.st-row .btn { display: flex; align-items: center; justify-content: center; white-space: nowrap; }
.st-more { margin-top: 10px; }
.bl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 8px; margin-top: 10px; }
.bl-tile { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 2px solid transparent; background: #fff; border-radius: 16px; padding: 10px 4px 8px; font: inherit; color: inherit; cursor: pointer; box-shadow: 0 1px 0 var(--line); min-width: 0; }
.bl-tile span { font-size: 28px; line-height: 1.15; }
.bl-tile b { font-size: 12.5px; line-height: 1.2; text-align: center; }
.bl-tile small { font-size: 11px; color: var(--ink-soft); display: flex; flex-wrap: wrap; justify-content: center; gap: 0 2px; }
.bl-tile small .ci { margin-left: 0; font-size: 11.5px; }
.bl-tile small .ci svg, .bl-tile small svg { width: 12px; height: 12px; }
.bl-tile.on { border-color: #8a6cf0; background: #f5f1ff; }
.bl-tile.lk { opacity: .5; cursor: default; }
.bl-pick { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 16px; padding: 10px 12px; margin-top: 8px; box-shadow: 0 1px 0 var(--line); }
.bl-pick > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bl-pick b { font-size: 16px; }
.bl-pick small { font-size: 12.5px; color: var(--ink-soft); }
.bl-pick .btn { white-space: nowrap; display: flex; align-items: center; }
/* jobs: the worker picked for a new building, and a building's worker on its page */
.bl-worker { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: #fff; border-radius: 14px; padding: 6px 12px 6px 6px; margin-top: 8px; box-shadow: 0 1px 0 var(--line); font: inherit; color: var(--ink); cursor: pointer; text-align: left; }
.bl-worker img { width: 38px; height: 42px; }
.bl-worker span { flex: 1; font-size: 13.5px; color: var(--ink-soft); }
.bl-worker b { color: var(--ink); font-size: 15px; }
.bl-worker i { font-style: normal; font-size: 13px; font-weight: 700; color: var(--pink); }
.job-row { display: flex; align-items: center; gap: 10px; background: var(--cream-2); border-radius: 16px; padding: 8px 12px 8px 8px; margin: 10px 0 4px; }
.job-row img { width: 44px; height: 48px; flex: none; }
.job-row > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.job-row b { font-size: 15px; }
.job-row small { font-size: 12px; color: var(--ink-soft); line-height: 1.3; }
.job-row.need { background: #fff3e0; }
.style-chips { margin: 4px 0 2px; }
.bc-next { display: flex; flex-direction: column; margin: 12px 2px 8px; }
.bc-next b { font-size: 17px; } .bc-next small { color: var(--ink-soft); font-size: 13px; }
.bc-links { display: flex; gap: 8px; margin-top: 12px; } .bc-links .btn { flex: 1; }
.tal { display: flex; flex-direction: column; background: #fff; border-radius: 14px; padding: 8px 12px; margin-top: 8px; font-size: 13px; box-shadow: 0 1px 0 var(--line); }
.tal b { font-size: 14px; } .tal span { color: var(--ink-soft); }
.rc-btns { margin-top: 12px; }
details.fold .facts { margin-top: 0; }
.vit-num { display: flex; align-items: center; justify-content: center; gap: 6px; }
.vit-num svg { width: 40px; height: 40px; }
.modal details.fold .receipt { margin-top: 0; }
[data-log] svg { width: 16px; height: 16px; vertical-align: -2px; }
.panel-on .helpbtn { display: none; }
.sheet-on .helpbtn { display: none; }

/* small step headers between kinds of choice */
.step-h { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; margin: 14px 2px 6px; }
.step-h small { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--ink-faint); margin-left: 4px; }
.step-h + .chips, .step-h + .ex-tiles, .step-h + .bl-grid, .step-h + .odds-wrap, .step-h + .st-row, .step-h + .ex-seats { margin-top: 0; }
.b-up .step-h { margin-top: 10px; }
.bl-sticky { position: sticky; bottom: 0; padding-top: 8px; background: linear-gradient(transparent, var(--cream) 30%); }
.likes2 { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 2px; font-size: 13px; }
.likes2 span { background: #fff; border-radius: 999px; padding: 5px 11px; box-shadow: 0 1px 0 var(--line); color: var(--ink-soft); }
.likes2 .lk-yes b { color: #d2416b; } .likes2 .lk-no b { color: var(--ink); }

/* ---- P2 feel ---- */
.sheet { transition: transform .42s cubic-bezier(.22, 1.28, .4, 1) !important; }
.modal > * { transform: scale(.92) translateY(10px); transition: transform .38s cubic-bezier(.22, 1.4, .4, 1); }
.modal.on > * { transform: none; }
.btn, .chip, .bl-tile, .ex-tile, .ex-seat, .pd-racer, .tile, .tab, .helpbtn { transition: transform .28s cubic-bezier(.3, 1.6, .5, 1), background-color .2s, box-shadow .2s; }
.btn:active, .chip:active, .bl-tile:active, .ex-tile:active, .ex-seat:active, .pd-racer:active, .helpbtn:active { transform: scale(.93); transition-duration: .08s; }
.chip.on { animation: chipPop .3s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes chipPop { 40% { transform: scale(1.08); } }
.confetti { position: absolute; width: 8px; height: 11px; border-radius: 2px; pointer-events: none !important; z-index: 40; will-change: transform, opacity; }
.thumb { width: 64px; height: 70px; object-fit: contain; display: block; margin: -4px auto -2px; }
.bl-tile .thumb-emo { font-size: 28px; line-height: 64px; height: 64px; display: block; }
.sh-pic .thumb { width: 84px; height: 92px; margin: 0 auto; }
@media (prefers-reduced-motion: reduce) { .sheet, .modal > * { transition-duration: .01s !important; } .chip.on { animation: none; } }
.vit-note { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 9px 10px; border-radius: 14px; background: #fff0f5; border: 1px dashed #ffb3c9; font-size: 13px; color: var(--ink-soft); }
.vit-note > svg { width: 18px; height: 18px; flex: none; }
.vit-note span { flex: 1; } .vit-note b { color: #d2416b; }
.vit-note .btn { white-space: nowrap; }
.agechip.gift { background: linear-gradient(90deg, #fff1c9, #ffe0ee); color: var(--ink); }
@media (orientation: landscape) and (max-height: 560px) { .agechip.gift { top: 108px !important; } }

/* ---- playing along in races ---- */
.race-cue { position: absolute; left: 50%; bottom: calc(var(--safe-b) + 128px); transform: translateX(-50%) scale(.9); opacity: 0; transition: opacity .15s, transform .15s; pointer-events: none; padding: 10px 22px; border-radius: 999px; background: rgba(58, 42, 61, .72); color: #fff; font-weight: 800; font-size: 20px; white-space: nowrap; text-shadow: 0 2px 0 rgba(0,0,0,.15); }
.race-cue.on { opacity: 1; transform: translateX(-50%) scale(1); }
.race-cue.jump.now { background: linear-gradient(180deg, #ffd166, #f7a823); color: #5a3d00; font-size: 30px; padding: 12px 34px; animation: cuePulse .35s ease-in-out infinite alternate; }
.race-cue.mash { background: linear-gradient(180deg, #ff9ab8, #ff6f91); font-size: 18px; animation: cueShake .18s ease-in-out infinite alternate; }
.race-cue.tapped { transform: translateX(-50%) scale(.92); }
.race-cue.nice::after { content: '✨ Nice!'; position: absolute; left: 50%; top: -34px; transform: translateX(-50%); font-size: 18px; color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.35); animation: rise 1s ease-out forwards; }
@keyframes cuePulse { to { transform: translateX(-50%) scale(1.08); } }
@keyframes cueShake { from { transform: translateX(-50%) rotate(-2deg); } to { transform: translateX(-50%) rotate(2deg); } }
.race-tip { position: absolute; left: 50%; top: 56%; transform: translateX(-50%); width: min(86vw, 360px); background: rgba(255, 250, 241, .96); border-radius: 18px; padding: 12px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--ink-soft); text-align: center; transition: opacity .4s; pointer-events: none; }
.race-tip > b { font-size: 17px; color: var(--ink); }
.race-tip.gone { opacity: 0; }
.race-ov { touch-action: manipulation; }
@media (orientation: landscape) and (max-height: 560px) { .race-cue { bottom: 62px; font-size: 16px; } .race-cue.jump.now { font-size: 22px; padding: 8px 24px; } .race-tip { top: 44%; } }
.pd-iteminfo { display: flex; gap: 10px; align-items: center; margin-top: 8px; padding: 10px 12px; border-radius: 14px; background: #fff; border: 2px solid #c9b6ff; }
.pd-iteminfo.r-rare { border-color: #8fbaff; } .pd-iteminfo.r-epic { border-color: #c38bff; } .pd-iteminfo.r-common { border-color: #b9dca0; }
.pd-iicon { font-size: 30px; line-height: 1; }
.pd-iteminfo div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pd-iteminfo b { font-size: 15px; } .pd-iteminfo small { font-size: 12.5px; color: var(--ink-soft); }
.pd-ichange { font-size: 13px; color: var(--ink-soft); } .pd-ichange b { color: #3d8a4c; }
.pep-offer { margin: 10px 0 4px; padding: 10px 12px; border-radius: 16px; background: #fff7e6; border: 1px dashed #f7b733; text-align: left; }
.pep-offer > b { display: block; font-size: 14px; margin-bottom: 2px; }
.pep-offer .chips { margin-top: 6px; }
.pep-offer .chip.pep { background: #fff; border: 1.5px solid #f7d07a; }
.pep-offer .chip svg { width: 13px; height: 13px; vertical-align: -2px; }

/* Treasure book */
.tr-glitter { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; margin-bottom: 10px; border-radius: 16px; background: linear-gradient(180deg, #fff8e1, #ffefc2); text-align: left; }
.tr-glitter b { font-size: 15px; } .tr-glitter small { font-size: 12px; color: var(--ink-soft); line-height: 1.35; }
.tr-set { padding: 10px 12px; margin-bottom: 10px; border-radius: 16px; background: var(--cream-2); text-align: left; }
.tr-set.done { background: linear-gradient(180deg, #f2fbe8, #e3f5d2); border: 2px solid #9fd27a; }
.tr-set.lk { opacity: .6; } .tr-set.lk .tr-head { display: flex; flex-direction: column; gap: 2px; }
.tr-head { display: flex; gap: 10px; align-items: center; }
.tr-head > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tr-head b { font-size: 15px; } .tr-head small { font-size: 12px; color: var(--ink-soft); line-height: 1.3; }
.tr-rw { flex: 0 0 52px; width: 52px; height: 52px; border-radius: 14px; background: #fff; display: grid; place-items: center; font-size: 30px; overflow: hidden; }
.tr-rw img { width: 100%; height: 100%; object-fit: contain; }
.tr-set:not(.done) .tr-rw img { filter: grayscale(.85) brightness(1.1); opacity: .7; }
.tr-pieces { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; margin-top: 8px; }
.tr-piece { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; border-radius: 12px; background: #fff; border: 2px dashed #d9cbb8; font: inherit; color: var(--ink-faint); cursor: pointer; }
.tr-piece i { font-style: normal; font-size: 22px; line-height: 1.1; }
.tr-piece small { font-size: 10px; line-height: 1.15; text-align: center; overflow-wrap: anywhere; }
.tr-piece.on { border: 2px solid #f7c948; background: #fffbea; color: var(--ink); cursor: default; }
.tr-piece:disabled { cursor: default; opacity: .75; }
.tr-piece:not(.on):not(:disabled) { border-color: #f7b733; color: #b7791f; }
/* Mystery box */
.mb-pic { font-size: 60px; line-height: 1; margin: 6px auto 6px; width: 96px; height: 96px; display: grid; place-items: center; animation: mbpop .5s cubic-bezier(.3,1.6,.5,1); }
.mb-pic img { width: 96px; height: 96px; object-fit: contain; }
@keyframes mbpop { from { transform: scale(.3) rotate(-15deg); opacity: 0; } to { transform: none; opacity: 1; } }
/* Grand pieces */
.sh-tile.grand { background: linear-gradient(180deg, #f6efff, #ece0ff); }
.gr-save { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 2px 0 4px; }
.gr-save .levelbar { width: 90%; } .gr-save small { font-size: 11.5px; }
.gr-next { display: block; margin-top: 4px; font-size: 11px !important; color: var(--ink-faint) !important; }
/* Shiny slimes: a rainbow border that slowly shimmers */
.res-card.shiny { border: 2px solid transparent; background: linear-gradient(var(--cream-2), var(--cream-2)) padding-box, linear-gradient(120deg, #ff9ec0, #ffd27a, #a8f0c0, #9fe8ff, #c9b6ff, #ff9ec0) border-box; background-size: 100% 100%, 300% 300%; animation: shinyEdge 4s linear infinite; }
.res-card.shiny small { background: linear-gradient(90deg, #d64f9a, #c98a00, #2f9fc9, #8a5bd6); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; }
@keyframes shinyEdge { from { background-position: 0 0, 0% 50%; } to { background-position: 0 0, 300% 50%; } }
.tag.shiny { background: linear-gradient(90deg, #ffd0e6, #fff1a8, #c9f5d8, #c8efff, #e2d6ff); background-size: 200% 100%; animation: shinyEdge 5s linear infinite; color: #6b3d8a; font-weight: 800; }
@media (prefers-reduced-motion: reduce) { .res-card.shiny, .tag.shiny { animation: none; } }

/* dev-only performance readout */
.perf-hud { position: fixed; left: max(6px, env(safe-area-inset-left)); bottom: calc(env(safe-area-inset-bottom) + 74px); z-index: 60; pointer-events: none;
  background: rgba(30, 22, 40, 0.72); color: #fff; font: 600 11px/1.35 ui-monospace, Menlo, Consolas, monospace; padding: 5px 7px; border-radius: 8px; }
.perf-hud b { color: #9ff29a; } .perf-hud b.meh { color: #ffd166; } .perf-hud b.bad { color: #ff7a8a; } .perf-hud i { opacity: 0.7; font-style: normal; }
.perf-boot { pointer-events: auto; margin-top: 3px; } .perf-boot summary { cursor: pointer; color: #c9e7ff; }
.perf-boot table { border-collapse: collapse; margin-top: 3px; max-height: 50vh; display: block; overflow: auto; } .perf-boot td, .perf-boot th { padding: 0 5px 0 0; text-align: left; font-weight: 500; } .perf-boot td:nth-child(n+2) { text-align: right; }

/* quick jumps between the open areas of the hillside (World update, Phase 1) */
.area-jump { position: fixed; right: calc(var(--safe-r, 0px) + 8px); top: 42%; transform: translateY(-50%); z-index: 20; display: flex; flex-direction: column; gap: 6px; transition: opacity .2s; }
.area-jump.hide { opacity: 0; pointer-events: none; }
.area-jump button { border: 0; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 250, 241, 0.92); box-shadow: 0 2px 8px rgba(74, 58, 82, 0.18); font-size: 20px; cursor: pointer; position: relative; padding: 0; }
.area-jump button small { display: none; }
.area-jump button:active { transform: scale(0.92); }

/* timed unlocks: the building-site card in the land / Beacon sheets, and the "it's ready" note */
.works { background: #fff6e4; border: 2px dashed #e8b878; border-radius: 16px; padding: 10px 12px; margin: 8px 0; }
.works.done { border-style: solid; border-color: #f2b233; background: #fff8dc; }
.works-h { font-weight: 700; font-size: 16px; color: var(--ink); }
.works p { margin: 4px 0 8px; }
.works-bar i { background: repeating-linear-gradient(45deg, #f2b233 0 8px, #f7c948 8px 16px); }
.works-t { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; margin-top: 4px; }
.works-t span { color: var(--ink-soft); font-size: 13px; }
.notice { position: absolute; left: 50%; top: calc(var(--safe-t) + 164px); transform: translate(-50%, -16px); opacity: 0; pointer-events: none; z-index: 30;
  display: flex; align-items: center; gap: 8px; background: #fffaf1; color: var(--ink); border: 2px solid #f2b233; border-radius: 18px; padding: 8px 8px 8px 14px;
  box-shadow: 0 6px 20px rgba(58, 42, 61, .18); font-weight: 600; font-size: 14px; width: max-content; max-width: min(94vw, 460px); transition: all .3s; }
.notice.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.notice .btn { flex: none; }
.notice .x { flex: none; border: 0; background: none; color: var(--ink-soft); font-size: 15px; padding: 4px 6px; cursor: pointer; }

/* ---------- the Storehouse (rebalance) ---------- */
.res.full { box-shadow: 0 0 0 2px #f2a23a, var(--shadow); }
.res.full [data-v] { color: #c46a12; }
.res-more .rx.full [data-v] { color: #c46a12; }
.st-list { display: grid; gap: 8px; margin: 10px 0 6px; }
.sh-row { display: grid; grid-template-columns: 24px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; background: var(--cream-2); border-radius: 14px; padding: 8px 10px; }
.sh-row .ic { grid-row: span 2; width: 22px; height: 22px; }
.sh-bar { height: 10px; border-radius: 99px; background: #f3dcbd; overflow: hidden; }
.sh-bar i { display: block; height: 100%; background: linear-gradient(90deg, #9fe3c4, #7fd3b3); border-radius: 99px; }
.sh-row.full .sh-bar i { background: linear-gradient(90deg, #ffc46b, #f2a23a); }
.sh-row span { font-size: 13px; font-weight: 600; grid-column: 2; margin-top: 3px; }
.sh-row small { font-size: 11.5px; color: var(--ink-soft); grid-column: 2; }
/* the age-up list on the Beacon page */
.au-list { display: grid; gap: 6px; margin: 6px 0; }
.au-row { position: relative; display: flex; align-items: center; justify-content: space-between; border: 0; background: var(--cream-2); border-radius: 12px; padding: 8px 12px; font: inherit; color: var(--ink); overflow: hidden; cursor: pointer; }
.au-row i { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(127, 211, 179, .28); }
.au-row span, .au-row b { position: relative; font-size: 13.5px; }
.au-row.ok b { color: #2f8a52; }
.bl-worker.need { background: #fff3e0; }
.bl-worker .pick-ic svg { width: 30px; height: 30px; }
/* rename pencil next to a slime's name (Jack, 25 Oct) */
.rn-pen { border: 0; background: var(--cream-2); color: var(--ink-soft); width: 28px; height: 28px; border-radius: 99px; font-size: 15px; margin-left: 6px; vertical-align: middle; cursor: pointer; }

/* ---------- the feedback kit (juice.js, 29 Oct) ---------- */
/* `scale`/`translate` (not `transform`), so they stack on top of whatever transform an element already has */
.jz-down { scale: .95; transition: scale .07s ease-out !important; }
.jz-up { animation: jz-release .38s cubic-bezier(.3, 1.7, .5, 1); }
@keyframes jz-release { 0% { scale: .95; } 45% { scale: 1.07; } 75% { scale: .98; } 100% { scale: 1; } }
.jz-pop { animation: jz-pop .45s cubic-bezier(.3, 1.8, .5, 1); }
.jz-pop-big { animation: jz-pop-big .6s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes jz-pop { 30% { scale: 1.18; } 100% { scale: 1; } }
@keyframes jz-pop-big { 0% { scale: 1; } 25% { scale: 1.32; rotate: -6deg; } 55% { scale: .94; rotate: 4deg; } 100% { scale: 1; rotate: 0deg; } }
.jz-shake { animation: jz-shake .42s ease-in-out; }
@keyframes jz-shake { 15% { translate: -6px 0; } 35% { translate: 5px 0; } 55% { translate: -4px 0; } 75% { translate: 2px 0; } 100% { translate: 0 0; } }
.jz-layer { position: absolute; inset: 0; pointer-events: none !important; z-index: 80; overflow: hidden; }
.jz-bit { position: absolute; width: 13px; height: 13px; pointer-events: none; will-change: transform, opacity; background: currentColor; }
.jz-star { clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); width: 16px; height: 16px; }
.jz-dot { border-radius: 50%; width: 9px; height: 9px; }
.jz-spark { clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); width: 14px; height: 14px; background: #fff; filter: drop-shadow(0 0 3px currentColor); }
.jz-fly { position: absolute; left: 0; top: 0; width: 24px; height: 24px; display: grid; place-items: center; pointer-events: none; will-change: transform; filter: drop-shadow(0 2px 4px rgba(90, 60, 80, .25)); }
.jz-fly .ic { width: 22px; height: 22px; }
@media (prefers-reduced-motion: reduce) { .jz-up, .jz-pop, .jz-pop-big, .jz-shake { animation: none; } .jz-down { scale: .97; } }

/* ---------- Goals, redesigned (29 Oct): sunny, claim-first, colour families ---------- */
.panel.theme-goals { background: linear-gradient(180deg, #fff1bd 0, #fff6dc 120px, #fffaf1 260px); }
.theme-goals header { gap: 8px; }
.theme-goals header h1 { color: #4a3420; }
.g-mascot { position: relative; flex: none; width: 50px; height: 50px; margin: -6px -2px -6px -6px; padding: 0; border: 0; background: none; cursor: pointer; }
.g-mascot[hidden] { display: none; }
.g-mascot img { width: 54px; height: 54px; object-fit: contain; animation: g-bob 2.6s ease-in-out infinite; transform-origin: 50% 90%; filter: drop-shadow(0 3px 4px rgba(90, 60, 30, .18)); }
@keyframes g-bob { 0%, 100% { transform: translateY(0) scaleY(1); } 45% { transform: translateY(-3px) scaleY(1.03); } 55% { transform: translateY(-3px) scaleY(1.03); } 80% { transform: translateY(0) scaleY(.95); } }
.g-say { position: absolute; left: 46px; top: 34px; z-index: 5; background: #fff; color: var(--ink); font-size: 12.5px; font-weight: 700; white-space: nowrap; padding: 5px 10px; border-radius: 12px; box-shadow: 0 4px 12px rgba(90, 60, 30, .18); opacity: 0; scale: .6; transform-origin: 0 0; pointer-events: none; transition: opacity .18s, scale .3s cubic-bezier(.3, 1.7, .5, 1); }
.g-say::before { content: ''; position: absolute; left: 8px; top: -5px; border: 6px solid transparent; border-top: 0; border-bottom-color: #fff; }
.g-say.on { opacity: 1; scale: 1; }
.g-wallet { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.g-wallet .ess-chip, .g-wallet .coin-chip { font-size: 13px; padding: 3px 9px; gap: 3px; }
.coin-chip { display: inline-flex; align-items: center; font-weight: 700; border-radius: 99px; background: #fff0c4; color: #8a5a00; }
.g-wallet .ic { width: 15px; height: 15px; }
.theme-goals .iconbtn { background: rgba(255, 255, 255, .75); }

.g-claimbar { display: flex; align-items: center; gap: 10px; margin: 4px 0 10px; padding: 12px 12px 12px 14px; border-radius: 20px; background: linear-gradient(120deg, #ffe58a, #ffc6dc); box-shadow: 0 8px 20px rgba(242, 160, 60, .28); animation: g-glow 2.2s ease-in-out infinite; }
.g-claimbar > div { flex: 1; display: flex; flex-direction: column; }
.g-claimbar b { font-size: 15.5px; color: #4a3420; } .g-claimbar small { font-size: 12.5px; color: #7a5a3a; font-weight: 500; }
.g-claimall { flex: none; min-height: 44px; padding: 0 16px; border-radius: 15px; font-size: 15px; font-weight: 700; background: linear-gradient(180deg, #fff 0, #fff7de 100%); color: #a35b00; box-shadow: 0 4px 0 #e9a93a, 0 8px 16px rgba(160, 90, 0, .2); }
@keyframes g-glow { 50% { box-shadow: 0 8px 26px rgba(255, 150, 80, .45); } }
.g-label { font-size: 13px; font-weight: 700; color: #7a5a3a; margin: 14px 2px 6px; }
.g-empty { text-align: center; color: var(--ink-soft); background: #fff; border-radius: 18px; padding: 18px; margin-top: 8px; font-weight: 600; }

.g-row { --k: #ffc94a; --k2: #ffe39a; --kt: #fff0c2; display: flex; gap: 11px; align-items: center; background: #fff; border: 2px solid transparent; border-radius: 18px; padding: 10px 10px 10px 10px; margin-bottom: 8px; box-shadow: 0 2px 0 rgba(120, 80, 40, .06), 0 4px 12px rgba(120, 80, 40, .06); overflow: hidden; }
.g-row.k-move { --k: #ff7aa2; --k2: #ffb2c8; --kt: #ffe3ec; }
.g-row.k-slimes { --k: #9b87f5; --k2: #c9bcff; --kt: #eee8ff; }
.g-row.k-race { --k: #ff9a52; --k2: #ffc79c; --kt: #ffe8d6; }
.g-row.k-explore { --k: #3fbf8a; --k2: #9be3c4; --kt: #daf6ea; }
.g-row.k-story { --k: #4fa3ee; --k2: #a8d4ff; --kt: #dff0ff; }
.g-row.k-special { --k: #f2b233; --k2: #ffe08a; --kt: #fff1c9; }
.g-row.k-bonus { --k: #b46be8; --k2: #e1b8ff; --kt: #f4e6ff; background: linear-gradient(120deg, #fff 40%, #f8eeff); }
.g-ic { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 23px; line-height: 1; background: var(--kt); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .05); }
.g-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.g-main b { font-size: 15px; line-height: 1.2; } .g-main > span { font-size: 12.5px; color: var(--ink-soft); line-height: 1.35; }
.g-tag { align-self: flex-start; font-style: normal; font-size: 10.5px; font-weight: 700; color: #d64f7c; background: #ffe3ec; padding: 1px 7px; border-radius: 99px; margin: 1px 0; }
.g-bar { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.g-track { flex: 1; height: 9px; border-radius: 99px; background: var(--kt); overflow: hidden; }
.g-track i { display: block; height: 100%; min-width: 9px; border-radius: 99px; background: linear-gradient(90deg, var(--k2), var(--k)); transition: width .8s cubic-bezier(.25, 1.2, .4, 1); }
.g-bar small { font-size: 11px; font-weight: 700; color: var(--ink-faint); white-space: nowrap; }
.g-rew { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.g-rew span { display: inline-flex; align-items: center; gap: 3px; background: #fbf5ea; padding: 2px 7px 2px 5px; border-radius: 99px; }
.g-rew .gr-ess { background: #f0ebff; color: #5b47c9; } .g-rew .gr-coin { background: #fff3d1; color: #8a5a00; }
.g-rew .ic { width: 14px; height: 14px; }
.g-act { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.g-show { border: 2px solid #e4dcff; background: #fff; color: var(--lilac-2); font: inherit; font-size: 12.5px; font-weight: 700; padding: 5px 10px; border-radius: 99px; white-space: nowrap; cursor: pointer; }
.g-claim { min-height: 42px; padding: 0 16px; border-radius: 14px; font-size: 15px; font-weight: 700; box-shadow: 0 4px 0 #d99a1c, 0 6px 14px rgba(247, 183, 51, .35); animation: g-wiggle 3.2s ease-in-out infinite; }
@keyframes g-wiggle { 0%, 82%, 100% { rotate: 0deg; } 85% { rotate: -5deg; } 89% { rotate: 5deg; } 93% { rotate: -3deg; } 96% { rotate: 2deg; } }
.g-claim.g-claimed { background: linear-gradient(180deg, #8fe3b0, #3fbf8a); color: #fff; box-shadow: 0 4px 0 #2a9a6a; animation: jz-pop-big .5s cubic-bezier(.3, 1.8, .5, 1); min-width: 52px; font-size: 20px; }
.g-row.ready { border-color: #ffcf5c; background: linear-gradient(120deg, #fffdf3, #fff4d2); box-shadow: 0 0 0 4px rgba(255, 207, 92, .18), 0 6px 16px rgba(242, 178, 51, .18); }
.g-row.claiming { animation: g-flash .5s ease-out; }
@keyframes g-flash { 30% { background: #fffbe0; box-shadow: 0 0 0 6px rgba(255, 207, 92, .35); } }
.g-row.done { opacity: .62; box-shadow: none; background: rgba(255, 255, 255, .6); }
.g-done { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #3fbf8a; color: #fff; font-weight: 800; font-size: 17px; }
.g-row.g-new { animation: g-in .5s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes g-in { 0% { opacity: 0; translate: 0 14px; scale: .96; } 100% { opacity: 1; translate: 0 0; scale: 1; } }
.g-tut .g-row { border-color: #ffc2d3; background: linear-gradient(120deg, #fff, #fff2f6); }
.g-tut .g-row.ready { border-color: #ffcf5c; background: linear-gradient(120deg, #fffdf3, #fff4d2); }

.g-board { border-radius: 22px; padding: 12px 10px 4px; margin: 14px 0 10px; background: linear-gradient(160deg, #ffe7b8, #ffd8c8); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .6); }
.g-board.b-week { background: linear-gradient(160deg, #d6ecff, #e3dcff); }
.g-bhead { display: flex; align-items: baseline; gap: 8px; padding: 0 4px; flex-wrap: wrap; }
.g-bhead b { font-size: 17px; color: #4a3420; } .g-bhead span { font-weight: 700; font-size: 13px; color: #fff; background: rgba(74, 52, 32, .45); padding: 1px 8px; border-radius: 99px; }
.g-bhead small { margin-left: auto; font-size: 11.5px; font-weight: 600; color: rgba(74, 52, 32, .65); }
.b-week .g-bhead b { color: #2f3e66; } .b-week .g-bhead span { background: rgba(47, 62, 102, .45); } .b-week .g-bhead small { color: rgba(47, 62, 102, .65); }
.g-stamps { display: flex; gap: 7px; margin: 9px 2px 10px; flex-wrap: wrap; }
.g-stamp { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 17px; background: rgba(255, 255, 255, .55); border: 2px dashed rgba(120, 80, 40, .22); filter: grayscale(.6); opacity: .8; }
.g-stamp.ready { border: 2px solid #ffcf5c; background: #fff; filter: none; opacity: 1; animation: g-glow-ring 1.6s ease-in-out infinite; }
@keyframes g-glow-ring { 50% { box-shadow: 0 0 0 5px rgba(255, 207, 92, .35); } }
.g-stamp.on { border: 0; background: #3fbf8a; color: #fff; font-weight: 800; filter: none; opacity: 1; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12); }
.g-stamp.g-gift { margin-left: auto; border-style: solid; }
.g-stamp.g-gift.on { background: #b46be8; }
.g-board .g-row { margin-bottom: 7px; }
.g-all { margin-top: 14px; }
.g-all > summary { font-weight: 700; color: #7a5a3a; }
@media (prefers-reduced-motion: reduce) { .g-mascot img, .g-claimbar, .g-claim, .g-stamp.ready { animation: none; } .g-track i { transition: none; } }

/* ---- healthy habits (30 Oct): streak chip, Move badge, Healthy week card, daily gift, Stone strengthen button, goal chip glow ---- */
.tab.move { overflow: visible; }
.tab .badge.gold { background: #ffc94d; color: #5a3d00; box-shadow: 0 2px 6px rgba(240, 170, 40, .5); top: -4px; right: -2px; }
.streak-chip { position: absolute; left: 50%; top: -19px; translate: -50% 0; padding: 1px 7px; border-radius: 999px; background: rgba(255, 250, 241, .92); color: #c2571f; font-size: 10.5px; font-weight: 800; line-height: 15px; white-space: nowrap; box-shadow: 0 2px 6px rgba(58, 42, 61, .12); pointer-events: none; }
.streak-chip[hidden] { display: none; }
@media (orientation: landscape) and (max-height: 560px) { .streak-chip { top: -16px; font-size: 10px; } }
.agechip.goal.claim { background: linear-gradient(90deg, #fff1c9, #ffe3ef); color: var(--ink); animation: goalGlow 1.8s ease-in-out infinite; }
@keyframes goalGlow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 196, 77, .0), var(--shadow); scale: 1; } 50% { box-shadow: 0 0 0 5px rgba(255, 196, 77, .38), 0 0 18px rgba(255, 170, 60, .45); scale: 1.035; } }
@media (prefers-reduced-motion: reduce) { .agechip.goal.claim { animation: none; box-shadow: 0 0 0 3px rgba(255, 196, 77, .45), var(--shadow); } }

.hw-card { background: linear-gradient(160deg, #fff4f8, #fff8e8); border: 2px solid #ffd6e4; border-radius: 22px; padding: 12px 12px 10px; margin-bottom: 14px; box-shadow: 0 4px 14px rgba(255, 111, 145, .1); }
.hw-card.has-ready { border-color: #ffc94d; box-shadow: 0 0 0 3px rgba(255, 201, 77, .25), 0 4px 14px rgba(255, 170, 60, .18); }
.hw-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.hw-head b { font-size: 16px; color: #d2416b; }
.hw-head small { color: var(--ink-soft); font-weight: 600; font-size: 12.5px; }
.hw-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin: 10px 0 8px; }
.hw-day { display: flex; flex-direction: column; align-items: center; gap: 2px; font-style: normal; }
.hw-day span { width: 100%; max-width: 40px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-size: 17px; background: #fff; border: 2px dashed #f1d9e2; }
.hw-day small { font-size: 11px; font-weight: 700; color: var(--ink-soft); }
.hw-day.move span { background: linear-gradient(180deg, #ff9ab8, #ff6f91); border: 2px solid #ff6f91; box-shadow: 0 2px 6px rgba(255, 111, 145, .35); }
.hw-day.rest span { background: #ece6ff; border: 2px solid #c8b8ff; }
.hw-day.today span { border-style: solid; border-color: #ff6f91; }
.hw-day.today small { color: #d2416b; }
.hw-day.later span { opacity: .55; }
.hw-prizes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.hw-prize { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 4px 8px; border-radius: 16px; background: rgba(255, 255, 255, .75); border: 1.5px solid #f6e3c8; text-align: center; min-height: 86px; justify-content: center; }
.hw-prize .hw-pi { font-size: 22px; line-height: 26px; display: inline-flex; align-items: center; gap: 2px; font-weight: 800; }
.hw-prize .hw-pi .ic { width: 18px; height: 18px; }
.hw-prize small { font-size: 11.5px; color: var(--ink-soft); font-weight: 700; }
.hw-prize .hw-left { font-size: 11px; color: var(--ink-soft); font-weight: 600; }
.hw-prize .hw-ok { color: #3aa76d; font-size: 16px; }
.hw-prize.ready { background: #fff7d6; border-color: #ffc94d; animation: g-glow-ring 1.6s ease-in-out infinite; }
.hw-prize.got { opacity: .7; }
.hw-prize .btn.small { padding: 4px 12px; min-height: 30px; }
.hw-last { margin-top: 8px; font-size: 12.5px; font-weight: 600; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hw-life { margin-top: 10px; font-size: 12.5px; color: var(--ink-soft); }
.hw-life b { color: var(--ink); }
.hw-life .levelbar { margin-top: 6px; height: 7px; }
.hw-life .levelbar i { background: linear-gradient(90deg, #ffb37a, #ff6f91); }
.hw-life-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hw-how { margin: 8px 0 0; font-size: 11.5px; color: var(--ink-soft); line-height: 1.35; }
.hw-how .link { padding: 0; font-size: 12px; }

.lg-card h2 { margin-bottom: 2px; }
.lg-track { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 12px 0; }
.lg-step { display: flex; flex-direction: column; align-items: center; gap: 2px; font-style: normal; }
.lg-step span { width: 100%; max-width: 38px; aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center; background: #fff; border: 1.5px solid #f1e2c8; font-size: 17px; }
.lg-step span .ic { width: 18px; height: 18px; }
.lg-step small { font-size: 10px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.lg-step.done span { background: #e6f7ee; border-color: #9fdcbc; opacity: .75; }
.lg-step.now span { background: linear-gradient(180deg, #fff1c9, #ffd98a); border: 2px solid #ffb84d; animation: g-glow-ring 1.4s ease-in-out infinite; }
.lg-step.now small { color: #b26a00; }
.lg-step.big span { border-color: #ffb3c9; }
.lg-gains { margin: 4px 0 12px; }
.lg-away { margin-top: 12px; padding: 10px; border-radius: 14px; background: var(--cream-2); text-align: center; }
.lg-away small { display: block; color: var(--ink-soft); font-size: 12.5px; }
.lg-away .gains { margin: 6px 0; }

.st-up { display: flex; flex-direction: column; align-items: stretch; gap: 4px; width: 100%; margin-top: 14px; padding: 12px 14px; border: 0; border-radius: 18px; cursor: pointer; text-align: left; color: #fff; background: linear-gradient(135deg, #a98bff, #ff7fae); box-shadow: 0 6px 16px rgba(169, 139, 255, .35); font: inherit; }
.st-up.ready { animation: g-glow-ring 1.8s ease-in-out infinite; background: linear-gradient(135deg, #8f6bff, #ff5f97); }
.st-up.locked { background: var(--cream-2); color: var(--ink-soft); box-shadow: none; cursor: default; }
.st-up-h { font-weight: 800; font-size: 15.5px; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.st-up-h svg { width: 16px; height: 16px; flex: none; vertical-align: -2px; }
.st-up.locked .st-up-h { justify-content: flex-start; gap: 6px; }
.st-up-go { background: #ffd166; color: #5a3d00; font-size: 11.5px; padding: 2px 8px; border-radius: 999px; font-weight: 800; }
.st-up-sub { font-size: 12.5px; opacity: .92; font-weight: 600; }
.st-up-odds { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px; font-size: 12px; }
.sx-o { background: rgba(255, 255, 255, .22); border-radius: 10px; padding: 2px 7px; white-space: nowrap; }
.sx-o i { font-style: normal; opacity: .8; } .sx-o em { font-style: normal; font-weight: 800; }
.st-up.locked .sx-o { background: rgba(0, 0, 0, .04); }

/* ---- the bright treatment for the Move, Slimes and building pages (30 Oct), in the Goals panel's style ---- */
/* Move: candy pink, each activity in its own colour */
.panel.theme-move { background: linear-gradient(180deg, #ffd9e5 0, #ffeef3 130px, #fffaf1 300px); }
.theme-move header h1 { color: #b8335c; }
.theme-move .iconbtn, .theme-slimes .iconbtn { background: rgba(255, 255, 255, .75); }
.theme-move .tile { --c: #ffe1ea; background: linear-gradient(170deg, #fff 0%, var(--c) 120%); border: 2px solid var(--c); box-shadow: 0 3px 0 rgba(120, 60, 80, .06), 0 6px 14px rgba(120, 60, 80, .07); color: var(--ink); }
.theme-move .tile .blob { background: var(--c); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .05), 0 3px 8px rgba(0, 0, 0, .06); transition: rotate .2s; }
.theme-move .tile:hover .blob { rotate: -6deg; }
.theme-move .mv-week { background: linear-gradient(120deg, #ffe3ec, #fff1c9); border: 2px solid #ffd0de; font-size: 14.5px; font-weight: 600; flex-wrap: wrap; }
.theme-move .hist { background: #fff; box-shadow: 0 2px 8px rgba(120, 60, 80, .06); }
.theme-move .fold > summary { color: #b8335c; font-weight: 700; }
.theme-move .stepper button { background: #ffe3ec; color: #d2416b; box-shadow: inset 0 -3px 0 rgba(210, 65, 107, .12); }
.theme-move .stepper input { border-color: #ffd0de; }
.theme-move .chip { background: #fff; border: 1.5px solid #ffd6e2; color: #9a4a64; }
.theme-move .chip.on { background: linear-gradient(180deg, #ff9ab8, #ff6f91); border-color: transparent; color: #fff; box-shadow: 0 3px 8px rgba(255, 111, 145, .3); }
.theme-move .seg button { background: #fff; border-color: #ffe1ea; }
.theme-move .seg button.on { background: #fff0f5; border-color: #ff6f91; box-shadow: 0 3px 10px rgba(255, 111, 145, .2); }
.theme-move .field > label { color: #9a3a58; }
.theme-move .estimate { background: linear-gradient(180deg, rgba(255, 250, 241, 0), #fffaf1 22%); }
.theme-move [data-log]:not(:disabled) { min-height: 54px; font-size: 18px; animation: mvGlow 2.2s ease-in-out infinite; }
@keyframes mvGlow { 50% { box-shadow: 0 6px 22px rgba(255, 111, 145, .55); } }
.mv-active { margin: 0 0 12px; padding: 9px 12px; border-radius: 14px; background: linear-gradient(120deg, #ffe3ec, #fff4d2); border: 2px solid #ffc2d3; font-size: 14px; color: var(--ink); text-align: center; }
.mv-active b { color: #d2416b; }

/* Slimes: soft lilac, coloured tabs */
.panel.theme-slimes { background: linear-gradient(180deg, #e6ddff 0, #f2edff 130px, #fffaf1 300px); }
.theme-slimes header h1 { color: #5b47c9; }
.theme-slimes .segs { background: rgba(255, 255, 255, .65); box-shadow: 0 2px 10px rgba(91, 71, 201, .1); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.theme-slimes .segs button.on { background: linear-gradient(180deg, #b9a7ff, #8f78f0); color: #fff; box-shadow: 0 3px 10px rgba(143, 120, 240, .35); }
.theme-slimes .segs button.on small { opacity: .9; }
.theme-slimes .res-card { background: #fff; border: 2px solid #ece6ff; box-shadow: 0 3px 0 rgba(91, 71, 201, .05), 0 6px 14px rgba(91, 71, 201, .07); }
.theme-slimes .res-card.r-rare { background: linear-gradient(180deg, #fff, #eaf3ff); }
.theme-slimes .res-card.r-epic { background: linear-gradient(180deg, #fff, #f3eaff); }
.theme-slimes .res-card.r-legendary { background: linear-gradient(180deg, #fff8e0, #ffe6b8); border-color: #f2b233; }
.theme-slimes .res-card.shiny { background: linear-gradient(#fff, #fff) padding-box, linear-gradient(120deg, #ff9ec0, #ffd27a, #a8f0c0, #9fe8ff, #c9b6ff, #ff9ec0) border-box; background-size: 100% 100%, 300% 300%; }
.theme-slimes .res-card img { transition: translate .25s cubic-bezier(.3, 1.6, .5, 1); }
.theme-slimes .res-card:hover img { translate: 0 -4px; }
.theme-slimes .res-card.empty { border: 2px dashed #c9bcff; background: rgba(255, 255, 255, .5); color: #8f78f0; box-shadow: none; }
.theme-slimes .body h3 { color: #5b47c9; font-weight: 700; }

/* Building pages: a picture tile, a level pill, a sunny "what it does" card, glowing Collect and Upgrade */
.sheet[data-kind="building"] { background: linear-gradient(180deg, #fff3cf 0, #fffaf1 140px); }
.b-head { display: flex; align-items: center; gap: 12px; padding-right: 84px; min-height: 56px; }
.b-ic { flex: none; width: 58px; height: 58px; border-radius: 18px; background: #fff; display: grid; place-items: center; box-shadow: 0 3px 0 rgba(150, 100, 30, .08), 0 6px 14px rgba(150, 100, 30, .1); overflow: hidden; font-size: 30px; }
.b-ic .thumb { width: 60px; height: 66px; margin: 2px 0 0; }
.b-ic .thumb-emo { font-size: 30px; line-height: 58px; height: 58px; }
.b-head h2 { margin: 0; }
.b-lv { display: inline-block; margin-top: 4px; padding: 1px 10px; border-radius: 99px; background: linear-gradient(90deg, #b9a7ff, #ff9ab8); color: #fff; font-weight: 800; font-size: 12.5px; box-shadow: 0 2px 6px rgba(143, 120, 240, .25); }
.sheet[data-kind="building"] .b-what { background: #fff; border: 2px solid #ffe6a8; box-shadow: 0 3px 10px rgba(242, 178, 51, .12); font-weight: 600; }
.sheet[data-kind="building"] .b-what b { color: #a35b00; }
.b-collect { animation: bCollect 1.8s ease-in-out infinite; }
@keyframes bCollect { 50% { box-shadow: 0 6px 22px rgba(247, 183, 51, .6); } }
.b-upbtn.can { animation: bUp 2.4s ease-in-out infinite; }
@keyframes bUp { 50% { box-shadow: 0 6px 22px rgba(143, 120, 240, .55); } }
.sheet[data-kind="building"] .levelbar { height: 10px; background: #f3ead8; }
.sheet[data-kind="building"] .levelbar i { background: linear-gradient(90deg, #ffd166, #ff9ab8, #b9a7ff); }
@media (prefers-reduced-motion: reduce) { .b-collect, .b-upbtn.can, .theme-move [data-log] { animation: none !important; } }
.theme-move .steps-card { background: #fff; border: 2px solid #ffe1ea; box-shadow: 0 4px 14px rgba(255, 111, 145, .08); }
.theme-move .steps-card .stepper button { background: #ffe3ec; }
.theme-move .steps-card .chip:not(.on) { background: #fff; }
/* 31 Oct: long slime names wrap under the sheet's ? and ✕ instead of hiding behind them (a float keeps the first line clear) */
.rcard h2 { padding-right: 0; overflow-wrap: anywhere; }
.rcard h2::before { content: ''; float: right; width: 84px; height: 34px; }
.rcard h2.long { font-size: 19px; }
.streak-chip.zero { filter: grayscale(1); color: var(--ink-soft); opacity: .9; }
/* the strengthen button's odds: two small bars (now / next tier), no numbers (Jack, 31 Oct) */
.st-up-bars { display: grid; grid-template-columns: auto 1fr; gap: 5px 8px; align-items: center; margin-top: 4px; }
.st-up-bars small { font-size: 11.5px; font-weight: 700; opacity: .9; }
.st-up .odds.st-mini { display: flex; height: 10px; border-radius: 99px; overflow: hidden; gap: 2px; background: rgba(255, 255, 255, .35); padding: 2px; box-sizing: content-box; }
.st-up .odds.st-mini i { display: block; border-radius: 99px; }
/* 31 Oct: on short landscape screens the area quick-jump column sat on top of the "?" help button. It now starts below the
   help button and, if there are many areas, wraps into a second column to the left instead of running off the screen. */
@media (orientation: landscape) and (max-height: 560px) {
  .area-jump { top: calc(var(--safe-t) + 114px); transform: none; flex-wrap: wrap-reverse; max-height: calc(100dvh - var(--safe-t) - 122px); align-content: flex-start; gap: 5px; }
  .area-jump button { width: 40px; height: 40px; font-size: 18px; }
}
