/* AGENT FOUNDRY — chrome around the canvas.
   Cartoon panel language: thick #20264d outlines, chunky radii, hard drop
   shadows, saturated fills. Nothing here is a flat dashboard card. */

:root {
  --out: #20264d;
  --ink: #1a1f42;
  --gold: #ffd35c;
  --teal: #3fd9b6;
  --blue: #7ce0ff;
  --red: #ff6b81;
  --green: #4fbf5e;
  --purple: #9d8bff;
  --amber: #ff9d2e;
  --panel: #fdfbf4;
  --shadow: 0 4px 0 var(--out), 0 9px 18px rgba(18, 22, 55, .34);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  font-family: Fredoka, system-ui, sans-serif;
  background: #12163a; color: #fff;
  user-select: none;
}

#world {
  position: fixed; inset: 0; width: 100%; height: 100%;
  display: block; cursor: pointer; touch-action: manipulation;
}

/* ============ shared bits ============ */

.bar {
  height: 9px; border-radius: 99px; background: rgba(20, 25, 60, .55);
  border: 2px solid var(--out); overflow: hidden;
}
.bar.big { height: 15px; }
.bar-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, #7ce0ff, #4fbf5e 55%, #ffd35c);
  transition: width .18s ease-out;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .16);
}

kbd {
  font: 600 11px Fredoka, sans-serif;
  background: #fff; color: var(--out);
  border: 2px solid var(--out); border-bottom-width: 3px;
  border-radius: 5px; padding: 0 5px;
}

@keyframes popper {
  0% { transform: scale(1); }
  40% { transform: scale(1.18) rotate(-2deg); }
  100% { transform: scale(1); }
}
.pop { animation: popper .34s ease-out; }

/* ============ top HUD ============ */

.hud-top {
  position: fixed; top: 10px; left: 12px; right: 12px;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; pointer-events: none; z-index: 20;
}

.levelwrap { display: flex; align-items: center; gap: 9px; }

.level-badge {
  width: 46px; height: 46px; flex: none;
  background: linear-gradient(160deg, #ffe9a8, var(--gold));
  border: 3px solid var(--out); border-radius: 14px;
  display: grid; place-items: center;
  box-shadow: var(--shadow);
  transform: rotate(-4deg);
}
.level-num { font-size: 22px; font-weight: 700; color: var(--out); }

.levelbox {
  background: rgba(253, 251, 244, .94);
  border: 3px solid var(--out); border-radius: 13px;
  padding: 6px 11px 8px; min-width: 178px;
  box-shadow: var(--shadow);
}
.level-row {
  display: flex; justify-content: space-between; gap: 10px;
  color: var(--out); font-weight: 600; font-size: 14px; margin-bottom: 5px;
}
#level-hint { opacity: .62; font-size: 12px; }

.hud-stats { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; pointer-events: auto; }

.cap {
  display: flex; align-items: center; gap: 6px;
  background: rgba(253, 251, 244, .94);
  border: 3px solid var(--out); border-radius: 13px;
  padding: 6px 12px; color: var(--out);
  font-weight: 600; font-size: 15px;
  box-shadow: var(--shadow);
  white-space: nowrap;
}
.cap .cap-ico { font-size: 15px; }
.cap b { font-size: 16px; letter-spacing: -.2px; }
.cap small { font-size: 11px; opacity: .85; font-weight: 600; color: #1c8a4a; }
.cap small.neg { color: #c2374b; }

.cap.gold { background: linear-gradient(165deg, #fff6d8, #ffe9a8); }
.cap.teal { background: linear-gradient(165deg, #e2fff8, #bcf5e7); }
.cap.blue { background: linear-gradient(165deg, #e6f8ff, #c3ecff); }
.cap.amber { background: linear-gradient(165deg, #fff0dd, #ffd9ac); }
.cap.red { background: linear-gradient(165deg, #ffeaee, #ffd0d8); }

.cap.full b { color: #c2374b; }
.cap.hot { animation: hotpulse 1s infinite; }
@keyframes hotpulse {
  0%, 100% { box-shadow: var(--shadow); }
  50% { box-shadow: 0 4px 0 var(--out), 0 0 22px rgba(255, 90, 110, .8); }
}

.cap.mute { cursor: pointer; font-size: 16px; padding: 6px 10px; }
.cap.mute:hover { transform: translateY(-1px); }

/* ============ terminal ============ */

.monitor {
  position: fixed; top: 74px; right: 14px; width: 396px; max-width: 42vw;
  background: #0d1330;
  border: 3px solid var(--out); border-radius: 15px;
  box-shadow: var(--shadow);
  overflow: hidden; z-index: 15;
}
.monitor.min #term-body { display: none; }
.monitor.min { width: 200px; }

.monitor-head {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 9px;
  background: linear-gradient(180deg, #2b3470, #202755);
  border-bottom: 3px solid var(--out);
}
.monitor-title { font-size: 12px; font-weight: 600; color: #cfe0ff; white-space: nowrap; }
.term-head-meta {
  display: flex; gap: 7px; margin-left: auto;
  font: 600 10px 'JetBrains Mono', monospace; color: #8fa4dd;
  overflow: hidden; white-space: nowrap;
}
.term-head-meta span { background: rgba(124, 224, 255, .12); padding: 1px 5px; border-radius: 5px; }
#term-tier { color: var(--gold); }
.monitor-min {
  background: none; border: 0; color: #8fa4dd; cursor: pointer;
  font-size: 14px; line-height: 1; padding: 2px 4px;
}

#term-body {
  height: 218px; overflow: hidden;
  padding: 9px 11px;
  font: 400 12.5px/1.5 'JetBrains Mono', monospace;
  color: #d7e2ff;
  background:
    repeating-linear-gradient(180deg, rgba(255,255,255,.022) 0 1px, transparent 1px 3px),
    radial-gradient(120% 90% at 50% 0%, #16204c, #0d1330);
}
.tl { white-space: pre; }
.cursor {
  display: inline-block; width: 7px; height: 14px; vertical-align: -2px;
  background: var(--blue); margin-left: 1px; animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.c-kw { color: #ff9ad5; }
.c-str { color: #9fe7a0; }
.c-com { color: #6c7cb0; font-style: italic; }
.c-num { color: #ffd35c; }

/* review overlay */
#review {
  position: absolute; inset: 0; display: none;
  background: linear-gradient(180deg, #201038, #170c28);
  padding: 10px 12px; overflow: auto;
}
#review.open { display: block; animation: slam .22s ease-out; }
@keyframes slam { from { transform: scale(.94); opacity: 0; } }
.review-title { font-weight: 700; color: var(--gold); font-size: 14px; }
.review-sub { font-size: 11px; color: #b4a9d6; margin-bottom: 7px; }
.rl {
  font: 400 12.5px/1.6 'JetBrains Mono', monospace;
  color: #ded6ff; white-space: pre; cursor: pointer;
  padding: 1px 6px; border-radius: 5px; border: 2px solid transparent;
}
.rl:hover { background: rgba(255, 255, 255, .09); border-color: rgba(255,255,255,.2); }
.rl-n { color: #7a6ea8; margin-right: 9px; }
.rl-bug { background: rgba(79, 191, 94, .22); border-color: var(--green); }
.rl-wrong { background: rgba(255, 107, 129, .2); border-color: var(--red); }
.review-why { margin-top: 8px; font-size: 12px; line-height: 1.45; min-height: 30px; }
.review-why.good { color: #9fe7a0; }
.review-why.bad { color: #ffa9b6; }

/* ============ bottom-left stack ============ */

.hud-bottom {
  position: fixed; left: 12px; bottom: 76px; width: 330px; max-width: 44vw;
  display: flex; flex-direction: column; gap: 7px; z-index: 18;
}

#feed { display: flex; flex-direction: column-reverse; gap: 4px; }
.feed-line {
  background: rgba(15, 20, 50, .78);
  border: 2px solid rgba(124, 224, 255, .22);
  border-radius: 9px; padding: 4px 9px;
  font-size: 12.5px; color: #d6e2ff;
  transition: opacity .9s, transform .9s;
  backdrop-filter: blur(3px);
}
.feed-line.fade { opacity: 0; transform: translateX(-14px); }
.feed-line.good { color: #a5f0b8; border-color: rgba(79, 191, 94, .4); }
.feed-line.bad { color: #ffb0bb; border-color: rgba(255, 107, 129, .45); }
.feed-line.ship { color: #ffe6a8; border-color: rgba(255, 211, 92, .5); }
.feed-line.level { color: #fff; background: rgba(64, 48, 128, .85); border-color: var(--purple); font-weight: 600; }

.incident, .quest, .feature {
  background: rgba(253, 251, 244, .95);
  border: 3px solid var(--out); border-radius: 13px;
  padding: 7px 11px 9px; color: var(--out);
  box-shadow: var(--shadow);
}

.incident {
  background: linear-gradient(160deg, #ffe0e5, #ffc9d2);
  border-color: #8d1f34;
  animation: alarm 1.05s infinite;
}
@keyframes alarm {
  0%, 100% { box-shadow: 0 4px 0 #8d1f34, 0 0 0 rgba(255, 60, 90, 0); }
  50% { box-shadow: 0 4px 0 #8d1f34, 0 0 26px rgba(255, 60, 90, .95); }
}
.inc-top { display: flex; justify-content: space-between; font-weight: 700; font-size: 13.5px; }
.inc-time { font-variant-numeric: tabular-nums; color: #8d1f34; }
.inc-blurb { font-size: 11.5px; opacity: .8; margin: 2px 0 5px; }
.inc-fill { background: linear-gradient(90deg, #ff6b81, #ffd35c); }
.inc-foot { display: flex; justify-content: space-between; font-size: 10.5px; opacity: .75; margin-top: 4px; }

.quest-top { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.quest-label { color: #b8862a; }
#quest-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quest-time { font-variant-numeric: tabular-nums; opacity: .65; font-size: 11.5px; }
.quest-time.urgent { color: #c2374b; opacity: 1; animation: hotpulse .7s infinite; }
.quest-fill { background: linear-gradient(90deg, #ffd35c, #ff9d2e); }
.quest-foot { display: flex; justify-content: space-between; font-size: 11px; margin-top: 4px; opacity: .8; }
#quest-reward { color: #1c8a4a; font-weight: 700; opacity: 1; }
.quest .bar { margin-top: 5px; }

.feature-top { display: flex; gap: 7px; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.feature-label { color: #4a5ce8; }
#feature-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#feature-pct { font-size: 11px; opacity: .7; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* abilities */
#abils { display: flex; gap: 8px; }
.abil {
  position: relative; width: 52px; height: 52px; flex: none;
  border: 3px solid var(--out); border-radius: 15px;
  background: linear-gradient(165deg, #4a4f86, #33375f);
  cursor: pointer; box-shadow: var(--shadow);
  display: grid; place-items: center; padding: 0;
  transition: transform .12s;
}
.abil::after {
  content: ''; position: absolute; inset: 0; border-radius: 11px;
  background: conic-gradient(rgba(10, 12, 32, .74) var(--cd, 0deg), transparent 0);
  pointer-events: none;
}
.abil.ready {
  background: linear-gradient(165deg, #ffe9a8, var(--gold));
  animation: readyglow 1.9s infinite;
}
.abil.ready::after { background: none; }
.abil.locked { filter: grayscale(1) brightness(.7); cursor: not-allowed; }
@keyframes readyglow {
  0%, 100% { box-shadow: 0 4px 0 var(--out), 0 0 0 rgba(255, 211, 92, 0); }
  50% { box-shadow: 0 4px 0 var(--out), 0 0 20px rgba(255, 211, 92, .85); }
}
.abil:active { transform: translateY(2px); }
.abil-ico { font-size: 23px; line-height: 1; }
.abil-timer {
  position: absolute; bottom: 1px; right: 4px;
  font-size: 10px; font-weight: 700; color: #fff;
  text-shadow: 0 1px 2px #000;
}

/* ============ bottom nav ============ */

.nav {
  position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 9px; z-index: 25;
}
.nav-btn {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  border: 3px solid var(--out); border-radius: 15px;
  padding: 6px 15px 7px; min-width: 74px;
  font: 600 12px Fredoka, sans-serif; color: var(--out);
  cursor: pointer; box-shadow: var(--shadow);
  transition: transform .12s;
}
.nav-btn span { font-size: 19px; line-height: 1; }
.nav-btn:hover { transform: translateY(-2px); }
.nav-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--out); }
.nav-btn.orange { background: linear-gradient(165deg, #ffd9a8, #ffb46b); }
.nav-btn.blue { background: linear-gradient(165deg, #d0efff, #98d9ff); }
.nav-btn.green { background: linear-gradient(165deg, #c9f5cf, #8fe0a0); }
.nav-btn.purple { background: linear-gradient(165deg, #ded4ff, #b7a5ff); }
.nav-btn.grey { background: linear-gradient(165deg, #eceff8, #c8cee0); }
.nav-btn.on { filter: brightness(1.08); transform: translateY(-2px); }

#ap-badge {
  position: absolute; top: -8px; right: -8px;
  background: var(--red); color: #fff;
  border: 2.5px solid var(--out); border-radius: 99px;
  font: 700 11px Fredoka, sans-serif; font-style: normal;
  padding: 1px 6px; min-width: 20px; text-align: center;
  animation: hotpulse 1.2s infinite;
}

/* ============ modal ============ */

.modal-veil {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(10, 13, 38, .72);
  backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-veil.open { display: flex; }

.modal {
  position: relative; width: min(660px, 96vw); max-height: 84vh;
  background: var(--panel);
  border: 4px solid var(--out); border-radius: 22px;
  box-shadow: 0 8px 0 var(--out), 0 24px 60px rgba(0, 0, 0, .55);
  padding: 30px 14px 16px;
  animation: pop .2s ease-out;
}
@keyframes pop { from { transform: scale(.93) translateY(12px); opacity: 0; } }

.modal-ribbon {
  position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(165deg, #5a6ff5, #3d4cc4);
  color: #fff; font-weight: 700; font-size: 15px;
  border: 3.5px solid var(--out); border-radius: 13px;
  padding: 6px 22px; white-space: nowrap;
  box-shadow: 0 4px 0 var(--out);
}
.modal-x, .modal-bulk {
  position: absolute; top: 10px;
  width: 34px; height: 34px; border-radius: 11px;
  border: 3px solid var(--out); background: #fff; color: var(--out);
  font: 700 14px Fredoka, sans-serif; cursor: pointer;
  box-shadow: 0 3px 0 var(--out);
}
.modal-x { right: 12px; }
.modal-bulk { left: 12px; width: 44px; background: linear-gradient(165deg, #ffe9a8, var(--gold)); }
.modal-x:active, .modal-bulk:active { transform: translateY(2px); box-shadow: none; }

.panel { display: none; max-height: calc(84vh - 62px); overflow-y: auto; padding: 4px 4px 6px; }
.panel.active { display: block; }
.panel::-webkit-scrollbar { width: 10px; }
.panel::-webkit-scrollbar-thumb { background: #c3c9dd; border-radius: 9px; border: 2px solid var(--panel); }

.panel-note {
  background: #eef1fb; border: 2.5px dashed #9aa4c8; border-radius: 12px;
  padding: 8px 12px; margin-bottom: 10px;
  color: #3b4270; font-size: 12.5px; line-height: 1.5;
}
.panel-sub {
  margin: 16px 2px 8px; font-weight: 700; color: var(--out); font-size: 14px;
  border-bottom: 3px solid rgba(32, 38, 77, .16); padding-bottom: 5px;
}
.panel-sub small { font-weight: 500; opacity: .6; font-size: 11px; margin-left: 6px; }

/* ============ shop rows ============ */

.shop-row {
  display: flex; align-items: center; gap: 11px;
  background: #fff;
  border: 3px solid var(--out); border-radius: 15px;
  padding: 9px 11px; margin-bottom: 8px;
  box-shadow: 0 3px 0 var(--out);
}
.shop-row.locked { opacity: .5; background: #e9ecf5; box-shadow: none; border-style: dashed; }
.shop-row.done { background: #e8f9ec; border-color: #3f8b51; box-shadow: 0 3px 0 #3f8b51; }
.shop-row.gpu { background: linear-gradient(120deg, #fff, #eef8ff); }
.shop-row.res { background: linear-gradient(120deg, #fff, #f2fff4); }
.shop-row.brk { background: linear-gradient(120deg, #fffaf0, #fff2d6); border-color: #b8862a; box-shadow: 0 3px 0 #b8862a; }

.shop-icon { font-size: 27px; width: 36px; text-align: center; flex: none; }
.shop-main { flex: 1; min-width: 0; }
.shop-name { font-weight: 700; color: var(--out); font-size: 14.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.shop-owned { background: var(--out); color: #fff; border-radius: 7px; padding: 0 7px; font-size: 11.5px; }
.tag { background: var(--gold); color: var(--out); border: 2px solid var(--out); border-radius: 7px; padding: 0 6px; font-size: 10.5px; }
.shop-blurb { font-size: 11.5px; color: #5b6389; line-height: 1.4; margin: 2px 0; }
.shop-stats { font-size: 11px; color: #2f7a55; font-weight: 600; }
.ms { color: #8b6fd0; }

.shop-btns { display: flex; flex-direction: column; gap: 5px; flex: none; }

.shop-buy, .shop-lvl {
  border: 3px solid var(--out); border-radius: 12px;
  padding: 8px 13px; min-width: 96px;
  background: #dfe3ef; color: #8890ad;
  font: 700 13px Fredoka, sans-serif; cursor: not-allowed;
  box-shadow: 0 3px 0 rgba(32, 38, 77, .35);
  display: flex; flex-direction: column; align-items: center; line-height: 1.15;
}
.shop-lvl { min-width: 96px; font-size: 11.5px; }
.shop-lvl small { font-size: 11px; opacity: .9; }
.shop-buy.afford {
  background: linear-gradient(165deg, #a5f0b8, var(--green));
  color: #10381a; cursor: pointer; box-shadow: 0 3px 0 #2c6b38;
}
.shop-lvl.afford {
  background: linear-gradient(165deg, #d5ccff, var(--purple));
  color: #241a52; cursor: pointer; box-shadow: 0 3px 0 #5b4aa8;
}
.shop-buy.afford:active, .shop-lvl.afford:active { transform: translateY(2px); box-shadow: none; }

/* tier accents down the left edge of each agent row */
.shop-row.tier-intern { border-left: 9px solid #aab7cc; }
.shop-row.tier-copilot { border-left: 9px solid #3fd9b6; }
.shop-row.tier-qa { border-left: 9px solid #ff6b81; }
.shop-row.tier-coder { border-left: 9px solid #ffb02e; }
.shop-row.tier-growth { border-left: 9px solid #ff9d5c; }
.shop-row.tier-frontier { border-left: 9px solid #9d8bff; }
.shop-row.tier-architect { border-left: 9px solid #7ce0ff; }
.shop-row.tier-agi { border-left: 9px solid #ff8ad8; }
.shop-row.tier-oracle { border-left: 9px solid #c9f24d; }
.shop-row.tier-singularity { border-left: 9px solid #2b2f5e; }
.shop-row.tier-godhead { border-left: 9px solid #e0c766; }

/* ============ rewrite ============ */

.rw { text-align: center; padding: 4px 8px 2px; }
.rw h3 { margin: 2px 0 6px; color: var(--out); font-size: 20px; }
.rw p { color: #5b6389; font-size: 12.5px; line-height: 1.55; margin: 0 auto 12px; max-width: 480px; }

.rw-stats {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px;
}
.rw-stats div {
  background: #eef1fb; border: 2.5px solid var(--out); border-radius: 12px;
  padding: 7px 13px; min-width: 96px;
}
.rw-stats span { display: block; font-size: 10.5px; color: #6b73a0; text-transform: uppercase; letter-spacing: .4px; }
.rw-stats b { font-size: 17px; color: var(--out); }

#rw-btn {
  width: 100%; max-width: 460px;
  border: 3.5px solid var(--out); border-radius: 15px;
  padding: 13px; font: 700 15px Fredoka, sans-serif;
  background: #dfe3ef; color: #8890ad; cursor: not-allowed;
  box-shadow: 0 4px 0 rgba(32, 38, 77, .35);
}
#rw-btn:not(:disabled) {
  background: linear-gradient(165deg, #d5ccff, #8f79ff);
  color: #1c1440; cursor: pointer; box-shadow: 0 4px 0 #4c3ba0;
  animation: readyglow 2.2s infinite;
}
#rw-btn:not(:disabled):active { transform: translateY(2px); box-shadow: none; }

.ap-node {
  display: flex; align-items: center; gap: 11px;
  background: linear-gradient(120deg, #fff, #f4f0ff);
  border: 3px solid var(--out); border-radius: 15px;
  padding: 9px 11px; margin-bottom: 8px;
  box-shadow: 0 3px 0 var(--out);
}
.ap-node.maxed { background: #efe8ff; opacity: .78; }
.ap-ico { font-size: 25px; width: 34px; text-align: center; flex: none; }
.ap-main { flex: 1; min-width: 0; }
.ap-name { font-weight: 700; color: var(--out); font-size: 14px; }
.ap-rank { background: var(--purple); color: #fff; border-radius: 7px; padding: 0 7px; font-size: 11px; margin-left: 5px; }
.ap-blurb { font-size: 11.5px; color: #5b6389; line-height: 1.4; }
.ap-cur { font-size: 11px; color: #6b4fbf; font-weight: 700; }
.ap-buy {
  border: 3px solid var(--out); border-radius: 12px;
  padding: 9px 14px; min-width: 76px; flex: none;
  background: #dfe3ef; color: #8890ad;
  font: 700 13px Fredoka, sans-serif; cursor: not-allowed;
  box-shadow: 0 3px 0 rgba(32, 38, 77, .35);
}
.ap-buy.afford {
  background: linear-gradient(165deg, #ffe9a8, var(--gold));
  color: var(--out); cursor: pointer; box-shadow: 0 3px 0 #b8862a;
}
.ap-buy.afford:active { transform: translateY(2px); box-shadow: none; }
.ap-max { font-weight: 700; color: #6b4fbf; font-size: 12px; padding: 0 10px; }

/* ============ stats + danger zone ============ */

.stat-table {
  background: #fff; border: 3px solid var(--out); border-radius: 15px;
  padding: 6px 14px; box-shadow: 0 3px 0 var(--out);
}
.stat-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 6px 0; border-bottom: 1.5px dashed rgba(32, 38, 77, .13);
  color: #5b6389; font-size: 12.5px;
}
.stat-row:last-child { border-bottom: 0; }
.stat-row b { color: var(--out); font-size: 13.5px; }
.stat-sep { height: 9px; }

.danger-zone {
  margin-top: 16px; background: #fff4f5;
  border: 3px dashed #c2374b; border-radius: 15px; padding: 12px 14px;
}
.danger-zone h4 { margin: 0 0 4px; color: #c2374b; font-size: 14px; }
.danger-zone p { margin: 0 0 10px; font-size: 12px; color: #8a5561; line-height: 1.5; }
#reset-btn {
  width: 100%; border: 3px solid #8d1f34; border-radius: 13px;
  padding: 11px; font: 700 13px Fredoka, sans-serif;
  background: linear-gradient(165deg, #ffc9d2, #ff8fa2);
  color: #62101f; cursor: pointer; box-shadow: 0 3px 0 #8d1f34;
}
#reset-btn.armed {
  background: linear-gradient(165deg, #ff6b81, #d62d47); color: #fff;
  animation: hotpulse .6s infinite;
}
#reset-btn:active { transform: translateY(2px); box-shadow: none; }

/* ============ banners / toast / footer ============ */

#banners {
  position: fixed; top: 96px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 7px; align-items: center;
  pointer-events: none; z-index: 30;
}
.banner {
  background: linear-gradient(165deg, #fff6d8, var(--gold));
  border: 3.5px solid var(--out); border-radius: 15px;
  padding: 8px 20px; color: var(--out);
  font-weight: 600; font-size: 15px; white-space: nowrap;
  box-shadow: var(--shadow);
  animation: bnrIn .3s cubic-bezier(.2, 1.6, .5, 1);
  transition: opacity .45s, transform .45s;
}
.banner span { color: #1c8a4a; font-weight: 700; margin-left: 5px; }
.banner.out { opacity: 0; transform: translateY(-16px) scale(.94); }
@keyframes bnrIn { from { transform: translateY(-22px) scale(.86); opacity: 0; } }

#toast {
  position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 20px);
  background: var(--panel); color: var(--out);
  border: 3.5px solid var(--out); border-radius: 16px;
  padding: 13px 20px; max-width: min(460px, 92vw);
  font-size: 13.5px; line-height: 1.55; text-align: center;
  box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s;
  z-index: 50;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast small { opacity: .65; font-size: 11px; }

/* anchored bottom-right so it never collides with the ability row or the nav */
.hint {
  position: fixed; bottom: 74px; right: 12px;
  max-width: 40vw; text-align: right;
  font-size: 11.5px; color: rgba(255, 255, 255, .72);
  text-shadow: 0 2px 6px rgba(0, 0, 0, .85);
  pointer-events: none; z-index: 10;
}
.credits {
  position: fixed; bottom: 3px; right: 10px;
  font-size: 10.5px; color: rgba(255, 255, 255, .5);
  text-shadow: 0 1px 4px rgba(0, 0, 0, .8); z-index: 10;
}
.credits a { color: rgba(255, 224, 140, .85); }

/* ============ narrow screens ============ */

@media (max-width: 900px) {
  .monitor { width: 300px; }
  #term-body { height: 168px; }
  .hud-bottom { width: 270px; }
  .hint { display: none; }
}
@media (max-width: 700px) {
  .monitor { top: 120px; }
  .hud-stats { max-width: 62vw; }
  .nav-btn { min-width: 60px; padding: 6px 9px 7px; font-size: 11px; }
  .hud-bottom { width: 240px; bottom: 84px; }
}
