/* Shared cinematic sci-fi styles for Project Nightfall */
:root {
  --bg: #08090b;
  --bg- elev: #121114;
  --panel: #14161a;
  --panel-border: #3a2a2a;
  --text: #ece6e4;
  --muted: #9a908c;
  --cyan: #e24a3c;
  --cyan-dim: #a3332c;
  --amber: #d4a84b;
  --danger: #e24a3c;
  --ok: #5caa7a;
  --steel: #6b7785;
  --radius: 10px;
  --touch: 44px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Code", "Consolas", "Courier New", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.45;
}

body {
  background-image:
    linear-gradient(rgba(8, 9, 11, 0.94), rgba(8, 9, 11, 0.97)),
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(226, 74, 60, 0.04) 2px, rgba(226, 74, 60, 0.04) 3px);
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
.page-landing .site-header a { color: inherit; text-decoration: none; }
.page-landing .site-header a:hover { text-decoration: none; opacity: 0.88; }

h1, h2, h3 { margin: 0 0 0.5rem; font-weight: 650; letter-spacing: 0.04em; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.85rem;
  color: var(--cyan);
  margin: 0 0 0.5rem;
}

.muted { color: var(--muted); }
.warn { color: var(--amber); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch);
  padding: 0.65rem 1.25rem;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:hover { border-color: var(--cyan-dim); text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn--primary {
  background: linear-gradient(180deg, #8a2420, #4a1212);
  border-color: var(--cyan-dim);
  color: #ffe8e6;
}
.btn--secondary {
  background: transparent;
  border-color: var(--steel);
}
.btn--danger {
  background: linear-gradient(180deg, #8a3535, #5c2020);
  border-color: var(--danger);
  color: #ffffff;
}
.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.btn--blue {
  background: linear-gradient(180deg, #4a90d9, #1d4f8c);
  border-color: #6eb3ff;
  color: #f2f8ff;
}
.btn--ghost:hover { color: var(--text); border-color: var(--panel-border); }
.btn--lg { min-height: 52px; padding: 0.85rem 1.75rem; font-size: 1rem; }
.btn--sm { min-height: 40px; padding: 0.4rem 0.8rem; font-size: 0.9rem; }
.btn--block { width: 100%; }

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.field span {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.field input {
  min-height: var(--touch);
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #0f141a;
  color: var(--text);
  font: inherit;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
}
.field input:focus {
  outline: 2px solid var(--cyan-dim);
  outline-offset: 1px;
}

.form-error {
  color: var(--danger);
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
}

.status-pill {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--amber);
  background: rgba(212, 168, 75, 0.08);
}
.status-pill--danger { color: var(--danger); background: rgba(196, 92, 92, 0.1); border-color: #6a3030; }
.status-pill--ok { color: var(--ok); background: rgba(92, 170, 122, 0.1); border-color: #2f5a40; }
.status-pill--warn { color: var(--amber); }

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel);
  border: 1px solid var(--cyan-dim);
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

/* Landing */
.page-landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0;
}
.page-landing .site-header {
  flex: 0 0 auto;
}
.page-landing .landing {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 1.5rem;
}
.landing {
  position: relative;
  width: min(960px, 100%);
  text-align: center;
  z-index: 1;
}
.landing__header {
  position: relative;
  margin: 0;
}
.landing__hero {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(212, 168, 75, 0.28);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.45),
    0 18px 48px rgba(0, 0, 0, 0.55),
    0 0 42px rgba(212, 168, 75, 0.12);
}
.landing h1 {
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  letter-spacing: 0.14em;
}
.tagline { color: var(--muted); margin: 0.75rem 0 2rem; }
.landing__actions {
  position: absolute;
  top: 6.5%;
  left: 5.14%;
  z-index: 2;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
}
.landing__actions .btn {
  min-height: 44px;
  padding: 0.55rem 1.15rem;
  font-size: 0.85rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}
.landing__actions .btn--secondary {
  background: rgba(13, 16, 20, 0.78);
  border-color: rgba(232, 236, 239, 0.4);
  color: #f3f6f8;
}
.landing__footer {
  margin-top: 2.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.landing__hint { color: var(--amber); margin-top: 1rem; }

@media (max-width: 519px) {
  .landing__actions {
    top: 4.5%;
    gap: 0.45rem;
  }
  .landing__actions .btn {
    min-height: 38px;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
  }
}

@keyframes blink-alarm {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
@keyframes flicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.7; }
  94% { opacity: 1; }
  97% { opacity: 0.85; }
}
@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 12px rgba(226, 74, 60, 0.2); }
  50% { box-shadow: 0 0 28px rgba(226, 74, 60, 0.45); }
}

/* In-game FX overlays (never native alert/confirm) */
.nf-surge {
  position: fixed;
  inset: 0;
  z-index: 280;
  pointer-events: none;
  background: radial-gradient(circle at 50% 40%, rgba(255, 200, 80, 0.18), rgba(0, 0, 0, 0.55));
}
.nf-surge[hidden],
.nf-fail[hidden],
.nf-penalty[hidden],
.nf-toast[hidden],
.nf-dialog[hidden] {
  display: none !important;
}
.nf-surge__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.nf-surge__stamp {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #fff6d2;
  text-shadow: 0 0 18px #ffb020, 0 2px 0 #3a1a00;
  animation: nf-surge-stamp 0.18s steps(2) infinite;
}
.nf-surge__bolt {
  display: block;
  font-size: 3.2rem;
  line-height: 1;
  filter: drop-shadow(0 0 12px #9cdcff);
}
.nf-surge__title {
  margin: 0.15rem 0 0;
  font-size: 2.4rem;
  letter-spacing: 0.28em;
  font-weight: 800;
}
.nf-surge__sub {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.85;
}
@keyframes nf-surge-stamp {
  from { transform: translate(-50%, -50%) skewX(-2deg); }
  to { transform: translate(-48%, -52%) skewX(3deg); }
}
@keyframes nf-shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-7px, 3px); }
  40% { transform: translate(8px, -4px); }
  60% { transform: translate(-5px, -2px); }
  80% { transform: translate(6px, 4px); }
}
body.nf-surging .player-app,
body.nf-surging .host-app {
  animation: nf-shake 0.1s linear infinite;
}
body.nf-surging .host-app .scene--power .generator-panel {
  animation: nf-panel-flicker 0.08s steps(2) infinite;
  box-shadow: 0 0 40px rgba(255, 200, 80, 0.55);
}
@keyframes nf-panel-flicker {
  from { filter: brightness(1.4) saturate(1.3); }
  to { filter: brightness(0.55) hue-rotate(-10deg); }
}

.nf-fail {
  position: fixed;
  inset: 0;
  z-index: 270;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  pointer-events: none;
}
.nf-fail--denied {
  background:
    repeating-linear-gradient(0deg, rgba(180, 20, 20, 0.12) 0 2px, transparent 2px 6px),
    rgba(40, 0, 0, 0.62);
  animation: nf-fail-in 0.2s ease-out;
}
.nf-fail--decode {
  background:
    repeating-linear-gradient(90deg, rgba(180, 220, 255, 0.08) 0 1px, transparent 1px 3px),
    rgba(4, 18, 28, 0.7);
  animation: nf-fail-in 0.2s ease-out;
}
.nf-fail--generic {
  background: rgba(8, 12, 16, 0.62);
  animation: nf-fail-in 0.2s ease-out;
}
.nf-fail__panel {
  width: min(100%, 320px);
  text-align: center;
  padding: 1.35rem 1.2rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 180, 180, 0.45);
  background: linear-gradient(165deg, #3a1414 0%, #1a0808 100%);
  color: #ffe8e8;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}
.nf-fail--decode .nf-fail__panel {
  border-color: rgba(120, 200, 220, 0.45);
  background: linear-gradient(165deg, #143040 0%, #081218 100%);
  color: #d8f4ff;
}
.nf-fail__eyebrow {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  opacity: 0.75;
}
.nf-fail__title {
  margin: 0.35rem 0 0.25rem;
  font-size: 1.35rem;
  letter-spacing: 0.12em;
}
.nf-fail__sub {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.8;
  line-height: 1.35;
}
@keyframes nf-fail-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.nf-penalty {
  position: fixed;
  inset: 0;
  z-index: 268;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 0.85rem;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
  border: 2px solid #e85e45;
  background: #5a1210e8;
  color: #ffe8e4;
  text-align: center;
  box-shadow: inset 0 0 48px rgba(0, 0, 0, 0.55);
  pointer-events: auto;
}
.nf-penalty__panel {
  width: min(100%, 420px);
  margin: 0 auto;
}
.nf-penalty__text {
  margin: 0 0 0.85rem;
  font-size: clamp(1rem, 4.2vw, 1.25rem);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.02em;
}
.nf-penalty__bar {
  height: 8px;
  border: 1px solid #ffb4a8;
  background: #2a0a08;
  overflow: hidden;
}
.nf-penalty__bar span {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #e85e45, #ffb199);
}

.nf-toast {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 4.6rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 260;
  max-width: min(92vw, 420px);
  padding: 0.7rem 1.1rem;
  border-radius: 10px;
  background: #1a222c;
  border: 1px solid var(--cyan-dim);
  color: var(--text);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  font-weight: 650;
  letter-spacing: 0.04em;
  text-align: center;
}

.nf-dialog {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(6, 10, 14, 0.72);
  backdrop-filter: blur(8px);
}
.nf-dialog__panel {
  width: min(100%, 360px);
  padding: 1.35rem 1.2rem 1.15rem;
  border-radius: 14px;
  background: #161b22;
  border: 1px solid var(--panel-border);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
}
.nf-dialog__eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  color: var(--cyan);
  font-weight: 700;
}
.nf-dialog__msg {
  margin: 0 0 1.1rem;
  color: var(--text);
  line-height: 1.45;
  white-space: pre-line;
}
.nf-dialog__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

/* Facility 17 sector grid (transmission puzzle) */
.facility-map {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0.65rem 0.75rem 0.7rem;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(12, 28, 36, 0.92), rgba(6, 14, 20, 0.96));
  border: 1px solid rgba(226, 74, 60, 0.38);
  box-shadow:
    inset 0 0 40px rgba(226, 74, 60, 0.06),
    0 8px 28px rgba(0, 0, 0, 0.35);
  color: #c5e8f2;
}
.facility-map__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
  flex-shrink: 0;
}
.facility-map__stamp {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  font-weight: 800;
  color: #e8c060;
}
.facility-map__heading {
  margin: 0;
  font-size: clamp(0.95rem, 2.2vw, 1.35rem);
  letter-spacing: 0.14em;
  color: #e8ecef;
}
.facility-map__sub {
  margin: 0.1rem 0 0;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: #e24a3c;
}
.facility-map__compass {
  position: relative;
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  border: 1px solid rgba(226, 74, 60, 0.35);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #e08a82;
}
.facility-map__compass::before,
.facility-map__compass::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  background: rgba(226, 74, 60, 0.45);
}
.facility-map__compass::before {
  width: 1px;
  height: 18px;
  transform: translate(-50%, -50%);
}
.facility-map__compass::after {
  width: 18px;
  height: 1px;
  transform: translate(-50%, -50%);
}
.facility-map__compass-n { position: absolute; top: 3px; left: 50%; transform: translateX(-50%); }
.facility-map__compass-s { position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%); }
.facility-map__compass-w { position: absolute; left: 5px; top: 50%; transform: translateY(-50%); }
.facility-map__compass-e { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); color: #e24a3c; }
.facility-map__grid {
  display: grid;
  grid-template-columns: 1.75rem repeat(9, minmax(0, 1fr));
  grid-template-rows: auto repeat(3, minmax(0, 1fr));
  gap: 0.2rem;
  flex: 1;
  min-height: 0;
  width: 100%;
  align-content: stretch;
  box-sizing: border-box;
}
.facility-map__corner,
.facility-map__col,
.facility-map__row-label,
.facility-map__cell {
  box-sizing: border-box;
  min-width: 0;
}
.facility-map__corner,
.facility-map__col,
.facility-map__row-label {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #8b98a8;
}
.facility-map__corner {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
}
.facility-map__col {
  font-size: clamp(0.65rem, 1.6vw, 0.95rem);
  color: #e08a82;
  line-height: 1;
  padding: 0 0 0.1rem;
}
.facility-map__row-label {
  font-size: clamp(0.8rem, 2vw, 1.1rem);
  color: #5a6572;
  line-height: 1;
}
.facility-map__row-label.is-live {
  color: #e24a3c;
  text-shadow: 0 0 8px rgba(226, 74, 60, 0.4);
}
.facility-map__cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  border-radius: 4px;
  border: 1px solid rgba(226, 74, 60, 0.22);
}
.facility-map__cell.is-live {
  background:
    linear-gradient(180deg, rgba(18, 42, 52, 0.95), rgba(8, 20, 28, 0.95));
  border-color: rgba(226, 74, 60, 0.55);
  box-shadow: inset 0 0 12px rgba(226, 74, 60, 0.12);
}
.facility-map__cell.is-live span {
  display: block;
  width: 100%;
  text-align: center;
  font-family: var(--mono);
  font-weight: 800;
  font-size: clamp(0.62rem, 2vw, 1.2rem);
  letter-spacing: 0.04em;
  line-height: 1;
  color: #b8eefc;
  text-shadow: 0 0 10px rgba(226, 74, 60, 0.45);
}
.facility-map__cell.is-lost {
  background:
    repeating-linear-gradient(
      -32deg,
      rgba(20, 28, 36, 0.9) 0 6px,
      rgba(40, 52, 62, 0.55) 6px 8px
    );
  border-color: rgba(90, 101, 114, 0.35);
  opacity: 0.55;
}
.facility-map__caption {
  margin: 0.45rem 0 0;
  flex-shrink: 0;
  font-size: 0.8rem;
  line-height: 1.4;
  letter-spacing: 0.06em;
  color: #b8d4de;
}
.facility-map--player {
  padding: 0.5rem 0.45rem 0.55rem;
  margin-top: 0.55rem;
}
.facility-map--player .facility-map__heading {
  font-size: 0.95rem;
}
.facility-map--player .facility-map__compass {
  width: 42px;
  height: 42px;
  font-size: 0.7rem;
}
.facility-map--player .facility-map__grid {
  flex: 0 0 auto;
  grid-template-rows: auto repeat(3, auto);
}
.facility-map--player .facility-map__cell {
  aspect-ratio: 1 / 1;
  min-height: 1.85rem;
}
.facility-map--player .facility-map__cell.is-live span {
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}

/* Gas tank — shared host + player overlay */
.gas-tank {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gas-tank__stage {
  position: relative;
  aspect-ratio: 576 / 1024;
  height: 100%;
  width: auto;
  max-width: 100%;
  container-type: size;
  overflow: hidden;
}
.gas-tank__art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  pointer-events: none;
}
.gas-tank__fog {
  --gas-fog: 0;
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.gas-tank__haze {
  position: absolute;
  left: -12%;
  right: -12%;
  bottom: -6%;
  height: calc(var(--gas-fog) * 1.12%);
  background:
    radial-gradient(ellipse 90% 55% at 50% 100%, rgba(70, 230, 95, 0.55) 0%, transparent 72%),
    linear-gradient(
      to top,
      rgba(28, 150, 55, 0.72) 0%,
      rgba(55, 200, 80, 0.42) 38%,
      rgba(90, 230, 110, 0.16) 72%,
      transparent 100%
    );
  filter: blur(14px);
  opacity: clamp(0, calc(var(--gas-fog) / 22), 1);
}
.gas-tank__fog::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(36, 150, 58, calc(var(--gas-fog) * 0.0048));
  box-shadow: inset 0 -40px 80px rgba(80, 255, 120, calc(var(--gas-fog) * 0.0035));
}
.gas-tank__clouds {
  position: absolute;
  inset: 0;
}
.gas-tank__clouds span {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(
    circle at 42% 40%,
    rgba(140, 255, 150, 0.7) 0%,
    rgba(60, 200, 85, 0.32) 42%,
    rgba(20, 110, 45, 0) 72%
  );
  filter: blur(16px);
  mix-blend-mode: screen;
  opacity: 0;
  animation: gas-billow 8s ease-in-out infinite;
  will-change: transform, opacity;
}
.gas-tank__clouds span:nth-child(1) {
  width: 58%;
  height: 28%;
  left: 18%;
  bottom: -4%;
  opacity: clamp(0, calc((var(--gas-fog) - 2) / 14), 0.9);
  animation-duration: 7.2s;
}
.gas-tank__clouds span:nth-child(2) {
  width: 48%;
  height: 24%;
  left: -8%;
  bottom: 2%;
  opacity: clamp(0, calc((var(--gas-fog) - 6) / 16), 0.85);
  animation-duration: 9s;
  animation-delay: -1.4s;
}
.gas-tank__clouds span:nth-child(3) {
  width: 52%;
  height: 26%;
  left: 54%;
  bottom: 1%;
  opacity: clamp(0, calc((var(--gas-fog) - 10) / 16), 0.85);
  animation-duration: 8.4s;
  animation-delay: -2.2s;
}
.gas-tank__clouds span:nth-child(4) {
  width: 62%;
  height: 30%;
  left: 8%;
  bottom: 12%;
  opacity: clamp(0, calc((var(--gas-fog) - 18) / 18), 0.88);
  animation-duration: 10s;
  animation-delay: -0.6s;
}
.gas-tank__clouds span:nth-child(5) {
  width: 44%;
  height: 22%;
  left: -6%;
  bottom: 24%;
  opacity: clamp(0, calc((var(--gas-fog) - 28) / 16), 0.82);
  animation-duration: 7.6s;
  animation-delay: -3.1s;
}
.gas-tank__clouds span:nth-child(6) {
  width: 50%;
  height: 24%;
  left: 52%;
  bottom: 26%;
  opacity: clamp(0, calc((var(--gas-fog) - 36) / 16), 0.84);
  animation-duration: 9.5s;
  animation-delay: -1.8s;
}
.gas-tank__clouds span:nth-child(7) {
  width: 70%;
  height: 34%;
  left: 12%;
  bottom: 38%;
  opacity: clamp(0, calc((var(--gas-fog) - 48) / 18), 0.9);
  animation-duration: 11s;
  animation-delay: -4s;
}
.gas-tank__clouds span:nth-child(8) {
  width: 46%;
  height: 24%;
  left: -10%;
  bottom: 52%;
  opacity: clamp(0, calc((var(--gas-fog) - 60) / 16), 0.86);
  animation-duration: 8.8s;
  animation-delay: -2.6s;
}
.gas-tank__clouds span:nth-child(9) {
  width: 54%;
  height: 26%;
  left: 48%;
  bottom: 56%;
  opacity: clamp(0, calc((var(--gas-fog) - 70) / 14), 0.88);
  animation-duration: 9.2s;
  animation-delay: -5s;
}
.gas-tank__clouds span:nth-child(10) {
  width: 86%;
  height: 40%;
  left: 6%;
  bottom: 62%;
  opacity: clamp(0, calc((var(--gas-fog) - 80) / 14), 0.92);
  animation-duration: 12s;
  animation-delay: -3.4s;
}
@keyframes gas-billow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  35% { transform: translate(5%, -8%) scale(1.14); }
  70% { transform: translate(-6%, -4%) scale(0.92); }
}
@media (prefers-reduced-motion: reduce) {
  .gas-tank__clouds span {
    animation: none;
  }
  .gas-tank__haze {
    transition: none;
  }
}
.gas-tank__footer {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 4%;
  bottom: auto;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  pointer-events: none;
}
.gas-tank__timer {
  position: static;
  transform: none;
  margin: 0;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  background: rgba(6, 10, 16, 0.94);
  border: 2px solid rgba(255, 110, 90, 0.8);
  font-family: var(--mono);
  font-size: clamp(1rem, 5cqw, 1.6rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #ffffff;
  text-shadow:
    0 0 12px rgba(255, 90, 80, 0.85),
    0 1px 3px rgba(0, 0, 0, 0.95);
  box-shadow:
    0 4px 18px rgba(0, 0, 0, 0.7),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.gas-tank__caption {
  margin: 0;
  padding: 0.55rem 0.75rem;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  font-size: clamp(0.72rem, 3.4cqw, 0.95rem);
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: 0.02em;
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  background: rgba(6, 10, 16, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
}
.gas-tank__meter {
  position: absolute;
  top: calc(30% + 3px);
  left: 58.5%;
  width: 4.25%;
  height: calc(27% - 3px);
  border-radius: 4px;
  overflow: hidden;
  background: rgba(4, 8, 12, 0.55);
  z-index: 3;
  transform: translate(8px, 5px);
}
.gas-tank__meter-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100%;
  background: linear-gradient(180deg, #ff6b4a 0%, #c62828 55%, #8b1a1a 100%);
  box-shadow: inset 0 0 12px rgba(255, 120, 80, 0.35);
  transition: height 0.12s ease-out;
}
.gas-tank__vent {
  position: absolute;
  top: 41.5%;
  left: 38%;
  width: 24%;
  height: 11%;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transform: translate(-2px, 6px);
}
.gas-tank__vent-label {
  display: none;
}
.gas-tank__vent-hit {
  width: 88%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  pointer-events: auto;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.gas-tank__vent-hit:active {
  transform: scale(0.96);
  filter: brightness(1.08);
}
span.gas-tank__vent-hit {
  pointer-events: none;
  cursor: default;
}
.gas-tank__status {
  display: none;
}
.gas-tank--player .gas-tank__stage {
  width: min(100%, 400px);
  height: auto;
  max-height: none;
  margin: 0 auto;
  aspect-ratio: 576 / 1024;
}

.tool-card--gas {
  padding: 0;
  overflow: hidden;
  background: #07090c;
  border-color: rgba(255, 255, 255, 0.1);
}
.gas-tank--player {
  width: 100%;
  height: auto;
  padding: 0.35rem 0 0;
}

/* Gas tool — keep white text on dark tank (player theme overrides .card p) */
.player-app[data-theme="gas"] .tool-card--gas {
  background: #07090c;
  border-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}
.player-app[data-theme="gas"] .tool-card--gas .gas-tank__timer,
.player-app[data-theme="gas"] .tool-card--gas .gas-tank__caption {
  color: #ffffff;
}

