/* ═══════════════════════════════════════════════════════════
   MOO FACTORY — ui.css (components inside panels & modals)
   ═══════════════════════════════════════════════════════════ */

.btn {
  font-family: var(--font-px);
  border: 3px solid var(--wood);
  background: var(--cream-dark);
  color: var(--ink);
  box-shadow: var(--shadow);
  cursor: pointer;
  padding: 10px 14px;
  font-size: 11px;
  line-height: 1.5;
  transition: filter .1s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
.btn-green { background: var(--green); border-color: var(--green-dark); color: #fff; }
.btn-gold  { background: var(--gold); border-color: var(--gold-dark); color: #5b3a00; }
.btn-red   { background: var(--red); border-color: var(--red-dark); color: #fff; }
.btn-big { font-size: 14px; padding: 16px 26px; }
.btn[disabled] { filter: grayscale(.8) brightness(.85); cursor: not-allowed; transform: none; }

/* ═══════════ PIXEL ICONS (replace emojis) ═══════════ */
.pix-ico {
  display: inline-block;
  width: 22px; height: 22px;
  image-rendering: pixelated;
  vertical-align: -4px;
  pointer-events: none;
  user-select: none;
}
.pix-ico.s14 { width: 14px; height: 14px; vertical-align: -2px; }
.pix-ico.s16 { width: 16px; height: 16px; vertical-align: -3px; }
.pix-ico.s18 { width: 18px; height: 18px; vertical-align: -3px; }
.pix-ico.s26 { width: 26px; height: 26px; vertical-align: -6px; }
.pix-ico.s28 { width: 28px; height: 28px; vertical-align: -7px; }
.pix-ico.s32 { width: 32px; height: 32px; vertical-align: -9px; }
.pix-ico.s36 { width: 36px; height: 36px; vertical-align: -10px; }
.pix-ico.s44 { width: 44px; height: 44px; vertical-align: -13px; }

/* ═══════════ BOLD TEXT READABILITY (v1.8.19 QA #1) ═══════════
   VT323 (the pixel body font) has NO real bold weight — browsers
   synthesize faux-bold by smearing the strokes, which at 18-20px turns
   <b> into a muddy, hard-to-read blob on the cream backgrounds.
   Pixel-art emphasis is COLOR, not weight: bold text in body contexts
   now renders at normal weight with a clearly readable darker-ink /
   context color (plus a small size bump where the text is the star). */
.modal-body b,
.welcome-step b,
.sec-note b,
.shop-desc b,
.stat-row b,
.policy-p b,
.set-label b,
.toast b {
  font-weight: 400;
  color: var(--wood-dark);
}
/* v1.8.29: the title save chip is now a translucent DARK chip over the
   world — its emphasis needs a warm gold (wood-dark would vanish). */
.title-save b {
  font-weight: 400;
  color: #ffd84a;
}
/* welcome steps: the emphasized action words get a size bump too —
   clearly distinct from surrounding text without faux-bold smearing */
.welcome-step b { font-size: 22px; color: var(--green-dark); }
/* colored toasts keep their own emphasis hues */
.toast.tip b { color: #2d6a9e; }
.toast.gold b { color: var(--gold-dark); }
.toast.green b { color: var(--green-dark); }
.toast.red b { color: #b3261e; }

/* ═══════════ POST-UPGRADE PREVIEW VALUE (v1.8.19 QA #11) ═══════════ */
.shop-desc .next-val { color: var(--green-dark); }

/* ═══════════ SHOP / UPGRADE ROWS ═══════════
   v1.8.28: calmer scan rhythm — softer cream, thinner 2px shadow,
   slightly tighter rows. Same pixel language, less border noise when a
   list runs 6+ rows. */
.shop-row {
  display: flex; align-items: flex-start; gap: 10px;
  background: #fbf4e2;
  border: 2px solid var(--wood);
  box-shadow: 0 2px 0 rgba(0,0,0,.15);
  padding: 8px 8px;
  margin-bottom: 8px;
}
.shop-row.locked { opacity: .55; filter: grayscale(.5); }
.shop-row.maxed { background: #eaf6e4; }

/* ═══ v2.7.4 TAP-TO-PANEL — the golden "you are here" flash on the row
   a world tap just opened (machine rows in MACHINES, farm cards in
   FARMS). One-shot pulse in the game's gold family; rows discarded by
   panel rebuilds start clean, so no cleanup timers are needed. ═══ */
.shop-row.row-flash, .farm-card.row-flash, .prod-storage.row-flash {
  animation: rowFlash 2.2s ease-out 1;
}
@keyframes rowFlash {
  0%   { box-shadow: 0 0 0 4px rgba(255, 193, 49, .95), 0 2px 0 rgba(0,0,0,.15); background: #ffe9a8; }
  18%  { box-shadow: 0 0 0 3px rgba(255, 193, 49, .85), 0 2px 0 rgba(0,0,0,.15); background: #ffdf8c; }
  38%  { box-shadow: 0 0 0 3px rgba(255, 193, 49, .55), 0 2px 0 rgba(0,0,0,.15); background: #fff3cd; }
  60%  { box-shadow: 0 0 0 2px rgba(255, 193, 49, .30), 0 2px 0 rgba(0,0,0,.15); background: #fbf4e2; }
  100% { box-shadow: 0 2px 0 rgba(0,0,0,.15); }
}
.farm-card.row-flash { box-shadow: 0 4px 0 rgba(0,0,0,.18); }   /* resting shadow matches .farm-card */
.shop-thumb {
  width: 44px; height: 44px; flex: 0 0 44px;
  image-rendering: pixelated; background-size: contain; background-repeat: no-repeat; background-position: center;
}
.shop-main { flex: 1 1 auto; min-width: 0; overflow: hidden; }
.shop-name { font-family: var(--font-px); font-size: 10px; color: var(--ink); margin-bottom: 5px; line-height: 1.5; overflow-wrap: break-word; }
.shop-desc { font-size: 18px; color: #7a674a; line-height: 1.28; overflow-wrap: break-word; margin-bottom: 2px; }
.shop-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: 0 0 auto; max-width: 96px; }
.shop-lvl {
  font-family: var(--font-px); font-size: 8px; color: #fff;
  background: var(--green-dark); padding: 3px 6px;
  line-height: 1.5; text-align: center;
}
.shop-lvl.maxed { background: var(--gold-dark); }
.buy-btn {
  font-family: var(--font-px); font-size: 9px;
  background: var(--green); color: #fff;
  border: 2px solid var(--green-dark);
  box-shadow: 0 3px 0 rgba(0,0,0,.25);
  padding: 8px 8px; cursor: pointer;
  width: 96px; text-align: center;
}
.buy-btn:active { transform: translateY(2px); box-shadow: none; }
/* v1.8.7 — retire (sell) cow button under the BUY button */
.sell-btn {
  font-family: var(--font-px); font-size: 8px;
  background: var(--cream-dark); color: var(--ink-soft);
  border: 2px solid var(--wood);
  padding: 5px 6px; cursor: pointer;
  width: 96px; text-align: center;
}
.sell-btn:active { transform: translateY(1px); }
.sell-btn small { display: block; font-size: 7px; margin-top: 2px; opacity: .85; line-height: 1.4; }
.buy-btn.cant { background: #9a9a9a; border-color: #6e6e6e; }
.buy-btn.maxed { background: var(--gold); border-color: var(--gold-dark); color: #5b3a00; }
.buy-btn small { display: block; font-size: 7px; margin-top: 3px; opacity: .9; line-height: 1.6; }

/* ═══════════ TABS ═══════════ */
.tab-bar { display: flex; gap: 4px; margin-bottom: 10px; flex-wrap: wrap; }
.tab-btn {
  font-family: var(--font-px); font-size: 8px;
  background: var(--cream-dark); border: 2px solid var(--wood);
  color: var(--ink-soft); padding: 7px 8px; cursor: pointer;
}
.tab-btn.active { background: var(--wood); color: var(--cream); }

/* ═══════════ SECTION HEADERS ═══════════ */
.sec-title {
  font-family: var(--font-px); font-size: 10px; color: var(--wood-dark);
  margin: 14px 0 8px 0; padding-bottom: 5px;
  border-bottom: 3px dashed rgba(91,67,38,.3);
  display: flex; align-items: center; gap: 6px;
}
.sec-title:first-child { margin-top: 2px; }
.sec-note { font-size: 18px; color: var(--ink-soft); margin: -4px 0 8px 0; line-height: 1.25; }
.sec-note b { color: var(--ink); }

/* ═══════════ PROGRESS BARS ═══════════ */
.pbar {
  height: 12px; background: #d9c79c;
  border: 2px solid var(--wood);
  position: relative; overflow: hidden;
}
.pbar-fill {
  position: absolute; inset: 0; width: 0%;
  background: repeating-linear-gradient(90deg, var(--green) 0 8px, #4a9a40 8px 16px);
  transition: width .2s linear;
}
.pbar-fill.gold { background: repeating-linear-gradient(90deg, var(--gold) 0 8px, #e5a428 8px 16px); }
.pbar-fill.red { background: repeating-linear-gradient(90deg, var(--red) 0 8px, #c04541 8px 16px); }

/* ═══════════ ALLOCATION STEPPERS ═══════════ */
.alloc-row {
  display: flex; align-items: center; gap: 8px;
  background: #fff9ea; border: 2px solid var(--wood);
  padding: 7px 9px; margin-bottom: 7px;
}
.alloc-name { flex: 1; font-size: 19px; }
.alloc-name small { display: block; color: var(--ink-soft); font-size: 15px; line-height: 1.2; }
.alloc-pct { font-family: var(--font-px); font-size: 11px; min-width: 52px; text-align: center; color: var(--green-dark); }
.stepper-btn {
  width: 34px; height: 34px;
  font-family: var(--font-px); font-size: 12px;
  background: var(--cream-dark); border: 2px solid var(--wood);
  cursor: pointer; color: var(--ink);
}
.stepper-btn:active { transform: translateY(2px); }

/* ═══════════ ACHIEVEMENT GRID ═══════════ */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 7px; }
.ach-cell {
  background: #fff9ea; border: 2px solid var(--wood);
  padding: 8px; text-align: center;
  opacity: .45; filter: grayscale(1);
}
.ach-cell.got { opacity: 1; filter: none; background: #fdf3d3; border-color: var(--gold-dark); }
.ach-ico { line-height: 1.2; }
.ach-ico .pix-ico { width: 32px; height: 32px; vertical-align: middle; }
.ach-name { font-family: var(--font-px); font-size: 7px; margin: 5px 0 4px 0; line-height: 1.5; }
.ach-desc { font-size: 15px; color: var(--ink-soft); line-height: 1.25; }
.ach-reward { font-size: 15px; color: var(--gold-dark); margin-top: 4px; display: inline-flex; align-items: center; gap: 4px; }

/* ═══════════ SETTINGS ═══════════ */
.set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 4px; border-bottom: 2px dashed rgba(91,67,38,.2);
}
.set-label { font-size: 20px; }
.set-label small { display: block; color: var(--ink-soft); font-size: 15px; }
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 130px; height: 10px;
  background: #d9c79c; border: 2px solid var(--wood);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  background: var(--green); border: 2px solid var(--green-dark);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  background: var(--green); border: 2px solid var(--green-dark);
  cursor: pointer; border-radius: 0;
}
/* v1.8.20 CrazyGames QA: .save-io removed together with the EXPORT /
   IMPORT save-code UI (saving is handled by the CrazyGames Data module). */

/* ═══════════ TOAST ═══════════
   v1.8.28: 2px border + lighter shadow — notifications stay readable
   but stop shouting over the farm. */
.toast {
  background: var(--cream);
  border: 2px solid var(--wood);
  box-shadow: 0 2px 0 rgba(0,0,0,.25);
  padding: 8px 14px;
  font-size: 18px; color: var(--ink);
  display: flex; align-items: center; gap: 9px;
  animation: toastIn .25s cubic-bezier(.34,1.56,.64,1);
  max-width: 100%;
  text-align: left;
}
.toast.gold { border-color: var(--gold-dark); background: #fff6dd; }
.toast.green { border-color: var(--green-dark); background: #eaf6e4; }
.toast.tip { border-color: #2d6a9e; background: #eaf3fb; max-width: 420px; }
.toast.tip b { color: #2d6a9e; }
.toast.red { border-color: #b3261e; background: #fdecea; }   /* v1.8.1: save-failure warning */
.toast.out { animation: toastOut .3s ease forwards; }
.toast-ico { line-height: 1; flex: 0 0 auto; display: inline-flex; }
.toast-ico .pix-ico { width: 26px; height: 26px; }
@keyframes toastIn { from { transform: translateY(-18px) scale(.9); opacity: 0; } }
@keyframes toastOut { to { transform: translateY(-14px); opacity: 0; } }

/* ═══════════ STAT LINES ═══════════ */
.stat-row { display: flex; justify-content: space-between; font-size: 19px; padding: 5px 2px; line-height: 1.2; }
.stat-row:nth-child(odd) { background: rgba(91,67,38,.06); }
.stat-row b { color: var(--wood-dark); }

/* ═══════════ MODAL CONTENT ═══════════ */
.modal-title {
  font-family: var(--font-px); font-size: 14px; color: var(--wood-dark);
  margin-bottom: 12px; text-align: center; line-height: 1.6;
}
.modal-body { font-size: 20px; line-height: 1.3; margin-bottom: 14px; }
.modal-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.modal-actions .btn { flex: 1 1 auto; min-width: 90px; }

/* ═══════════ PRODUCT SELECT ═══════════ */
.prod-pick {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 7px;
}
/* v3.5.0: the merged STORAGE & SALES section inside the PRODUCTS panel
   (the old standalone Storage panel). A dashed seam separates it from
   the focus/allocation content above — one panel, two clear halves. */
.prod-storage {
  margin-top: 16px;
  padding-top: 4px;
  border-top: 2px dashed rgba(91, 67, 38, .3);
}
.prod-cell {
  background: #fff9ea; border: 2px solid var(--wood);
  padding: 8px; text-align: center; cursor: pointer;
  position: relative;
}
.prod-cell.active { border-color: var(--green-dark); background: #eaf6e4; box-shadow: 0 0 0 2px var(--green-dark) inset; }
.prod-cell.locked { opacity: .5; filter: grayscale(.6); }
.prod-ico { line-height: 1; }
.prod-ico .pix-ico { width: 32px; height: 32px; vertical-align: middle; }
.prod-name { font-family: var(--font-px); font-size: 7px; margin: 5px 0; line-height: 1.5; }
.prod-val { font-size: 15px; color: var(--green-dark); line-height: 1.25; }
.prod-req { font-size: 14px; color: var(--red-dark); line-height: 1.25; display: flex; align-items: center; justify-content: center; gap: 4px; }

/* Empty inventory state */
.empty-note {
  text-align: center; padding: 26px 10px; color: var(--ink-soft);
  background: #fff9ea; border: 2px dashed var(--wood);
}
.empty-note .empty-ico { display: block; margin-bottom: 8px; }
.empty-note .empty-ico .pix-ico { width: 44px; height: 44px; }

/* ═══════════ WELCOME MODAL STEPS ═══════════ */
.welcome-steps { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.welcome-step {
  display: flex; align-items: center; gap: 12px;
  background: #fff9ea; border: 2px solid var(--wood);
  padding: 8px 12px; text-align: left; font-size: 20px;
}
.welcome-ico { flex: 0 0 36px; text-align: center; line-height: 1; }
.welcome-ico .pix-ico { width: 32px; height: 32px; vertical-align: middle; }

/* ═══════════ CREDITS ═══════════ */
.credits { text-align: center; padding: 6px 0 2px 0; }
.credits-dev { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 4px 0 2px 0; }
.credits-dev .pix-ico { width: 36px; height: 36px; }
.credits-name { font-family: var(--font-px); font-size: 16px; color: var(--wood-dark); letter-spacing: 1px; }
.credits-role { font-size: 19px; color: var(--ink-soft); margin-bottom: 12px; }
.credits-divider {
  height: 0; border-top: 3px dashed rgba(91,67,38,.3);
  margin: 10px 26px;
}
.credits-label { font-family: var(--font-px); font-size: 8px; color: var(--ink-soft); margin-bottom: 4px; }
.credits-tech { font-size: 21px; color: var(--ink); letter-spacing: 1px; }
.credits-power { font-size: 17px; color: var(--ink-soft); margin-top: 2px; }
.credits-thanks {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 14px; padding-top: 10px;
  border-top: 3px dashed rgba(91,67,38,.3);
  font-size: 22px; color: var(--green-dark);
}
.credits-thanks .pix-ico { width: 24px; height: 24px; }
.credits-heart { animation: heartBeat 1.2s ease-in-out infinite; display: inline-flex; }
@keyframes heartBeat { 0%,100% { transform: scale(1); } 30% { transform: scale(1.25); } 45% { transform: scale(1.05); } }

/* Cow tier list */
.cow-tier-ico { display: flex; align-items: center; justify-content: center; }

/* ═══════════ PRIVACY POLICY MODAL ═══════════ */
.policy { text-align: left; font-size: 19px; line-height: 1.35; }
.policy-intro {
  background: #fff9ea; border: 2px solid var(--wood);
  padding: 8px 12px; margin-bottom: 12px;
}
.policy-sec { margin-bottom: 12px; }
.policy-h {
  font-family: var(--font-px); font-size: 9px; color: var(--wood-dark);
  letter-spacing: 1px; margin-bottom: 4px;
  display: flex; align-items: center; gap: 6px;
}
.policy-h .pix-ico { width: 16px; height: 16px; flex: 0 0 auto; }
.policy-p { color: var(--ink); overflow-wrap: break-word; }
.policy-p b { color: var(--wood-dark); }
.policy-contact {
  background: #eaf6e4; border: 2px solid var(--green-dark);
  padding: 8px 12px;
}
.policy-mail {
  font-family: var(--font-px); font-size: 9px; color: var(--green-dark);
  display: inline-block; margin-top: 4px; line-height: 1.6;
  user-select: text; -webkit-user-select: text;
}

/* scrollbars */
#panelBody::-webkit-scrollbar, #modalCard::-webkit-scrollbar { width: 10px; }
#panelBody::-webkit-scrollbar-track, #modalCard::-webkit-scrollbar-track { background: #d9c79c; }
#panelBody::-webkit-scrollbar-thumb, #modalCard::-webkit-scrollbar-thumb { background: var(--wood); border: 2px solid #d9c79c; }

/* ═══════════ v1.8 FARM REGION CARDS ═══════════ */
.farm-card {
  background: #fff9ea;
  border: 3px solid var(--wood);
  box-shadow: 0 4px 0 rgba(0,0,0,.18);
  padding: 12px 10px 10px 10px;
  margin-bottom: 14px;
  position: relative;
}
.farm-card.owned { border-color: var(--green-dark); background: #f4fbef; }
.farm-card.owned::before {
  content: '';
  position: absolute; inset: 0;
  border: 2px solid rgba(88,176,76,.25);
  pointer-events: none;
}
.farm-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.farm-ico {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  background: #f0e6d2;
  border: 2px solid var(--wood);
  display: flex; align-items: center; justify-content: center;
}
.farm-title { min-width: 0; }
.farm-title b {
  font-family: var(--font-px);
  font-size: 11px; color: var(--ink);
  display: block; line-height: 1.6;
  letter-spacing: 1px;
}
.farm-card.owned .farm-title b { color: var(--green-dark); }
.farm-title small {
  display: block;
  font-size: 17px; color: var(--ink-soft); line-height: 1.3;
  overflow-wrap: break-word;
}
/* unlock requirement rows: icon · label · X / Y · bar */
.farm-gates { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 10px 0; }
.gate-row {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
  background: #f0e6d2;
  border: 2px solid #d9c79c;
  padding: 5px 8px;
}
.gate-row.done { background: #eaf6e4; border-color: var(--green); }
.gate-ico { grid-row: 1 / 3; line-height: 1; }
.gate-label { font-size: 18px; color: var(--ink); line-height: 1.25; overflow-wrap: break-word; }
.gate-row.done .gate-label { color: var(--green-dark); }
.gate-val { font-family: var(--font-px); font-size: 9px; color: var(--ink-soft); white-space: nowrap; }
.gate-val .pix-ico { vertical-align: -3px; }
.gate-row.done .gate-val .pix-ico { filter: none; }
.gate-bar {
  grid-column: 2 / 4;
  height: 7px;
  background: #d9c79c;
  border: 1px solid var(--wood);
  margin-top: 4px;
}
.gate-bar i { display: block; height: 100%; background: #e8a33c; }
.gate-row.done .gate-bar i { background: var(--green); }
.farm-buy { display: flex; justify-content: flex-end; }
.farm-unlock {
  min-width: 150px;
  background: var(--gold); border-color: var(--gold-dark); color: #5b3a00;
}
.farm-unlock.cant { background: #9a9a9a; border-color: #6e6e6e; color: #fff; }
.herd-btn { margin-top: 4px; background: var(--green); border-color: var(--green-dark); color: #fff; }
.herd-btn.cant { background: #9a9a9a; border-color: #6e6e6e; }

/* ═══════════ v2.5 IMPROVED STATS PANEL ═══════════
   Awards panel — top-products podium. (v2.5.1: the game-
   completion block styles were removed with the tracker —
   the game is endless and has no completion state.) */
.top-prod-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.top-prod {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(91,67,38,.06);
  padding: 5px 8px;
  font-size: 19px;
  line-height: 1.2;
}
.top-prod-rank {
  font-family: var(--font-px);
  font-size: 12px;
  color: var(--gold-dark);
  flex: 0 0 16px;
  text-align: center;
}
.top-prod-ico { line-height: 1; flex: 0 0 auto; }
.top-prod-name { overflow-wrap: break-word; }
.top-prod b { margin-left: auto; white-space: nowrap; }

/* ═══════════ v2.6.3 WHAT'S NEW — settings button + snapshot panel ═══════════
   The snapshots are NOT embedded in settings: the More panel carries one
   friendly button (gold-tinted, icon + label + version teaser + NEW chip
   while unviewed); tapping it opens a DEDICATED snapshot panel (modal).
   The card styles below render inside that modal — same wood/cream pixel
   language as the farm cards: a cream card, VT323 headline row, and thin
   left-accented rows per group. Text sizes match .sec-note so the panel
   reads like the rest of the game, not like a website. */

/* the in-settings button */
.btn-whatsnew {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 2px 0 14px 0;
  padding: 9px 12px;
  text-align: left;
  background: #fff3cf;
  border-color: var(--gold-dark);
}
.btn-whatsnew .wn-btn-txt { flex: 1 1 auto; min-width: 0; }
.wn-btn-main {
  display: block;
  font-family: var(--font-px);
  font-size: 12px;
  color: var(--wood-dark);
  line-height: 1.5;
}
.wn-btn-sub {
  display: block;
  font-family: var(--font-px);
  font-size: 9px;
  color: var(--ink-soft);
  letter-spacing: .5px;
  line-height: 1.7;
}
/* v3.4.2: .btn-whatsnew .chip-new retired — the NEW chip never shows
   (updates are silent); rule removed. */

/* the snapshot panel (modal) content */
.notes-modal { padding-right: 2px; }
.notes-card {
  border: 3px solid var(--wood);
  background: #fbf3df;
  box-shadow: var(--shadow);
  padding: 10px 12px 8px 12px;
  margin: 2px 0 10px 0;
}
.notes-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  border-bottom: 2px dashed var(--wood);
  padding-bottom: 6px;
  margin-bottom: 6px;
}
.notes-ver {
  font-family: var(--font-px);
  font-size: 12px;
  color: #fff;
  background: var(--gold);
  border: 2px solid var(--gold-dark);
  padding: 3px 7px 2px 7px;
  line-height: 1.3;
}
.notes-title {
  font-family: var(--font-px);
  font-size: 13px;
  color: var(--ink);
  line-height: 1.4;
}
.notes-date { margin-left: auto; font-size: 17px; color: var(--ink-soft); }
.notes-intro { font-size: 18px; color: var(--ink-soft); margin: 0 0 6px 0; line-height: 1.25; }
.notes-group-h {
  display: block;
  font-family: var(--font-px);
  font-size: 10px;
  color: var(--green-dark);
  letter-spacing: 1px;
  margin: 8px 0 4px 0;
}
.notes-item {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  font-size: 18px;
  line-height: 1.22;
  color: var(--ink);
  padding: 3px 0 3px 2px;
  border-left: 3px solid #e3cf9e;
  margin: 0 0 3px 0;
}
.notes-bullet { flex: 0 0 auto; margin-top: 3px; }
/* v3.4.2: .chip-new retired (no NEW chip anywhere) — rule removed.
   chipPulse keyframes stay: world-chip.coming / tracker-chip.done /
   the event badge still pulse with them. */
@keyframes chipPulse { 0% { filter: brightness(1); } 100% { filter: brightness(1.35); } }
.notes-toggle { width: 100%; margin: 0 0 10px 0; padding: 8px 10px; font-size: 10px; }
.notes-past-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 17px;
  line-height: 1.25;
  padding: 5px 2px;
  border-bottom: 1px dashed #e3cf9e;
}
.notes-past-row b { font-weight: 400; color: var(--wood-dark); }
.notes-past-ver { font-family: var(--font-px); font-size: 9px; color: var(--ink-soft); flex: 0 0 auto; }
.notes-past-main { color: var(--ink-soft); }

/* ═══════════ v2.7.0 WORLDS PANEL ═══════════
   One card per world in the same wood/cream pixel language. Each card
   carries a swatch strip (grass · sand · sea) instead of a screenshot —
   three pixels tell you which island you are looking at. Locked worlds
   show live requirement rows with progress; the active world wears a
   green ACTIVE chip. */

.world-card {
  border: 3px solid var(--wood);
  background: #fbf3df;
  box-shadow: var(--shadow);
  padding: 10px 12px 10px 12px;
  margin: 2px 0 12px 0;
  position: relative;
}
.world-card.active { border-color: var(--green-dark); }
.world-card.locked { filter: saturate(.8); }
.world-head {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  border-bottom: 2px dashed var(--wood);
  padding-bottom: 6px; margin-bottom: 6px;
}
.world-num {
  font-family: var(--font-px); font-size: 12px; color: #fff;
  background: var(--green); border: 2px solid var(--green-dark);
  padding: 3px 7px 2px 7px; line-height: 1.3;
}
.world-card .world-num.w2 { background: var(--gold); border-color: var(--gold-dark); }
.world-name { font-family: var(--font-px); font-size: 13px; color: var(--ink); line-height: 1.4; }
.world-chip {
  font-family: var(--font-px); font-size: 9px; color: #fff;
  background: var(--green); border: 2px solid var(--green-dark);
  padding: 2px 6px 1px 6px; margin-left: auto; vertical-align: 3px;
}
.world-chip.coming { background: var(--gold); border-color: var(--gold-dark); animation: chipPulse 1.2s steps(2) infinite; }
.world-desc { font-size: 18px; color: var(--ink-soft); margin: 0 0 8px 0; line-height: 1.25; }
.world-swatch { display: flex; height: 14px; margin: 0 0 8px 0; border: 2px solid var(--wood); }
.world-swatch i { flex: 1 1 0; }
.world-stats { display: flex; gap: 12px; font-size: 17px; color: var(--ink-soft); margin: 0 0 4px 0; flex-wrap: wrap; }
.world-stats b { color: var(--wood-dark); font-weight: 400; }
.world-req {
  display: flex; gap: 7px; align-items: flex-start;
  font-size: 18px; line-height: 1.22; color: var(--ink);
  padding: 3px 0 3px 2px; border-left: 3px solid #e3cf9e;
  margin: 0 0 3px 0;
}
.world-req.done { color: var(--ink-soft); }
.world-req.done .wr-txt { text-decoration: line-through; }
.wr-ico { flex: 0 0 auto; margin-top: 1px; }
.wr-prog { margin-left: auto; color: var(--ink-soft); font-size: 16px; white-space: nowrap; }
.world-actions { display: flex; gap: 8px; margin-top: 8px; }
.world-actions .btn { flex: 1 1 auto; }
.world-travel-note { font-size: 16px; color: var(--ink-soft); margin-top: 6px; line-height: 1.3; }

/* ═══════════════════════════════════════════════════════════════
   v2.8.0 — WORLD COMPLETION TRACKER (stats panel + worlds cards)
   The headline bar is the world's STORY completion (quest chain);
   the five breakdown rows track the optional breadth (breeds,
   achievements, expansions, farms). Pixel rules: flat fills, hard-stop
   stripes, no gradients-with-soft-stops, no blur.
   ═══════════════════════════════════════════════════════════════ */
.tracker-card {
  background: #fff9ea;
  border: 3px solid var(--wood);
  box-shadow: 0 3px 0 rgba(0, 0, 0, .18);
  padding: 12px 12px 10px;
  margin: 2px 0 4px;
}
.tracker-card.done { background: #fdf3d3; border-color: var(--gold-dark); }
.tracker-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.tracker-name { font-family: var(--font-px); font-size: 10px; color: var(--ink); flex: 1; line-height: 1.5; }
.tracker-chip {
  font-family: var(--font-px); font-size: 7px; color: #fff;
  background: var(--green); border: 2px solid var(--green-dark);
  padding: 3px 6px 2px; white-space: nowrap;
}
.tracker-chip.done { background: var(--gold); border-color: var(--gold-dark); color: var(--wood-dark); animation: chipPulse 1.2s steps(2) infinite; }
.tracker-big { display: flex; align-items: center; gap: 8px; margin: 2px 0 4px; }
.tracker-bar {
  flex: 1; height: 16px;
  background: #d9c79c; border: 2px solid var(--wood);
  position: relative; overflow: hidden;
}
.tracker-bar i {
  position: absolute; inset: 0; width: 0%;
  background: repeating-linear-gradient(90deg, var(--gold) 0 8px, #e5a428 8px 16px);
}
.tracker-card.done .tracker-bar i { background: repeating-linear-gradient(90deg, var(--gold) 0 8px, #ffd84a 8px 16px); }
.tracker-pct { font-family: var(--font-px); font-size: 11px; color: var(--gold-dark); min-width: 46px; text-align: right; }
.tracker-sub { font-size: 16px; color: var(--ink-soft); margin: 2px 0 9px; line-height: 1.25; }
.tracker-sub b { color: var(--wood-dark); font-weight: 400; }
.tracker-break { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.trow { display: flex; align-items: center; gap: 6px; font-size: 15px; color: var(--ink-soft); }
.trow .tbar { flex: 1; height: 8px; background: #d9c79c; border: 1px solid var(--wood); position: relative; overflow: hidden; }
.trow .tbar i { position: absolute; inset: 0; width: 0%; background: var(--green); }
.trow.done .tbar i { background: var(--gold); }
.trow .tval { min-width: 64px; text-align: right; font-size: 14px; color: var(--ink); }
.tracker-other {
  display: flex; align-items: center; gap: 8px;
  font-size: 16px; color: var(--ink-soft);
  background: #fff9ea; border: 2px solid var(--wood);
  padding: 7px 10px; margin: 4px 0 2px;
}
.tracker-other b { color: var(--wood-dark); font-weight: 400; }
.tracker-other .tbar { flex: 1; height: 8px; background: #d9c79c; border: 1px solid var(--wood); position: relative; overflow: hidden; }
.tracker-other .tbar i { position: absolute; inset: 0; width: 0%; background: var(--green); }
@media (max-width: 460px) {
  .tracker-break { grid-template-columns: 1fr; }
}

/* ── worlds panel: the per-world completion row (v2.8.0) ── */
.world-prog {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 6px; font-size: 15px; color: var(--ink-soft);
}
.world-prog .wp-bar { flex: 1; height: 10px; background: #d9c79c; border: 2px solid var(--wood); position: relative; overflow: hidden; }
.world-prog .wp-bar i { position: absolute; inset: 0; width: 0%; background: repeating-linear-gradient(90deg, var(--green) 0 6px, #4a9a40 6px 12px); }
.world-prog .wp-count { min-width: 58px; text-align: right; }
.world-prog.done { color: var(--gold-dark); }
.world-prog.done .wp-bar { border-color: var(--gold-dark); }
.world-prog.done .wp-bar i { background: repeating-linear-gradient(90deg, var(--gold) 0 6px, #ffd84a 6px 12px); }
.world-prog.done .wp-label { font-family: var(--font-px); font-size: 8px; color: var(--gold-dark); }

/* ═══════════════════════════════════════════════════════════════
   v2.8.0 — THE WORLD ENDING SCENE (js/ending.js)
   A full-screen curtain call: dark dithered veil, celebration card
   with rotating flat-sector golden rays, journey stats and one green
   button. Chunky steps() motion, square particles, zero blur.
   ═══════════════════════════════════════════════════════════════ */
#endRoot {
  position: fixed; inset: 0; z-index: 320;   /* above modals (300) — the celebration owns the screen */
  display: flex; align-items: center; justify-content: center;
}
#endRoot.hidden { display: none !important; }
.end-veil {
  position: absolute; inset: 0;
  /* flat dark + a faint 4px pixel dither so it reads as "night", not blur */
  background: rgba(24, 16, 7, .82);
  background-image: repeating-linear-gradient(0deg, rgba(0,0,0,.10) 0 2px, transparent 2px 4px);
  animation: endVeilIn .35s steps(6) forwards;
}
#endRoot.out .end-veil { animation: endVeilOut .45s steps(6) forwards; }
@keyframes endVeilIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes endVeilOut { from { opacity: 1; } to { opacity: 0; } }
.end-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.end-card {
  position: relative;
  width: min(92vw, 440px);
  max-height: calc(100vh - 32px);
  overflow: hidden auto;
  background: var(--cream);
  border: var(--px-border);
  box-shadow: 0 6px 0 rgba(0, 0, 0, .45);
  padding: 24px 20px 20px;
  text-align: center;
  animation: endCardIn .5s cubic-bezier(.34, 1.56, .64, 1);
}
#endRoot.out .end-card { animation: endCardOut .4s ease forwards; }
@keyframes endCardIn { from { transform: scale(.55) translateY(40px); opacity: 0; } }
@keyframes endCardOut { to { transform: scale(.8) translateY(26px); opacity: 0; } }

/* rotating golden rays — flat hard-stop sectors (repeating-conic with
   no soft stops = chunky flat wedges, the striped-bar idiom radial) */
.end-rays {
  position: absolute; top: -120px; left: 50%;
  width: 380px; height: 380px; margin-left: -190px;
  pointer-events: none; opacity: 0;
  background: repeating-conic-gradient(rgba(255, 216, 74, .38) 0deg 14deg, transparent 14deg 30deg);
}
.end-rays.on { opacity: 1; animation: raysSpin 6s steps(12) infinite; }
@keyframes raysSpin { to { transform: rotate(360deg); } }

.end-trophy { line-height: 1; opacity: 0; position: relative; }
.end-trophy.on { animation: endPop .45s cubic-bezier(.34, 1.56, .64, 1) forwards; }
.end-trophy .pix-ico { width: 52px; height: 52px; }
.end-kicker {
  font-family: var(--font-px); font-size: 15px; line-height: 1.6;
  color: var(--gold-dark); margin: 6px 0 4px; opacity: 0;
  text-shadow: 2px 2px 0 rgba(201, 133, 20, .25);
}
.end-kicker.on { animation: endPop .35s cubic-bezier(.34, 1.56, .64, 1) forwards; }
.end-world { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 2px 0 12px; opacity: 0; }
.end-world.on { animation: endPop .35s cubic-bezier(.34, 1.56, .64, 1) forwards; }
.end-swatch { display: flex; width: 34px; height: 12px; border: 2px solid var(--wood); }
.end-swatch i { flex: 1 1 0; }
.end-wnum {
  font-family: var(--font-px); font-size: 9px; color: #fff;
  background: var(--green); border: 2px solid var(--green-dark);
  padding: 2px 5px 1px;
}
.end-wnum.w2 { background: var(--gold); border-color: var(--gold-dark); color: var(--wood-dark); }
.end-wname { font-family: var(--font-px); font-size: 11px; color: var(--ink); line-height: 1.4; }

.end-barwrap { display: flex; align-items: center; gap: 8px; margin: 0 2px 10px; opacity: 0; }
.end-barwrap.on { animation: endPop .3s ease forwards; }
.end-barwrap.done .end-bar i { background: repeating-linear-gradient(90deg, var(--gold) 0 8px, #ffd84a 8px 16px); }
.end-bar { flex: 1; height: 18px; background: #d9c79c; border: 2px solid var(--wood); position: relative; overflow: hidden; }
.end-bar i { position: absolute; inset: 0; width: 0%; background: repeating-linear-gradient(90deg, var(--gold) 0 8px, #e5a428 8px 16px); }
.end-pct { font-family: var(--font-px); font-size: 13px; color: var(--gold-dark); min-width: 54px; text-align: right; }
.end-sub { font-size: 18px; color: var(--ink-soft); margin: 0 0 10px; line-height: 1.3; opacity: 0; }
.end-sub.on { animation: endPop .3s ease forwards; }
.end-sub b { color: var(--wood-dark); font-weight: 400; }

.end-stats { border-top: 3px dashed rgba(91, 67, 38, .3); padding-top: 8px; margin-bottom: 6px; }
.end-stat {
  display: flex; align-items: center; gap: 8px;
  font-size: 18px; color: var(--ink-soft);
  padding: 4px 2px; opacity: 0;
}
.end-stat.on { animation: endPop .32s cubic-bezier(.34, 1.56, .64, 1) forwards; }
.end-stat:nth-child(odd) { background: rgba(91, 67, 38, .06); }
.end-stat-ico { flex: 0 0 auto; line-height: 1; }
.end-stat-label { flex: 1; text-align: left; }
.end-stat b { color: var(--wood-dark); font-weight: 400; }
.end-legend {
  font-size: 18px; color: var(--gold-dark);
  margin: 2px 0 8px; opacity: 0; line-height: 1.3;
}
.end-legend.on { animation: endPop .35s cubic-bezier(.34, 1.56, .64, 1) forwards; }
.end-legend .pix-ico { vertical-align: -4px; }
.end-btn {
  min-width: 190px; margin-top: 6px;
  opacity: 0; pointer-events: none;
}
.end-btn.on {
  opacity: 1; pointer-events: auto;   /* keyframes carry the pop; these guarantee interactivity */
  animation: endBtnIn .4s cubic-bezier(.34, 1.56, .64, 1), endBtnPulse 1.6s steps(2) infinite .4s;
}
@keyframes endPop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes endBtnIn { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes endBtnPulse { 50% { filter: brightness(1.14); } }

@media (max-width: 430px) {
  .end-card { padding: 18px 12px 16px; }
  .end-kicker { font-size: 12px; }
  .end-wname { font-size: 9px; }
  .end-stat { font-size: 16px; }
  .end-rays { width: 300px; height: 300px; margin-left: -150px; top: -110px; }
}

/* ═══════════════════════════════════════════════════════════════
   v2.9.0 — STATS CLARITY PASS · BULK BUY · SPEEDRUN UI
   Same pixel rules as everything above: flat fills, hard-stop stripes,
   chunky borders, no soft gradients, no blur.
   ═══════════════════════════════════════════════════════════════ */

/* ── AT A GLANCE — the four-tile scan row (stats panel hero) ── */
.glance-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; margin: 2px 0 6px;
}
.glance-tile {
  display: flex; flex-direction: column; gap: 2px;
  background: #fff9ea;
  border: 3px solid var(--wood);
  box-shadow: 0 3px 0 rgba(0,0,0,.18);
  padding: 8px 10px 7px;
}
.glance-tile .glance-ico { line-height: 0; }
.glance-tile .glance-val {
  font-family: var(--font-px); font-size: 11px; color: var(--ink);
  line-height: 1.6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.glance-tile .glance-label {
  font-family: var(--font-px); font-size: 6px; color: var(--ink-soft); letter-spacing: .5px;
}
.glance-tile.money { border-color: var(--gold-dark); }
.glance-tile.money .glance-val { color: var(--gold-dark); }
.glance-tile.income .glance-val { color: var(--green-dark); }
.glance-tile.herd .glance-val { color: var(--wood-dark); }
@media (max-width: 430px) { .glance-grid { grid-template-columns: 1fr 1fr; } }

/* ── dossier sections: headed cards with zebra rows ── */
.stat-sec {
  background: #fff9ea;
  border: 2px solid var(--wood);
  box-shadow: 0 2px 0 rgba(0,0,0,.14);
  padding: 6px 10px 7px;
  margin: 2px 0 8px;
}
.stat-sec-head {
  font-family: var(--font-px); font-size: 8px; color: var(--wood-dark);
  border-bottom: 2px solid var(--cream-dark);
  padding: 2px 0 5px; margin-bottom: 3px;
}
.stat-sec .stat-row { font-size: 19px; padding: 4px 2px; }

/* tracker rows: label joins the bar (v2.9.0) */
.trow .trow-ico { line-height: 0; flex: 0 0 auto; }
.trow .trow-label { min-width: 74px; font-size: 14px; color: var(--ink-soft); }
.top-prod.first {
  background: #fdf3d3; border-color: var(--gold-dark);
}

/* ── BULK BUY — the ×1 / ×10 / MAX segmented control ── */
.buymult-bar {
  display: flex; gap: 0; margin: 0 0 10px;
  border: 3px solid var(--wood);
  box-shadow: 0 3px 0 rgba(0,0,0,.18);
  width: max-content;
}
.buymult-btn {
  font-family: var(--font-px); font-size: 9px;
  background: var(--cream-dark); color: var(--ink);
  border: none; border-right: 3px solid var(--wood);
  padding: 8px 14px 7px; cursor: pointer;
}
.buymult-btn:last-child { border-right: none; }
.buymult-btn:hover { filter: brightness(1.06); }
.buymult-btn.active {
  background: var(--green); color: #fff;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.25);
}

/* ── SPEEDRUN — HUD-adjacent cards, intro + results modal ── */
.sr-live-card {
  background: #fff9ea;
  border: 3px solid var(--wood);
  box-shadow: 0 3px 0 rgba(0,0,0,.18);
  padding: 10px 12px 9px;
  margin: 2px 0 6px;
  text-align: center;
}
.sr-live-card.done { background: #fdf3d3; border-color: var(--gold-dark); }
.sr-live-card.small { text-align: left; }
.sr-live-time {
  font-family: var(--font-px); font-size: 20px; color: var(--ink);
  line-height: 1.4;
}
.sr-live-time.done { color: var(--gold-dark); }
.sr-live-pace { font-size: 17px; color: var(--ink-soft); margin: 3px 0 1px; line-height: 1.25; }
.sr-live-quests { font-size: 16px; color: var(--ink-soft); line-height: 1.25; }
.sr-pace { color: var(--gold-dark); }

/* worlds panel: the mid-run ferry note */
.sr-worldnote {
  display: flex; gap: 10px; align-items: flex-start;
  background: #fdf3d3; border: 3px solid var(--gold-dark);
  box-shadow: 0 3px 0 rgba(0,0,0,.18);
  padding: 10px 12px; margin: 0 0 10px;
  font-size: 17px; color: var(--ink-soft); line-height: 1.3;
}
.sr-worldnote b { font-weight: 400; color: var(--wood-dark); }

/* the speedrun modal family (intro + results)
   (v3.1.1: the v3.0.0 intro furniture — .sr-grid/.sr-cell chip grid,
   .sr-caveat(s) lines, .sr-medalrow/.sr-medalcard podium — retired
   with the decluttered rules panel; the intro now uses .sr-sub,
   .sr-medalline/.sr-ml/.sr-dot below) */
.sr-hero {
  display: flex; gap: 8px; align-items: center;
  font-size: 19px; color: var(--ink); margin-bottom: 4px; line-height: 1.3;
}
.sr-best { font-size: 18px; color: var(--gold-dark); margin-bottom: 4px; }
.sr-note { font-size: 15px; color: var(--ink-soft); margin-top: 6px; line-height: 1.3; }
.sr-final-time {
  font-family: var(--font-px); font-size: 26px; color: var(--ink);
  text-align: center; line-height: 1.5; margin-top: 4px;
}
.sr-final-time.sr-gold { color: var(--gold-dark); }
.sr-medal {
  font-family: var(--font-px); font-size: 10px; text-align: center;
  color: var(--ink-soft); margin: 4px 0 2px;
}
.sr-medal.sr-gold { color: var(--gold-dark); }
.sr-medal.sr-silver { color: #33383d; }
.sr-medal.sr-bronze { color: #4a2a10; }
.sr-newbest {
  font-family: var(--font-px); font-size: 9px; text-align: center;
  color: #fff; background: var(--green); border: 2px solid var(--green-dark);
  padding: 5px 6px 4px; width: max-content; margin: 6px auto 2px;
  animation: chipPulse 1.2s steps(2) infinite;
}
.sr-splits { margin-top: 4px; }
.sr-split {
  display: flex; gap: 8px; font-size: 17px; color: var(--ink-soft);
  padding: 3px 2px; line-height: 1.2;
}
.sr-split:nth-child(odd) { background: rgba(91,67,38,.06); }
.sr-split-label { flex: 1; }
.sr-split-delta { min-width: 70px; text-align: right; color: var(--ink-soft); }
.sr-split-time { min-width: 80px; text-align: right; color: var(--wood-dark); }
.sr-split.final {
  background: #fdf3d3; border: 2px solid var(--gold-dark);
  color: var(--gold-dark); padding: 4px 4px; margin-top: 2px;
}

/* ═══════════ v3.1.1 SPEEDRUN RULES PANEL — decluttered ═══════════
   The intro modal was a wall of blocks (six turbo chips, two caveat
   lines, a three-card medal podium, two banners). It is now five
   quiet lines: hero sentence, one muted turbo line, the medal
   thresholds as ONE compact inline row — tiny color dots, plain
   small text, no icons — a slim best-time line, and the safety
   footnote. Readable at a glance; the details live in the run
   itself. */
.sr-sub {
  font-size: 16px; color: var(--ink-soft);
  margin: 0 0 10px; line-height: 1.35;
}
.sr-medalline {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 4px 14px;
  margin: 0 0 8px;
}
.sr-ml {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 16px; color: var(--ink-soft); line-height: 1.2;
}
.sr-ml b { font-weight: 400; }
.sr-ml .sr-dot {
  width: 10px; height: 10px; flex: 0 0 auto;
  border: 2px solid rgba(0,0,0,.25);
  box-shadow: 0 1px 0 rgba(0,0,0,.15);
}
.sr-ml.gold   { color: var(--gold-dark); }
.sr-ml.gold   b { color: var(--gold-dark); }
.sr-ml.gold   .sr-dot { background: var(--gold); }
.sr-ml.silver { color: #33383d; }
.sr-ml.silver b { color: #33383d; }
.sr-ml.silver .sr-dot { background: #c5ced8; }
.sr-ml.bronze { color: #4a2a10; }
.sr-ml.bronze b { color: #4a2a10; }
.sr-ml.bronze .sr-dot { background: #d9945e; }
.sr-bestline {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--font-px); font-size: 10px; letter-spacing: 1px;
  color: var(--gold-dark);
  padding: 2px 0 0; margin: 0 0 4px;
}
.sr-bestline b { font-weight: 400; }
.sr-note {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 15px; color: var(--ink-soft); margin-top: 2px; line-height: 1.3;
}
@media (max-width: 420px) {
  .sr-medalline { gap: 3px 10px; }
}

/* ═══════════ v3.1.0 SPEEDRUN LEADERBOARD ═══════════
   The main-menu trophy's modal: a gold hero banner with the headline
   numbers (best time, runs recorded, medal counts), ranked run rows
   (tap a row's head to fold out the splits + the farm dossier), and
   an empty state that invites the first race. Splits inside a row
   reuse the .sr-split family from the results modal; medal tints
   reuse the sr-gold/sr-silver/sr-bronze color ids. */
.lb-hero {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 4px 12px;
  background: #fdf3d3; border: 3px solid var(--gold-dark);
  box-shadow: 0 3px 0 rgba(0,0,0,.18);
  padding: 8px 10px 7px; margin: 0 0 8px;
}
.lb-hero .lb-hero-main {
  font-family: var(--font-px); font-size: 10px; letter-spacing: 1px;
  color: var(--gold-dark);
}
.lb-hero .lb-hero-main b { font-weight: 400; color: #5b3a00; }
.lb-hero .lb-hero-sub { font-size: 16px; color: var(--ink-soft); line-height: 1.2; }
.lb-hero .lb-hero-sub b { font-weight: 400; color: var(--wood-dark); }

.lb-list { margin: 2px 0 4px; }
.lb-row {
  border: 2px solid rgba(91,67,38,.25);
  background: #fff9ea;
  box-shadow: 0 2px 0 rgba(0,0,0,.12);
  margin-bottom: 6px;
}
.lb-row:hover { border-color: rgba(91,67,38,.55); }
.lb-row.top1 { border-color: var(--gold-dark); background: #fdf3d3; }
.lb-row.this-run { border-color: var(--green-dark); }
.lb-row-head {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 9px; cursor: pointer;
}
.lb-rank {
  font-family: var(--font-px); font-size: 10px; color: var(--ink-soft);
  min-width: 26px; text-align: center; flex: 0 0 auto;
  background: var(--cream-dark); border: 2px solid var(--wood);
  padding: 5px 3px 4px;
}
.lb-row.top1 .lb-rank { background: var(--gold); border-color: var(--gold-dark); color: #5b3a00; }
.lb-ico { flex: 0 0 auto; display: inline-flex; }
.lb-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lb-time { font-family: var(--font-px); font-size: 15px; color: var(--ink); line-height: 1.25; }
.lb-time.sr-gold { color: var(--gold-dark); }
.lb-time.sr-silver { color: #33383d; }
.lb-time.sr-bronze { color: #4a2a10; }
.lb-date { font-size: 14px; color: var(--ink-soft); line-height: 1.15; }
.lb-delta { flex: 0 0 auto; font-size: 16px; color: var(--ink-soft); }
.lb-delta.best {
  font-family: var(--font-px); font-size: 8px; letter-spacing: 1px;
  color: #5b3a00; background: var(--gold); border: 2px solid var(--gold-dark);
  padding: 4px 5px 3px;
}
.lb-caret {
  flex: 0 0 auto; display: inline-flex; opacity: .6;
  transition: transform .18s ease;
}
.lb-row.open .lb-caret { transform: rotate(180deg); }
.lb-detail { display: none; border-top: 2px dashed rgba(91,67,38,.25); padding: 5px 9px 9px; }
.lb-row.open .lb-detail { display: block; }
.lb-detail-title {
  font-family: var(--font-px); font-size: 8px; letter-spacing: 1px;
  color: var(--ink-soft); margin: 5px 0 3px;
}
.lb-detail .sr-splits { margin: 0 0 4px; }
.lb-stats {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 3px 12px;
}
.lb-stat {
  display: flex; align-items: center; gap: 7px;
  font-size: 16px; color: var(--ink-soft); line-height: 1.2;
  padding: 2px 0; min-width: 0;
}
.lb-stat .pix-ico { flex: 0 0 auto; opacity: .8; }
.lb-stat-label {
  flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lb-stat b { font-weight: 400; color: var(--wood-dark); flex: 0 0 auto; }
.lb-empty {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  background: #fff9ea; border: 3px dashed rgba(91,67,38,.35);
  padding: 16px 12px; margin: 2px 0 6px;
  font-size: 17px; color: var(--ink-soft); line-height: 1.35; text-align: left;
}
.lb-empty b { font-weight: 400; color: var(--wood-dark); }
.lb-empty .pix-ico { flex: 0 0 auto; }

/* (the rules panel's clickable .sr-lblink banner retired in v3.1.1
   with the decluttered intro — the dock trophy and the finish
   screen's LEADERBOARD button are the board's entry points) */
@media (max-width: 420px) {
  .lb-stats { grid-template-columns: 1fr; }
  .lb-time { font-size: 13px; }
  .lb-date { font-size: 12px; }
  .lb-hero { flex-direction: column; gap: 3px; }
  .lb-row-head { gap: 7px; }
}

/* ═══════════ v3.4.0 CRAZYGAMES LEADERBOARDS — the weekly race ═══════════
   The weekly panel (title screen → the hanging CRAZYGAMES LEADERBOARDS
   sign) and the weekly live cards (STATS + MORE while the competition
   farm runs). Same modal family as the speedrun's (sr-modal base,
   cream cards, wood borders); the race's own accent is a grape purple,
   kept in one place (.wk-score-row's border + the live-card stripe).
   Structure: hero sentence → the THIS WEEK score banner → the Monday
   countdown → best from past weeks → the one-line rules plaque → the
   safety footnote (reuses .sr-note). */
.wk-hero {
  display: flex; gap: 8px; align-items: center;
  font-size: 19px; color: var(--ink); margin-bottom: 6px; line-height: 1.3;
}
.wk-hero b { font-weight: 400; color: var(--gold-dark); }
.wk-score-row {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: #fdf3d3;
  border: 3px solid #6b4a99;
  box-shadow: 0 3px 0 rgba(0,0,0,.18);
  padding: 8px 10px 7px; margin: 0 0 6px;
}
.wk-score-label {
  font-family: var(--font-px); font-size: 9px; letter-spacing: 2px;
  color: #6b4a99;
}
.wk-score {
  font-family: var(--font-px); font-size: 24px; color: #5b3a00;
  line-height: 1.35;
}
.wk-reset-line {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 17px; color: var(--ink-soft); margin: 0 0 6px; line-height: 1.3;
}
.wk-reset-line b { font-weight: 400; color: var(--gold-dark); }
.wk-best-line {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--font-px); font-size: 10px; letter-spacing: 1px;
  color: var(--gold-dark); margin: 0 0 8px; line-height: 1.3;
}
.wk-best-line b { font-weight: 400; }
.wk-best-line.none { color: var(--ink-soft); }
.wk-rules {
  font-size: 16px; color: var(--ink-soft); line-height: 1.35;
  background: rgba(91,67,38,.07);
  border: 2px dashed rgba(91,67,38,.3);
  padding: 7px 9px 6px; margin: 0 0 2px;
}
/* v3.5.4: the sync line (last score that reached the board) and the
   fair-play plaque (visible anti-cheat reassurance) — same rhythm as
   the reset line, green accents reading as verified/honest */
.wk-sync-line {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--font-px); font-size: 10px; letter-spacing: 1px;
  color: var(--green-dark); margin: 0 0 6px; line-height: 1.3;
}
.wk-fair {
  display: flex; align-items: flex-start; gap: 7px;
  font-size: 15px; color: var(--ink-soft); line-height: 1.35;
  background: rgba(46,125,50,.08);
  border: 2px solid rgba(46,125,50,.28);
  padding: 7px 9px 6px; margin: 6px 0 2px;
}
.wk-fair b { font-weight: 400; color: var(--green-dark); }
/* the live cards inside STATS / MORE while the week runs */
.wk-live { border-left: 6px solid #9b6fd0; }
.wk-live-score {
  font-family: var(--font-px); font-size: 20px; color: #6b4a99;
  line-height: 1.4;
}
@media (max-width: 420px) {
  .wk-score { font-size: 20px; }
  .wk-rules { font-size: 15px; }
}

/* ═══════════════════════════════════════════════════════════
   v3.6.0 "THE CLEAR LADDER" — locked-row requirements & the
   JOURNEY modal (tap the objective banner). One shared answer
   to "where do I unlock this?" for every gate in the game.
   ═══════════════════════════════════════════════════════════ */

/* the live requirement line on a locked machine row (MACHINES):
   lock icon + gate text, mini progress bar for countable gates,
   a WHERE chip + GO button when the gate lives in another panel */
.lock-req {
  display: flex; align-items: center; gap: 7px;
  flex-wrap: wrap;
  margin: 4px 0 2px 0;
  font-size: 16px; color: #8a6a3f;
  line-height: 1.25;
}
.lock-req .pix-ico { width: 14px; height: 14px; }
.lock-txt { min-width: 0; overflow-wrap: break-word; }
.lock-pbar { flex: 1 1 90px; max-width: 170px; height: 8px; margin: 0; }
.lock-val {
  font-family: var(--font-px); font-size: 8px; color: var(--ink-soft);
  white-space: nowrap;
}
.lock-where {
  font-family: var(--font-px); font-size: 8px; color: #fff;
  background: var(--wood); padding: 3px 6px;
  letter-spacing: .5px; white-space: nowrap;
}
/* v3.6.1: the chip may never stick out of its row — if a future label
   runs long it wraps INSIDE the chip instead of overflowing the panel */
.lock-where { max-width: 100%; }
.lock-go {
  font-family: var(--font-px); font-size: 8px;
  background: var(--gold); color: #4a3208;
  border: 2px solid var(--gold-dark);
  padding: 4px 11px; cursor: pointer;
  box-shadow: 0 2px 0 rgba(0,0,0,.25);
  min-height: 22px;
}
.lock-go:active { transform: translateY(2px); box-shadow: none; }

/* ── the JOURNEY modal (modal-body.jrn) ── */
/* the current-objective hero */
.jrn-hero {
  background: #f0e6d2;
  border: 2px solid var(--gold-dark);
  padding: 10px 12px;
  margin-bottom: 4px;
}
.jrn-qnum {
  font-family: var(--font-px); font-size: 8px; color: var(--gold-dark);
  letter-spacing: 1px; margin-bottom: 6px;
}
.jrn-qtext {
  font-size: 20px; color: var(--ink); line-height: 1.3;
  display: flex; gap: 7px; align-items: flex-start;
}
.jrn-qtext .pix-ico { flex: 0 0 auto; margin-top: 3px; }
.jrn-qreward {
  font-family: var(--font-px); font-size: 9px; color: var(--green-dark);
  margin: 7px 0 2px 0;
}
.jrn-qsub { font-size: 18px; color: var(--ink-soft); margin-top: 5px; line-height: 1.25; }
.jrn-qprog { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.jrn-qprog .pbar { flex: 1 1 auto; height: 10px; margin: 0; }
.jrn-qprog span {
  font-family: var(--font-px); font-size: 8px; color: var(--ink-soft);
  white-space: nowrap;
}

/* coming-up rows: dimmed objective + reward — v3.6.2: TEXT ONLY
   (the WHERE chips and hint lines are gone; where a thing lives is
   answered when it becomes the NOW objective) */
.jrn-next {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; row-gap: 4px;
  padding: 5px 2px;
  border-bottom: 2px dashed rgba(91, 67, 38, .22);
  font-size: 17px; color: var(--ink-soft); line-height: 1.25;
}
.jrn-next:last-of-type { border-bottom: 0; }
.jrn-ntext { flex: 1 1 auto; min-width: 0; overflow-wrap: break-word; }
.jrn-nreward {
  font-family: var(--font-px); font-size: 8px; color: var(--gold-dark);
  white-space: nowrap;
}

/* v3.6.2 "SAY LESS": NEXT UNLOCKS rows are minimal — icon + name +
   price (or lock), ONE status line, GO. Descriptions and WHERE chips
   are gone; the afford estimate is plain green text, not a chip. */
.jrn-unlock {
  background: #f0e6d2;
  border: 2px solid #d9c79c;
  padding: 7px 9px;
  margin-bottom: 6px;
}
.jrn-uhead { display: flex; align-items: center; gap: 8px; }
.jrn-uico { line-height: 1; flex: 0 0 auto; }
.jrn-uname {
  font-family: var(--font-px); font-size: 10px; color: var(--ink);
  flex: 1 1 auto; min-width: 0; line-height: 1.5;
  overflow-wrap: break-word;
}
.jrn-uprice {
  font-family: var(--font-px); font-size: 9px; color: var(--gold-dark);
  white-space: nowrap;
}
.jrn-ulock { flex: 0 0 auto; line-height: 1; display: flex; }
.jrn-note { font-size: 15px; color: var(--ink-soft); margin-top: 4px; line-height: 1.25; overflow-wrap: break-word; }
.jrn-ufoot {
  display: flex; align-items: center; gap: 7px;
  flex-wrap: wrap; margin-top: 6px;
}
.jrn-afford {
  font-family: var(--font-px); font-size: 8px; color: var(--green-dark);
  flex: 0 1 auto; min-width: 0; line-height: 1.6;
}
/* the gate label sits INSIDE the bar row: label · bar · count —
   wraps to its own line only on the narrowest screens
   (selector beats the .jrn-qprog span nowrap rule on purpose) */
.jrn-qprog .jrn-gate {
  font-family: var(--font-px); font-size: 8px; color: var(--ink-soft);
  flex: 0 1 auto; min-width: 0; line-height: 1.6;
  white-space: normal; overflow-wrap: break-word;
}
.jrn-qprog { flex-wrap: wrap; row-gap: 3px; }
/* v3.6.1: the hero's hint line (wheres without a GO button) — plain
   wrapping text at body size; chips stay for real locations only. */
.jrn-hint {
  flex: 1 1 100%; font-size: 16px; color: var(--ink-soft);
  line-height: 1.3; overflow-wrap: break-word;
  display: flex; align-items: flex-start; gap: 6px;
}
.jrn-hint .pix-ico { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 3px; }
.jrn-unlock .lock-go, .jrn-hero .lock-go { margin-left: auto; }

/* phones: body text sizes for the minimal rows, GO keeps its thumb room */
@media (max-width: 560px) {
  .jrn-qtext { font-size: 18px; }
  .jrn-hint { font-size: 14px; }
  .jrn-note { font-size: 14px; }
  /* real thumb room for the GO chip on phones — it is the one button
     in the unlock rows that navigates, so it earns the extra pixels */
  .lock-go { padding: 8px 14px; min-height: 28px; }
}
