@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');
:root {
  --ink: #dceee2;
  --muted: #87aaa0;
  --line: rgba(168,224,190,.22);
  --panel: rgba(7,25,22,.94);
  --mint: #9de8bb;
  --cyan: #83d8d2;
  --amber: #ecc183;
  --pink: #ef9ea5;
  --shadow: 0 18px 80px rgba(0,0,0,.45);
}
* { box-sizing: border-box; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
html, body { margin: 0; width: 100%; height: 100%; background: #061311; color: var(--ink); font-family: Manrope, system-ui, sans-serif; overflow: hidden; }
button, a { font: inherit; color: inherit; }
button { border: 1px solid var(--line); background: rgba(8,31,27,.75); cursor: pointer; }
button:hover, button:focus-visible { border-color: var(--mint); color: #fff; background: rgba(31,78,60,.8); outline: none; }
button:disabled { opacity: .38; cursor: not-allowed; }
[hidden] { display: none !important; }
#gameShell, #world { position: fixed; inset: 0; width: 100%; height: 100%; }
#world { display: block; image-rendering: auto; cursor: crosshair; }
.vignette { position: fixed; inset: 0; pointer-events: none; z-index: 2; background: radial-gradient(ellipse at center, transparent 45%, rgba(2,10,9,.42) 100%); }
.game-header, .hud-top, .objective, .environment-readout, .bottom-hint, .quick-nav, .toast { position: fixed; z-index: 4; }
.game-header { top: 0; left: 0; right: 0; height: 72px; padding: 15px 26px; display: flex; align-items: center; justify-content: space-between; background: linear-gradient(180deg, rgba(3,16,14,.9), transparent); border-bottom: 1px solid rgba(170,226,193,.08); }
.brand { display: flex; align-items: baseline; gap: 8px; color: #f0fff0; text-decoration: none; font: 700 14px 'Space Grotesk', sans-serif; letter-spacing: .16em; }
.brand span { color: var(--mint); }
.brand small { align-self: end; color: var(--muted); font: 10px 'DM Mono', monospace; letter-spacing: .1em; }
.title-lockup { text-align: center; line-height: 1; }
.title-lockup strong { font: 700 19px 'Space Grotesk', sans-serif; letter-spacing: .16em; }
.title-lockup strong span { color: var(--mint); }
.title-lockup small { display: block; margin-top: 5px; color: var(--muted); font: 9px 'DM Mono', monospace; letter-spacing: .19em; }
.header-actions { display: flex; align-items: center; gap: 7px; }
.header-actions button, .header-actions .save-state { padding: 8px 10px; font: 10px 'DM Mono', monospace; letter-spacing: .04em; }
.header-actions .save-state { color: var(--mint); border: 1px solid rgba(157,232,187,.2); }
.hud-top { top: 92px; left: 28px; right: 28px; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
.eyebrow { color: var(--mint); font: 10px 'DM Mono', monospace; letter-spacing: .14em; text-transform: uppercase; }
.region-readout strong { display: block; margin-top: 5px; text-shadow: 0 2px 18px #03120f; font: 600 23px 'Space Grotesk', sans-serif; }
.region-readout small { display: block; margin-top: 4px; color: var(--muted); font: 10px 'DM Mono', monospace; letter-spacing: .08em; }
.resource-strip { display: flex; gap: 10px; pointer-events: auto; }
.resource-strip div { min-width: 72px; padding: 9px 11px; border: 1px solid rgba(166,225,190,.18); background: rgba(5,24,20,.7); backdrop-filter: blur(6px); }
.resource-strip span { display: block; color: var(--muted); font: 9px 'DM Mono', monospace; letter-spacing: .1em; }
.resource-strip b { display: block; margin-top: 4px; color: #f0fff0; font: 600 17px 'Space Grotesk', sans-serif; }
.objective { left: 28px; bottom: 79px; max-width: min(590px,55vw); display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-left: 2px solid var(--mint); background: linear-gradient(90deg, rgba(4,21,18,.92), rgba(4,21,18,.45), transparent); pointer-events: auto; }
.objective-mark { color: var(--amber); font-size: 20px; }
.objective strong { display: block; margin-top: 4px; font: 500 13px/1.35 Manrope, sans-serif; }
.objective button { margin-left: 14px; padding: 9px 12px; color: var(--mint); font: 10px 'DM Mono', monospace; }
.environment-readout { right: 28px; bottom: 80px; padding: 10px 12px; border-right: 2px solid var(--cyan); background: rgba(4,20,17,.7); backdrop-filter: blur(6px); text-align: right; }
.environment-readout span { display: block; }
.environment-readout #environmentText { margin-top: 4px; color: #d7eee0; font: 10px 'DM Mono', monospace; }
.bottom-hint { left: 28px; bottom: 24px; color: rgba(224,245,228,.74); font: 10px 'DM Mono', monospace; }
.bottom-hint span { margin-right: 17px; }
.bottom-hint b { color: var(--mint); font-weight: 500; }
.quick-nav { right: 28px; bottom: 20px; display: flex; gap: 6px; }
.quick-nav button { position: relative; display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: rgba(4,21,18,.84); backdrop-filter: blur(7px); }
.quick-nav i { color: var(--mint); font-size: 19px; font-style: normal; }
.quick-nav span { font: 10px 'DM Mono', monospace; letter-spacing: .08em; }
.quick-nav b { position: absolute; top: -7px; right: -5px; min-width: 17px; padding: 2px 4px; border-radius: 10px; background: var(--amber); color: #162017; font: 10px 'DM Mono', monospace; }
.touch-controls { display: none; }
.toast { left: 50%; top: 25%; max-width: min(520px,90vw); padding: 12px 17px; transform: translateX(-50%) translateY(-10px); border: 1px solid rgba(157,232,187,.45); background: rgba(4,25,20,.94); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .2s ease; font: 12px 'DM Mono', monospace; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.modal-shell, .pause-shell { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; overflow: hidden; max-width: 100vw; background: rgba(1,8,8,.58); backdrop-filter: blur(7px); }
.game-panel { width: min(1040px,calc(100vw - 48px)); max-height: min(780px,calc(100vh - 80px)); min-width: 0; overflow: auto; padding: 25px; border: 1px solid rgba(157,232,187,.28); background: var(--panel); box-shadow: var(--shadow); }
.game-panel > header { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 17px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.game-panel h2 { margin: 7px 0 0; font: 600 30px 'Space Grotesk', sans-serif; }
.close-button { padding: 0 5px; border: 0; background: none; color: var(--muted); font-size: 27px; }
.panel-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; min-width: 0; }
.map-card, .data-card, .device-card, .tech-card, .journal-card { min-width: 0; padding: 16px; border: 1px solid rgba(157,232,187,.16); background: rgba(10,37,30,.68); }
.map-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; min-width: 0; }
.map-region { min-width: 0; min-height: 90px; padding: 10px; display: flex; flex-direction: column; justify-content: space-between; overflow-wrap: anywhere; background: rgba(8,27,25,.8); text-align: left; }
.map-region.discovered { border-color: rgba(157,232,187,.35); }
.map-region.current { border-color: var(--amber); box-shadow: inset 0 0 25px rgba(236,193,131,.08); }
.map-region.locked { filter: grayscale(.8); opacity: .55; }
.map-region strong { font: 600 13px 'Space Grotesk', sans-serif; }
.map-region small { color: var(--muted); font: 9px/1.35 'DM Mono', monospace; }
.map-region em { color: var(--amber); font: 9px 'DM Mono', monospace; font-style: normal; }
.section-label { display: flex; justify-content: space-between; align-items: center; margin: 0 0 10px; color: var(--muted); font: 10px 'DM Mono', monospace; letter-spacing: .1em; text-transform: uppercase; }
.panel-copy { color: #b9d3c3; font-size: 13px; line-height: 1.6; }
.stat-line { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid rgba(157,232,187,.1); color: var(--muted); font: 11px 'DM Mono', monospace; }
.stat-line b { color: var(--ink); font-weight: 500; }
.device-list, .tech-list, .archive-list, .journal-list { display: grid; gap: 10px; }
.device-card { display: flex; gap: 15px; align-items: flex-start; }
.device-icon { width: 52px; height: 52px; display: grid; flex: none; place-items: center; border: 1px solid rgba(157,232,187,.3); color: var(--cyan); background: radial-gradient(circle,rgba(78,170,141,.27),transparent 68%); font-size: 26px; }
.device-card h3, .tech-card h3 { margin: 0 0 5px; font: 600 16px 'Space Grotesk', sans-serif; }
.device-card p, .tech-card p, .archive-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.device-card .meta, .tech-card .meta { margin-top: 9px; color: var(--cyan); font: 10px 'DM Mono', monospace; }
.device-card .actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; margin-left: auto; }
.device-card button, .tech-card button { padding: 8px 10px; font: 10px 'DM Mono', monospace; }
.progress { height: 5px; margin-top: 10px; background: #142a25; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg,var(--cyan),var(--mint)); transition: width .1s; }
.tech-list { grid-template-columns: repeat(2,1fr); }
.tech-card { position: relative; min-height: 145px; }
.tech-card .branch { display: block; margin-bottom: 8px; color: var(--amber); font: 9px 'DM Mono', monospace; letter-spacing: .1em; }
.tech-card .owned { color: var(--mint); font: 10px 'DM Mono', monospace; }
.archive-list { grid-template-columns: repeat(3,1fr); }
.archive-card { min-height: 190px; padding: 15px; border: 1px solid rgba(157,232,187,.17); background: rgba(10,37,30,.66); }
.specimen-art { height: 72px; margin-bottom: 12px; overflow: hidden; position: relative; background: radial-gradient(circle at 50% 50%,rgba(132,226,187,.2),transparent 52%); }
.specimen-art:before, .specimen-art:after { content: ''; position: absolute; inset: 21px 42%; border: 2px solid currentColor; border-radius: 50%; color: var(--mint); box-shadow: 0 0 20px currentColor; }
.specimen-art:after { inset: 29px 30%; border-color: var(--amber); opacity: .7; transform: rotate(35deg); }
.archive-card h3 { margin: 0 0 3px; font: 600 15px 'Space Grotesk', sans-serif; }
.archive-card .tag { color: var(--amber); font: 9px 'DM Mono', monospace; }
.archive-card p { margin-top: 9px; font-size: 11px; }
.journal-list { grid-template-columns: 1fr 1fr; }
.journal-card time { display: block; margin-bottom: 6px; color: var(--amber); font: 10px 'DM Mono', monospace; }
.journal-card strong { display: block; font: 14px 'Space Grotesk', sans-serif; }
.journal-card p { margin: 6px 0 0; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.primary { border-color: var(--mint); background: var(--mint); color: #102a1f; font-weight: 700; }
.primary:hover { background: #d0f7dc; color: #102a1f; }
.pause-shell { z-index: 20; }
.pause-card { width: min(420px,calc(100vw - 40px)); padding: 33px; border: 1px solid rgba(157,232,187,.4); background: rgba(6,25,21,.97); box-shadow: var(--shadow); }
.pause-card h2 { margin: 9px 0; font: 600 34px 'Space Grotesk', sans-serif; }
.pause-card p { color: var(--muted); line-height: 1.6; }
.pause-card button { display: block; width: 100%; padding: 12px; margin-top: 9px; }
@media (max-width:820px) {
  .game-header { height: 60px; padding: 12px 15px; }
  .title-lockup, .brand small, .header-actions .save-state { display: none; }
  .header-actions { gap: 3px; }
  .header-actions button { padding: 7px 8px; font-size: 9px; }
  .hud-top { top: 75px; left: 15px; right: 15px; }
  .region-readout strong { font-size: 18px; }
  .resource-strip { gap: 3px; }
  .resource-strip div { min-width: 52px; padding: 6px; }
  .resource-strip span { font-size: 7px; }
  .resource-strip b { font-size: 13px; }
  .objective { right: 15px; bottom: 85px; left: 15px; max-width: none; padding: 9px; }
  .objective strong { font-size: 11px; }
  .objective button { margin-left: auto; font-size: 9px; }
  .environment-readout { right: auto; bottom: 142px; left: 15px; padding: 7px; text-align: left; }
  .bottom-hint { display: none; }
  .quick-nav { right: 10px; bottom: 12px; left: 10px; justify-content: space-between; gap: 3px; }
  .quick-nav button { flex: 1; justify-content: center; padding: 7px 8px; }
  .quick-nav i { font-size: 15px; }
  .quick-nav span { font-size: 8px; }
  .touch-controls { position: fixed; left: 13px; bottom: 105px; z-index: 5; display: flex; gap: 5px; }
  .touch-controls button { width: 42px; height: 38px; background: rgba(5,25,21,.7); font: 600 13px 'DM Mono', monospace; }
  .touch-controls button[data-key=interact], .touch-controls button[data-key=scan] { width: 38px; margin-left: 2px; border-radius: 50%; }
  .game-panel { width: calc(100vw - 30px); max-width: calc(100vw - 30px); max-height: calc(100vh - 25px); padding: 16px; }
  .game-panel h2 { overflow-wrap: anywhere; font-size: 24px; }
  .panel-grid { grid-template-columns: 1fr; }
  .map-grid { grid-template-columns: repeat(3,1fr); }
  .map-region { min-height: 75px; padding: 7px; }
  .map-region strong { font-size: 11px; }
  .tech-list { grid-template-columns: 1fr; }
  .archive-list { grid-template-columns: 1fr 1fr; }
  .journal-list { grid-template-columns: 1fr; }
  .device-card { flex-wrap: wrap; }
  .device-card .actions { width: 100%; margin-left: 0; justify-content: flex-start; }
}
@media (max-width:500px) {
  .resource-strip div:nth-child(2), .resource-strip div:nth-child(3) { display: none; }
  .archive-list { grid-template-columns: 1fr; }
  .region-readout small { font-size: 8px; }
  .environment-readout { bottom: 153px; }
  .header-actions button { padding: 6px 5px; font-size: 8px; }
  .modal-shell, .pause-shell { overflow: hidden; }
}
