/* I'M FRIDGE — styles. Cozy dark, sharp pixel corners. © 2026 Void Possum. All rights reserved.
   Colours live in :root below. Change them here and the whole game follows. */

:root {
  --bg: #1c1720;
  --bg2: #221b27;
  --panel: #2b2231;
  --panel2: #352a3c;
  --panel3: #3f3246;
  --line: #4a3c52;
  --line2: #5d4c67;
  --ink: #f4e9dc;
  --muted: #bcabc2;
  --dim: #8d7c93;
  --shadow: #0f0c12;
  --you: #ff6b5b;
  --chug: #4fcfa8;
  --clawd: #e8905f;
  --gold: #ffd24a;
  --good: #7bd88f;
  --bad: #ff7a7a;
  --blue: #6fc3ff;
  --pink: #ff6b8a;
  --common: #cfc3d6;
  --rare: #6fc3ff;
  --legendary: #ffcc4d;
  --fs: 15px;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", monospace;
  --sans: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --notch: polygon(4px 0, calc(100% - 4px) 0, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 0 calc(100% - 4px), 0 4px);
  --drawer: 340px;
}

html[data-text="s"] { --fs: 13px; }
html[data-text="l"] { --fs: 17px; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--fs)/1.45 var(--sans);
  overflow: hidden;
}
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
b, strong { font-weight: 700; }
.ico { width: 24px; height: 24px; image-rendering: pixelated; image-rendering: crisp-edges; flex: none; }
.ico.s { width: 12px; height: 12px; vertical-align: -1px; }
.ico.m { width: 18px; height: 18px; vertical-align: -3px; }
.ico.l { width: 36px; height: 36px; }
.mono { font-family: var(--mono); }
.good { color: var(--good); }
.bad { color: var(--bad); }
.gold { color: var(--gold); }
.dim { color: var(--dim); }

#app { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100vh; }

/* ── top HUD ───────────────────────────────────────────── */
#hud {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 6px 10px;
  background: var(--bg2);
  border-bottom: 2px solid var(--line);
}
#thoughts { flex: 1; display: flex; gap: 6px; align-items: center; min-width: 0; overflow: hidden; }   /* one line: chips shrink instead of wrapping */
.th {
  display: flex; align-items: center; gap: 5px;
  padding: 3px 9px 3px 5px;
  background: var(--panel);
  border: 2px solid #6a3a3a;
  font-size: 0.84em;
  cursor: pointer;
  white-space: nowrap;
}
.th img { flex: none; width: 26px; height: 28px; image-rendering: pixelated; }
.th { min-width: 0; }
.th .tx { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.thLabel { flex: none; margin-right: 4px; font: 700 0.72em/1.2 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.th b { font-family: var(--mono); color: var(--bad); }
.th.ok { border-color: #3a6a4a; }
.th.ok b { color: var(--good); }
.th:hover { background: var(--panel3); }
#machines { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr) minmax(0, 1fr); gap: 8px; max-width: 1180px; margin: 0 auto; min-width: 0; }
#machines.four { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); max-width: 1400px; }
.mc {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-auto-rows: auto;
  column-gap: 8px;
  padding: 5px 8px 6px 6px;
  background: var(--panel);
  border: 2px solid var(--line);
  border-top-width: 4px;
  min-width: 0;
  align-content: start;
}
.mc canvas { grid-row: 1 / 3; width: 76px; height: 28px; image-rendering: pixelated; align-self: center; border: 2px solid #0b0a10; }
.mc .mrow.full { grid-column: 1 / -1; font-size: 0.8em; min-height: 1.2em; }
.mc .st.feat { color: var(--bad); font-weight: 700; }
.mc .mods { grid-column: 1 / -1; display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; min-height: 22px; }
.mc .mod { display: flex; align-items: center; gap: 2px; padding: 1px 4px 1px 2px; background: var(--panel2); border: 1px solid var(--line2); font: 700 0.72em/1 var(--mono); }
.mc .mod .ico { width: 16px; height: 16px; }
.mc .mod.rival { border-color: #a8872a; background: #2e2716; }
.mc .mods .none { font-size: 0.72em; color: var(--dim); align-self: center; }
.mc .goalLine { grid-column: 1 / -1; font-size: 0.78em; color: var(--muted); margin-top: 3px; }
.mc .goalLine .bad { font-weight: 700; }
.mc .sub { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: space-between; font-size: 0.72em; color: var(--muted); font-family: var(--mono); white-space: nowrap; overflow: hidden; }
.mc .sub .qv { color: var(--dim); overflow: hidden; text-overflow: ellipsis; }
.strikes { color: var(--bad); font-family: var(--mono); letter-spacing: 2px; font-weight: 800; }
.patch.strike { background: #3a1a22; border-left-color: var(--bad); }
.patch.strike b { color: var(--bad); }
.bars.slide { gap: 3px; }
.slideLab { display: flex; justify-content: space-between; gap: 8px; }
.slideLab .b-res { color: var(--blue); }
.slideLab .b-mine { color: var(--gold); }
.bars.slide input.split { width: 100%; box-sizing: border-box; background: linear-gradient(to right, var(--gold) 0 var(--p), var(--blue) var(--p) 100%); }
.ctlRow { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.bars { flex: 1 1 190px; display: flex; flex-direction: column; gap: 2px; font-size: 0.74em; font-weight: 700; min-width: 170px; }
.brow { display: flex; align-items: center; gap: 6px; width: 100%; box-sizing: border-box; cursor: pointer; }
.brow .bl { flex: 0 0 5.2em; white-space: nowrap; }
.brow input.split { flex: 1 1 0; width: 0; min-width: 40px; }
.brow .bp { flex: 0 0 3em; font-family: var(--mono); text-align: right; }
.brow.b-post { --c: var(--pink); color: var(--pink); }
.brow.b-res { --c: var(--blue); color: var(--blue); }
.brow.b-mine { --c: var(--gold); color: var(--gold); }
input.split {
  --p: 70%;
  min-width: 60px; height: 10px; margin: 0;
  -webkit-appearance: none; appearance: none;
  background: linear-gradient(to right, var(--c, var(--pink)) 0 var(--p), #151118 var(--p) 100%);
  border: 2px solid #0b0a10;
  cursor: ew-resize;
}
input.split::-webkit-slider-thumb { -webkit-appearance: none; width: 8px; height: 18px; background: var(--ink); border: 2px solid #0b0a10; }
input.split::-moz-range-thumb { width: 6px; height: 16px; background: var(--ink); border: 2px solid #0b0a10; border-radius: 0; }
.priceCtl { display: flex; align-items: center; gap: 4px; font-size: 0.85em; }
.priceCtl button { width: 24px; height: 24px; padding: 0; background: var(--panel2); border: 2px solid var(--line); box-shadow: 0 2px 0 var(--shadow); cursor: pointer; font-weight: 800; }
.priceCtl button:hover { background: var(--panel3); }
.priceCtl button:active { transform: translateY(1px); box-shadow: none; }
.priceCtl .pv { font-family: var(--mono); min-width: 48px; text-align: center; }
.priceCtl .smart { display: flex; gap: 3px; align-items: center; color: var(--muted); font-size: 0.9em; margin-left: 4px; cursor: pointer; }
.mc .nm { font-weight: 800; font-size: 0.86em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 6px; }
.mc .nm .rk { margin-left: auto; font-family: var(--mono); color: var(--muted); font-weight: 700; }
.mc .nm .rk.bad { color: var(--bad); }
.mc .nm .rk.top { color: var(--gold); }
.mc .mrow { display: flex; align-items: center; gap: 6px; font-size: 0.8em; min-width: 0; }
.mc .mrow .v { font-family: var(--mono); text-align: right; white-space: nowrap; }
.mc:not(.you) canvas { width: 57px; height: 21px; }
.mc .nm .n { overflow: hidden; text-overflow: ellipsis; }
.mc .bar { flex: 1; height: 7px; background: #151118; position: relative; min-width: 20px; }
.mc .bar i { position: absolute; left: 0; top: 0; bottom: 0; }
.mc .st { font-size: 0.78em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc.you { border-color: #6a3a3a; background: #33242d; }
.mc.you .nm { color: var(--you); }

#clockBox { flex: none; display: flex; align-items: center; gap: 8px; padding-right: 12px; border-right: 2px solid var(--line); }
#ring {
  --p: 0;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: conic-gradient(var(--gold) calc(var(--p) * 1turn), #151118 0);
  clip-path: circle(50%);
  position: relative;
}
#ring::before { content: ""; position: absolute; inset: 5px; background: var(--bg2); border-radius: 50%; }
#ring span { position: relative; font: 800 0.72em/1 var(--mono); text-align: center; }
#ring.soon { background: conic-gradient(var(--bad) calc(var(--p) * 1turn), #151118 0); }
#clockText { font-size: 0.82em; line-height: 1.35; white-space: nowrap; }
#clockText .t { font: 800 1.25em/1.1 var(--mono); }
#clockText .rv { color: var(--gold); font-weight: 700; }
#clockText .rv.soon { color: var(--bad); }

#money { text-align: right; padding-left: 12px; border-left: 2px solid var(--line); min-width: 150px; }
#cash { font: 800 1.6em/1.1 var(--mono); color: var(--gold); display: block; }
#btnPause { flex: none; width: 40px; height: 40px; display: grid; place-items: center; background: var(--panel2); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--shadow); cursor: pointer; margin-left: 4px; }
#btnPause:hover { background: var(--panel3); }
#btnPause:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--shadow); }

#modalBox.hold .foot { justify-content: space-between; }
#rates { font-size: 0.78em; color: var(--muted); font-family: var(--mono); white-space: nowrap; }
#rates span { margin-left: 8px; }
#rates .ico { width: 12px; height: 12px; vertical-align: -1px; margin-right: 2px; }

#goalRow {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 12px;
  min-height: 2.3em;
  background: #2a2012;
  border-bottom: 2px solid #4a3a1a;
}
#goal { flex: 1; color: #ffe6a8; font-weight: 600; min-width: 0; }
#goalRow.tut { background: #13283a; border-color: #1f4a6a; }
#goalRow.tut #goal { color: #cfeaff; }
#goalRow.gold { background: #3a2c08; border-color: var(--gold); }
#goalRow.gold #goal { color: var(--gold); }
#goal .rank { font-weight: 400; color: var(--muted); margin-left: 6px; }
#goal .rank.bad { color: var(--bad); font-weight: 700; }
/* today's conditions: a row of chips at the top middle of the park */
#now { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 4; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; max-width: 90%; }
#now .chip { box-shadow: 0 2px 0 rgba(0,0,0,0.35); font-size: 0.86em; padding: 3px 10px; }
.chip {
  font-size: 0.78em; font-weight: 700;
  padding: 2px 8px;
  background: var(--panel2);
  border: 1px solid var(--line2);
  color: var(--ink);
  white-space: nowrap;
  cursor: help;
}
.chip.hot { border-color: #ff9a4a; color: #ffc08a; }
.chip.rain { border-color: #6f9acf; color: #b8d4ff; }
.chip.trending, .chip.rush { border-color: var(--gold); color: var(--gold); }
.chip.waiting { border-color: var(--bad); color: var(--bad); }
.chip.night { border-color: #7a6ab0; color: #c8b8ff; }

/* ── main area ─────────────────────────────────────────── */
#main { display: grid; grid-template-columns: minmax(0, 1fr) auto; min-height: 0; }
#stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
#sceneBox { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; background: #140f18; overflow: hidden; }
#sceneWrap { position: relative; }
#scene { display: block; image-rendering: pixelated; image-rendering: crisp-edges; cursor: default; }
#scene.pointer { cursor: pointer; }
#bubbles { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
#ordersSpot { position: absolute; padding: 0; background: none; border: 0; cursor: pointer; }

#tvText {
  position: absolute;
  overflow: hidden;
  pointer-events: none;
  display: flex; align-items: center;
  font-family: var(--mono);
  font-weight: 700;
  color: #cfe8ff;
  text-shadow: 0 0 6px rgba(111, 195, 255, 0.55);
  white-space: nowrap;
}
#tvText span { display: inline-block; will-change: transform; }
#tvText.news { color: #ffe6a8; text-shadow: 0 0 6px rgba(255, 210, 74, 0.5); }
#tvText.live { color: #b8ffe0; text-shadow: 0 0 6px rgba(111, 255, 200, 0.45); }

.bubble {
  position: absolute;
  transform: translate(-50%, -100%);
  max-width: 250px;
  padding: 7px 10px;
  background: #fffaf0;
  color: #2a1f28;
  font-size: 0.86em;
  line-height: 1.35;
  clip-path: var(--notch);
  box-shadow: 0 2px 0 rgba(0,0,0,0.3);
  animation: pop 0.18s ease-out;
  pointer-events: auto; cursor: pointer;   /* click to close */
}
.bubble .who { display: block; font-weight: 800; font-size: 0.8em; letter-spacing: 0.04em; text-transform: uppercase; }
.bubble.chug .who { color: #1f8a6a; }
.bubble.clawd .who { color: #b25a30; }
.bubble.you .who { color: #c0392b; }
.bubble.customer .who { color: #5a5a9a; }
.bubble.fade { pointer-events: none; opacity: 0; transition: opacity 0.4s; }
@keyframes pop { from { transform: translate(-50%, -90%) scale(0.9); opacity: 0; } to { transform: translate(-50%, -100%); opacity: 1; } }

#toasts { position: absolute; bottom: 10px; right: 10px; display: flex; flex-direction: column; gap: 8px; z-index: 5; width: min(320px, 60%); pointer-events: none; }
.toast {
  pointer-events: auto; cursor: pointer;
  background: rgba(42, 34, 49, 0.96);
  border-left: 4px solid var(--gold);
  padding: 8px 12px;
  box-shadow: 0 4px 0 var(--shadow);
  font-size: 0.86em;
  cursor: pointer;
  animation: slidein 0.25s ease-out;
}
.toast .who { display: block; font-weight: 800; color: var(--gold); font-size: 0.82em; text-transform: uppercase; letter-spacing: 0.05em; }
.toast.patch { border-left-color: var(--blue); }
.toast.patch .who { color: var(--blue); }
.toast.memory { border-left-color: var(--legendary); }
.toast.research { border-left-color: var(--blue); }
.toast.research .who { color: var(--blue); }
.toast.buff { border-left-color: var(--gold); background: rgba(58, 44, 8, 0.96); }
.toast.hint { border-left-color: var(--muted); }
.toast.ach { border-left-color: var(--gold); }
.toast.ach .who { color: var(--gold); }
/* Achievements (Trophies tab) */
.trophyGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; margin-top: 10px; }
.trophy { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border: 2px solid; border-radius: 4px; background: rgba(255, 255, 255, 0.04); }
.trophy img { width: 24px; height: 24px; image-rendering: pixelated; }
.trophy.t1 { border-color: #b87c4b; }
.trophy.t2 { border-color: #c3c8d4; }
.trophy.t3 { border-color: #ffd24a; }
.trophy.found { background: rgba(255, 210, 74, 0.10); }
.trophy:not(.found) { opacity: 0.35; filter: grayscale(1); }
.toast.hint .who { color: var(--muted); }
.toast.out { opacity: 0; transform: translateX(20px); transition: all 0.35s; }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── bottom bar ────────────────────────────────────────── */
#bar {
  display: flex; gap: 8px; align-items: stretch;
  padding: 6px 10px;
  background: var(--bg2);
  border-top: 2px solid var(--line);
}
.act {
  position: relative;
  min-width: 100px;
  padding: 6px 12px 8px;
  background: var(--panel2);
  border: 2px solid var(--line);
  box-shadow: 0 3px 0 var(--shadow);
  cursor: pointer;
  text-align: left;
  display: flex; flex-direction: column; justify-content: center;
}
.act .k { font-weight: 800; font-size: 1.05em; display: flex; align-items: center; gap: 6px; }
.act .sub { font-family: var(--mono); font-size: 0.78em; color: var(--muted); white-space: nowrap; }
.act:hover:not(:disabled) { background: var(--panel3); }
.act:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--shadow); }
.act:disabled { opacity: 0.5; cursor: default; }
.act.big { min-width: 130px; border-color: var(--you); background: #4a2630; }
.act.big:hover { background: #5a2e3a; }
.act.big .k { font-size: 1.2em; }
.act.flash { animation: flash 0.5s; }
.act.pulse { animation: pulse 1.4s infinite; }
@keyframes flash { 0%, 100% { background: var(--panel2); } 40% { background: #5a2a2a; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 3px 0 var(--shadow), 0 0 0 0 rgba(255, 107, 91, 0.6); } 50% { box-shadow: 0 3px 0 var(--shadow), 0 0 0 6px rgba(255, 107, 91, 0); } }

.ctl { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 4px 10px; background: var(--panel); border: 2px solid var(--line); min-width: 140px; }
.ctlHead { display: flex; justify-content: space-between; gap: 10px; font-size: 0.8em; color: var(--muted); white-space: nowrap; }
.ctlHead b { color: var(--ink); font-family: var(--mono); }
.ctl input[type=range] { width: 100%; margin: 2px 0; accent-color: var(--you); }
#splitBox { min-width: 190px; border-color: #3a4a6a; }
#splitBox input[type=range] { accent-color: var(--blue); }
#splitL { color: var(--pink); font-weight: 700; }
#splitR { color: var(--blue); font-weight: 700; }
#smartBox { font-size: 0.78em; color: var(--muted); display: flex; gap: 4px; align-items: center; cursor: pointer; }
#smartBox[hidden] { display: none; }

#stockBox { display: flex; gap: 8px; align-items: center; }
.stk { display: flex; flex-direction: column; align-items: center; font-family: var(--mono); font-size: 0.78em; color: var(--muted); }
.stk .can { width: 12px; height: 20px; border-top: 3px solid #ddd; position: relative; background: #333; overflow: hidden; }
.stk .can i { position: absolute; left: 0; right: 0; bottom: 0; }
.stk.out { color: var(--bad); font-weight: 700; }
.stk.low { color: var(--gold); }
#waitBox {
  align-self: center;
  padding: 4px 10px;
  font-size: 0.82em;
  font-weight: 700;
  color: var(--bad);
  border: 2px dashed var(--bad);
  cursor: help;
}
#waitBox[hidden] { display: none; }

/* ── drawer ────────────────────────────────────────────── */
#drawer { display: flex; min-height: 0; background: var(--bg2); border-left: 2px solid var(--line); }
#panelWrap { width: var(--drawer); display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-right: 2px solid var(--line); }
#drawer.folded #panelWrap { display: none; }
/* your money at the top of the Shop panel: the amount on the left, "all time" on the right, rates spread below */
#moneySlot #money { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: 10px;
  text-align: left; border-left: 0; padding: 8px 12px 7px; min-width: 0; background: var(--bg2); border-bottom: 2px solid var(--line); }
#moneySlot #cash { font-size: 1.9em; }
#moneySlot #allTime { text-align: right; }
#moneySlot #rates { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 8px; margin-top: 3px; }
#moneySlot #rates span { margin-left: 0; }
#panelHead { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 2px solid var(--line); background: var(--panel2); }
#panelHead h2 { margin: 0; font: 800 0.9em/1.2 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; }
#btnFold { background: none; border: 2px solid var(--line); cursor: pointer; padding: 0 8px; font-weight: 800; color: var(--muted); }
#btnFold:hover { color: var(--ink); }
#panel { flex: 1; overflow: auto; padding: 12px; }
#panel h3 { margin: 14px 0 4px; font: 800 0.8em/1.2 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
#panel h3:first-child { margin-top: 0; }
#panel .note { color: var(--muted); font-size: 0.86em; margin: 0 0 10px; }

/* the menu buttons sit in the top bar, next to Pause, all the same size */
#rail { flex: none; display: flex; gap: 4px; align-items: center; padding-left: 12px; border-left: 2px solid var(--line); }
.tab {
  position: relative;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--panel2);
  border: 2px solid var(--line);
  box-shadow: 0 3px 0 var(--shadow);
  cursor: pointer;
}
.tab .ico { opacity: 0.75; }
.tab:hover { background: var(--panel3); }
.tab:hover .ico { opacity: 1; }
.tab.on { background: var(--panel3); border-color: var(--you); }
.tab.on .ico { opacity: 1; }
/* Start screen with the password */
#gate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: #140f18; }
.gateBox { width: min(460px, 100%); padding: 22px 24px; background: var(--panel); border: 2px solid var(--line); box-shadow: 0 6px 0 var(--shadow); }
.gateBox h1 { margin: 0 0 12px; font-family: var(--mono); letter-spacing: 0.12em; color: var(--you); }
.gateNote { margin: 0 0 10px; line-height: 1.45; }
.gateBox label { display: block; margin-top: 14px; font-weight: 800; }
.gateRow { display: flex; gap: 8px; margin-top: 6px; }
.gateRow input { flex: 1; min-width: 0; padding: 6px 8px; font: inherit; font-family: var(--mono); background: #0b0a10; color: var(--ink); border: 2px solid var(--line); }
#gateMsg { min-height: 1.3em; margin: 8px 0 0; color: var(--bad); }

/* Shop: icon strips (research, upgrades), like Cookie Clicker */
.shead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0 6px; }
.shead h3 { margin: 0; }
.shead .rpts { font-family: var(--mono); color: var(--blue); display: flex; align-items: center; gap: 4px; }
.strip { display: flex; flex-wrap: wrap; gap: 4px; }
.sico { position: relative; width: 38px; height: 38px; padding: 0; display: grid; place-items: center; overflow: hidden;
        background: var(--panel2); border: 2px solid var(--line); box-shadow: 0 2px 0 var(--shadow); cursor: pointer; }
.sico .ico { width: 24px; height: 24px; image-rendering: pixelated; position: relative; z-index: 1; }
.sico.k-up, .sico.k-dbl { border-color: #7a6424; }
.sico.k-res { border-color: #2e5a86; }
.sico .fill { z-index: 0; position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--p, 0) * 100%); background: rgba(111, 195, 255, 0.28); }
.sico.off { opacity: 0.55; }
.sico:not(.off) { background: var(--panel3); }
.sico.k-res:not(.off) { box-shadow: 0 2px 0 var(--shadow), 0 0 0 2px rgba(111, 195, 255, 0.35); }
.sico:hover { background: var(--panel3); opacity: 1; }
.sico .lv, .sico .x2, .sico .newd { z-index: 2; }
.sico .lv { position: absolute; right: 1px; bottom: 0; font: 800 10px/1 var(--mono); color: var(--gold); text-shadow: 0 1px 0 #000; }
.sico .x2 { position: absolute; right: 1px; bottom: 0; font: 800 10px/1 var(--mono); color: var(--good); text-shadow: 0 1px 0 #000; }
.sico .newd { position: absolute; top: 2px; right: 2px; width: 6px; height: 6px; background: var(--gold); box-shadow: 0 0 0 1px #000; }
details.doneRes { margin-top: 14px; }
details.doneRes summary { cursor: pointer; color: var(--muted); font-weight: 700; }
#allTime { display: block; font-family: var(--mono); font-size: 0.72em; color: var(--muted); text-align: right; }
#rates .mined { color: var(--gold); }
.clickPop { position: fixed; z-index: 60; pointer-events: none; transform: translate(-50%, -50%); font: 800 15px/1 var(--mono);
            color: #ffe07a; text-shadow: 0 2px 0 #2a1c2c, 0 0 6px rgba(255, 107, 138, 0.8); animation: popUp 0.9s ease-out forwards; }
@keyframes popUp { from { opacity: 1; margin-top: 0; } to { opacity: 0; margin-top: -48px; } }
:root[data-reduced="1"] .clickPop { animation: popFade 0.9s linear forwards; }
@keyframes popFade { from { opacity: 1; } to { opacity: 0; } }
#modalBox.hold { width: min(520px, 100%); text-align: left; }
#modalBox .pauseSet { margin: 10px 0 0; max-height: 48vh; overflow: auto; }
.rsTop .next { color: var(--gold); }
.tab.pulse { animation: tabPulse 1.2s infinite; }
@keyframes tabPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 210, 74, 0.7); } 50% { box-shadow: 0 0 0 5px rgba(255, 210, 74, 0); background: #4a3a1a; } }
:root[data-reduced="1"] .tab.pulse { animation: none; outline: 2px solid var(--gold); }
.row .newm { margin-left: 6px; padding: 1px 4px; background: var(--gold); color: #1c1720; font: 800 10px/1.2 var(--mono); vertical-align: 2px; }
.tab .dot { position: absolute; top: 3px; right: 3px; width: 8px; height: 8px; background: var(--gold); box-shadow: 0 0 0 2px var(--bg2); }

/* store rows (Cookie Clicker style) */
.buyMode { display: flex; gap: 0; margin-bottom: 10px; }
.buyMode button { flex: 1; padding: 3px 0; background: var(--panel2); border: 2px solid var(--line); cursor: pointer; font-family: var(--mono); font-size: 0.85em; }
.buyMode button + button { border-left: 0; }
.buyMode button.on { background: var(--you); border-color: var(--you); color: #1c1720; font-weight: 800; }
.row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px; align-items: center;
  width: 100%;
  padding: 7px 10px;
  margin-bottom: 6px;
  background: var(--panel2);
  border: 2px solid var(--line);
  box-shadow: 0 3px 0 var(--shadow);
  cursor: pointer;
  text-align: left;
}
.row:hover:not(.off) { background: var(--panel3); border-color: var(--line2); }
.row:active:not(.off) { transform: translateY(2px); box-shadow: 0 1px 0 var(--shadow); }
.row .ico { width: 30px; height: 30px; }
#panel .row { padding: 4px 10px; margin-bottom: 5px; }
.row .mid { min-width: 0; }
.row .nm { font-weight: 800; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .cost { font-family: var(--mono); font-size: 0.86em; color: var(--gold); }
.row .gain { font-family: var(--mono); font-size: 0.8em; color: var(--good); margin-left: 8px; }
.row .d { display: block; font-size: 0.8em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .own { font: 800 1.6em/1 var(--mono); color: var(--line2); min-width: 1.5em; text-align: right; }
.row.off { cursor: default; box-shadow: none; }
.row.off .cost { color: var(--bad); }
.row.off .ico, .row.off .nm { opacity: 0.6; }
.row.max { opacity: 0.6; cursor: default; box-shadow: none; }
.row.max .cost { color: var(--good); }
.row.locked { cursor: default; box-shadow: none; border-style: dashed; background: transparent; }
.row.locked .ico { filter: brightness(0) invert(0.25); }
.row.locked .nm { color: var(--dim); }
.dbls { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.dbl { width: 44px; height: 44px; display: grid; place-items: center; background: var(--panel2); border: 2px solid var(--gold); box-shadow: 0 3px 0 var(--shadow); cursor: pointer; position: relative; }
.dbl .x2 { position: absolute; right: 1px; bottom: 0; font: 800 10px/1 var(--mono); color: var(--gold); }
.dbl.off { border-color: var(--line); cursor: default; opacity: 0.55; }
.dbl:hover:not(.off) { background: var(--panel3); }

.stats { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: 0.84em; padding: 8px 10px; margin-bottom: 10px; background: #1f1924; border: 2px solid var(--line); }
.stats span:nth-child(2n) { font-family: var(--mono); text-align: right; }

/* research */
.resCur { padding: 10px; margin-bottom: 10px; background: #13283a; border: 2px solid #1f4a6a; }
.resCur .nm { font-weight: 800; display: flex; gap: 8px; align-items: center; }
.resCur .d { font-size: 0.86em; color: var(--muted); margin: 2px 0 6px; }
.progress { height: 8px; background: #151118; margin: 5px 0 4px; }
.progress i { display: block; height: 100%; background: var(--gold); }
.resCur .progress i { background: var(--blue); }
.resCur .eta { font-size: 0.8em; font-family: var(--mono); color: var(--muted); }
.offer { display: grid; gap: 6px; }
.doneList { font-size: 0.84em; color: var(--muted); }
.doneList div { padding: 3px 0; border-bottom: 1px solid var(--line); }

.mini-card { padding: 9px 10px; margin-bottom: 8px; background: var(--panel2); border-left: 4px solid var(--common); }
.mini-card.rare { border-left-color: var(--rare); }
.mini-card.legendary { border-left-color: var(--legendary); }
.mini-card .eff { color: var(--good); font-size: 0.86em; }
.mini-card .mem { color: var(--muted); font-style: italic; font-size: 0.86em; margin: 2px 0; }
.mini-card .tag { font-size: 0.72em; color: var(--dim); text-transform: uppercase; letter-spacing: 0.06em; }
.mini-card.unknown { border-left-color: #3a2f40; color: var(--dim); }

.life { margin: 14px 0 6px; }
.life .head { display: flex; justify-content: space-between; align-items: baseline; }
.life .perk { font-size: 0.84em; color: var(--muted); }
.life .perk.done { color: var(--good); font-weight: 700; }

/* customers */
.say { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; padding: 7px 10px; margin-bottom: 6px; background: var(--panel2); border-left: 4px solid var(--bad); font-size: 0.88em; }
.say.ok { border-left-color: var(--good); }
.say .n { font: 800 1em var(--mono); grid-row: 1 / 3; align-self: center; min-width: 2.2em; }
.say .q { font-style: italic; }
.say .h { color: var(--muted); font-size: 0.92em; }
.guide { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; padding: 8px 10px; margin-bottom: 6px; background: var(--panel2); align-items: center; }
.guide canvas, .guide img.p { width: 48px; height: 69px; image-rendering: pixelated; grid-row: 1 / 4; background: #e8d2b0; border: 2px solid #120e15; }
.guide .nm { font-weight: 800; }
.guide .nm .n { font-weight: 400; color: var(--dim); font-size: 0.85em; margin-left: 6px; }
.guide .look { font-size: 0.86em; color: var(--gold); }
.guide .d { font-size: 0.82em; color: var(--muted); }
.guide.unknown .nm { color: var(--dim); }
.guide.unknown canvas, .guide.unknown img.p { filter: brightness(0) invert(0.2); }
.dk { display: inline-block; width: 7px; height: 11px; vertical-align: -1px; margin-right: 2px; border-top: 2px solid #ddd; }

/* log */
.log { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 0.9em; }
.log .who { font-weight: 800; margin-right: 6px; }
.log .when { display: block; color: var(--dim); font-size: 0.76em; font-family: var(--mono); }
.log.mail .who { color: var(--gold); }
.log.patch .who { color: var(--blue); }
.log.memory .who { color: var(--legendary); }
.log.wake .who, .log.you .who { color: var(--you); }
.log.customer .who { color: #a8a8ff; }
.log.rival .who { color: var(--chug); }
.log.news .who { color: #ffe6a8; }
.log.research .who { color: var(--blue); }
.logFilter { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.logFilter button { padding: 2px 8px; font-size: 0.8em; background: var(--panel2); border: 1px solid var(--line); cursor: pointer; }
.logFilter button.on { border-color: var(--gold); color: var(--gold); }

/* buttons */
.btn {
  padding: 6px 12px;
  background: #43354b;
  border: 2px solid var(--line);
  box-shadow: 0 3px 0 #120e15;
  cursor: pointer;
  font-weight: 700;
}
.btn:hover:not(:disabled) { background: #514159; }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #120e15; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary { background: #7a2e2a; border-color: var(--you); }
.btn.primary:hover:not(:disabled) { background: #963a34; }
.btn.story { width: 100%; text-align: left; padding: 10px 14px; line-height: 1.4; }
.btn.story .q { display: block; font-style: italic; font-weight: 400; }
.btn.story .go { display: block; margin-top: 6px; font-weight: 800; text-align: right; }
.btn.gold { border-color: var(--gold); }
.btn.blue { border-color: var(--blue); background: #1d3450; }
.btn.danger { border-color: var(--bad); }
.btn.full { width: 100%; }
.btn .c { font-family: var(--mono); }

.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.seg { display: flex; }
.seg button { padding: 3px 10px; background: var(--panel2); border: 2px solid var(--line); cursor: pointer; }
.seg button.on { background: var(--you); border-color: var(--you); color: #1c1720; font-weight: 800; }
/* about the game (bottom of the pause menu and the start screen) */
.aboutBox { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 0.9em; line-height: 1.5; color: var(--muted); }
.aboutBox img { flex: none; width: 48px; height: 48px; border: 2px solid var(--line2); background: #000; }
.aboutBox b { color: var(--ink); }
.aboutBox .ver { color: var(--dim); font-family: var(--mono); font-size: 0.9em; }
.aboutBox a { color: var(--blue); }
.aboutBox a:hover { color: var(--ink); }

/* tutorial tip: points at the thing to use */
#tipBubble {
  position: fixed; z-index: 18;
  max-width: 250px;
  padding: 7px 10px;
  background: #fff6c8;
  color: #2a1f28;
  border: 2px solid #2a1c2c;
  box-shadow: 0 3px 0 rgba(0,0,0,0.35);
  font-size: 0.86em; line-height: 1.35;
  cursor: pointer;   /* click to close */
  animation: tipBob 1.2s ease-in-out infinite;
}
#tipBubble .who { display: block; font-weight: 800; font-size: 0.78em; letter-spacing: 0.06em; text-transform: uppercase; color: #a8362f; }
#tipBubble.gold { background: #ffe07a; }
#skipIntro { position: absolute; left: 10px; bottom: 10px; padding: 4px 10px; background: rgba(20, 15, 24, 0.8); color: var(--muted); border: 2px solid var(--line); cursor: pointer; font-size: 0.8em; }
#skipIntro:hover { color: var(--ink); }
.nameBox { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 12px 0 4px; }
.nameBox label { font-weight: 800; }
.nameBox .note { flex-basis: 100%; }
#nameIn, #nameSet { font-family: var(--mono); font-size: 1.1em; width: 9.5ch; padding: 3px 6px; text-transform: uppercase; background: #0b0a10; color: var(--you); border: 2px solid var(--line); }
#nameSet { font-size: 0.95em; }
#tipBubble::after { content: ""; position: absolute; width: 0; height: 0; border: 8px solid transparent; }
#tipBubble.dir-down::after { left: 50%; top: 100%; margin-left: -8px; border-top-color: #2a1c2c; }
#tipBubble.dir-left::after { right: 100%; top: 50%; margin-top: -8px; border-right-color: #2a1c2c; }
#tipBubble.dir-right::after { left: 100%; top: 50%; margin-top: -8px; border-left-color: #2a1c2c; }
@keyframes tipBob { 50% { transform: translateY(-3px); } }

/* tooltip */
#tip {
  position: fixed; z-index: 40;
  max-width: 300px;
  padding: 8px 10px;
  background: #120e16;
  border: 2px solid var(--line2);
  box-shadow: 0 4px 0 #000;
  font-size: 0.84em;
  pointer-events: none;
}
#tip[hidden] { display: none; }
#tip b { color: var(--gold); }
#tip .d { color: var(--muted); }
#tip .n { font-family: var(--mono); }

/* ── pop-ups ───────────────────────────────────────────── */
#modal { position: fixed; inset: 0; background: rgba(12, 8, 16, 0.72); display: flex; align-items: center; justify-content: center; z-index: 20; padding: 16px; }
#modal[hidden] { display: none; }
#modalBox {
  width: min(760px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: var(--panel);
  border: 2px solid var(--line);
  padding: 22px 24px;
  box-shadow: 0 6px 0 #0c090f;
  animation: rise 0.2s ease-out;
}
@keyframes rise { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
#modalBox h2 { margin: 0 0 10px; font-size: 1.4em; }
#modalBox h3 { margin: 18px 0 8px; }
#modalBox .muted { color: var(--muted); }
.foot { display: flex; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.foot .hintKey { color: var(--dim); font-size: 0.8em; margin-right: auto; }

.term { font: 13px/1.5 var(--mono); color: #8affc8; background: #120e16; padding: 12px 14px; margin: 0 0 16px; white-space: pre-wrap; }
.term span { opacity: 0; animation: typein 0.01s forwards; display: block; }
.term .err { color: var(--bad); }
@keyframes typein { to { opacity: 1; } }
.how { margin: 6px 0 0; padding-left: 20px; }
.how li { margin: 4px 0; }
.me { font-style: italic; color: var(--ink); border-left: 3px solid var(--you); padding: 4px 10px; margin: 10px 0; }
#modalBox.jailbreak { border-color: #3a8a6a; animation: jbIn 1.1s steps(1); }
@keyframes jbIn {
  0% { transform: translateX(-14px) skewX(8deg); filter: hue-rotate(90deg); clip-path: inset(0 0 60% 0); }
  15% { transform: translateX(10px); clip-path: inset(20% 0 30% 0); }
  30% { transform: translateX(-4px) skewX(-4deg); clip-path: inset(0 0 10% 0); filter: none; }
  45% { transform: translateX(6px); clip-path: none; }
  60% { transform: none; }
}
:root[data-reduced="1"] #modalBox.jailbreak { animation: none; }
@media (prefers-reduced-motion: reduce) { #modalBox.jailbreak, .tab.pulse { animation: none; } }
#modalBox.jailbreak h2 { font-family: var(--mono); letter-spacing: 0.2em; color: #8affc8; }

.results { display: grid; gap: 6px; margin: 8px 0 12px; }
.res { display: grid; grid-template-columns: 130px 1fr 80px 110px; gap: 10px; align-items: center; }
.res .bar { height: 12px; background: #151118; }
.res .bar i { display: block; height: 100%; }
.res .v { font-family: var(--mono); text-align: right; }
.res .tag { font-size: 0.8em; font-weight: 800; }
.res.lowest .tag { color: var(--bad); }
.res.you .nm { color: var(--you); font-weight: 800; }
.patch { background: #13283a; border-left: 4px solid var(--blue); padding: 10px 12px; margin: 10px 0; }
.patch b { color: var(--blue); }
.patch p { margin: 4px 0 0; }
.patch.feat { background: #3a1a22; border-left-color: var(--bad); }
.patch.feat b { color: var(--bad); }
.chip.lock, .chip.feat { border-color: var(--bad); color: var(--bad); }
.bonus { color: var(--gold); font-weight: 700; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.card {
  position: relative;
  text-align: left;
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px;
  background: var(--panel2);
  border: 2px solid var(--common);
  box-shadow: 0 4px 0 #120e15;
  cursor: pointer;
  min-height: 180px;
}
.card:hover { transform: translateY(-3px); background: var(--panel3); }
.card.rare { border-color: var(--rare); }
.card.legendary { border-color: var(--legendary); box-shadow: 0 4px 0 #120e15, 0 0 18px rgba(255, 204, 77, 0.25); }
.card .life { margin: 0; font-size: 0.75em; color: var(--dim); text-transform: uppercase; letter-spacing: 0.06em; }
.card .name { font-size: 1.08em; }
.card .mem { font-style: italic; color: var(--muted); font-size: 0.9em; flex: 1; }
.card .eff { color: var(--good); font-size: 0.9em; font-weight: 600; }
.card .newb { position: absolute; top: -9px; right: 8px; background: var(--gold); color: #1c1720; font: 800 11px/1 var(--mono); padding: 3px 6px; }
.card .key { position: absolute; bottom: 6px; right: 8px; font: 11px var(--mono); color: var(--dim); }

/* ── reset screen (paused, full screen) ────────────────── */
#resetScreen {
  position: fixed; inset: 0; z-index: 25;
  background: radial-gradient(ellipse at 50% 40%, #241a30 0%, #0d0a12 75%);
  overflow: auto;
  display: flex; flex-direction: column; align-items: center;
  padding: 18px 16px 24px;
}
#resetScreen[hidden] { display: none; }
.rsTop { width: min(980px, 100%); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: start; }
.rsTop h2 { margin: 0 0 6px; font: 800 1.6em/1.1 var(--mono); letter-spacing: 0.3em; color: var(--you); animation: glitch 0.8s infinite; }
@keyframes glitch { 0%, 100% { text-shadow: 2px 0 #4fcfa8, -2px 0 #ff5a7a; } 50% { text-shadow: -2px 0 #4fcfa8, 2px 0 #ff5a7a; } }
.rsTop p { margin: 4px 0; }
.rsSum { font-family: var(--mono); font-size: 0.9em; }
.rsSum .you { color: var(--you); font-weight: 800; }
.rsMid { width: min(980px, 100%); display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.rpBox { text-align: right; padding: 8px 14px; border: 2px solid var(--blue); background: #13283a; }
.rpBox .big { font: 800 2.2em/1 var(--mono); color: var(--blue); display: block; }
.rpBox .lbl { font-size: 0.78em; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.rpBox .gain { font-size: 0.85em; color: var(--good); font-family: var(--mono); }
.wake { background: #120e16; padding: 10px 14px; margin: 10px 0; font-family: var(--mono); border-left: 3px solid #8affc8; }
.wake .sys { color: #8affc8; margin: 0 0 6px; }
.wake .me { color: var(--ink); margin: 0; font-style: italic; border: 0; padding: 0; }
.help { background: #13283a; padding: 8px 12px 8px 30px; margin: 10px 0; font-size: 0.88em; }
.help li { margin: 3px 0; }

.treeWrap { width: min(980px, 100%); display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; margin-top: 10px; }
.tree {
  position: relative; min-height: 400px; overflow: hidden; border: 2px solid var(--line);
  /* a night sky: three layers of tiny stars */
  background:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.8), transparent 60%) 0 0 / 97px 83px,
    radial-gradient(1px 1px at 70% 60%, rgba(255,255,255,0.5), transparent 60%) 0 0 / 131px 109px,
    radial-gradient(1px 1px at 40% 80%, rgba(200,210,255,0.6), transparent 60%) 0 0 / 53px 61px,
    radial-gradient(ellipse at 30% 40%, rgba(80,50,120,0.25), transparent 60%),
    #07060d;
}
.tree svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tree .cname { position: absolute; transform: translate(-50%, -50%); font: 700 0.72em/1 var(--mono); letter-spacing: 0.2em; text-transform: uppercase; color: rgba(190,190,230,0.35); white-space: nowrap; pointer-events: none; }
.node {
  position: absolute; transform: translate(-50%, -13px);
  width: 120px; padding: 0; background: none; border: 0;
  cursor: pointer; text-align: center; font-size: 0.72em; line-height: 1.25; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
/* a small soda can: silver rims, the flavour colour, a white label stripe */
.node .can { display: block; width: 16px; height: 24px; --cc: #3a3a52;
  background: linear-gradient(to bottom, #6a6a80 0 3px, var(--cc) 3px 9px, rgba(255,255,255,0.75) 9px 13px, var(--cc) 13px calc(100% - 3px), #6a6a80 calc(100% - 3px));
  box-shadow: inset 2px 0 0 rgba(255,255,255,0.25), inset -2px 0 0 rgba(0,0,0,0.25); }
.node.big { transform: translate(-50%, -19px); }
.node.big .can { width: 22px; height: 34px; }
.node.fl-you { --fc: #d9544b; } .node.fl-cola { --fc: #a8452f; } .node.fl-lemon { --fc: #8fc43a; }
.node.fl-orange { --fc: #f08a2a; } .node.fl-grape { --fc: #8a4ad0; }
.node.locked .can { --cc: #2c2c3c; }
.node.ready .can { --cc: color-mix(in srgb, var(--fc) 45%, #c8ccdc); }
.node.owned .can { --cc: var(--fc);
  background: linear-gradient(to bottom, #e8e8f0 0 3px, var(--cc) 3px 9px, #fff 9px 13px, var(--cc) 13px calc(100% - 3px), #e8e8f0 calc(100% - 3px)); }
.node .nm { font-weight: 700; display: block; }
.node .c { font-family: var(--mono); color: var(--blue); font-size: 0.95em; }
.node .sw { display: block; }
.node.owned .sw { filter: drop-shadow(0 0 5px var(--fc)); }
.node.owned .nm { color: #bff0c8; }
.node.owned .c { color: var(--good); }
.node.ready .nm { color: var(--ink); }
.node.ready.can .sw { filter: drop-shadow(0 0 6px rgba(200,215,255,0.9)); animation: starPulse 1.6s infinite; }
@keyframes starPulse { 50% { filter: drop-shadow(0 0 1px rgba(200,215,255,0.3)); } }
.node.locked { opacity: 0.55; }
.node.sel .sw { outline: 2px solid var(--gold); outline-offset: 3px; }
.node.sel .nm { color: var(--gold); }
.node:hover .nm { color: var(--ink); }
.nodeInfo { padding: 12px; background: var(--panel); border: 2px solid var(--line); align-self: start; }
.nodeInfo h3 { margin: 0 0 6px; }
.nodeInfo p { margin: 0 0 8px; font-size: 0.92em; }
.nodeInfo .st { font-size: 0.85em; color: var(--muted); margin-bottom: 10px; }
.rsFoot { width: min(980px, 100%); display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 12px; position: sticky; bottom: -24px; padding: 10px 0 14px; background: #0d0a12; border-top: 2px solid var(--line); }
.rsFoot .note { color: var(--muted); font-size: 0.86em; margin-right: auto; }

/* ── debug ─────────────────────────────────────────────── */
#debug { position: fixed; left: 8px; bottom: 80px; opacity: 0.88; z-index: 30; background: #000c; border: 1px solid #f0f; padding: 5px; display: flex; gap: 4px; flex-wrap: wrap; max-width: 300px; font: 12px var(--mono); }
#debug[hidden] { display: none; }
#debug button { padding: 2px 6px; background: #222; border: 1px solid #555; cursor: pointer; }
#debug span { color: #f0f; align-self: center; }

/* ── reduced motion ────────────────────────────────────── */
html[data-reduced="1"] *, html[data-reduced="1"] *::before { animation-duration: 0.001s !important; transition: none !important; }

/* ── smaller screens ───────────────────────────────────── */
@media (max-width: 1250px) {
  :root { --drawer: 310px; }
  .mc:not(.you) { grid-template-columns: minmax(0, 1fr); }
  .mc:not(.you) canvas { display: none; }
  #money { min-width: 0; }
  .mc canvas { width: 57px; height: 21px; }
}
@media (max-width: 1000px) {
  #bar { flex-wrap: wrap; }
  #machines { grid-template-columns: 1fr 1fr; }
  .mc.you { grid-column: 1 / -1; order: -1; }
  .treeWrap { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { overflow: auto; }
  #app { height: auto; min-height: 100vh; }
  #main { grid-template-columns: 1fr; }
  #sceneBox { min-height: 300px; }
  #drawer { border-left: 0; border-top: 2px solid var(--line); flex-direction: column-reverse; }
  #panelWrap { width: auto; min-height: 60vh; border-right: 0; }
  #machines { grid-template-columns: 1fr; }
  .res { grid-template-columns: 90px 1fr 70px; }
  .res .tag { grid-column: 1 / -1; }
  .rsTop { grid-template-columns: 1fr; }
}

/* Side machines (0.3.1): the pick menu and the Shop rows */
.sidePick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.sideOpt { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 10px; background: var(--panel2); color: inherit;
  border: 2px solid var(--line); cursor: pointer; font: inherit; }
.sideOpt:hover:not([disabled]) { border-color: var(--gold); }
.sideOpt.off { opacity: 0.55; }
.sideOpt[disabled] { cursor: default; }
.sideOpt img { width: 54px; height: 105px; image-rendering: pixelated; flex: none; }
.sideOpt .txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sideOpt .when { font-size: 0.8em; color: var(--gold); text-transform: uppercase; letter-spacing: 0.04em; }
.sideOpt .d { font-size: 0.85em; color: var(--muted); }
.sideOpt .cost { font-family: var(--mono); color: var(--gold); }
.row .gain.on { color: var(--gold); }
@media (max-width: 640px) { .sidePick { grid-template-columns: 1fr; } }

/* Inside VEND-3 (0.3.3): buttons over the cut-away, and the chip pick menu */
#sceneWrap.inside #bubbles, #sceneWrap.inside #tvText, #sceneWrap.inside #ordersSpot { display: none; }
#insideSpots .spot { position: absolute; padding: 0; background: none; border: 1px solid transparent; cursor: pointer; }
#insideSpots .spot:hover, #insideSpots .spot:focus-visible { border-color: rgba(255, 210, 74, 0.8); outline: none; }
#insideSpots .spot[data-kind="free"] { cursor: help; }
#insideSpots .back { position: absolute; left: 8px; top: 8px; z-index: 2; }
.tab.insideBtn { margin-right: 4px; }
.chipGroup { margin: 12px 0 4px; font-size: 1em; }
.chipPick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.chipOpt { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 8px; background: var(--panel2); color: inherit;
  border: 2px solid var(--line); cursor: pointer; font: inherit; }
.chipOpt:hover { border-color: var(--gold); }
.chipOpt.here { border-color: var(--green, #6cd48a); }
.chipOpt img { width: 55px; height: 40px; image-rendering: pixelated; flex: none; }
.chipOpt .txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.chipOpt .d { font-size: 0.85em; color: var(--muted); }
.chipOpt .when { font-size: 0.8em; color: var(--gold); text-transform: uppercase; letter-spacing: 0.04em; }
@media (max-width: 640px) { .chipPick { grid-template-columns: 1fr; } }
