/* Game Generator - one stylesheet for the generator and every generated game.
   Colours come from CSS variables that each game's palette sets. */
:root {
  --bg: #08060c; --bg2: #110d18; --panel: #17121f; --panel2: #201a2b; --edge: #3a2f4a;
  --text: #eee8f2; --dim: #a59bb0; --accent: #6c5cff; --accentDark: #2e2670; --accent2: #ff2e8a;
  --good: #8be12f; --bad: #e0243c; --drop: #6a78ff; --money: #8be12f; --meta: #c08cff;
  --fs: 15px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: var(--fs)/1.35 "Segoe UI", system-ui, sans-serif; overflow-x: hidden; }
button { font: inherit; color: var(--text); background: var(--panel2); border: 2px solid var(--edge); border-radius: 10px; padding: 8px 12px; cursor: pointer; touch-action: manipulation; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: 0.45; cursor: default; }
button.primary { background: var(--accentDark); border-color: var(--accent); font-weight: 700; }
button.big { font-size: 1.15em; padding: 12px 18px; }
select, input[type=text], input[type=number] { font: inherit; color: var(--text); background: var(--bg2); border: 2px solid var(--edge); border-radius: 8px; padding: 7px 8px; width: 100%; }
input[type=range] { width: 100%; accent-color: var(--accent); }
h1, h2, h3 { margin: 0.3em 0; }
.dim { color: var(--dim); }
.good { color: var(--good); } .bad { color: var(--bad); } .money { color: var(--money); } .meta { color: var(--meta); } .dropc { color: var(--drop); }
.row { display: flex; gap: 8px; align-items: center; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.hidden { display: none !important; }
.card { background: var(--panel); border: 2px solid var(--edge); border-radius: 12px; padding: 10px; }

/* ---------- generator page ---------- */
#gen { max-width: 1040px; margin: 0 auto; padding: 12px 16px 40px; }
.gen-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 4px; }
.gen-head h1 { font-size: 1.8em; letter-spacing: 0.5px; margin: 0.15em 0 0.1em; }
.gen-head h1 span { color: var(--accent2); }
.tagline { margin: 0 0 10px; }
button.small, .small { font-size: 0.85em; padding: 5px 10px; }
.small-text { font-size: 0.85em; }
.gen-grid { display: grid; grid-template-columns: 330px 1fr; gap: 14px; align-items: start; }
.gen-grid > * { min-width: 0; }
.gen-grid .col > .card + .card { margin-top: 12px; }
@media (max-width: 760px) { .gen-grid { grid-template-columns: 1fr; } }
.field { margin-bottom: 9px; }
.field label { display: block; font-size: 0.85em; color: var(--dim); margin-bottom: 3px; }
.step-title { display: flex; align-items: center; gap: 7px; font-weight: 800; margin: 4px 0 7px; }
.step-title i { font-style: normal; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 0.8em; flex: none; }
.step-title ~ .step-title { margin-top: 12px; }
.genre-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.genre-pick button { text-align: left; padding: 7px 9px; font-size: 0.92em; display: flex; flex-direction: column; gap: 2px; }
.genre-pick button span { font-size: 0.8em; color: var(--dim); line-height: 1.2; }
.genre-pick button.on { border-color: var(--accent); background: var(--accentDark); }
.genre-pick button.on span { color: var(--text); }
#ideaChips { gap: 4px; margin-top: 6px; }
details#more { border: 2px dashed var(--edge); border-radius: 10px; padding: 6px 9px; margin: 10px 0 2px; }
details#more summary { cursor: pointer; font-weight: 700; padding: 3px 0; }
details#more summary .dim { font-weight: 400; font-size: 0.85em; }
details#more[open] summary { margin-bottom: 8px; }
.code-load { margin-top: 12px; }
.field.minw { min-width: 150px; }
.row.wrap > .field { margin-bottom: 9px; }
details#more .row { gap: 0 8px; }
#make { font-size: 1.1em; }
.resume { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; border-color: var(--accent); }
.welcome { margin-bottom: 12px; border-color: var(--accent); }
.welcome h2 { font-size: 1.2em; }
.welcome .steps { margin: 6px 0; padding-left: 22px; }
.welcome .steps li { margin: 4px 0; }
.keyart-wrap { position: relative; }
#preview .keyart { width: 100%; border-radius: 10px; display: block; border: 2px solid var(--edge); }
.seed-tag { position: absolute; left: 8px; bottom: 8px; font-size: 0.75em; background: rgba(0,0,0,0.65); padding: 2px 7px; border-radius: 8px; color: var(--dim); }
.pv-title { margin-top: 10px; font-size: 1.45em; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0; }
.chips span { font-size: 0.8em; padding: 2px 9px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--edge); }
.chips span:first-child { border-color: var(--accent); color: var(--accent2); font-weight: 700; }
#preview .story { margin: 8px 0; }
#preview .section-title { margin-left: 0; }
.pv-cast { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.twists { margin: 4px 0; padding-left: 18px; }
.twists li { margin: 3px 0; }
.pv-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 6px; }
.pv-actions .play-btn { flex: 1 1 100%; font-size: 1.3em; padding: 13px; }
@media (min-width: 761px) { .pv-actions .play-btn { flex: 0 1 auto; min-width: 180px; } }
.code-line { word-break: break-all; margin-top: 4px; }
.foes { display: flex; flex-wrap: wrap; gap: 6px; }
.foes figure { margin: 0; width: 76px; text-align: center; font-size: 0.72em; color: var(--dim); }
.foes canvas { width: 64px; height: 64px; }
.gal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 560px) { .gal-grid { grid-template-columns: 1fr 1fr; } }
.gal-tile { padding: 0; overflow: hidden; display: flex; flex-direction: column; text-align: left; border-radius: 10px; }
.gal-tile:hover:not(:disabled) { border-color: var(--tile, var(--accent)); }
.gal-tile canvas { width: 100%; display: block; aspect-ratio: 480 / 210; background: var(--bg2); }
.gal-cap { display: flex; flex-direction: column; padding: 4px 7px 6px; font-size: 0.78em; line-height: 1.25; min-width: 0; }
.gal-cap b, .gal-cap span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.saved { display: flex; gap: 6px; align-items: stretch; margin-top: 7px; }
.saved-main { flex: 1; min-width: 0; display: flex; gap: 9px; align-items: center; text-align: left; padding: 5px; }
.saved-main canvas { width: 104px; height: 46px; border-radius: 6px; flex: none; background: var(--bg2); }
.saved-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.saved-info > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.saved-del { flex: none; font-size: 0.8em; padding: 4px 8px; color: var(--dim); }
.saved-del.sure { border-color: var(--bad); color: var(--text); background: color-mix(in srgb, var(--bad) 35%, var(--panel2)); }

/* ---------- game shell ---------- */
#game { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.topbar { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: var(--bg2); border-bottom: 2px solid var(--edge); min-height: 46px; }
.topbar .title { font-weight: 800; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar button { padding: 5px 10px; }
.hud { display: flex; flex-wrap: wrap; gap: 4px 6px; padding: 5px 8px; background: var(--panel); border-bottom: 1px solid var(--edge); font-size: 0.92em; }
.hud > span { background: rgba(0, 0, 0, 0.45); border: 1px solid var(--edge); border-radius: 8px; padding: 1px 8px; white-space: nowrap; color: var(--dim); }
.hud b { font-weight: 800; color: var(--text); }
.hud .money b { color: var(--money); } .hud .meta b { color: var(--meta); }
.topbar .snd { min-width: 64px; font-size: 0.85em; }
.topbar .snd.off { color: var(--dim); border-style: dashed; }
.main { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; }
.tabs { display: flex; background: var(--bg2); border-top: 2px solid var(--edge); }
.tabs button { flex: 1; border: 0; border-radius: 0; background: transparent; padding: 11px 4px; font-weight: 700; font-size: 0.9em; border-top: 3px solid transparent; }
.tabs button.on { border-top-color: var(--accent); background: var(--panel); }
.toasts { position: fixed; left: 8px; bottom: 64px; display: flex; flex-direction: column; gap: 4px; z-index: 30; max-width: min(64vw, 340px); pointer-events: none; }
.toast { background: var(--panel2); background: color-mix(in srgb, var(--panel2) 88%, transparent); border: 2px solid var(--edge); border-left: 5px solid var(--accent); border-radius: 8px; padding: 5px 9px; font-size: 0.82em; animation: tin 0.2s; }
.toast.drop { border-left-color: var(--drop); }
.toast.bad { border-left-color: var(--bad); }
.toast.good { border-left-color: var(--good); }
@keyframes tin { from { transform: translateX(-20px); opacity: 0; } }
.modal-back { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.72); display: flex; align-items: center; justify-content: center; z-index: 40; padding: 12px; }
.modal { background: var(--panel); border: 2px solid var(--accent); border-radius: 14px; padding: 14px; max-width: 560px; width: 100%; max-height: 88vh; overflow-y: auto; }
.modal .btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
.list-item { display: flex; gap: 10px; align-items: center; background: var(--panel); border: 2px solid var(--edge); border-radius: 10px; padding: 7px 9px; margin: 6px 8px; }
.list-item canvas { flex: none; }
.list-item .info { flex: 1; min-width: 0; }
.list-item .name { font-weight: 700; }
.list-item .sub { font-size: 0.85em; color: var(--dim); }
.list-item button { flex: none; min-width: 92px; }
.section-title { margin: 12px 10px 2px; font-weight: 800; color: var(--accent2); }
.bar { height: 14px; background: #000; border: 2px solid var(--edge); border-radius: 7px; overflow: hidden; position: relative; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--bad); transition: width 0.1s; }
.bar > span { position: absolute; inset: 0; font-size: 10px; line-height: 10px; text-align: center; font-weight: 800; text-shadow: 0 0 3px #000, 0 0 2px #000; }
.guide dt { font-weight: 800; margin-top: 8px; color: var(--accent2); }
.guide dd { margin: 2px 0 0 0; }
.seg { display: flex; gap: 0; margin: 6px 0 10px; border: 2px solid var(--edge); border-radius: 10px; overflow: hidden; }
.seg button { flex: 1; border: 0; border-radius: 0; background: transparent; padding: 7px 4px; font-weight: 700; font-size: 0.9em; }
.seg button + button { border-left: 2px solid var(--edge); }
.seg button.on { background: var(--accentDark); }
.guide-sec { background: var(--bg2); border: 1px solid var(--edge); border-radius: 10px; padding: 7px 10px; margin: 6px 0; }
.guide-sec h4 { margin: 0 0 3px; color: var(--accent2); font-size: 1em; }
.guide-sec p { margin: 0; }
.guide-sec.twist { border-color: var(--accent); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.stat-grid div { background: var(--bg2); border: 1px solid var(--edge); border-radius: 8px; padding: 5px 8px; font-size: 0.9em; }
.stat-grid b { display: block; color: var(--accent2); }
.howto { background: var(--bg2); border: 2px solid var(--accent); border-radius: 10px; padding: 8px 10px; margin-top: 10px; }
.howto h4 { margin: 0 0 4px; }
.howto ul { margin: 0; padding-left: 18px; } .howto li { margin: 3px 0; }
.opt-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.opt-row label { flex: 0 0 120px; font-size: 0.9em; color: var(--dim); }
.opt-row input[type=range], .opt-row select { flex: 1; }
.opt-row output { flex: 0 0 44px; text-align: right; font-weight: 700; font-size: 0.9em; }
.opt-sample { display: block; width: 100%; height: 56px; border-radius: 8px; border: 1px solid var(--edge); margin: 2px 0 10px; }
.opt-group { font-weight: 800; color: var(--accent2); margin: 10px 0 6px; }
.pause-box { text-align: center; } .pause-box h2 { font-size: 1.6em; }
.big-text { font-size: 1.25em; }
canvas.view { display: block; width: 100%; touch-action: none; }
.float-num { position: absolute; pointer-events: none; font-weight: 900; text-shadow: 0 0 3px #000, 0 2px 2px #000; animation: fup 0.8s forwards; }
@keyframes fup { to { transform: translateY(-48px); opacity: 0; } }

/* ---------- per-world UI styles (set by engines/shell.js from the theme) ---------- */
.ui-sharp button, .ui-sharp .card, .ui-sharp .list-item, .ui-sharp .modal, .ui-sharp .toast { border-radius: 2px; }
.ui-sharp .modal { border-width: 3px; }
.ui-round button, .ui-round .card, .ui-round .list-item, .ui-round .toast { border-radius: 18px; }
.ui-round .modal { border-radius: 24px; }
.ui-glow .list-item, .ui-glow .modal, .ui-glow .card { box-shadow: 0 0 10px -2px var(--accent), inset 0 0 12px -6px var(--accent); }
.ui-glow button.primary { box-shadow: 0 0 10px var(--accent); }
.ui-glow .topbar { box-shadow: 0 2px 12px -4px var(--accent); }
.ui-ornate .list-item, .ui-ornate .modal { border-style: double; border-width: 4px; }
.ui-ornate .section-title { font-variant: small-caps; letter-spacing: 1px; }
.ui-round .tabs button, .ui-sharp .tabs button, .ui-ornate .tabs button { border-radius: 0; border-style: none; border-top: 3px solid transparent; }
.ui-round .tabs button.on, .ui-sharp .tabs button.on, .ui-ornate .tabs button.on { border-top-color: var(--accent); }
#ideaChips button { font-size: 0.78em; padding: 3px 8px; border-radius: 12px; }
.school { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px; border: 1px solid var(--meta); color: var(--meta); font-size: 0.85em; }
.fingerprint { margin: 6px 0 2px; font-size: 0.9em; }

/* FRAMES (2026-11-21): panels and windows follow the world's shape language (spec.motif.style -> html[data-frame]) */
html[data-frame=smooth] .card { border-radius: 18px; box-shadow: 0 0 14px -4px var(--accent); }
html[data-frame=smooth] .modal { border-radius: 22px; box-shadow: 0 0 30px -6px var(--accent); }
html[data-frame=spiked] .card, html[data-frame=spiked] .modal { border-radius: 2px; clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px); }
html[data-frame=spiked] .modal { border-width: 3px; }
html[data-frame=horned] .card, html[data-frame=horned] .modal { position: relative; border-radius: 6px; }
html[data-frame=horned] .card::before, html[data-frame=horned] .card::after, html[data-frame=horned] .modal::before, html[data-frame=horned] .modal::after { content: ''; position: absolute; top: -2px; width: 14px; height: 14px; border-top: 3px solid var(--accent); pointer-events: none; }
html[data-frame=horned] .card::before, html[data-frame=horned] .modal::before { left: -2px; border-left: 3px solid var(--accent); border-top-left-radius: 10px; }
html[data-frame=horned] .card::after, html[data-frame=horned] .modal::after { right: -2px; border-right: 3px solid var(--accent); border-top-right-radius: 10px; }
html[data-frame=marked] .card { border-style: double; border-width: 4px; }
html[data-frame=marked] .modal { outline: 1px dashed var(--accent2); outline-offset: -7px; }

/* CHARCOAL art style (Options > Look, 2026-11-21): game canvases go dark and smudged, some red survives; grain + vignette over the play area */
html[data-look=charcoal] #game canvas { filter: saturate(0.35) contrast(1.25) brightness(1.08) sepia(0.1); }
html[data-look=charcoal] #game { position: relative; }
html[data-look=charcoal] #game::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 5; mix-blend-mode: multiply; opacity: 0.32;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0) 60%, rgba(0,0,0,.5) 100%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.2  0 0 0 0 0.2  0 0 0 0 0.2  0 0 0 0.9 0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>"); }

/* ---- PRODUCT PASS (2026-11-22): desktop layout ---- */
/* menu screens (camp, town, clicker lists) sit in a centred column; full-screen play canvases (direct canvas.view children) keep the whole window */
@media (min-width: 820px) {
  .main:not(:has(> canvas.view)) > * { max-width: 980px; margin-left: auto !important; margin-right: auto !important; }
  .main:not(:has(> canvas.view)) > p, .main:not(:has(> canvas.view)) > .section-title { padding-left: 10px; padding-right: 10px; box-sizing: border-box; }
  .tabs { justify-content: center; }
  .tabs button { flex: 0 1 240px; }
}
/* box art on camp / town screens: never more than about a third of the screen, so Start is above the fold */
#campart, #townart { width: auto !important; max-width: 100%; max-height: 36vh; margin: 0 auto; }
/* toasts: on desktop a bottom-centre snackbar above the tabs (covers row text, never the buttons on the right); phones keep bottom-left (owner phone dead zone is top-right) */
@media (min-width: 820px) {
  .toasts { left: 50%; right: auto; top: auto; bottom: 64px; transform: translateX(-50%); max-width: 440px; width: max-content; align-items: center; }
  .toast { font-size: 0.92em; width: 380px; box-sizing: border-box; }
}

/* CONTINUE PLAYING strip (top of the generator page, only when you have saved games) */
.continue-strip { margin: 0 0 12px; padding: 12px; border: 2px solid var(--accent); border-radius: 12px; background: var(--panel); }
.cont-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 8px; }
.cont-card { display: flex; flex-direction: column; align-items: stretch; text-align: left; padding: 0; overflow: hidden; border: 2px solid var(--edge); border-radius: 10px; background: var(--panel2); cursor: pointer; }
.cont-card:hover { border-color: var(--accent); }
.cont-card canvas { width: 100%; height: auto; display: block; }
.cont-info { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 4px; }
.cont-info .dim { font-size: 0.85em; }
.cont-go { margin: 4px 10px 10px; padding: 7px; text-align: center; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 800; }

/* RUN SUMMARY (survivor / grow run-end window) */
.sum-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 6px; margin: 8px 0; }
.sum-tile { display: flex; flex-direction: column; gap: 2px; padding: 7px 9px; border: 2px solid var(--edge); border-radius: 9px; background: var(--panel2); }
.sum-tile .dim { font-size: 0.78em; text-transform: uppercase; letter-spacing: 0.06em; }
.sum-new { color: var(--good); font-size: 0.75em; margin-left: 3px; }
.sum-found { margin: 4px 0; color: var(--drop); }
.sum-dmg { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 8px; }
.sum-row { display: grid; grid-template-columns: 150px 1fr 110px; gap: 8px; align-items: center; font-size: 0.9em; }
.sum-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sum-bar { height: 9px; border-radius: 5px; background: var(--bg2); overflow: hidden; }
.sum-bar i { display: block; height: 100%; background: var(--accent); }
.sum-val { color: var(--dim); font-size: 0.85em; white-space: nowrap; text-align: right; }

/* PICK CARDS (survivor / grow level-up) */
.modal.modal-pick { max-width: 860px; }
.pick-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 640px) { .pick-row { grid-template-columns: 1fr; } .pick-card { flex-direction: row; flex-wrap: wrap; text-align: left; } .pick-card img, .pc-glyph { width: 48px; height: 48px; font-size: 30px; } .pc-hint { display: none; } }
.pick-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 12px 12px; text-align: center; border: 2px solid var(--edge); border-radius: 12px; background: var(--panel2); cursor: pointer; transition: transform .08s, border-color .08s; }
.pick-card:hover, .pick-card:focus-visible { transform: translateY(-3px); border-color: var(--accent); }
.pc-tag { position: absolute; top: 7px; left: 50%; transform: translateX(-50%); font-size: 0.68em; font-weight: 800; letter-spacing: 0.08em; padding: 2px 8px; border-radius: 99px; background: var(--bg2); color: var(--dim); white-space: nowrap; }
.pc-new .pc-tag { color: var(--good); } .pc-up .pc-tag { color: var(--accent2); } .pc-fuse .pc-tag { color: var(--drop); } .pc-fuse { border-color: var(--drop); box-shadow: 0 0 14px color-mix(in srgb, var(--drop) 40%, transparent); }
.pc-key { position: absolute; top: 6px; left: 8px; font-size: 0.72em; color: var(--dim); }
.pc-glyph { display: flex; align-items: center; justify-content: center; width: 72px; height: 72px; font-size: 42px; color: var(--accent2); }
.pc-name { font-size: 1.02em; }
.pc-sub { font-size: 0.86em; color: var(--dim); line-height: 1.3; }
.pc-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: auto; }
.pc-pips { display: inline-flex; gap: 3px; }
.pc-pips i { width: 9px; height: 9px; border-radius: 3px; background: var(--bg2); border: 1px solid var(--edge); }
.pc-pips i.on { background: var(--accent); border-color: var(--accent); }
@media (hover: none) { .pc-key, .pc-hint { display: none; } }

/* PAGES (grow-style): header with progress + Buy all, bigger pips */
.pg-head { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; gap: 4px 12px; align-items: center; margin: 10px 10px 6px; padding: 10px 12px; border: 2px solid var(--accent); border-radius: 12px; background: var(--panel); }
.pg-head .pg-title { font-size: 1.15em; }
.pg-head .pg-bar { height: 12px; border-radius: 6px; background: var(--bg2); overflow: hidden; border: 1px solid var(--edge); }
.pg-head .pg-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.pg-head .small-text { grid-column: 1 / 3; }
.pg-head button { grid-row: 1 / 3; grid-column: 3; }
.pg-pips { display: inline-flex; gap: 3px; margin-left: 6px; vertical-align: middle; }
.pg-pips i { width: 14px; height: 14px; border-radius: 4px; background: var(--bg2); border: 1px solid var(--edge); }
.pg-pips i.on { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 50%, transparent); }

/* ZONE PATH (survivor / grow camp): every zone's boss, beaten / next / not reached */
.zpath { display: flex; align-items: flex-start; gap: 0; margin: 4px 0 12px; overflow-x: auto; padding: 4px 2px 6px; }
.zp { flex: 0 0 auto; width: 104px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.zp canvas { width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--edge); background: var(--bg2); }
.zp-done canvas { border-color: var(--good); }
.zp-next canvas { border-color: var(--accent); box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 60%, transparent); }
.zp-locked canvas { opacity: 0.75; }
.zp-n { font-size: 0.72em; font-weight: 800; letter-spacing: 0.05em; color: var(--dim); }
.zp-done .zp-n { color: var(--good); } .zp-next .zp-n { color: var(--accent2); }
.zp-name { font-size: 0.78em; line-height: 1.15; }
.zp-locked .zp-name { color: var(--dim); }
.zp-boss { font-size: 0.72em; color: var(--bad); line-height: 1.15; }
.zp-line { flex: 1 0 14px; height: 2px; margin-top: 30px; background: var(--edge); }

/* NIGHTMARE picker (survivor / grow camp, after a win) */
.nm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 8px; }
.nm-row button.on { background: var(--bad); border-color: var(--bad); color: #fff; }

/* COLLECTION grid (in-game menu) */
.coll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin: 4px 0 10px; }
.coll-cell { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 6px; text-align: center; border: 2px solid var(--edge); border-radius: 10px; background: var(--panel2); }
.coll-cell.coll-rare { border-color: color-mix(in srgb, var(--drop) 70%, var(--edge)); }
.coll-cell.coll-has.coll-rare { box-shadow: 0 0 10px color-mix(in srgb, var(--drop) 45%, transparent); }
.coll-pic { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--bg2); }
.coll-pic span { font-size: 24px; font-weight: 800; color: var(--dim); }
.coll-cell figcaption { font-size: 0.78em; font-weight: 700; line-height: 1.15; }
.coll-cell:not(.coll-has) figcaption { color: var(--dim); }
.coll-cell small { font-size: 0.68em; color: var(--dim); line-height: 1.2; }
/* full-screen button in the game top bar: only where there is a mouse (phones go full screen on their own) */
.topbar .fs-btn { margin-right: 6px; }
@media (hover: none), (max-width: 640px) { .topbar .fs-btn { display: none; } }

/* RECORDS window */
.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.rec-tile { display: flex; flex-direction: column; gap: 3px; padding: 9px 11px; border: 2px solid var(--edge); border-radius: 10px; background: var(--panel2); }
.rec-tile span { font-size: 0.75em; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dim); }
.rec-tile b { font-size: 1.1em; }

/* genre pictures on the Kind-of-game buttons */
.genre-pick canvas.gpic { width: 100%; height: auto; aspect-ratio: 200 / 64; border-radius: 6px; margin-bottom: 4px; display: block; }
.pick-card + .pick-card {}
.modal-pick .pc-reroll { float: right; margin-top: 2px; }
@media (max-width: 640px) { .modal-pick .pc-reroll { float: none; display: block; margin: 0 0 6px; } }   /* phones: never top-right (owner's phone dead zone) */
.cont-prog { margin: 0 10px; font-size: 0.8em; color: var(--good); font-weight: 700; }

/* generator page: a short note (backup restored etc.) */
.gen-note { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; padding: 10px 16px; border: 2px solid var(--good); border-radius: 10px; background: var(--panel); box-shadow: 0 6px 24px rgba(0,0,0,.5); }
.saved-list .row button.small { margin-left: 6px; }

/* BESTIARY cells + monster card */
.bst-cell { margin: 0; width: 78px; text-align: center; font-size: 0.72em; }
.bst-cell .bst-pic { width: 64px; height: 64px; margin: 0 auto; background: var(--bg2); border-radius: 12px; }
.bst-cell.bst-has { cursor: pointer; } .bst-cell.bst-has:hover .bst-pic { outline: 2px solid var(--accent); }
.bst-cell.bst-has .bst-pic { background: transparent; }
.bst-card { display: flex; gap: 14px; align-items: center; }
.bst-card img { flex: 0 0 auto; border-radius: 14px; background: var(--bg2); }
@media (max-width: 520px) { .bst-card { flex-direction: column; text-align: center; } }
.coll-cell.coll-has { cursor: pointer; } .coll-cell.coll-has:hover { border-color: var(--accent); }

/* QA 2026-11-24: long windows keep their buttons in view */
.modal .btns { position: sticky; bottom: -14px; background: var(--panel); padding: 8px 0 2px; margin-bottom: -2px; z-index: 2; }
/* QA 2026-11-24: toasts never show through an open window; the older one steps back */
body:has(.modal-back) .toasts { visibility: hidden; }
.toasts .toast:not(:last-child) { opacity: .72; }
@media (max-width: 520px) { select { padding: 7px 4px; font-size: .92em; text-overflow: ellipsis; } }

/* QA R5: phone tap targets on the generator page */
@media (max-width: 520px) { #ideaChips button, #howBtn { min-height: 38px; padding-top: 6px; padding-bottom: 6px; } }
