/* ── Design Tokens ───────────────────────────────────────── */
:root {
  --font-pixel:  'Press Start 2P', 'Courier New', monospace;
  /* Teal dulled from 100% to 60% saturation (hue and lightness unchanged) so the
     pure accents — gold, type badges, the sprite — read as figure against it.
     Also puts idle in the same saturation register as focus red's 39%. */
  --mode-bg:     #228674;   /* default = teal; overridden in run-focus */
  --gold:        #ffd600;
  --gold-dk:     #b89500;
  --green:       #2ecc71;
  --green-dk:    #1e8449;
  --blue:        #74b9ff;
  --purple:      #d980fa;
  --text:        #ffffff;
  --text-dim:    rgba(255,255,255,.72);
  --text-muted:  rgba(255,255,255,.42);
  --surface:     rgba(0,0,0,.32);
  --stats-h:     82px;

  /* Layout grid: one type area, subdivided in 40px fields (10x the 4px module) */
  --col:         680px;
  --field:       40px;

  /* Leading, tied to the type scale: small text needs more room between lines,
     display text needs less. Single-line chrome (icon buttons, badges) keeps
     line-height:1 for vertical centring — that is not typography. */
  --lh-loose:    1.6;   /* 6-8px  */
  --lh-normal:   1.5;   /* 10-12px */
  --lh-snug:     1.4;   /* 14-16px */
  --lh-tight:    1.2;   /* 20px+  */

  /* Borders by role. Nine different white alphas (.06-.6) across four widths
     had accumulated; these four cover every structural edge. Form focus rings
     and the dashed drop target stay bespoke — those carry meaning. */
  --border-hair:   1px solid rgba(255,255,255,.08);   /* internal dividers   */
  --border-soft:   2px solid rgba(255,255,255,.18);   /* panel / card edge   */
  --border-card:   2px solid rgba(255,255,255,.35);   /* raised card edge    */
  --border-frame:  3px solid rgba(255,255,255,.18);   /* canvas / major frame*/
  --border-accent: 3px solid var(--gold);             /* highlighted box     */

  /* Pomomon type colours — five flavour types (Basic/Steel/Dark tier
     placeholders and the borrowed Fire/Fighting/Ghost/Plant/Water elemental
     set are gone; every mon now carries a real taste instead). Run
     `node tools/palette-check.js` to audit. All five are chromatic, spread
     around the wheel (min 21° apart) avoiding 30-70° (UI gold) and 150-190°
     (teal mode background), and clear 4.5:1 against white labels. */
  --type-spicy:    #cc3a24;   /*   8° */
  --type-sour:     #5a791a;   /*  80° */
  --type-savory:   #3a7630;   /* 111° */
  --type-bitter:   #2d7746;   /* 140° */
  --type-sweet:    #bd277e;   /* 325° — unchanged from the previous palette */

  /* Typography scale — whole pixels only. Press Start 2P is drawn on a pixel
     grid, so fractional sizes (.45rem = 7.2px) land its glyph edges between
     device pixels and antialias the hard edges away. Every size in the sheet
     is an integer px for that reason; keep it that way. */
  --text-xs:     8px;
  --text-sm:     10px;
  --text-base:   12px;
  --text-md:     14px;

  /* Panel & button tokens */
  --panel-bg:     #175e50;   /* dulled to match --mode-bg's register */
  --panel-border: rgba(255,255,255,.38);
  --panel-radius: 16px;
  --panel-shadow: 0 8px 0 rgba(0,0,0,.28);
  --btn-press:    translate(4px, 4px);

  /* Pixel corner clip-paths — right-angle staircase so each step reads as a square "pixel" */
  /* Main: 4px pixel blocks, 3 steps per corner (12px total notch) */
  --pixel-clip: polygon(
    0 12px, 4px 12px, 4px 8px, 8px 8px, 8px 4px, 12px 4px, 12px 0,
    calc(100% - 12px) 0, calc(100% - 12px) 4px, calc(100% - 8px) 4px,
    calc(100% - 8px) 8px, calc(100% - 4px) 8px, calc(100% - 4px) 12px, 100% 12px,
    100% calc(100% - 12px), calc(100% - 4px) calc(100% - 12px),
    calc(100% - 4px) calc(100% - 8px), calc(100% - 8px) calc(100% - 8px),
    calc(100% - 8px) calc(100% - 4px), calc(100% - 12px) calc(100% - 4px), calc(100% - 12px) 100%,
    12px 100%, 12px calc(100% - 4px), 8px calc(100% - 4px),
    8px calc(100% - 8px), 4px calc(100% - 8px), 4px calc(100% - 12px), 0 calc(100% - 12px)
  );
  /* Small: 4px pixel blocks, 2 steps per corner (8px total notch) */
  --pixel-clip-sm: polygon(
    0 8px, 4px 8px, 4px 4px, 8px 4px, 8px 0,
    calc(100% - 8px) 0, calc(100% - 8px) 4px, calc(100% - 4px) 4px,
    calc(100% - 4px) 8px, 100% 8px,
    100% calc(100% - 8px), calc(100% - 4px) calc(100% - 8px),
    calc(100% - 4px) calc(100% - 4px), calc(100% - 8px) calc(100% - 4px), calc(100% - 8px) 100%,
    8px 100%, 8px calc(100% - 4px), 4px calc(100% - 4px),
    4px calc(100% - 8px), 0 calc(100% - 8px)
  );
  /* Rounded: 2px pixel blocks, 3 finer steps per corner (6px notch) — softer, less sharp */
  --pixel-clip-round: polygon(
    0 6px, 2px 6px, 2px 4px, 4px 4px, 4px 2px, 6px 2px, 6px 0,
    calc(100% - 6px) 0, calc(100% - 6px) 2px, calc(100% - 4px) 2px,
    calc(100% - 4px) 4px, calc(100% - 2px) 4px, calc(100% - 2px) 6px, 100% 6px,
    100% calc(100% - 6px), calc(100% - 2px) calc(100% - 6px),
    calc(100% - 2px) calc(100% - 4px), calc(100% - 4px) calc(100% - 4px),
    calc(100% - 4px) calc(100% - 2px), calc(100% - 6px) calc(100% - 2px), calc(100% - 6px) 100%,
    6px 100%, 6px calc(100% - 2px), 4px calc(100% - 2px),
    4px calc(100% - 4px), 2px calc(100% - 4px), 2px calc(100% - 6px), 0 calc(100% - 6px)
  );
  /* Blocky: one 4px step per corner (single notch) — simplest, same 4px edge size */
  --pixel-clip-1: polygon(
    0 4px, 4px 4px, 4px 0,
    calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px,
    100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%,
    4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px)
  );
  /* Elevation. Two levels, both drop-shadow rather than box-shadow so they
     follow the clip-path staircase instead of being sliced by it.
     --pxdrop-sm = small chrome (badges, icon buttons, pills)
     --pxdrop    = raised surfaces (buttons, panels, cards)
     A second identical pair (--pxborder/--pxborder-sm, 0.05 alpha apart) and
     two unused --shadow-btn tokens were merged away; don't reintroduce them. */
  --pxdrop-sm: drop-shadow(4px 4px 0 rgba(0,0,0,.60));
  --pxdrop:    drop-shadow(5px 5px 0 rgba(0,0,0,.60));
}

/* ── Mode backgrounds — only two states ─────────────────── */
/* Default (idle / paused / break): teal */
body           { background: #228674; }

/* Running a focus session: red */
body.run-focus { --mode-bg: #af4d4d; background: #af4d4d; --panel-bg: #7a3636; }

/* Encounter overlay matches body */
.encounter-overlay                { background: #228674; }
body.run-focus .encounter-overlay { background: #af4d4d; }

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: var(--font-pixel);
  color: var(--text);
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  transition: background .4s ease;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 0%, transparent 55%, rgba(0,0,0,.18) 100%);
  z-index: 0;
}

/* Main content column — centred, comfortable reading width.
   This is the type area: every screen and the header share it, so the frame
   stays put as you navigate. Layout containers inside it size in 40px fields
   (10x the 4px module): 560=14, 480=12, 360=9, 320=8, 240=6. Keep new
   containers on that field; smaller component measures use the 4px module. */
.app-header,
.screen {
  max-width: var(--col);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* ── Header ──────────────────────────────────────────────── */
.app-header {
  background: transparent;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 16px 8px;
  flex-shrink: 0;
  gap: 4px;
  position: relative;
}

.btn-audio {
  background: #222;
  border: none;
  border-radius: 0;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  clip-path: var(--pixel-clip-sm);
  color: var(--text);
  box-shadow:
    inset 0 10px 0 rgba(255,255,255,.14),
    inset 0 -10px 0 rgba(0,0,0,.38);
}

.pxb-audio:hover  { filter: brightness(1.2) var(--pxdrop-sm); }
.pxb-audio:active { transform: var(--btn-press); filter: none; }

.logo {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  line-height: var(--lh-snug);
}

.logo-icon {
  font-size: 40px;
  filter: drop-shadow(3px 3px 0 rgba(0,0,0,.5));
  display: inline-block;
  animation: logo-float 2.4s ease-in-out infinite;
  margin-right: 4px;
}

.btn-tomato-img {
  height: 1.6em;
  width: auto;
  display: inline-block;
  vertical-align: middle;
  image-rendering: pixelated;
  margin-left: 4px;
}

.logo-tomato-img {
  height: 2.6rem;
  width: auto;
  display: block;
  image-rendering: pixelated;
}

@keyframes logo-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

.logo-pomo {
  font-family: var(--font-pixel);
  font-size: 48px;
  color: var(--text);
  letter-spacing: .06em;
  margin-right: -.06em;
  -webkit-text-stroke: 1.5px rgba(255,255,255,.6);
  text-shadow: 2px 2px 0 rgba(0,0,0,.4);
}

.logo-mons {
  font-family: var(--font-pixel);
  font-size: 48px;
  color: var(--gold);
  letter-spacing: .06em;
  -webkit-text-stroke: 1.5px var(--gold-dk);
  text-shadow: 2px 2px 0 rgba(0,0,0,.4);
}

.tagline {
  font-family: var(--font-pixel);
  font-size: var(--text-base);
  color: var(--text-muted);
  letter-spacing: .12em;
  margin-top: 4px;
}

/* ── Screen system ───────────────────────────────────────── */
.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  align-items: center;
  padding: 12px 16px calc(var(--stats-h) + 12px);
  overflow-y: auto;
  justify-content: space-evenly;
  gap: 8px;
}

.screen.active { display: flex; }

/* Scrolling list screens flow from the top (so the sticky header/toolbar pins
   flush and doesn't shift). space-evenly is only for the centred timer screen. */
#screen-mymons, #screen-dex, #screen-progress { justify-content: flex-start; }

/* ── Companion box ───────────────────────────────────────── */
.companion-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  position: relative;
  background: var(--panel-bg);
  clip-path: var(--pixel-clip);
  padding: 32px 16px 60px;
}

.btn-dex {
  background: rgba(255,255,255,.18);
  border: none;
  border-radius: 0;
  color: var(--text);
  font-family: var(--font-pixel);
  font-size: 12px;
  padding: 8px 12px;
  cursor: pointer;
  letter-spacing: .05em;
  clip-path: var(--pixel-clip-sm);
  box-shadow:
    inset 0 10px 0 rgba(255,255,255,.4),
    inset 0 -10px 0 rgba(0,0,0,.3);
  backdrop-filter: blur(4px);
}
.pxb-dex:hover  { filter: brightness(1.1) var(--pxdrop-sm); }
.pxb-dex:active { transform: var(--btn-press); filter: none; }

.companion-stage {
  position: relative;
  width: 200px;
  height: 200px;
  flex-shrink: 0;
  /* Ground rim overflows the stage; the panel's clip-path trims it. */
  overflow: visible;
  /* Nudge the mon + ground up together (rigid) so the ground's front rim
     isn't clipped at the panel bottom. Applies equally at every breakpoint. */
  transform: translateY(-6px);
}

#companion-canvas {
  display: block;
  position: relative;
  z-index: 1;
  width: 200px;
  height: 200px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Ground is sized relative to the mon/canvas (not the panel), reproducing the
   encounter screen's ratio: there the ground (460px) is ~1.5× the mon's canvas
   box. Aspect 2:1 matches the encounter's flatter draw (460×230). Bottom is
   tuned so the grass surface meets the mon's feet (canvas GROUND_Y = 96%). */
.companion-ground {
  position: absolute;
  z-index: 0;
  width: 150%;
  height: 75%;
  left: 50%;
  bottom: -34%;
  transform: translateX(-50%);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.companion-name {
  position: absolute;
  top: 24%;
  left: 0;
  right: 0;
  z-index: 3;
  pointer-events: none;
  font-size: 16px;
  color: var(--text);
  letter-spacing: .1em;
  text-transform: uppercase;
  text-align: center;
  text-shadow: 2px 2px 0 rgba(0,0,0,.45);
}

/* Empty state. A mon's name is one line at 24%; this prompt wraps to two and
   ran straight into the "?" placeholder, which is bottom-anchored and occupies
   the canvas from 44% down. Sit it higher and smaller — the LVL/type pills are
   hidden in this state, so the top of the stage is free. */
.companion-name.is-prompt {
  top: 6%;
  font-size: 12px;
  line-height: var(--lh-normal);
}

/* Mirrors the player's readout in the stats strip — level pill + "n / n XP" on
   one row, progress bar beneath — but small, on the panel instead of the black
   strip, so the two are never mistaken for each other. */
.companion-meta {
  position: absolute;
  top: 0;
  /* Extend beyond the narrow sprite stage (overflow: visible) so the readout can
     sit out toward the panel's left side, clear of the mon. */
  left: -190px;
  right: -110px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  z-index: 2;
}

.companion-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.companion-xp-text {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--text-dim);
  letter-spacing: .06em;
  white-space: nowrap;
}

/* Deliberately shorter and thinner than the player's full-width bar */
.companion-xp-wrap {
  width: 180px;
  max-width: 100%;
  height: 10px;
  background: rgba(0,0,0,.30);
  clip-path: var(--pixel-clip-1);
  overflow: hidden;
}

.companion-xp-bar {
  height: 100%;
  background: var(--gold);
  transition: width .4s ease;
}

.companion-lvl {
  font-size: 10px;
  font-family: var(--font-pixel);
  color: #3a2c00;
  letter-spacing: .06em;
  background: var(--gold);
  padding: 8px 12px;
  clip-path: var(--pixel-clip-sm);
  filter: var(--pxdrop-sm);
  white-space: nowrap;
  text-shadow: none;
}

/* ── Type badges ─────────────────────────────────────────── */
.type-badges { display: inline-flex; gap: 4px; align-items: center; }
.type-badge {
  font-size: 8px;
  font-family: var(--font-pixel);
  padding: 2px 4px;
  border-radius: 999px;
  color: var(--text);
  text-shadow: 1px 1px 0 rgba(0,0,0,.4);
  letter-spacing: .04em;
  white-space: nowrap;
  /* Defines the chip edge on any backdrop. The encounter topbar puts badges
     straight onto the mode background, where fire and sweet sit within ~1.05:1
     of the focus red — without this ring their outline would vanish there. */
  box-shadow: 0 0 0 2px rgba(0,0,0,.38);
}
.type-spicy    { background: var(--type-spicy); }
.type-sour     { background: var(--type-sour); }
.type-savory   { background: var(--type-savory); }
.type-bitter   { background: var(--type-bitter); }
.type-sweet    { background: var(--type-sweet); }

/* ── Session tabs ────────────────────────────────────────── */
.session-tabs {
  display: flex;
  gap: 4px;
  background: rgba(0,0,0,.18);
  border: var(--border-frame);
  padding: 4px;
  width: 100%;
  border-radius: 0;
}

.tab {
  flex: 1;
  padding: 4px 4px;
  border: none;
  background: transparent;
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--text-dim);
  cursor: pointer;
  letter-spacing: .05em;
  transition: background .15s, color .15s;
  border-radius: 0;
}

.tab.active {
  background: rgba(255,255,255,.22);
  color: var(--text);
}

.tab:hover:not(.active) {
  background: rgba(255,255,255,.1);
  color: var(--text);
}

/* ── Combined timer + controls box ───────────────────────── */
.combined-timer-wrap {
  background: var(--panel-bg);
  clip-path: var(--pixel-clip);
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
}

/* ── Big box: mon + timer + buttons in one panel ─────────── */
/* TO REVERT: see HTML comment above .big-box in index.html  */
.big-box {
  background: var(--panel-bg);
  clip-path: var(--pixel-clip);
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: visible;
}
.big-box .companion-wrap {
  background: none;
  clip-path: none;
  animation: none;
}
.big-box .combined-timer-wrap {
  background: none;
  clip-path: none;
  overflow: visible;
}

/* Timer display — CSS text */
/* .timer-display--bare: removes the panel border so timer floats on the backdrop.
   TO REVERT: remove this class from the <section> in index.html. */
.timer-display--bare {
  border-bottom: none;
}

.timer-display {
  font-family: var(--font-pixel);
  font-size: 64px;
  color: var(--text);
  text-shadow: none;
  background: none;
  padding: 12px 16px 12px 20px;
  clip-path: none;
  letter-spacing: .08em;
  width: 100%;
  display: flex;
  align-items: center;
  border-bottom: 2px solid rgba(255,255,255,.08);
}

.timer-edit-input {
  font-family: var(--font-pixel);
  font-size: 1em;
  color: var(--text);
  background: none;
  border: none;
  border-bottom: 2px solid rgba(255,255,255,.6);
  outline: none;
  width: 2ch;
  text-align: center;
  letter-spacing: .08em;
  padding: 0;
  caret-color: #fff;
}

#timer-minutes {
  cursor: text;
}

.timer-time {
  flex: 1;
  text-align: center;
  white-space: nowrap;
}

.timer-colon {
  display: inline-block;
  padding: 0 4px;
  color: var(--text);
}

/* Small arrow buttons for time adjustment */
.time-adjust {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.btn-adjust {
  background: #222;
  border: none;
  border-radius: 0;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  padding: 8px 8px;
  line-height: 1;
  min-width: 36px;
  min-height: 36px;
  clip-path: var(--pixel-clip-sm);
  box-shadow:
    inset 0 10px 0 rgba(255,255,255,.12),
    inset 0 -10px 0 rgba(0,0,0,.4);
  font-family: var(--font-pixel);
}

.pxb .btn-adjust:hover  { filter: brightness(1.3); }
.pxb .btn-adjust:active { transform: none; filter: none; }

/* Hide adjust arrows when timer is running */
body.run-focus .time-adjust { opacity: 0; pointer-events: none; }

/* ── Timer controls + tabs group ────────────────────────── */
.controls-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  background: none;
  clip-path: none;
  padding: 12px;
}

.timer-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}

.timer-bottom-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 4fr 2fr;
  gap: 8px;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  font-family: var(--font-pixel);
  font-size: 14px;
  letter-spacing: .05em;
  border: none;
  border-radius: 0;
  cursor: pointer;
  padding: 12px 28px;
  clip-path: var(--pixel-clip);
  filter: var(--pxdrop);
  transition: filter .12s ease;
}

.btn:active {
  transform: var(--btn-press);
  filter: none;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 12px;
}

.btn-primary {
  background: var(--gold);
  color: #1a0a00;
  box-shadow:
    inset 0 0 0 6px #000,
    inset 0 14px 0 rgba(255,255,255,.5),
    inset 0 -14px 0 rgba(0,0,0,.3);
  transition: background .4s, color .4s, filter .12s;
}

.btn-primary:hover {
  filter: brightness(.94) var(--pxdrop);
}

.btn-ghost {
  background: #222;
  color: var(--text);
  border: none;
  box-shadow:
    inset 0 0 0 6px #000,
    inset 0 12px 0 rgba(255,255,255,.15),
    inset 0 -12px 0 rgba(0,0,0,.5);
}

.btn-ghost:hover {
  background: #333;
  filter: brightness(1.15) var(--pxdrop);
}

/* ── Pixel-border wrapper — black staircase outline ──────── */
/* A div with the same clip-path + black background + 4px padding.
   The button inside fills the content area; the 4px of black padding
   traces the staircase edge on all sides including the corner steps. */
.pxb {
  clip-path: var(--pixel-clip);
  background: transparent;
  padding: 0;
  display: flex;
  filter: var(--pxdrop);
  transition: filter .15s, transform .12s;
}

.pxb:active {
  transform: var(--btn-press);
  filter: none;
}

.pxb .btn {
  filter: none;  /* wrapper owns the depth shadow */
  flex: 1;
  width: 100%;
}

/* Higher specificity to beat per-button hover/active rules */
.pxb .btn:hover:not(:disabled) {
  filter: brightness(1.06);
}

.pxb .btn:active:not(:disabled) {
  transform: none;
  filter: none;
}

.pxb .btn:disabled {
  filter: none;  /* wrapper handles disabled opacity */
}

/* Fade the whole wrapper (border included) when its button is disabled */
.pxb:has(button:disabled) {
  opacity: 0.55;
  filter: none;
}

/* Hide wrapper entirely when its button is hidden */
.pxb:has(button[hidden]) {
  display: none;
}

/* Small variant — matches buttons that use --pixel-clip-sm */
.pxb-sm {
  clip-path: var(--pixel-clip-sm);
  filter: var(--pxdrop-sm);
  padding: 0;
}

/* Back button — match the collection-tab height so its pixel corners read the same
   proportion (on a shorter button the fixed 12px steps look overly pointed). */
.pxb-back .btn {
  padding: 12px 20px;
}


/* Positioned wrappers */
.pxb-dex {
  position: absolute;
  top: 10px;
  right: 12px;
}
.pxb-audio {
  position: absolute;
  top: 14px;
  right: 16px;
}

/* ── Spawn-rate help button — top-right of companion box, mute-button style ── */
.pxb-help {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
}
.btn-help {
  background: #222;
  border: none;
  border-radius: 0;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  min-width: 38px;
  clip-path: var(--pixel-clip-sm);
  color: var(--text);
  font-family: var(--font-pixel);
  font-size: 14px;
  line-height: 1;
  box-shadow:
    inset 0 10px 0 rgba(255,255,255,.14),
    inset 0 -10px 0 rgba(0,0,0,.38);
}
.pxb-help:hover  { filter: brightness(1.2) var(--pxdrop-sm); }
.pxb-help:active { transform: var(--btn-press); filter: none; }

/* Mode button wrapper needs to fill the btn-mode-wrap flex container */
.btn-mode-wrap .pxb {
  flex: 1;
  width: 100%;
}

/* Strip inner 6px inset from btn-primary/btn-ghost when wrapper provides the border */
.pxb .btn-primary {
  box-shadow:
    inset 0 14px 0 rgba(255,255,255,.55),
    inset 0 -14px 0 rgba(0,0,0,.35);
}

.pxb .btn-ghost {
  box-shadow:
    inset 0 12px 0 rgba(255,255,255,.35),
    inset 0 -12px 0 rgba(0,0,0,.28);
}

/* Back buttons — solid black, fully opaque, no shadows */
.btn-ghost.btn-sm,
.pxb .btn-ghost.btn-sm {
  opacity: 1;
  background: #222;
  color: var(--text);
  box-shadow:
    inset 0 12px 0 rgba(255,255,255,.15),
    inset 0 -12px 0 rgba(0,0,0,.5);
  text-shadow: none;
  backdrop-filter: none;
}
.btn-ghost.btn-sm:hover {
  background: #1a1a1a;
}

/* Collection buttons row */
.collection-btns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: 100%;
}

/* Collection button — yellow/gold */
.btn-collection {
  background: var(--gold);
  border: none;
  border-radius: 0;
  width: 100%;
  font-size: 14px;
  color: #1a0a00;
  padding: 16px 8px;
  font-family: var(--font-pixel);
  cursor: pointer;
  clip-path: var(--pixel-clip);
  filter: var(--pxdrop);
  box-shadow:
    inset 0 14px 0 rgba(255,255,255,.55),
    inset 0 -14px 0 rgba(0,0,0,.35);
  transition: filter .15s;
}

/* Items button — same gold as collection */
.btn-collection-items {
  background: var(--gold);
  box-shadow:
    inset 0 14px 0 rgba(255,255,255,.55),
    inset 0 -14px 0 rgba(0,0,0,.35);
}

.btn-collection:hover {
  filter: brightness(1.06) var(--pxdrop);
}

.btn-collection:active {
  transform: var(--btn-press);
  filter: none !important;
}

/* ── Mode dropdown ───────────────────────────────────────── */
.btn-mode-wrap {
  position: relative;
  display: flex;
}

/* Focus mode button — black with white text */
.btn-timer-mode {
  width: 100%;
  background: #222;
  color: var(--text);
  font-size: 14px;
  letter-spacing: .04em;
  border: none;
  border-radius: 0;
  padding: 12px 8px;
  min-height: 48px;
  cursor: pointer;
  font-family: var(--font-pixel);
  filter: var(--pxdrop);
  box-shadow:
    inset 0 14px 0 rgba(255,255,255,.15),
    inset 0 -14px 0 rgba(0,0,0,.5);
  transition: filter .12s;
}
.btn-timer-mode:hover {
  background: #333;
  filter: brightness(1.15) var(--pxdrop);
}
.btn-timer-mode:active {
  background: #1a1a1a;
  transform: var(--btn-press);
  filter: none;
}

.mode-dropdown {
  position: fixed;
  background: #111827;
  border: var(--border-soft);
  border-radius: 0;
  z-index: 200;
  overflow: hidden;
  box-shadow: 4px 4px 0 rgba(0,0,0,.5);
}

.mode-option {
  display: block;
  width: 100%;
  padding: 12px 8px;
  background: transparent;
  border: none;
  border-bottom: var(--border-hair);
  color: rgba(255,255,255,.7);
  font-family: var(--font-pixel);
  font-size: var(--text-sm);
  letter-spacing: .05em;
  cursor: pointer;
  text-align: center;
  text-transform: uppercase;
}

.mode-option:last-child { border-bottom: none; }
.mode-option:hover      { background: rgba(255,255,255,.1); color: var(--text); }
.mode-option.active     { color: var(--gold); }

/* ── Timer action buttons — unified rule ─────────────────── */
.btn-timer-start,
.btn-timer-pause {
  width: 100%;
  background: var(--gold);
  color: #1a0a00;
  font-size: 14px;
  letter-spacing: .04em;
  border: none;
  border-radius: 0;
  box-shadow:
    inset 0 14px 0 rgba(255,255,255,.55),
    inset 0 -14px 0 rgba(0,0,0,.35);
  padding: 12px 8px;
  min-height: 48px;
  cursor: pointer;
  font-family: var(--font-pixel);
  transition: filter .12s;
}

/* Hover */
.btn-timer-start:hover:not(:disabled),
.btn-timer-pause:hover:not(:disabled) {
  filter: brightness(.93) var(--pxdrop);
}

/* Press */
.btn-timer-start:active:not(:disabled),
.btn-timer-pause:active:not(:disabled) {
  transform: var(--btn-press);
  filter: brightness(.88);
}

/* Disabled */
.btn-timer-start:disabled {
  background: rgba(0,0,0,.24);
  color: rgba(255,255,255,.38);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.2);
  cursor: not-allowed;
  transform: none;
  filter: opacity(.6);
}

/* Reset button — black with white text */
.btn-timer-dark {
  width: 100%;
  background: #222;
  color: var(--text);
  font-size: 14px;
  letter-spacing: .04em;
  border: none;
  border-radius: 0;
  filter: var(--pxdrop);
  box-shadow:
    inset 0 14px 0 rgba(255,255,255,.15),
    inset 0 -14px 0 rgba(0,0,0,.5);
  padding: 12px 8px;
  min-height: 48px;
  cursor: pointer;
  font-family: var(--font-pixel);
  transition: filter .12s;
}
.btn-timer-dark:hover:not(:disabled) {
  background: #333;
  filter: brightness(1.15) var(--pxdrop);
}
.btn-timer-dark:active:not(:disabled) {
  background: #1a1a1a;
  transform: var(--btn-press);
  filter: none;
}
.btn-timer-dark:disabled {
  background: rgba(0,0,0,.24);
  color: rgba(255,255,255,.38);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.2);
  cursor: not-allowed;
  transform: none;
  filter: opacity(.6);
}

/* ── Collection Screen ───────────────────────────────────── */
.collection-header {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--mode-bg);
  padding: 8px 0;
}

.collection-tabs {
  display: flex;
  gap: 12px;
  flex: 1;
  justify-content: center;
}

.collection-tab {
  background: #222;
  color: var(--text);
  border-radius: 0;
  clip-path: var(--pixel-clip);
  filter: var(--pxdrop);
  box-shadow:
    inset 0 12px 0 rgba(255,255,255,.15),
    inset 0 -12px 0 rgba(0,0,0,.5);
  padding: 12px 20px;
  font-size: 12px;
  border: none;
  cursor: pointer;
  font-family: var(--font-pixel);
  transition: filter .12s;
}

.collection-tab:hover {
  filter: brightness(1.15);
}

.collection-tab--active {
  background: var(--gold);
  color: #1a0a00;
  box-shadow:
    inset 0 12px 0 rgba(255,255,255,.55),
    inset 0 -12px 0 rgba(0,0,0,.35);
}

.screen-title {
  font-size: 14px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text);
  text-shadow: 1px 1px 4px rgba(0,0,0,.15);
  flex: 1;
  text-align: center;
}

.collection-count {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  font-size: 10px;
  line-height: var(--lh-normal);
  padding: 32px 16px;
}

.mon-card {
  aspect-ratio: 1;
  background: var(--surface);
  border: var(--border-card);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: transform .1s, box-shadow .1s;
  box-shadow: 4px 4px 0 rgba(90,90,90,.35);
  position: relative;
}

.mon-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 rgba(90,90,90,.35);
}

.mon-card.unseen {
  cursor: default;
}

.mon-card canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.mon-card-dexnum {
  font-size: 6px;
  color: var(--text-muted);
  letter-spacing: .05em;
}

.mon-card-name {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-dim);
}

.mon-card-count {
  position: absolute;
  bottom: 4px; right: 5px;
  font-size: 8px;
  color: var(--text-dim);
  background: rgba(0,0,0,.5);
  padding: 0 4px;
  line-height: var(--lh-snug);
  letter-spacing: .04em;
}

.mon-card.shiny {
  border-color: var(--gold);
  box-shadow: 4px 4px 0 var(--gold-dk);
}

.mon-card.dark {
  border-color: #111;
  box-shadow: 4px 4px 0 #000;
}

.mon-card-rarity {
  font-size: var(--text-xs);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.mon-card-rarity.uncommon    { color: var(--blue); }
.mon-card-rarity.rare        { color: var(--purple); }
.mon-card-rarity.ultra-rare  { color: var(--gold); }
.mon-card-rarity.pitch-black { color: #c7ccd1; }

.mon-card.active-companion {
  border-color: var(--green);
  box-shadow: 4px 4px 0 var(--green-dk);
}

.mon-card-active-indicator {
  position: absolute;
  top: 4px; left: 5px;
  font-size: 8px;
  color: var(--green);
  line-height: 1;
}

/* ── Stats strip — full browser width ───────────────────── */
.stats-strip {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: var(--stats-h);
  background: #000;
  border-top: var(--border-frame);
  display: flex;
  flex-direction: column;
  z-index: 50;
}

/* Top row: level badge + XP progress text */
.stats-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 4px;
}

.level-badge {
  background: var(--gold);
  color: #1a0a00;
  font-family: var(--font-pixel);
  font-size: 12px;
  /* Vertical padding matches .companion-lvl's ~28px height so the fixed 8px
     notch leaves the same amount of straight edge — at 21px tall the steps
     met near the middle and read as points. */
  padding: 8px 12px;
  border-radius: 0;
  clip-path: var(--pixel-clip-sm);
  letter-spacing: .06em;
  white-space: nowrap;
  /* drop-shadow, not box-shadow — clip-path would clip a box-shadow away
     entirely, since it sits outside the stepped shape */
  filter: drop-shadow(0 3px 0 var(--gold-dk));
  flex-shrink: 0;
}


/* Map icon button — fixed just above the stats strip */
.btn-map-icon {
  position: fixed;
  bottom: calc(var(--stats-h) + 10px);
  left: 14px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 49;
  filter: drop-shadow(3px 3px 0 rgba(0,0,0,.5));
  transition: filter .15s;
}

.btn-map-icon:hover  { filter: brightness(1.15) drop-shadow(3px 3px 0 rgba(0,0,0,.5)); }
.btn-map-icon:active { transform: translate(2px,2px); filter: drop-shadow(1px 1px 0 rgba(0,0,0,.5)); }

#map-icon-canvas {
  display: block;
  width: 96px;
  height: 96px;
  background-image: url('assets/sprites/Map/NewMap.png');
  background-repeat: no-repeat;
  background-size: 96px 192px;
  background-position: 0 -96px; /* bottom frame: normal, nothing to claim */
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.btn-map-icon.has-reward #map-icon-canvas {
  background-position: 0 0; /* top frame: reward available */
}

.xp-text {
  font-family: var(--font-pixel);
  font-size: var(--text-sm);
  color: rgba(255,255,255,.6);
  letter-spacing: .05em;
}

/* Bottom row: pill bar + stats inline */
.stats-bottom {
  flex: 1;
  display: flex;
  align-items: flex-start;
  padding: 4px 12px 4px;
  gap: 12px;
}

/* Pill track — rounded oval container */
.exp-bar-wrap {
  flex: 1;
  height: 22px;
  background: rgba(255,255,255,.12);
  border-radius: 0;
  clip-path: var(--pixel-clip-sm);
  overflow: hidden;
  /* No 1px border — the staircase clip slices a rectangular border at each
     corner, leaving the steps unoutlined. The fill reads against the track. */
}

/* Yellow fill — square; the wrap's clip-path shapes both ends */
.exp-bar {
  height: 100%;
  background: var(--gold);
  border-radius: 0;
  transition: width .4s ease;
}

/* Stats sit to the right of the pill */
.stats-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-val {
  font-size: var(--text-md);
  color: var(--text);
  letter-spacing: .04em;
}

.stat-label {
  font-size: var(--text-xs);
  color: rgba(255,255,255,.5);
  letter-spacing: .06em;
}

/* ── Encounter Flash (full-screen battle transition) ────── */
.encounter-flash {
  position: fixed;
  inset: 0;
  z-index: 400;
  pointer-events: none;
  opacity: 0;
}


/* ── Encounter Overlay ───────────────────────────────────── */
.encounter-overlay {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  z-index: 100;
  padding: 40px 20px 24px;
  transition: background .4s ease;
}

.encounter-overlay.active { display: flex; }

/* Logo + arena + controls: logo pinned near the top, arena/controls centered below */
.encounter-body {
  flex: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

/* Arena panel — frames the wild mon in a pixel-panel card (matches timer/companion
   panels), width-constrained so it doesn't sprawl on wide desktops. */
.encounter-arena {
  background: var(--panel-bg);
  clip-path: var(--pixel-clip);
  width: 100%;
  max-width: 560px;
  padding: 24px 20px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* Top bar: LVL pill + type badge on the left (mirrors the main-screen companion
   box), rarity on the right. Headline sits below. */
/* Stage wraps the canvas so the badges can float in the sky above the mon */
.encounter-stage {
  position: relative;
  width: 100%;
  max-width: 480px;
}

/* Floating mon name above the wild mon's head (bobs in sync via JS, un-bold) */
.encounter-mon-name {
  position: absolute;
  top: 26%;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 3;
  pointer-events: none;
  font-family: var(--font-pixel);
  font-size: 16px;
  color: var(--text);
  letter-spacing: .1em;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 rgba(0,0,0,.45);
}

.encounter-topbar {
  position: absolute;
  top: 2%;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
}

/* Pin each to its own column so the type stays on the right even when the
   rarity is hidden (a hidden rarity would otherwise let the type slide left). */
.encounter-topbar .encounter-level  { grid-column: 1; justify-self: start; transform: translateX(14px); }
.encounter-topbar .encounter-rarity { grid-column: 2; justify-self: center; }
.encounter-topbar .encounter-tags   { grid-column: 3; justify-self: end; transform: translateX(-14px); }

/* Rarity only shows when it's noteworthy (uncommon / rare / dark / shiny) — hidden for common */
.encounter-rarity.common { display: none; }

/* Type badge — same shallow corner as every other type badge in the app
   (My Mons / Dex cards, mon-detail, evolution chain). The deeper
   --pixel-clip-sm notch used to make this small a badge read as a rounded
   pill instead of a rectangle — --pixel-clip-2xs keeps it a clean rectangle
   with just the corner knocked off. */
.encounter-topbar .type-badge {
  font-size: 10px;
  padding: 8px 12px;
  letter-spacing: .06em;
  border-radius: 0;
  clip-path: var(--pixel-clip-2xs);
  filter: var(--pxdrop-sm);
}


.encounter-rarity {
  font-size: 10px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.encounter-rarity.uncommon   { color: var(--blue); }
.encounter-rarity.rare       { color: var(--purple); }
.encounter-rarity.ultra-rare { color: var(--gold); }
.encounter-rarity.pitch-black { color: #c7ccd1; text-shadow: 0 0 6px rgba(0,0,0,.9), 2px 2px 0 rgba(0,0,0,.6); }

/* ── Encounter tag badges (SHINY, type labels, etc.) ── */
.encounter-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
  min-height: 0;
}

.tag {
  font-family: var(--font-pixel);
  font-size: 8px;
  letter-spacing: .07em;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 0;
  line-height: 1;
  clip-path: var(--pixel-clip-sm);
}

.tag-shiny {
  background: var(--gold);
  color: #1a0a00;
  box-shadow: inset 0 6px 0 rgba(255,255,255,.45), inset 0 -6px 0 rgba(0,0,0,.2);
}

.tag-dark {
  background: #1a1a1a;
  color: #d6d6d6;
  box-shadow: inset 0 6px 0 rgba(255,255,255,.08), inset 0 -6px 0 rgba(0,0,0,.5);
}

.encounter-msg {
  font-family: var(--font-pixel);
  font-size: 20px;
  letter-spacing: .04em;
  color: var(--text);
  text-align: center;
  line-height: var(--lh-tight);
}

.encounter-level {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: #3a2c00;
  letter-spacing: .06em;
  background: var(--gold);
  padding: 8px 12px;
  /* Same shallow corner as the companion's LV badge (.lv-frame .companion-lvl)
     — the deeper --pixel-clip-sm notch read as a rounded pill at this size. */
  clip-path: var(--pixel-clip-xs);
  filter: var(--pxdrop-sm);
  white-space: nowrap;
}

#encounter-canvas {
  width: 100%;
  max-width: 480px;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}


.encounter-sub {
  font-size: 20px;
  color: var(--text);
  letter-spacing: .05em;
  min-height: 1.2em;
  text-align: center;
}

.encounter-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
  max-width: 560px;
  padding: 16px 20px;
  background: var(--panel-bg);
  clip-path: var(--pixel-clip);
}

/* Action buttons share equal width (flex-basis 0 + grow), a bit wider than content */
.encounter-controls .pxb {
  flex: 1 1 0;
  max-width: 240px;
}

/* ── Animations ──────────────────────────────────────────── */
@keyframes enc-flash {
  0%, 100% { opacity: 1; }
  25%, 75%  { opacity: 0.1; }
  50%       { opacity: 1; }
}

@keyframes enc-levelup {
  0%   { transform: translateX(-50%) scale(1); }
  50%  { transform: translateX(-50%) scale(1.14); }
  100% { transform: translateX(-50%) scale(1); }
}

.level-up-banner {
  position: fixed;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: #1a0a00;
  font-family: var(--font-pixel);
  font-size: 12px;
  letter-spacing: .1em;
  padding: 8px 20px;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
  z-index: 200;
  animation: enc-levelup .4s ease;
  text-align: center;
  white-space: nowrap;
}

.banner-sub {
  display: block;
  font-size: 8px;
  margin-top: 4px;
  letter-spacing: .08em;
  color: rgba(26,10,0,.75);
}

/* When only NEXT button is shown, centre it */
.encounter-controls.postcatch { justify-content: center; }

/* 1.5em of the 14px button = 21px, a whole pixel; 1.6em gave 22.4px and blurred
   the glyph. Kept relative so it tracks the button's size. */
.btn-arrow { font-size: 1.5em; vertical-align: middle; position: relative; top: -0.22em; line-height: 1; }

/* Bigger action buttons — similar footprint to the main-screen START / POMODEX */
.encounter-controls .btn {
  min-height: 60px;
  font-size: 16px;
  padding: 16px 28px;
}

#btn-flee { min-height: 60px; padding: 16px 24px; }

/* ── Mon Info Overlay ────────────────────────────────────── */
.mon-info-overlay                { background: #228674; }
body.run-focus .mon-info-overlay { background: #af4d4d; }

.mon-info-overlay {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 170;
  padding: 28px 24px calc(var(--stats-h) + 16px);
  text-align: center;
  overflow-y: auto;
}

.mon-info-overlay.active {
  display: flex;
  animation: mon-info-appear .35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes mon-info-appear {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

.mon-info-name {
  font-family: var(--font-pixel);
  font-size: 16px;
  color: var(--text);
  letter-spacing: .06em;
}

.mon-info-dexnum {
  font-size: 8px;
  letter-spacing: .1em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.mon-info-rarity {
  font-size: 10px;
  letter-spacing: .15em;
  color: var(--text-muted);
}
.mon-info-rarity.uncommon   { color: var(--blue); }
.mon-info-rarity.rare       { color: var(--purple); }
.mon-info-rarity.ultra-rare { color: var(--gold); }
.mon-info-rarity.pitch-black { color: #c7ccd1; text-shadow: 0 0 6px rgba(0,0,0,.9), 2px 2px 0 rgba(0,0,0,.6); }

#mon-info-canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border: var(--border-frame);
  border-radius: 8px;
}

.mon-info-evo-section {
  width: 100%;
  max-width: 480px;
  background: rgba(0,0,0,.30);
  border: var(--border-soft);
  border-radius: 12px;
  padding: 12px 12px;
  margin-top: 4px;
}

.mon-info-evo-title {
  font-size: 8px;
  letter-spacing: .14em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.mon-info-evo-chain {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}

.evo-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.evo-node canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border: var(--border-soft);
  border-radius: 6px;
}

.evo-node.base canvas {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(255,214,0,.30);
}

.evo-node-name {
  font-size: 6px;
  color: var(--text-dim);
  letter-spacing: .06em;
  max-width: 72px;    /* component measure, so 4px module rather than a field */
  text-align: center;
  line-height: var(--lh-loose);
}

.evo-node-label {
  font-size: 6px;
  color: var(--text-muted);
  letter-spacing: .05em;
}

.evo-node-label.base-label { color: var(--gold); }

.evo-arrow {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
  user-select: none;
  margin-bottom: 20px;
}

/* ── Mon Detail Card (individual caught mon) ─────────────── */
.mon-detail-overlay                { background: #228674; }
body.run-focus .mon-detail-overlay { background: #af4d4d; }

.mon-detail-overlay {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  z-index: 170;
  padding: 24px 16px calc(var(--stats-h) + 16px);
  overflow-y: auto;
}

.mon-detail-overlay.active {
  display: flex;
  animation: mon-info-appear .3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.mon-detail-card {
  position: relative;
  width: 100%;
  max-width: 360px;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Tight default: this is the space WITHIN a group (dexnum+rarity, name+species).
     Group breaks come from margin-top on the elements that start a new group, so
     the between-group space always exceeds the space inside one. */
  gap: 4px;
  padding: 20px 16px;
  background: rgba(0,0,0,.28);
  border: var(--border-soft);
  clip-path: var(--pixel-clip);
  text-align: center;
}

/* Pinned to the card's top-left corner, clear of the 12px clip-path staircase.
   Absolute so it doesn't offset the centred dexnum/rarity beneath it. */
.mon-detail-back {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  /* Same shallow corner as the Pomodex/My Mons header BACK button
     (.btn-ghost gets --pixel-clip-xs globally) — the deeper --pixel-clip-sm
     notch read as a rounded pill at this button's small size. */
  clip-path: var(--pixel-clip-xs);
  filter: var(--pxdrop-sm);
}

/* Much smaller than the collection header's BACK — this one is a corner
   affordance, not a header control. Overrides .pxb-back's 12px/20px padding
   and rescales the gloss insets, which would otherwise swallow the button. */
.mon-detail-back .btn {
  padding: 8px 12px;
  font-size: 8px;
  min-height: 0;
  clip-path: var(--pixel-clip-xs);
}
/* 14px insets match SAVE/CANCEL — at this height they meet in the middle
   for a clean two-tone split rather than a thin band. */
.mon-detail-back .btn-ghost.btn-sm {
  box-shadow:
    inset 0 14px 0 rgba(255,255,255,.15),
    inset 0 -14px 0 rgba(0,0,0,.5);
}

.mon-detail-dexnum {
  font-size: 8px;
  letter-spacing: .1em;
  color: var(--text-muted);
}

.mon-detail-rarity {
  font-size: 10px;
  letter-spacing: .15em;
  color: var(--text-muted);
  min-height: .55rem;
}
.mon-detail-rarity.ultra-rare  { color: var(--gold); }
.mon-detail-rarity.pitch-black { color: #c7ccd1; text-shadow: 0 0 6px rgba(0,0,0,.9), 2px 2px 0 rgba(0,0,0,.6); }

#mon-detail-canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border: var(--border-frame);
  border-radius: 8px;
  margin-top: 12px;    /* group break: header -> sprite */
}

.mon-detail-namerow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;    /* group break: sprite -> identity */
}

.mon-detail-name {
  font-family: var(--font-pixel);
  font-size: 14px;
  color: var(--text);
  letter-spacing: .05em;
  word-break: break-word;
}

.mon-detail-rename-btn {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--text);
  background: #333;
  border: none;
  box-shadow: inset -2px -2px 0 #1c1c1c, inset 2px 2px 0 #4a4a4a;
  clip-path: var(--pixel-clip-sm);
  width: 26px;
  height: 26px;
  cursor: pointer;
  flex-shrink: 0;
}
.mon-detail-rename-btn:hover { background: #3d3d3d; }

.mon-detail-species {
  font-size: 8px;
  letter-spacing: .1em;
  color: var(--text-muted);
}

/* The `hidden` attribute only sets display:none in the UA stylesheet, which any
   author display rule outranks — without this the row is permanently visible. */
.mon-detail-rename-row[hidden] { display: none; }

.mon-detail-rename-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.mon-detail-input {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--text);
  background: #1c1c1c;
  border: 2px solid #4a4a4a;
  padding: 8px 8px;
  letter-spacing: .05em;
  text-align: center;
  width: 140px;
  outline: none;
}
.mon-detail-input:focus { border-color: var(--gold); }

/* SAVE / CANCEL — matched small buttons. Fixed wrapper width so the two read
   as a pair regardless of label length; small clip since 12px notches look
   overly pointed at this height. */
.mon-detail-rename-row .pxb {
  flex: 0 0 76px;
  width: 76px;
  clip-path: var(--pixel-clip-sm);
  filter: var(--pxdrop-sm);
}
.mon-detail-rename-row .btn {
  font-size: 8px;
  padding: 8px 4px;
  min-height: 0;
  clip-path: var(--pixel-clip-sm);
}

/* Scale the gloss to this button's height. The shared 14px insets are tuned for
   the ~40px yellow buttons (THROW!, CONTINUE!), where they leave a band of flat
   gold in the middle; on a ~30px button they meet and lose that band entirely. */
.mon-detail-rename-row .btn-primary {
  box-shadow:
    inset 0 10px 0 rgba(255,255,255,.55),
    inset 0 -10px 0 rgba(0,0,0,.35);
}

.mon-detail-stats {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 16px 0 0;    /* group break: identity -> stats */
}

.mds-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 8px;
  background: rgba(0,0,0,.22);
  border-bottom: var(--border-hair);
}

/* Badges are inline-flex boxes and don't sit on the text baseline, so this
   row centres instead of baseline-aligning like the text-only rows. */
.mds-row-type { align-items: center; }
.mds-row-type .mds-v { display: flex; justify-content: flex-end; }

/* Next-level progress — text row + bar row read as one grouped block (no
   divider between them), same gold-on-dark language as the companion's XP
   bar on the timer screen, just full-width instead of a fixed 164px. */
.mds-row-xp    { border-bottom: none; padding-bottom: 4px; }
.mds-row-xpbar { padding-top: 0; align-items: center; }

.mds-xp-wrap {
  width: 100%;
  height: 10px;
  background: #0a1710;
  clip-path: var(--pixel-clip-xs);
  overflow: hidden;
}

.mds-xp-bar {
  height: 100%;
  background: var(--gold);
  box-shadow:
    inset 0 3px 0 rgba(255,255,255,.42),
    inset 0 -3px 0 rgba(0,0,0,.22);
  transition: width .4s ease;
}

.mds-k {
  font-size: 8px;
  letter-spacing: .1em;
  color: var(--text-muted);
  flex-shrink: 0;
}

.mds-v {
  font-size: 8px;
  letter-spacing: .04em;
  color: var(--text);
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.mds-v.muted  { color: var(--text-muted); }
.mds-v.male   { color: #5aa9e6; }
.mds-v.female { color: #ff8fb3; }

.mds-v .gsym { font-family: system-ui, "Segoe UI Symbol", sans-serif; }

.mds-sub {
  font-size: 6px;
  letter-spacing: .04em;
  color: var(--text-muted);
  text-transform: none;
}

.mon-detail-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 16px;    /* group break: stats -> action */
}
/* Flex-centred with a shared min-height so the gold and dark buttons match
   exactly — their base padding rules differ (11px/28px vs 13px/8px). */
.mon-detail-actions .btn {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mon-detail-actions .btn:disabled { cursor: default; }
/* Equipped state: an opaque darker gold, NOT the generic wrapper fade.
   .pxb:has(button:disabled) drops the whole wrapper to 55% opacity, which on
   this button blended gold with the teal backdrop and rendered olive-green.
   Opting out and recolouring keeps it legibly "gold, but inactive". */
.mon-detail-actions .pxb:has(.is-equipped) {
  opacity: 1;
  filter: var(--pxdrop);
}
.mon-detail-actions .btn.is-equipped {
  background: var(--gold-dk);
  color: rgba(26,10,0,.82);
}

/* ── Catch Overlay ───────────────────────────────────────── */
.catch-overlay {
  position: fixed;
  inset: 0;
  background: #0a2a0a;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 160;
  padding: 24px 20px;
  text-align: center;
}

.catch-overlay.active {
  display: flex;
  animation: catch-appear 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes catch-appear {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}

.catch-gotcha {
  font-family: var(--font-pixel);
  font-size: 24px;
  color: #ffd700;
  animation: catch-glow 0.7s ease-in-out infinite alternate;
}

@keyframes catch-glow {
  from { text-shadow: 0 0 6px rgba(255,215,0,.4); }
  to   { text-shadow: 0 0 22px rgba(255,215,0,.9), 0 0 44px rgba(255,215,0,.3); }
}

.catch-name {
  font-family: var(--font-pixel);
  font-size: 14px;
  color: var(--text);
  letter-spacing: .05em;
}

.catch-sub {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: rgba(255,255,255,.7);
  letter-spacing: .08em;
}

.catch-shiny {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: #ffd700;
  min-height: 1em;
}

/* ── Evolution Overlay ───────────────────────────────────── */
.evolution-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 150;
  padding: 24px 20px;
  text-align: center;
}

.evolution-overlay.active {
  display: flex;
  animation: evo-fadein 0.5s ease forwards;
}

@keyframes evo-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.evolution-msg {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--text);
  letter-spacing: .05em;
  max-width: 320px;   /* 8 fields */
  line-height: var(--lh-normal);
  text-align: center;
  min-height: 3em;
  transition: opacity .25s;
}

.evolution-sub {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--gold);
  letter-spacing: .06em;
  text-align: center;
  min-height: 1.5em;
  transition: opacity .25s;
}

#evolution-canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border: var(--border-frame);
  box-shadow: 0 0 40px rgba(255,255,255,.08);
}

/* Pal level badge on collection cards */
.mon-card-pallvl {
  font-size: var(--text-xs);
  color: var(--gold);
  letter-spacing: .06em;
}

/* ── Progress Screen ─────────────────────────────────────── */
.progress-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: var(--border-card);
  border-radius: 8px;
  padding: 8px 12px;
}

.progress-row.locked { opacity: 0.38; }

.progress-row.next-goal {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(255,214,0,.28);
}

.progress-status {
  font-size: 10px;
  min-width: 14px;
  text-align: center;
  flex-shrink: 0;
}

.progress-status.unlocked { color: var(--green); }
.progress-status.next     { color: var(--gold); }
.progress-status.locked   { color: var(--text-muted); }

.progress-lvl {
  font-size: var(--text-xs);
  color: var(--text-muted);
  min-width: 34px;
  flex-shrink: 0;
  letter-spacing: .04em;
}

.progress-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.progress-name {
  font-size: 10px;
  color: var(--text);
  letter-spacing: .05em;
}

.progress-desc {
  font-size: 8px;
  color: var(--text-muted);
  letter-spacing: .04em;
  line-height: var(--lh-loose);
}

.progress-tag {
  font-size: var(--text-xs);
  padding: 2px 4px;
  border-radius: 4px;
  letter-spacing: .06em;
  flex-shrink: 0;
  background: rgba(0,0,0,.3);
}

.progress-tag-item    { color: var(--gold); }
.progress-tag-feature { color: var(--blue); }
.progress-tag-style   { color: var(--purple); }

.progress-row.claimable {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(255,214,0,.3);
}

.btn-claim {
  font-family: var(--font-pixel);
  font-size: 8px;
  background: var(--gold);
  color: #1a0a00;
  border: none;
  border-radius: 0;
  padding: 4px 8px;
  cursor: pointer;
  letter-spacing: .04em;
  clip-path: var(--pixel-clip-sm);
  box-shadow:
    inset 0 8px 0 rgba(255,255,255,.5),
    inset 0 -8px 0 rgba(0,0,0,.32);
  filter: var(--pxdrop-sm);
  flex-shrink: 0;
  transition: filter .12s;
}

.btn-claim:hover  { filter: brightness(1.1) var(--pxdrop-sm); }
.btn-claim:active { transform: translate(3px,3px); filter: none; }

/* ── Responsive ──────────────────────────────────────────── */

/* Mobile (< 480px) — base adjustments for touch devices */
@media (max-width: 479px) {
  .app-header { padding: 20px 12px 8px; gap: 4px; }
  .logo-pomo, .logo-mons { font-size: 32px; }
  .logo-tomato-img { height: 2.1rem; }
  .logo-icon { font-size: 32px; }
  /* Touch drag-and-drop unsupported; hide blender zone */
  .blender-zone { display: none !important; }
  /* Level-up banner: prevent off-screen overflow */
  .level-up-banner { max-width: calc(100vw - 32px); white-space: normal; text-align: center; }

  /* Companion name: shrink on mobile (now overlaid above the mon, not in the top row) */
  .companion-name { font-size: 12px; line-height: var(--lh-normal); }

  /* Narrower panel on mobile — keep the left-grouped pills on-panel */
  .companion-meta { left: -85px; right: -55px; }

  /* Collection tabs: BACK + tabs + count try to stay on one row, but on the
     Dex screen "X / Y" is wide enough that at narrow widths there's no room
     left for it next to BACK + both tabs. Rather than clip it, let it wrap
     to its own centered line below — happens automatically only when it
     doesn't fit (My Mons' shorter count never triggers it). */
  .collection-header { gap: 4px; flex-wrap: wrap; }
  .collection-tabs { gap: 4px; }
  .collection-tab { padding: 8px 12px; font-size: 10px; white-space: nowrap; }
  .collection-count { font-size: 10px; margin: 2px auto 0; }

  /* Map icon: smaller, and its frame position must scale with the size.
     The timer screen is top-anchored (flex-start) with natural bottom slack,
     so the icon sits in that empty corner clear of the controls — no reserve needed. */
  #map-icon-canvas { width: 40px; height: 40px; background-size: 40px 80px; background-position: 0 -40px; }
  .btn-map-icon.has-reward #map-icon-canvas { background-position: 0 0; }

  /* Keep the enlarged encounter headline in bounds on small screens */
  .encounter-msg { font-size: 16px; }
}

/* Very small phones (≤ 359px) */
@media (max-width: 359px) {
  .app-header { padding: 16px 8px 4px; gap: 4px; }
  .logo-pomo, .logo-mons { font-size: 28px; }
  .logo-tomato-img { height: 1.75rem; }
  .logo-icon { font-size: 28px; }
  .logo { gap: 4px; }
  .tagline { font-size: 8px; letter-spacing: .06em; }
  .timer-display { font-size: 48px; padding: 8px 8px 8px 12px; }
  .screen { padding: 8px 8px calc(var(--stats-h) + 8px); gap: 4px; }
  .screen-title { font-size: 10px; }
  .companion-area { padding: 12px 8px 8px; }
  .btn { padding: 8px 12px; font-size: 12px; }
  .btn-collection { padding: 12px 4px; font-size: 12px; }
  #companion-canvas { width: 150px; height: 150px; }
  .companion-stage { width: 150px; height: 150px; }
}

/* Small-medium mobile (360px – 399px) */
@media (min-width: 360px) and (max-width: 399px) {
  #companion-canvas { width: 180px; height: 180px; }
  .companion-stage { width: 180px; height: 180px; }
  .timer-display { font-size: 64px; }
}

/* Standard and up (≥ 400px) */
@media (min-width: 400px) {
  #companion-canvas { width: 220px; height: 220px; }
  .companion-stage { width: 220px; height: 220px; }
  .timer-display { font-size: 80px; }
}

/* Landscape phones (height ≤ 520px, landscape orientation) */
@media (max-height: 520px) and (orientation: landscape) {
  :root { --stats-h: 60px; }

  .app-header { padding: 4px 12px 4px; gap: 2px; }
  .logo-pomo, .logo-mons { font-size: 20px; }
  .logo-tomato-img { height: 1.2rem; }
  .logo-icon { font-size: 20px; margin-right: 4px; }
  .tagline { display: none; }

  .screen { padding: 4px 8px calc(var(--stats-h) + 4px); gap: 4px; }

  /* Timer screen: companion left, timer+controls right */
  #screen-timer {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
  }
  #screen-timer .companion-wrap { flex: 0 0 auto; width: 44%; }
  #screen-timer .combined-timer-wrap { flex: 1 1 auto; min-width: 0; }

  #companion-canvas { width: 90px; height: 90px; }
  .companion-stage { width: 90px; height: 90px; }
  .companion-area { padding: 8px 8px 8px; gap: 4px; }
  .companion-name { font-size: 8px; }

  .timer-display { font-size: 40px; padding: 8px 8px; }
  .controls-group { padding: 8px; gap: 4px; }
  .timer-controls { gap: 4px; }
  .btn { padding: 8px 8px; font-size: 12px; }
  .btn-collection { padding: 8px 4px; font-size: 12px; }
  .collection-btns { margin-top: 0; }

  /* Compact stats strip */
  .stats-top { padding: 4px 12px 2px; }
  .stats-bottom { padding: 4px 12px 4px; gap: 8px; }
  .stat-label { display: none; }
  /* 16px tall: the 8px sm-notch would consume the full height and the top and
     bottom steps would meet, so drop to the single 4px step. */
  .exp-bar-wrap { height: 16px; clip-path: var(--pixel-clip-1); }

  /* Encounter: scrollable, canvas scaled to fit short height */
  .encounter-overlay {
    padding: 8px 20px calc(var(--stats-h) + 8px);
    justify-content: flex-start;
    gap: 4px;
    overflow-y: auto;
  }
  #encounter-canvas { height: 180px; width: 95px; }
  .encounter-controls {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    margin-top: 4px;
  }
}

/* ── Panel appear animation ──────────────────────────────── */
@keyframes panel-appear {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.companion-wrap { animation: panel-appear .3s ease-out both; }
.controls-wrap  { animation: panel-appear .3s ease-out .08s both; }

/* ── Panel pixel-border wrapper (panels, not buttons) ─────── */
/* TO RESTORE BORDER: uncomment background and padding below */
.pxb-panel {
  clip-path: var(--pixel-clip);
  /* background: #000; */
  /* padding: 4px; */
  width: 100%;
}
.pxb-panel.timer-panel { flex: 1; width: auto; }

/* ── Blender toolbar — docked at top of My Mons (V1: horizontal cards) ── */
.blender-zone {
  display: none;        /* hidden until .active is added */
  flex-direction: row;
  gap: 8px;
  width: 100%;
}

.blender-zone.active { display: flex; }

/* Sticky wrapper: header + blender toolbar pin together while the grid scrolls */
.mymons-top {
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--mode-bg);
  padding-bottom: 8px;
}
.mymons-top .collection-header { position: static; }

/* Shared card style — two even cards forming a horizontal toolbar */
.blender-drop,
.smoothie-box {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(0,0,0,.45);
  border: 2px dashed rgba(255,255,255,.28);
  border-radius: 8px;
  text-align: left;
  user-select: none;
}

.blender-drop {
  cursor: default;
  transition: border-color .15s, background .15s, box-shadow .15s;
}

.blender-drop.drag-over {
  border-color: var(--gold);
  background: rgba(255,200,0,.12);
  box-shadow: 0 0 22px rgba(255,200,0,.35);
}

.zone-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.blender-label {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--text);
  letter-spacing: .06em;
}

.blender-hint,
.smoothie-hint {
  font-size: 8px;
  color: var(--text-muted);
  letter-spacing: .04em;
  line-height: var(--lh-loose);
}

.zone-icon-img {
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  image-rendering: pixelated;
}

/* Smoothie count as a badge on the top-right corner of the icon (e.g. "x3") */
.zone-icon-wrap {
  position: relative;
  flex-shrink: 0;
  display: flex;
}

.smoothie-badge {
  position: absolute;
  top: -1px;
  right: -8px;
  font-family: var(--font-pixel);
  font-size: 10px;
  text-transform: lowercase;
  color: var(--gold);
  background: rgba(0,0,0,.82);
  padding: 4px 4px;
  border-radius: 8px;
  line-height: 1;
  letter-spacing: .02em;
}

.smoothie-count { color: var(--gold); }

/* Cards become draggable in My Mons */
.mon-card[draggable="true"] { cursor: grab; }
.mon-card[draggable="true"]:active { cursor: grabbing; }
.mon-card.dragging { opacity: .45; transform: scale(.96); }

/* Mon card highlighted as smoothie drop target */
.mon-card.smoothie-hover {
  border-color: var(--green);
  box-shadow: 0 0 16px rgba(46,204,113,.5);
  transform: scale(1.06);
}

/* Smoothie box draggable cursor */
.smoothie-box[draggable="true"] { cursor: grab; }
.smoothie-box[draggable="true"]:active { cursor: grabbing; }

/* ── Blender Confirm Modal ───────────────────────────── */
.blender-confirm {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.72);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}

.blender-confirm.active { display: flex; }

.blender-confirm-box {
  background: #1a0a00;
  border: var(--border-accent);
  border-radius: 12px;
  padding: 28px 20px;
  max-width: 320px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 0 30px rgba(255,200,0,.2);
}

.blender-confirm-title {
  font-size: 10px;
  color: var(--gold);
  letter-spacing: .1em;
}

.blender-confirm-body {
  font-size: 8px;
  line-height: var(--lh-loose);
  color: var(--text);
  letter-spacing: .05em;
}

.blender-confirm-body span {
  color: var(--gold);
}

.blender-confirm-warn {
  font-size: 8px;
  color: #ff6b6b;
  letter-spacing: .08em;
}

.blender-confirm-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
}

/* ── Spawn Rates Info Modal (matches blender-confirm) ── */
.spawn-info {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.72);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}

.spawn-info.active { display: flex; }

.spawn-info-box {
  background: #1a0a00;
  border: var(--border-accent);
  border-radius: 12px;
  padding: 28px 20px;
  max-width: 320px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 0 30px rgba(255,200,0,.2);
}

.spawn-info-title {
  font-size: 10px;
  color: var(--gold);
  letter-spacing: .1em;
}

.spawn-info-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.spawn-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 8px;
  letter-spacing: .05em;
  color: var(--text);
}

.spawn-info-row .swatch {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.3);
}

.spawn-info-row .swatch.normal { background: var(--text-muted); }
.spawn-info-row .swatch.shiny  { background: var(--gold); }
.spawn-info-row .swatch.dark   { background: #1a1a1a; }

.spawn-info-label { flex: 1; text-align: left; }
.spawn-info-odds  { color: var(--gold); letter-spacing: .04em; }

/* ── Blend result flash ──────────────────────────────── */
.blend-result-flash {
  position: fixed;
  bottom: calc(var(--stats-h) + 24px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: rgba(0,0,0,.88);
  border: var(--border-accent);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 8px;
  color: var(--gold);
  letter-spacing: .1em;
  z-index: 300;
  white-space: nowrap;
  animation: blend-flash 2.6s ease forwards;
}

.blend-result-icon {
  width: 20px;
  height: 20px;
  image-rendering: pixelated;
  vertical-align: middle;
  margin-right: 4px;
}

@keyframes blend-flash {
  0%   { opacity: 0; transform: translateX(-50%) translateY(6px); }
  12%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  78%  { opacity: 1; }
  100% { opacity: 0; }
}
