/* Deadwatch: a worn field-station terminal. Palette from the student's design sheet:
   charcoal/slate base, off-white text, gray secondary, green = cure/hope, red-orange = danger,
   teal = action, amber = progress, near-black sprite outlines. */
:root {
  --bg: #0f1215;
  --surface: #161a1f;
  --surface-2: #1e232a;
  --surface-3: #262c34;
  --ink: #e6e8e3;
  --ink-2: #8e969d;
  --ink-3: #646c74;
  --line: #2b323b;
  --cure: #5fd37a;
  --danger: #ff6a3d;
  --accent: #3fd0c9;       /* action */
  --accent-ink: #062321;
  --gold: #f0b13a;         /* progress */
  --violet: #b67bff;
  --outline: #0b0d10;
  --good: var(--cure);
  --bad: var(--danger);
  --warn: var(--gold);
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 0 rgb(0 0 0 / 40%);
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --max: 1180px;
  color-scheme: dark;
}
:root:not([data-theme="light"]) { --bg: #0f1215; --surface: #161a1f; --surface-2: #1e232a; --ink: #e6e8e3; --ink-2: #8e969d; }

body {
  background:
    repeating-linear-gradient(0deg, rgb(255 255 255 / 1.2%) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at 80% -10%, #2a1f1a 0, transparent 55%),
    var(--bg);
  background-attachment: fixed;
}
.num, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.label { display: block; font: 600 .68rem/1.3 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.small { font-size: .85rem; }
.why { color: var(--danger); margin: 6px 0 0; }

/* ---------- Header ---------- */
.dw-header { background: color-mix(in srgb, var(--bg) 88%, transparent); border-bottom: 1px solid var(--line); gap: 10px; }
.dw-header .brand img { width: 30px; height: 30px; border-radius: 6px; image-rendering: pixelated; }
.logo-text { height: 18px; width: auto; color: var(--ink); }
.watch-status {
  display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface);
  font: 700 .72rem/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent);
}
.watch-status .dot { width: 8px; height: 8px; background: currentColor; box-shadow: 0 0 8px currentColor; animation: blink 1.6s steps(2) infinite; }
.watch-status[data-state="strained"] { color: var(--gold); }
.watch-status[data-state="breach"] { color: var(--danger); }
.watch-status[data-state="cured"] { color: var(--cure); }
.session-timer { font: .8rem var(--font-mono); color: var(--ink-2); white-space: nowrap; }
.session-timer .label { display: inline; font-size: .62rem; }
@keyframes blink { 50% { opacity: .25; } }
@media (max-width: 560px) {
  .session-timer .label { display: none; }
  .logo-text { height: 14px; }
  .dw-header .brand img { display: none; }
}
@media (max-width: 380px) { .session-timer { display: none; } }

/* ---------- Pixel headings ---------- */
.px-h { margin: 0 0 12px; line-height: 0; color: var(--ink); }
.px-h svg { height: 15px; width: auto; }
.screen-head { margin: 4px 0 14px; }
.screen-head .px-h svg { height: 20px; }
.screen-head p { color: var(--ink-2); margin: 0 0 4px; max-width: 70ch; }
.screen-head b { color: var(--ink); }

/* ---------- Cards, bars, buttons ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.card + .card { margin-top: 0; }
.bar { height: 4px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--ink-2); transition: width .2s ease; }
.bar.cure > i, .bar.hp > i { background: var(--cure); }
.bar.xp > i, .bar.gold > i { background: var(--gold); }
.bar.action > i { background: var(--accent); }
.btn {
  border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
  box-shadow: inset 0 -2px 0 rgb(0 0 0 / 35%), inset 0 1px 0 rgb(255 255 255 / 4%);
  transition: transform .08s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { box-shadow: inset 0 -2px 0 rgb(0 0 0 / 35%), 0 0 0 1px var(--accent), 0 0 12px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: #7ae6e0; }
.btn.gold { background: color-mix(in srgb, var(--gold) 18%, var(--surface-2)); border-color: color-mix(in srgb, var(--gold) 50%, transparent); color: #ffe2a6; }
.btn.danger { color: var(--danger); }
.btn[aria-disabled="true"] { opacity: .45; }
.badge { background: color-mix(in srgb, var(--cure) 18%, transparent); color: var(--cure); border-radius: 4px; font-family: var(--font-mono); }
.row.tight { gap: 6px; }

/* ---------- Tab bar ---------- */
.tabbar { background: color-mix(in srgb, #0b0e11 92%, transparent); border-top: 1px solid var(--line); }
.tabbar button { color: var(--ink-3); font-family: var(--font-mono); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; border-radius: 8px; }
.tabbar .icon { line-height: 0; }
.px-icon { width: 20px; height: 20px; }
.tabbar [aria-selected="true"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); box-shadow: inset 0 2px 0 var(--accent); }
.tabbar button[data-tab="story"] { color: color-mix(in srgb, var(--cure) 70%, var(--ink-3)); }
.tabbar button[data-tab="story"][aria-selected="true"] { color: var(--cure); background: color-mix(in srgb, var(--cure) 12%, transparent); box-shadow: inset 0 2px 0 var(--cure); }

/* Screen transitions: quick crossfade. */
.panel:not([hidden]) { animation: panel-in .2s ease; }
@keyframes panel-in { from { opacity: 0; transform: translateY(4px); } }

/* ---------- Screen A: The Watch ---------- */
.watch-layout { display: grid; gap: 12px; grid-template-columns: 1fr; }
.combat-col, .side-col { display: grid; gap: 12px; align-content: start; min-width: 0; }
@media (min-width: 900px) {
  .watch-layout { grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); }
  .notes { grid-column: 1 / -1; }
}
.combat-frame {
  position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  background: #11151c; box-shadow: 0 0 0 3px var(--outline), 0 8px 30px rgb(0 0 0 / 40%);
}
.combat-frame canvas { width: 100%; height: auto; aspect-ratio: 240 / 100; image-rendering: pixelated; image-rendering: crisp-edges; }
.combat-frame.cured { box-shadow: 0 0 0 3px var(--outline), 0 0 30px color-mix(in srgb, var(--cure) 35%, transparent); }
.hud { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; gap: 6px; justify-content: space-between; pointer-events: none; }
.hud .hud-chip { pointer-events: auto; }
.hud-chip {
  display: inline-flex; gap: 6px; align-items: center; padding: 3px 8px; border-radius: 4px;
  background: rgb(11 13 16 / 72%); border: 1px solid rgb(255 255 255 / 8%);
  font: 600 .66rem/1.4 var(--font-mono); letter-spacing: .1em; color: var(--ink-2);
}
.hud-chip b { color: var(--ink); font-weight: 700; }
.cure-overlay { position: absolute; inset: 0; display: grid; place-items: center; color: var(--cure); pointer-events: none; animation: cure-pop .6s steps(4); }
.cure-overlay svg { width: min(70%, 420px); height: auto; filter: drop-shadow(0 0 10px rgb(95 211 122 / 60%)); }
@keyframes cure-pop { from { transform: scale(.6); opacity: 0; } }

.fight-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.counter { display: flex; flex-direction: column; min-width: 0; }
.counter .big { font-size: clamp(1.9rem, 6vw, 2.6rem); font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.counter .rate { color: var(--ink-2); font-size: .85rem; }
.counter .rate b { color: var(--gold); }
.fight-btn {
  min-width: 132px; min-height: 64px; padding: 0 24px; border-radius: 10px; cursor: pointer;
  font: 800 1.15rem/1 var(--font-mono); letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent-ink); background: var(--accent); border: 2px solid var(--outline);
  box-shadow: inset 0 -5px 0 rgb(0 0 0 / 28%), inset 0 2px 0 rgb(255 255 255 / 30%), 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent), 0 0 18px color-mix(in srgb, var(--accent) 30%, transparent);
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.fight-btn:hover { filter: brightness(1.08); }
.fight-btn:active { transform: translateY(2px); box-shadow: inset 0 -2px 0 rgb(0 0 0 / 28%); }
.fight-btn.pulse { animation: fight-pulse .18s steps(3); }
.fight-btn:disabled { background: var(--surface-3); color: var(--ink-2); box-shadow: none; cursor: default; }
@keyframes fight-pulse { 50% { transform: scale(.95); filter: brightness(1.3); } }

.cure-card .cure-main { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; min-width: 0; overflow: hidden; }
.cure-big { color: var(--cure); font-size: clamp(1.8rem, 5vw, 2.4rem); font-weight: 700; line-height: 1.1; text-shadow: 0 0 18px rgb(95 211 122 / 35%); margin: 0; }
.cure-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 10px 0; }
.cure-grid .num { font-size: 1.05rem; color: var(--ink); }
.cure-card.found { border-color: color-mix(in srgb, var(--cure) 50%, var(--line)); background: linear-gradient(180deg, color-mix(in srgb, var(--cure) 10%, var(--surface)), var(--surface)); }
.condition { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.meter-top { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 0 8px; margin-bottom: 5px; }
.meter-top .label { grid-column: 1 / -1; }
.meter .val { font-size: 1.15rem; font-weight: 700; }
.meter .val small { color: var(--ink-3); font-size: .75rem; font-weight: 400; }
.rate-tag { font-size: .72rem; color: var(--ink-2); text-align: right; }
.meter[data-meter="supplies"] .bar > i { background: var(--gold); }
.meter[data-meter="survivors"] .bar > i { background: #cfd3d6; }
.meter[data-meter="morale"] .bar > i { background: var(--cure); }
.meter[data-meter="samples"] .bar > i { background: var(--violet); }
.meter.low .val, .meter.low .rate-tag { color: var(--danger); }
.meter.low .bar > i { background: var(--danger) !important; animation: blink 1s steps(2) infinite; }

.notes .log { max-height: 260px; overflow: auto; }
.log { list-style: none; margin: 0; padding: 0; font: .84rem/1.45 var(--font-mono); }
.log .note { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); color: #c9ccc6; }
.log .note:first-child { animation: note-in .25s ease; }
.log time { color: var(--ink-3); font-size: .74rem; padding-top: 1px; }
.note.tone-good { color: var(--cure); }
.note.tone-bad { color: var(--danger); }
.note.tone-gold { color: var(--gold); }
.note.tone-action { color: var(--accent); }
.note.tone-cure { color: var(--cure); font-weight: 700; text-shadow: 0 0 10px rgb(95 211 122 / 40%); }
.note.tone-note { color: var(--ink-2); font-style: italic; }
@keyframes note-in { from { opacity: 0; transform: translateX(-6px); } }

/* ---------- Screen B: Squad (tactical party menu) ---------- */
.squad-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.member { --role: var(--ink-2); position: relative; border-top: 3px solid var(--role); display: grid; gap: 10px; align-content: start; }
.role-fighter { --role: #e0734a; }
.role-marksman { --role: #5f9fd6; }
.role-medic { --role: #5fd37a; }
.role-scavenger { --role: #c9a253; }
.role-scientist { --role: #b48cff; }
.member-top { display: flex; gap: 12px; align-items: center; }
.portrait {
  width: 72px; height: 72px; flex: none; display: grid; place-items: center; border-radius: 8px;
  background: radial-gradient(circle at 50% 70%, color-mix(in srgb, var(--role, #888) 22%, transparent), transparent 70%), var(--surface-2);
  border: 1px solid var(--line); box-shadow: inset 0 0 0 2px var(--outline);
}
.portrait-svg { width: 64px; height: 64px; }
.who h3 { margin: 0 0 4px; font-family: var(--font-display); font-size: 1.1rem; letter-spacing: .04em; }
.role-tag { font: 700 .68rem/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--role); padding: 4px 6px; border: 1px solid color-mix(in srgb, var(--role) 50%, transparent); border-radius: 4px; }
.lvl { font-size: .78rem; color: var(--gold); }
.down-note { margin: 4px 0 0; color: var(--danger); font: 600 .76rem var(--font-mono); min-height: 1em; }
.member.is-down .portrait { filter: grayscale(1) brightness(.6); }
.stat-bars { display: grid; gap: 6px; }
.mini { display: grid; grid-template-columns: 26px 1fr 64px; gap: 8px; align-items: center; }
.mini .label { font-size: .62rem; }
.mini .num { font-size: .76rem; color: var(--ink-2); text-align: right; }
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0; }
.skills > div { background: var(--surface-2); border-radius: 6px; padding: 6px 8px; }
.skills dt { font: 600 .6rem var(--font-mono); letter-spacing: .1em; color: var(--ink-3); }
.skills dd { margin: 0; font-weight: 700; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 3px; gap: 3px; }
.segmented button { min-height: 40px; border: 0; border-radius: 6px; background: none; color: var(--ink-2); font: 700 .78rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.task { margin: 0; color: var(--ink-2); }
.task b { color: var(--ink); }
.gear { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gear-slot {
  display: grid; gap: 2px; text-align: left; min-height: 44px; padding: 8px; border-radius: 8px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); font: inherit;
}
.gear-slot:hover { border-color: var(--accent); }
.gear-slot[aria-disabled="true"] { cursor: default; }
.gear-slot[aria-disabled="true"] .cost { color: var(--ink-3); }
.slot-name { font: 600 .6rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.tier-name { font-size: .8rem; font-weight: 600; line-height: 1.2; }
.gear-slot .small { font-size: .7rem; }
.cost { font-size: .72rem; color: var(--accent); }
.pips { display: flex; gap: 3px; }
.pips i { width: 10px; height: 4px; background: var(--surface-3); border-radius: 1px; }
.pips i.on { background: var(--gold); }
.tier-2 .tier-name { color: #6ff0e0; }

/* ---------- Screen C: Contracts (radio transmissions) ---------- */
.contract-intro { font-family: var(--font-mono); font-size: .85rem; }
.contract-intro b { color: var(--cure); }
.contract-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.contract { position: relative; display: grid; gap: 8px; align-content: start; overflow: hidden; }
.contract h3 { margin: 0; font-family: var(--font-display); letter-spacing: .03em; }
.contract-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.freq { font-size: .7rem; letter-spacing: .08em; color: var(--accent); text-transform: uppercase; }
.transmission { margin: 0; padding: 8px 10px; border-left: 2px solid var(--accent); background: rgb(63 208 201 / 5%); font: italic .84rem/1.45 var(--font-mono); color: #c3cfcc; }
.objective { margin: 0; font-weight: 600; }
.objective .label, .reqs .label { display: inline; margin-right: 6px; }
.reqs { margin: 0; color: var(--ink-2); }
.pact { display: grid; gap: 4px; font-size: .88rem; }
.pact .up { color: var(--cure); }
.pact .down { color: var(--danger); }
.rewards { display: flex; flex-wrap: wrap; gap: 6px; }
.reward { font: 600 .7rem var(--font-mono); letter-spacing: .06em; padding: 3px 7px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.reward b { color: var(--gold); }
.reward.r-smp b { color: var(--violet); }
.reward.r-mor b { color: var(--cure); }
.progress { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.contract.status-active { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent), 0 0 18px rgb(63 208 201 / 10%); }
.contract.status-active::before { content: "ON AIR"; position: absolute; top: 12px; right: 12px; font: 700 .62rem var(--font-mono); letter-spacing: .14em; color: var(--accent); animation: blink 1.4s steps(2) infinite; }
.contract.status-active .stamp { margin-right: 54px; }
.contract.status-locked { opacity: .55; }
.contract.status-locked .transmission { filter: blur(1.5px); }
.contract.status-cooldown { opacity: .8; }
.stamp { font: 800 .64rem var(--font-mono); letter-spacing: .12em; color: var(--cure); border: 2px solid currentColor; padding: 2px 6px; border-radius: 3px; transform: rotate(-4deg); }
.contract.has-done:not(.status-active):not(.status-open) { background: repeating-linear-gradient(-45deg, transparent 0 10px, rgb(95 211 122 / 3%) 10px 20px), var(--surface); }
.contract .btn { justify-self: start; }

/* ---------- Screen D: Recovery Lab ---------- */
.lab-bench { padding: 0; overflow: hidden; display: grid; }
.lab-scene { width: 100%; height: auto; aspect-ratio: 160 / 64; display: block; }
@media (min-width: 900px) {
  .lab-bench { grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); }
  .milestone { border-top: 0; border-left: 1px solid var(--line); align-content: center; }
}
.milestone { padding: 12px 14px; display: grid; gap: 6px; border-top: 1px solid var(--line); }
.branch-title { margin: 18px 0 8px; font: 700 .78rem var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.lab-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.lab-card { display: grid; gap: 6px; align-content: start; }
.lab-card h4 { margin: 0; font-family: var(--font-display); }
.lab-card p { margin: 0; }
.lab-card.maxed { border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
.pinned {
  justify-self: start; transform: rotate(-1.5deg); background: #d8d0b4; color: #2a2620; padding: 4px 8px;
  font: .72rem/1.3 var(--font-mono); border-radius: 2px; box-shadow: 0 2px 0 rgb(0 0 0 / 40%); position: relative;
}
.pinned::before { content: ""; position: absolute; top: -3px; left: 50%; width: 6px; height: 6px; border-radius: 50%; background: var(--danger); }
.lab-card .btn { justify-self: start; white-space: nowrap; }

/* ---------- Screen E: Settings (back of the terminal) ---------- */
.settings-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.settings-grid h3 { font: 700 .78rem var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); margin: 6px 0 10px; }
.settings-grid h3 + p { margin-top: 0; }
.settings-grid textarea { font-family: var(--font-mono); font-size: 16px; background: var(--surface-2); }
.switch { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; min-height: 44px; border-bottom: 1px dashed var(--line); cursor: pointer; }
.switch input { margin-top: 2px; flex: none; }
.stat-list { margin: 0; display: grid; gap: 4px; font-size: .9rem; }
.stat-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.stat-list dt { color: var(--ink-2); }
.stat-list dd { margin: 0; font-weight: 600; }

/* ---------- Story mode ---------- */
.story { display: grid; gap: 12px; }
.story-stats { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.standings { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.standing { display: grid; grid-template-columns: 110px 1fr 20px; align-items: center; gap: 8px; }
.map-wrap { padding: 0; overflow: hidden; }
.story-map { width: 100%; height: auto; display: block; }
.map-label { font: 700 7px var(--font-mono); fill: #f1efe6; paint-order: stroke; stroke: #0b0d10; stroke-width: 2px; letter-spacing: .04em; }
.map-node.can-go { cursor: pointer; animation: blink 1.2s steps(2) infinite; }
.scene-top { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.scene-top h3 { margin: 0; font-family: var(--font-display); }
.scene-text { font-size: 1rem; line-height: 1.6; max-width: 70ch; }
.choices { display: grid; gap: 8px; }
.choice {
  display: grid; gap: 6px; text-align: left; padding: 12px 14px; min-height: 44px; border-radius: 8px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); font: inherit;
}
.choice:hover { border-color: var(--accent); box-shadow: 0 0 10px rgb(63 208 201 / 15%); }
.choice[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font: 600 .68rem var(--font-mono); letter-spacing: .06em; padding: 2px 6px; border-radius: 3px; background: var(--surface-3); color: var(--ink-2); }
.tag.dose { color: var(--violet); }
.tag.heal { color: var(--cure); }
.tag.why { color: var(--danger); }
.travel-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ending { border-color: color-mix(in srgb, var(--cure) 45%, var(--line)); }
.ending h3 { font-family: var(--font-display); font-size: 1.4rem; color: var(--cure); }
.journal .log { max-height: 300px; overflow: auto; }

/* ---------- Banners (slide-in, auto-dismiss) and tooltips ---------- */
.banner-host { position: fixed; z-index: 70; top: calc(64px + var(--safe-top)); right: calc(12px + var(--safe-right)); display: grid; gap: 8px; width: min(380px, calc(100vw - 24px)); pointer-events: none; }
.banner {
  padding: 10px 14px; border-radius: 8px; background: #0b0e11; border: 1px solid var(--line); border-left: 3px solid var(--accent);
  font: .85rem/1.4 var(--font-mono); color: var(--ink); box-shadow: 0 8px 24px rgb(0 0 0 / 45%);
  animation: banner-in .2s ease;
}
.banner.out { opacity: 0; transform: translateX(20px); transition: opacity .2s, transform .2s; }
.banner.tone-good { border-left-color: var(--cure); }
.banner.tone-bad { border-left-color: var(--danger); }
.banner.tone-gold { border-left-color: var(--gold); }
.banner.tone-cure { border-left-color: var(--cure); color: var(--cure); font-weight: 700; box-shadow: 0 0 24px rgb(95 211 122 / 30%); }
@keyframes banner-in { from { opacity: 0; transform: translateX(24px); } }
.tooltip {
  position: fixed; z-index: 80; left: 0; top: 0; max-width: 260px; padding: 7px 10px; border-radius: 6px;
  background: #07090b; border: 1px solid #39414b; color: var(--ink); font: .78rem/1.4 var(--font);
  box-shadow: 0 6px 18px rgb(0 0 0 / 50%); pointer-events: none;
}

.install-hint { background: var(--surface-2); }
.empty-state { color: var(--ink-2); }
@media (max-width: 420px) {
  .fight-btn { min-width: 112px; padding: 0 16px; }
  .gear { grid-template-columns: 1fr 1fr 1fr; }
  .gear-slot .small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .watch-status .dot, .map-node.can-go, .contract.status-active::before, .meter.low .bar > i { animation: none; }
}
@media (min-width: 1000px) {
  .story { grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); align-items: start; }
  .story > .story-head { grid-column: 1 / -1; }
  .story > .map-wrap { grid-row: span 2; position: sticky; top: 76px; }
}
