/* workspace/rapidprototypes/surfacewalk/css/hud-lean.css */
/* The lean HUD of round 28 (owner, 2026-10-11), on desktop and touch: linked after css/touch.css and css/cards.css, so */
/* these rules win. The corner counter with its health and O2 bars, the field log button and pad (js/field-log.js), the */
/* "???" label over the aimed specimen, the icon-only vehicle markers, the warnings as big words in the middle */
/* (js/hud-alerts.js), a smaller Commander box and the touch buttons: Scan big in the corner, Jump above it, Mode to its left. */
/* The details these replace live in the field log: the planet panel, the score panel, the target panel, the status line, */
/* the warning line and the desktop Health and Oxygen rows are hidden. */
#hud-planet, #hud-score, #hud-target, #hud-status, #hud-warning, #meter-health, #meter-oxygen { display: none !important; }
/* The corner counter: the count ("3/229") with a thin progress bar, then the health bar, then the O2 bar (no number). */
#hud-pill, body.touch #hud-pill {
  display: flex; flex-direction: column; align-items: stretch; gap: 5px; width: 104px; padding: 7px 9px 8px; border-radius: 12px;
  background: rgba(11, 14, 22, 0.5); color: var(--text); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22); pointer-events: none;
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
body.no-blur #hud-pill { background: rgba(11, 14, 22, 0.72); }
.pill-top { display: flex; align-items: center; gap: 6px; }
.pill-count { font-size: 10px; font-weight: 800; color: var(--good); letter-spacing: 0.3px; }
.pill-progress { flex: 1; height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); overflow: hidden; }
.pill-progress-fill { height: 100%; width: 0; border-radius: 999px; background: var(--good); transition: width 0.3s ease; }
#hud-pill-health, body.touch #hud-pill-health, body.touch #hud-pill-health.shown, #hud-pill-oxygen {
  display: block; position: relative; left: auto; right: auto; top: auto; height: 5px; margin-left: 17px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.14); overflow: visible;
}
#hud-pill-health::before, #hud-pill-oxygen::before {
  position: absolute; left: -17px; top: 50%; transform: translateY(-50%); width: 14px; text-align: center;
  font-size: 8px; font-weight: 900; line-height: 1;
}
#hud-pill-health::before { content: '+'; font-size: 12px; color: #ff6a55; }
#hud-pill-oxygen::before { content: 'O₂'; color: var(--glow); }
.pill-oxygen-fill { height: 100%; width: 100%; border-radius: 999px; background: var(--glow); box-shadow: 0 0 6px rgba(127, 231, 255, 0.7); }
#hud-pill-oxygen.low .pill-oxygen-fill { background: var(--accent); box-shadow: 0 0 6px rgba(255, 173, 92, 0.8); }
#hud-pill-oxygen.critical .pill-oxygen-fill { background: var(--danger); animation: pulse 0.9s ease-in-out infinite; }
#hud-pill-oxygen.critical::before { color: var(--danger); }
/* Draining faster than walking (running, flying, a rip, a cracked visor): stripes run along the bar, quicker when faster. */
#hud-pill-oxygen.fast .pill-oxygen-fill, #hud-pill-oxygen.faster .pill-oxygen-fill {
  background-image: repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.45) 0 3px, transparent 3px 7px);
  background-size: 20px 5px; animation: oxygen-drain 0.9s linear infinite;
}
#hud-pill-oxygen.faster .pill-oxygen-fill { animation-duration: 0.4s; }
#hud-pill-oxygen.critical.fast .pill-oxygen-fill, #hud-pill-oxygen.critical.faster .pill-oxygen-fill { animation: oxygen-drain 0.4s linear infinite, pulse 0.9s ease-in-out infinite; }
@keyframes oxygen-drain { from { background-position: 0 0; } to { background-position: -20px 0; } }
#hud-pill.pulse-good { animation: pill-good 0.6s ease-out 1; }
/* The field log button: a small data pad; a red dot when there is something new in the log. */
#hud-log-button {
  position: relative; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0;
  border-radius: 999px; cursor: pointer; color: var(--glow); background: var(--panel); border: 1px solid var(--panel-edge);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
body.no-blur #hud-log-button { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(18, 22, 34, 0.72); }
body.touch #hud-log-button { width: 44px; height: 44px; }
#hud-log-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
#hud-log-button:hover { background: rgba(40, 46, 66, 0.78); }
#hud-log-button:focus-visible { outline: 3px solid rgba(255, 255, 255, 0.7); outline-offset: 2px; }
#hud-log-button.has-new::after {
  content: ''; position: absolute; top: 5px; right: 5px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--danger); box-shadow: 0 0 0 2px rgba(11, 14, 22, 0.9);
}
/* The label over the aimed specimen: "???" until it is scanned, then the name; no box, no scan mode. */
#hud-target-tag.shown, body.touch #hud-target-tag.shown { display: block; }
#hud-target-tag, body.touch #hud-target-tag {
  padding: 0; background: none; border-radius: 0; text-align: center; font-size: 12px; font-weight: 800; letter-spacing: 0.6px;
  color: var(--text); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 6px rgba(0, 0, 0, 0.55);
}
#hud-target-tag.unknown .tag-name { font-size: 15px; letter-spacing: 3px; color: var(--glow); }
.tag-bar { margin: 3px auto 0; }
body.touch #hud-target-tag.stamp, #hud-target-tag.stamp { background: none; color: var(--good); animation: none; }
body.touch #hud-target-tag.faint, #hud-target-tag.faint { background: none; color: var(--muted); opacity: 0.85; }
#hud-target-tag.faint .tag-name::before {
  content: ''; display: inline-block; width: 3px; height: 6px; margin: 0 6px 1px 1px;
  border: solid var(--good); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg);
}
#hud-target-tag.faint.destroyed .tag-name::before { display: none; }
/* The vehicle markers: the icon alone in a small round chip, no name and no distance. */
.marker, body.touch .marker { gap: 0; padding: 5px; border-radius: 50%; }
.marker-icon { width: 15px; height: 15px; }
/* The warnings across the middle of the screen (js/hud-alerts.js). */
#hud-alert {
  display: none; position: fixed; z-index: 11; left: 50%; top: 27%; transform: translateX(-50%); max-width: 94vw;
  text-align: center; pointer-events: none; font-family: var(--font); text-transform: uppercase; white-space: nowrap;
}
#hud-alert.shown { display: block; }
.alert-head:empty, .alert-key:empty { display: none; }
#hud-alert.danger .alert-head {
  font-size: clamp(40px, 11vw, 76px); font-weight: 900; letter-spacing: 0.12em; line-height: 1; color: #ff3b30;
  text-shadow: 0 0 22px rgba(255, 40, 30, 0.75), 0 3px 0 rgba(60, 0, 0, 0.8), 0 0 3px #000;
  animation: alert-throb 1s ease-in-out infinite;
}
#hud-alert.danger .alert-line {
  margin-top: 4px; font-size: clamp(20px, 6vw, 34px); font-weight: 900; letter-spacing: 0.16em; color: #ff4d42;
  text-shadow: 0 0 14px rgba(255, 40, 30, 0.6), 0 2px 0 rgba(60, 0, 0, 0.8), 0 0 3px #000;
}
#hud-alert.warning .alert-head { font-size: clamp(20px, 5.5vw, 30px); font-weight: 900; letter-spacing: 0.14em; color: var(--accent); }
#hud-alert.warning .alert-line { margin-top: 2px; font-size: clamp(15px, 4vw, 20px); font-weight: 800; letter-spacing: 0.14em; color: var(--accent); }
#hud-alert.warning div { text-shadow: 0 0 12px rgba(255, 140, 40, 0.5), 0 2px 2px rgba(0, 0, 0, 0.85); }
#hud-alert.busy, #hud-alert.note { top: auto; bottom: calc(210px + env(safe-area-inset-bottom, 0px)); text-transform: none; }
#hud-alert.busy .alert-line, #hud-alert.note .alert-line {
  font-size: 13px; font-weight: 700; letter-spacing: 0.5px; color: var(--text); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
}
#hud-alert.busy .alert-line { color: var(--glow); }
.alert-key {
  display: inline-block; margin-top: 10px; padding: 3px 10px; border: 2px solid #ff4d42; border-radius: 7px; color: #fff;
  font-size: 13px; font-weight: 900; letter-spacing: 0.12em; background: rgba(120, 0, 0, 0.45); animation: alert-throb 1s ease-in-out infinite;
}
.alert-bar { display: none; width: 120px; height: 4px; margin: 6px auto 0; border-radius: 999px; background: rgba(255, 255, 255, 0.2); overflow: hidden; }
#hud-alert.progress .alert-bar { display: block; }
.alert-bar i { display: block; height: 100%; width: 0; background: var(--glow); }
@keyframes alert-throb { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
@media (min-width: 761px) and (min-height: 521px) { #hud-alert.busy, #hud-alert.note { bottom: 130px; } }
/* The Commander's box: smaller, one short line. */
#comms { top: 72px; width: auto; max-width: min(340px, calc(100vw - 28px)); gap: 8px; padding: 6px 10px 6px 6px; align-items: center; }
#comms-face { width: 36px; height: 36px; border-radius: 6px; }
#comms .comms-head { font-size: 8px; }
#comms p { margin-top: 2px; font-size: 13px; line-height: 1.3; }
body.touch #comms { top: calc(116px + env(safe-area-inset-top, 0px)); right: auto; width: auto; }
/* The scan result toast on touch: under the corner counter at the right, clear of the Commander's box. */
body.touch #hud-toast { top: calc(66px + env(safe-area-inset-top, 0px)); left: auto; right: calc(12px + env(safe-area-inset-right, 0px)); transform: none; }
/* The touch buttons, placed from the bottom right corner: Scan big in the corner, Jump above it, Mode small to the left */
/* of Scan, the Spare pill above Mode, Patch and Tank above that, and Run (Always run off) above Jump. */
body.touch #touch-buttons { display: block; width: 0; height: 0; right: calc(14px + env(safe-area-inset-right, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
body.touch #touch-buttons .touch-row, body.touch #touch-buttons .touch-scan-stack { display: contents; }
body.touch #touch-scan { position: absolute; right: 0; bottom: 10px; width: 96px; height: 96px; font-size: 16px; }
body.touch #touch-jump { position: absolute; right: 12px; bottom: 120px; width: 72px; height: 72px; font-size: 13px; }
body.touch #touch-mode { position: absolute; right: 108px; bottom: 32px; height: 36px; min-width: 54px; padding: 0 10px; font-size: 11px; }
body.touch #touch-spare { position: absolute; right: 108px; bottom: 76px; height: 36px; font-size: 11px; }
body.touch #touch-battery-bar { right: 24px; top: auto; bottom: 0; }
body.touch #touch-buttons .touch-context { display: flex; position: absolute; right: 108px; bottom: 120px; flex-direction: column; align-items: flex-end; gap: 6px; }
body.touch #touch-run.shown { position: absolute; right: 22px; bottom: 202px; width: 52px; height: 52px; }
/* The Patch button pulses while it shows (it shows only on a ripped suit with a kit left). */
body.touch .touch-context #touch-patch.shown {
  border-color: #ff4d42; color: #fff; background: rgba(150, 20, 10, 0.55);
  animation: touch-appear 0.45s ease-out 1, patch-pulse 1s ease-in-out 0.45s infinite;
}
@keyframes patch-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 77, 66, 0.85); }
  50% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(255, 77, 66, 0); }
}
/* Landscape phones: the same corner layout, a little smaller. */
@media (max-height: 520px) {
  body.touch #touch-scan { width: 84px; height: 84px; }
  body.touch #touch-jump { right: 10px; bottom: 106px; width: 64px; height: 64px; }
  body.touch #touch-mode { right: 96px; bottom: 28px; }
  body.touch #touch-spare { right: 96px; bottom: 70px; }
  body.touch #touch-buttons .touch-context { right: 96px; bottom: 112px; }
  body.touch #touch-run.shown { right: 16px; bottom: 178px; }
  body.touch #comms { top: calc(66px + env(safe-area-inset-top, 0px)); }
  #hud-alert { top: 18%; }
  #hud-alert.busy, #hud-alert.note { bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }
}
/* The field log (js/field-log.js): a data pad over a dim screen, cyan on dark glass with faint scan lines. */
#field-log { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; background: rgba(2, 6, 12, 0.55); padding: 14px; }
#field-log.hidden { display: none; }
.log-pad {
  position: relative; display: flex; flex-direction: column; width: min(560px, 100%); max-height: min(640px, 100%); overflow: hidden;
  border: 1px solid rgba(127, 231, 255, 0.55); border-radius: 14px; color: var(--text);
  background: linear-gradient(180deg, rgba(8, 20, 30, 0.96), rgba(5, 12, 20, 0.97));
  box-shadow: 0 0 0 4px rgba(127, 231, 255, 0.08), 0 0 32px rgba(127, 231, 255, 0.22), 0 18px 40px rgba(0, 0, 0, 0.5);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.log-pad::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: repeating-linear-gradient(0deg, rgba(127, 231, 255, 0.035) 0 1px, transparent 1px 4px);
}
.log-head { display: flex; align-items: baseline; gap: 10px; padding: 12px 14px 8px; border-bottom: 1px solid rgba(127, 231, 255, 0.25); }
.log-title { font-size: 13px; font-weight: 800; letter-spacing: 0.3em; text-transform: uppercase; color: var(--glow); }
.log-planet { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--muted); letter-spacing: 0.1em; }
.log-close {
  min-height: 34px; padding: 0 14px; border-radius: 8px; cursor: pointer; font: 700 11px var(--font); letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--glow); background: rgba(127, 231, 255, 0.1); border: 1px solid rgba(127, 231, 255, 0.45);
}
body.touch .log-close { min-height: 44px; }
.log-tabs { display: flex; gap: 4px; padding: 8px 10px; }
.log-tab {
  flex: 1; min-height: 34px; border-radius: 8px; cursor: pointer; font: 700 11px var(--font); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(127, 231, 255, 0.18);
}
body.touch .log-tab { min-height: 44px; }
.log-tab.on { color: #031a22; background: var(--glow); border-color: var(--glow); }
.log-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 12px 10px; -webkit-overflow-scrolling: touch; }
.log-row { padding: 9px 4px; border-bottom: 1px dashed rgba(127, 231, 255, 0.16); }
.log-row-top { display: flex; align-items: baseline; gap: 8px; }
.log-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 700; color: var(--text); }
.log-state { font-size: 10px; font-weight: 800; letter-spacing: 0.12em; color: var(--muted); white-space: nowrap; }
.log-state.good { color: var(--good); }
.log-state.bad { color: #ff6a55; }
.log-detail { margin-top: 3px; font-size: 11px; line-height: 1.45; color: var(--muted); }
.log-bar { height: 4px; margin-top: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.log-bar i { display: block; height: 100%; background: var(--glow); }
.log-foot { padding: 8px 14px 11px; border-top: 1px solid rgba(127, 231, 255, 0.25); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--glow); }
@media (max-width: 760px) {
  #field-log { padding: 0; align-items: flex-end; }
  .log-pad { width: 100%; max-height: 88vh; border-radius: 14px 14px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
}
