:root {
  color-scheme: dark;
  --ink: #06100a;
  --panel: #0b180f;
  --panel-deep: #08130c;
  --line: #29472e;
  --line-bright: #4e8054;
  --green: #93ff9e;
  --green-soft: #5fd36c;
  --muted: #819984;
  --amber: #ffc76b;
  --red: #ff5f5f;
  --mono: "IBM Plex Mono", "Lucida Console", "Courier New", monospace;
  font-family: var(--mono);
  background: var(--ink);
  color: var(--green);
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(41, 88, 47, .18), transparent 56%),
    repeating-linear-gradient(0deg, rgba(112, 255, 129, .018) 0 1px, transparent 1px 4px),
    #050b07;
}

body::after {
  position: fixed;
  z-index: 10;
  inset: 0;
  pointer-events: none;
  content: "";
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(0, 0, 0, .18) 3px 4px);
  opacity: .38;
}

button, input { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  z-index: 20;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  transform: translateY(-150%);
  color: var(--ink);
  background: var(--green);
}
.skip-link:focus { transform: translateY(0); }

.screen {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px clamp(14px, 3vw, 42px) 18px;
  border-inline: 1px solid rgba(147, 255, 158, .1);
  box-shadow: 0 0 100px rgba(0, 0, 0, .48);
}

.daily-reward-toast { position: fixed; z-index: 12; top: calc(env(safe-area-inset-top, 0px) + 66px); left: 50%; max-width: calc(100vw - 24px); padding: 7px 10px; border: 1px solid rgba(255, 199, 107, .7); color: var(--amber); background: rgba(5, 13, 8, .96); box-shadow: 0 0 18px rgba(255, 199, 107, .2), inset 0 0 8px rgba(255, 199, 107, .08); font-size: clamp(8px, 2.3vw, 10px); font-weight: 900; letter-spacing: .07em; text-align: center; opacity: 0; transform: translate(-50%, -6px); transition: opacity 220ms ease, transform 220ms ease; pointer-events: none; }
.daily-reward-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.topbar, .brand, .topbar-right, .topbar-readouts, .connection, .tab-nav,
.panel-heading, .target-heading-row, .target-footer, .health-label,
.stat-line, .helper-row, .helper-info, .helper-actions, .powerup-button,
.account-forms, .leaderboard-row {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 18px;
  min-height: 70px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.brand { gap: 12px; color: inherit; text-decoration: none; }
.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 2px solid var(--green);
  color: var(--green);
  font-size: 29px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 12px rgba(147, 255, 158, .55);
  box-shadow: inset 0 0 0 4px var(--ink), inset 0 0 0 5px var(--green-soft), 0 0 14px rgba(71, 206, 92, .17);
}
.brand-copy { display: grid; gap: 4px; }
.brand-copy strong { font-size: 20px; letter-spacing: .14em; }
.eyebrow, .brand-copy .eyebrow, .panel-heading .eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.topbar-right { flex-direction: column; align-items: flex-end; gap: 7px; }
.topbar-readouts { gap: clamp(16px, 3vw, 36px); }
.topbar-readouts > span { display: grid; gap: 3px; min-width: 64px; }
.topbar-readouts small, .target-counter small {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .15em;
}
.topbar-readouts strong { font-size: 16px; letter-spacing: .04em; }
.system-readout strong { color: var(--amber); }
.connection { gap: 7px; color: var(--muted); font-size: 9px; letter-spacing: .1em; }
.connection-light { width: 7px; height: 7px; border-radius: 50%; background: var(--green-soft); box-shadow: 0 0 8px var(--green-soft); }

.tab-nav { gap: 8px; padding: 14px 0 18px; }
.tab-button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  letter-spacing: .12em;
}
.tab-button:hover, .tab-button.active { border-color: var(--line-bright); color: var(--green); background: rgba(63, 122, 70, .1); }

.game-view { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.panel {
  min-width: 0;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(15, 32, 19, .97), rgba(7, 16, 10, .98));
  box-shadow: inset 0 0 0 3px rgba(3, 9, 5, .8), 0 8px 28px rgba(0, 0, 0, .22);
}
.target-panel { padding: clamp(14px, 2.2vw, 24px); }
.panel-heading { justify-content: space-between; gap: 12px; }
.panel-heading h1, .panel-heading h2 { margin: 5px 0 0; font-size: 16px; letter-spacing: .11em; }
.target-counter { display: grid; gap: 4px; min-width: 70px; text-align: right; }
.target-counter strong { font-size: 14px; }

.target-stage {
  position: relative;
  display: grid;
  min-height: clamp(300px, 43vh, 470px);
  margin: 16px 0 18px;
  overflow: hidden;
  place-items: center;
  isolation: isolate;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.letter-target {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: baseline;
  gap: .04em;
  padding: 8px 14px 18px;
  border: 0;
  outline: 0;
  color: var(--green);
  background: transparent;
  cursor: crosshair;
  font-size: clamp(118px, 22vw, 276px);
  font-weight: 900;
  line-height: .9;
  text-shadow: 0 0 3px #c4ffc7, 0 0 15px rgba(106, 255, 119, .58), 0 0 50px rgba(63, 219, 80, .35);
  transition: color 80ms linear, filter 80ms linear;
}
.letter-target:hover { filter: brightness(1.25); }
.letter-target:focus-visible { outline: 2px dashed var(--amber); outline-offset: 8px; }
.letter-target:disabled { cursor: not-allowed; filter: grayscale(1); opacity: .5; }
.target-prefix { color: #4e8054; font-size: .48em; text-shadow: 0 0 10px rgba(106, 255, 119, .35); }
.target-cursor { font-size: .56em; animation: cursorBlink 1s steps(2, end) infinite; }
.letter-target.is-hit { animation: targetHit 180ms steps(3, end); color: #e7ffe9; }
.letter-target.is-destroyed { animation: targetBreak 460ms steps(5, end); color: var(--amber); text-shadow: 0 0 8px white, 0 0 34px var(--red); }
.letter-target.is-critical { animation: criticalGlyphHit 300ms steps(4, end); color: var(--amber); }
.target-stage.is-impact { animation: terminalJolt 140ms steps(2, end); }
.impact-layer { position: absolute; z-index: 3; inset: 0; pointer-events: none; }
.damage-burst { position: absolute; color: #d8ff92; font-size: clamp(16px, 3vw, 28px); font-weight: 900; line-height: 1; text-shadow: 0 0 8px var(--green-soft), 2px 2px #06100a; white-space: nowrap; animation: damageFloat 2.8s linear forwards; }
.kill-burst { color: var(--amber); text-shadow: 0 0 8px var(--amber), 2px 2px #06100a; }
.critical-burst { z-index: 2; color: #fff0b7; font-size: clamp(22px, 5vw, 44px); letter-spacing: .08em; text-shadow: 0 0 5px white, 0 0 18px var(--amber), 2px 2px #06100a; }

.health-readout { display: grid; gap: 7px; }
.health-label, .target-footer { justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10px; letter-spacing: .11em; }
.health-label strong { color: var(--green); font-size: 11px; }
.hp-meter { height: 13px; padding: 2px; border: 1px solid var(--line-bright); background: #030805; }
.hp-fill { display: block; width: 100%; height: 100%; background: linear-gradient(90deg, #579f5d, #9aff9e); box-shadow: 0 0 9px rgba(115, 255, 125, .6); transition: width 110ms linear; }
.target-footer { padding-top: 13px; font-size: 9px; }
.target-footer strong { color: var(--green); }
#hit-status { color: var(--amber); }

.control-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.control-panel { padding: 15px; }
.control-panel .panel-heading { margin-bottom: 13px; }
.control-panel .panel-heading h2 { font-size: 13px; }
.panel-code { color: var(--amber); font-size: 9px; letter-spacing: .1em; white-space: nowrap; }
.stat-line { justify-content: space-between; min-height: 27px; border-top: 1px solid rgba(74, 115, 79, .25); color: var(--muted); font-size: 9px; letter-spacing: .1em; }
.stat-line strong { color: var(--green); font-size: 12px; }
.action-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 11px;
  border: 1px solid var(--line-bright);
  color: var(--green);
  background: rgba(50, 102, 57, .13);
  cursor: pointer;
  font-size: 9px;
  letter-spacing: .08em;
  text-align: left;
}
.action-button:hover:not(:disabled) { border-color: var(--green); background: rgba(72, 155, 80, .24); box-shadow: 0 0 12px rgba(111, 255, 125, .12); }
.action-button:focus-visible, .tab-button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px dashed var(--amber); outline-offset: 3px; }
.action-button:disabled { border-color: #26362a; color: #536358; background: #0a100c; cursor: not-allowed; }
.primary-action, .prestige-action { width: 100%; margin-top: 10px; }
.primary-action span { color: var(--amber); }
.prestige-action { border-color: #85632f; color: var(--amber); background: rgba(131, 91, 36, .12); }
.fine-print { margin: 10px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }

.helper-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.helper-row { justify-content: space-between; gap: 8px; min-height: 48px; padding: 6px 0; border-top: 1px solid rgba(74, 115, 79, .25); }
.helper-info { flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.helper-info strong { font-size: 9px; letter-spacing: .08em; }
.helper-info small { color: var(--muted); font-size: 8px; }
.helper-upgrade { min-height: 32px; font-size: 8px; }
.helper-actions { gap: 7px; margin-top: 8px; }
.helper-actions .action-button { flex: 1; min-width: 0; font-size: 8px; }
.secondary-action { color: var(--amber); border-color: #70582e; }

.powerup-empty { display: grid; min-height: 49px; margin: 0; place-items: center; border: 1px dashed #29472e; color: #617b66; font-size: 9px; letter-spacing: .1em; }
.powerup-button { width: 100%; min-height: 58px; gap: 12px; border: 1px solid var(--amber); color: var(--amber); background: rgba(130, 94, 36, .12); cursor: pointer; text-align: left; animation: signalPulse 700ms steps(2, end) infinite alternate; }
.powerup-button:hover { background: rgba(130, 94, 36, .26); }
.powerup-icon { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid currentColor; font-size: 23px; }
.powerup-copy { display: grid; flex: 1; gap: 4px; }
.powerup-copy strong { font-size: 11px; letter-spacing: .1em; }
.powerup-copy small { font-size: 8px; }
.powerup-arrow { font-size: 10px; }
.active-effects { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.effect-chip { padding: 5px 6px; border: 1px solid #42684a; color: var(--green); font-size: 8px; letter-spacing: .06em; }
.effect-tripleDamage { color: var(--red); border-color: #773c38; }
.effect-tenfoldScore { color: var(--amber); border-color: #70582e; }

.account-view { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .8fr); gap: 16px; align-items: start; }
.account-panel, .leaderboard-panel { padding: clamp(15px, 2vw, 24px); }
.account-forms { align-items: stretch; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.account-form { display: grid; flex: 1 1 240px; gap: 8px; min-width: 0; padding: 13px; border: 1px solid rgba(74, 115, 79, .35); }
.account-form h2, .admin-test-tools h2 { margin: 0 0 4px; font-size: 12px; letter-spacing: .1em; }
.account-form label { color: var(--muted); font-size: 9px; letter-spacing: .08em; }
.account-form input { width: 100%; min-height: 36px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 0; color: var(--green); background: #050b07; }
.account-form .action-button { margin-top: 5px; }
.account-details { flex: 1 1 240px; border: 1px solid rgba(74, 115, 79, .35); }
.account-details summary { padding: 13px; color: var(--amber); cursor: pointer; font-size: 9px; letter-spacing: .08em; }
.account-details .account-form { border: 0; }
.account-message, .panel-copy { color: var(--muted); font-size: 10px; line-height: 1.6; }
.panel-copy strong { color: var(--green); }
.admin-account-controls, .admin-test-tools { display: grid; gap: 9px; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.recovery-once { display: grid; gap: 10px; margin-top: 16px; padding: 13px; border: 1px solid var(--amber); color: var(--amber); font-size: 9px; }
.recovery-once code { overflow-wrap: anywhere; color: var(--green); font-size: 11px; }
.leaderboard-panel .panel-heading { margin-bottom: 12px; }
.compact-action { min-height: 32px; font-size: 8px; }
.leaderboard-list { display: grid; gap: 4px; margin: 12px 0 0; padding: 0; list-style: none; }
.leaderboard-row { gap: 10px; min-height: 34px; padding: 6px 8px; border: 1px solid rgba(74, 115, 79, .25); font-size: 9px; }
.leaderboard-rank { width: 34px; color: var(--amber); }
.leaderboard-name { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.leaderboard-score { color: var(--green); }
.leaderboard-empty { padding: 16px 8px; color: var(--muted); font-size: 9px; }
.own-entry { border-top: 1px dashed var(--amber); padding-top: 10px; }
.leaderboard-own-row { border-color: #765d32; }

.footer-line { display: flex; justify-content: space-between; gap: 10px; padding-top: 18px; color: #4c6952; font-size: 8px; letter-spacing: .11em; }

@keyframes cursorBlink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: .1; } }
@keyframes targetHit { 0% { transform: translate(0); filter: brightness(1); } 25% { transform: translate(-7px, 2px); filter: brightness(2.2); } 55% { transform: translate(5px, -2px); } 100% { transform: translate(0); filter: brightness(1); } }
@keyframes targetBreak { 0% { transform: scale(1); clip-path: inset(0); filter: brightness(2); } 35% { transform: scale(1.08) skewX(-4deg); clip-path: inset(0 0 42% 0); } 65% { transform: scale(.92) skewX(5deg); clip-path: inset(52% 0 0 0); opacity: .7; } 100% { transform: scale(1); clip-path: inset(0); opacity: 1; } }
@keyframes terminalJolt { 0%, 100% { transform: translate(0); } 25% { transform: translate(-3px, 2px); } 75% { transform: translate(2px, -1px); } }
@keyframes damageFloat {
  0% { transform: translate(-50%, -50%) scale(.72); opacity: 0; }
  8% { opacity: 1; }
  72% { transform: translate(-50%, -50%) scale(1.02); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--damage-drift-x)), calc(-50% + var(--damage-drift-y))) scale(1.28); opacity: 0; filter: blur(2px); }
}
@keyframes damageFade { 0%, 8% { opacity: 0; } 16%, 72% { opacity: 1; } 100% { opacity: 0; } }
@keyframes signalPulse { from { box-shadow: 0 0 0 rgba(255, 199, 107, 0); } to { box-shadow: 0 0 16px rgba(255, 199, 107, .2), inset 0 0 12px rgba(255, 199, 107, .08); } }

@media (max-width: 960px) {
  .control-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .target-stage { min-height: 390px; }
}

@media (max-width: 680px) {
  .screen { padding: 12px 10px 14px; border-inline: 0; }
  .topbar { align-items: flex-start; }
  .brand-mark { width: 38px; height: 38px; font-size: 24px; }
  .brand-copy strong { font-size: 16px; }
  .brand-copy .eyebrow { max-width: 150px; font-size: 8px; line-height: 1.4; }
  .topbar-right { gap: 8px; }
  .topbar-readouts { gap: 10px; }
  .topbar-readouts > span { min-width: 48px; }
  .topbar-readouts small { font-size: 8px; }
  .topbar-readouts strong { font-size: 12px; }
  .system-readout { display: none !important; }
  .connection { font-size: 8px; }
  .tab-nav { padding: 10px 0 13px; }
  .tab-button { padding: 0 10px; font-size: 9px; }
  .target-panel { padding: 12px; }
  .target-stage { min-height: 330px; margin: 12px 0 14px; }
  .letter-target { font-size: clamp(116px, 43vw, 210px); }
  .control-grid, .account-view { grid-template-columns: minmax(0, 1fr); }
  .control-panel { padding: 13px; }
  .account-forms { display: grid; }
  .footer-line { font-size: 7px; }
}

@media (max-width: 380px) {
  .topbar { flex-wrap: wrap; }
  .topbar-right { width: 100%; flex-direction: row; align-items: center; justify-content: space-between; }
  .topbar-readouts { flex: 1; justify-content: space-between; }
  .target-stage { min-height: 285px; }
  .target-footer { font-size: 8px; }
  .helper-actions { align-items: stretch; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Compact clicker shell: keep the complete game loop inside the viewport. */
html, body { width: 100%; height: 100%; overflow: hidden; }
body { min-height: 0; }
.screen {
  display: grid;
  width: min(1120px, 100%);
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  grid-template-rows: 42px 38px minmax(0, 1fr);
  overflow: hidden;
  padding: max(4px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  border: 0;
}
.topbar {
  position: relative;
  min-height: 0;
  height: 42px;
  justify-content: flex-end;
  gap: 0;
  padding: 0;
  border: 0;
}
.topbar-spacer { flex: 1; }
.header-username {
  position: absolute;
  display: block;
  left: 50%;
  width: min(44%, 360px);
  max-width: 44%;
  overflow: hidden;
  color: var(--green);
  font-size: 11px;
  letter-spacing: .08em;
  text-align: center;
  text-overflow: ellipsis;
  text-transform: uppercase;
  transform: translateX(-50%);
  white-space: nowrap;
}
.topbar-readouts { gap: clamp(8px, 3vw, 20px); }
.topbar-readouts > span { min-width: 42px; gap: 1px; text-align: right; }
.topbar-readouts small { font-size: 7px; letter-spacing: .09em; }
.topbar-readouts strong { font-size: 12px; }
.tab-nav {
  min-height: 0;
  height: 38px;
  justify-content: center;
  gap: 6px;
  padding: 0 0 5px;
}
.tab-button { flex: 1; max-width: 180px; min-height: 31px; padding-inline: 10px; font-size: 9px; }
main { min-height: 0; height: 100%; overflow: hidden; }
.game-view {
  position: relative;
  height: 100%;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 7px;
}
.target-panel { display: flex; min-height: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.target-stage {
  flex: 1;
  width: 100%;
  min-height: 0;
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.target-cluster {
  z-index: 2;
  display: flex;
  max-width: calc(100% - 24px);
  flex-direction: column;
  align-items: center;
  gap: clamp(5px, 2vh, 12px);
}
.letter-target {
  padding: 0 8px;
  font-size: clamp(104px, 34vmin, 218px);
  line-height: .82;
  animation: glyphPulse 1.8s steps(5, end) infinite alternate;
}
.letter-target.is-hit, .letter-target.is-destroyed { animation-iteration-count: 1; }
.research-button {
  width: auto;
  min-width: 132px;
  min-height: 34px;
  justify-content: center;
  gap: 7px;
  margin: 0;
  padding: 4px 10px;
  border-color: var(--line-bright);
  font-size: 8px;
  letter-spacing: .06em;
}
.research-button strong { color: var(--green); font-size: 10px; }
.research-button small { color: var(--amber); font-size: 8px; }
.health-readout {
  position: absolute;
  z-index: 2;
  top: 13px;
  left: 50%;
  width: min(138px, 42vw);
  transform: translateX(-50%);
}
.hp-meter { height: 6px; padding: 1px; }
.hp-fill { box-shadow: 0 0 8px rgba(115, 255, 125, .55); }
.impact-layer { z-index: 4; }
.powerup-button.powerup-popup {
  position: absolute;
  z-index: 5;
  top: 12%;
  left: -142px;
  width: min(150px, 48vw);
  min-height: 46px;
  gap: 7px;
  padding: 5px 7px;
  border: 1px solid var(--amber);
  background: rgba(8, 16, 10, .94);
  box-shadow: 0 0 14px rgba(255, 199, 107, .17);
  animation: powerupGlide 6s linear both, signalPulse 700ms steps(2, end) infinite alternate;
}
.powerup-popup .powerup-icon { width: 27px; height: 27px; flex: none; font-size: 18px; }
.powerup-popup .powerup-copy { gap: 2px; }
.powerup-popup .powerup-copy strong { font-size: 8px; }
.powerup-popup .powerup-copy small { font-size: 7px; }
.powerup-popup .powerup-arrow { font-size: 8px; }
.active-effects {
  position: absolute;
  z-index: 3;
  bottom: 7px;
  left: 7px;
  display: flex;
  max-width: calc(100% - 14px);
  flex-wrap: nowrap;
  gap: 4px;
  margin: 0;
  overflow: hidden;
  pointer-events: none;
}
.effect-chip { flex: none; padding: 3px 4px; font-size: 7px; }
.game-dock { display: grid; min-height: 38px; grid-template-columns: 1fr 1fr; gap: 7px; }
.dock-button {
  display: flex;
  min-width: 0;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  color: var(--green);
  background: rgba(50, 102, 57, .11);
  cursor: pointer;
  font-size: 8px;
  letter-spacing: .08em;
}
.dock-button strong { color: var(--amber); font-size: 8px; }
.dock-button:hover:not(:disabled) { border-color: var(--green); background: rgba(72, 155, 80, .2); }
.dock-button:focus-visible, .dialog-close:focus-visible { outline: 2px dashed var(--amber); outline-offset: 2px; }
.dock-button:disabled { opacity: .48; cursor: not-allowed; }
.prestige-action { width: auto; min-height: 36px; margin: 0; border-color: #70582e; color: var(--amber); }
.helper-dialog {
  width: min(420px, calc(100vw - 24px));
  max-height: min(78dvh, 520px);
  margin: auto;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--line-bright);
  color: var(--green);
  background: #08130c;
  box-shadow: 0 0 32px rgba(0, 0, 0, .7), inset 0 0 22px rgba(66, 145, 75, .1);
}
.helper-dialog::backdrop { background: rgba(0, 0, 0, .74); backdrop-filter: blur(2px); }
.helper-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.helper-dialog-head h2 { margin: 0; color: var(--green); font-size: 12px; letter-spacing: .12em; }
.dialog-close { width: 34px; height: 34px; border: 1px solid var(--line); color: var(--amber); background: transparent; cursor: pointer; font-size: 20px; }
.helper-list { max-height: 34dvh; overflow: auto; }
.helper-row { min-height: 44px; }
.helper-actions { display: flex; gap: 7px; margin-top: 8px; }
.helper-actions .action-button { min-height: 36px; padding: 6px 8px; font-size: 8px; }
.helper-empty-note { display: none; }
.helper-dialog .fine-print { margin-top: 8px; }
.offline-summary-dialog { width: min(390px, calc(100vw - 24px)); }
.offline-summary-duration, .offline-progress-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 12px 0 0; }
.offline-summary-duration span, .offline-progress-line span { color: var(--muted); font-size: 8px; letter-spacing: .1em; }
.offline-summary-duration strong { color: var(--amber); font-size: clamp(16px, 5vw, 22px); letter-spacing: .06em; }
.offline-summary-note { margin: 4px 0 12px; color: var(--muted); font-size: 7px; letter-spacing: .06em; }
.offline-summary-stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.offline-summary-stat-grid > span { display: grid; min-width: 0; gap: 4px; padding: 8px 4px; border: 1px solid rgba(78, 128, 84, .4); text-align: center; }
.offline-summary-stat-grid small { color: var(--muted); font-size: 7px; letter-spacing: .08em; }
.offline-summary-stat-grid strong { overflow: hidden; color: var(--green); font-size: clamp(12px, 4vw, 18px); text-overflow: ellipsis; white-space: nowrap; }
.offline-progress-line { margin: 10px 0; }
.offline-progress-line strong { color: var(--amber); font-size: 10px; }
.offline-summary-continue { width: 100%; justify-content: center; }
.prestige-dialog { width: min(360px, calc(100vw - 24px)); }
.prestige-reward { display: grid; gap: 8px; justify-items: center; margin: 14px 0 10px; padding: 15px 10px; border: 1px solid #70582e; color: var(--amber); background: rgba(131, 91, 36, .1); text-align: center; }
.prestige-reward strong { font-size: clamp(28px, 9vw, 38px); line-height: 1; text-shadow: 0 0 14px rgba(255, 199, 107, .55); }
.prestige-factor { display: grid; gap: 4px; }
.prestige-factor small { color: var(--muted); font-size: 8px; letter-spacing: .08em; }
.prestige-reward .prestige-factor strong { font-size: 14px; text-shadow: 0 0 8px rgba(255, 199, 107, .35); }
.prestige-reset-note { margin: 0 0 12px; color: var(--muted); font-size: 8px; letter-spacing: .07em; text-align: center; }
.prestige-dialog-actions { display: flex; gap: 8px; }
.prestige-dialog-actions .action-button { flex: 1; justify-content: center; text-align: center; }
.prestige-confirm { border-color: #85632f; color: var(--amber); background: rgba(131, 91, 36, .16); }
.account-view { height: 100%; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 4px 0; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@keyframes glyphPulse {
  from { transform: scale(.96); filter: brightness(.85); text-shadow: 0 0 3px #c4ffc7, 0 0 12px rgba(106, 255, 119, .35), 0 0 36px rgba(63, 219, 80, .2); }
  to { transform: scale(1.025); filter: brightness(1.25); text-shadow: 0 0 5px #e3ffe4, 0 0 22px rgba(106, 255, 119, .8), 0 0 66px rgba(63, 219, 80, .48); }
}
@keyframes powerupGlide {
  from { left: -142px; }
  to { left: calc(100% + 142px); }
}

@keyframes criticalGlyphHit {
  0% { transform: translateX(0) scale(1); filter: brightness(1); text-shadow: 0 0 4px white, 0 0 16px var(--amber); }
  25% { transform: translateX(-8px) scale(1.08) skewX(-4deg); filter: brightness(2); text-shadow: 8px 0 var(--red), -8px 0 #baffbd, 0 0 38px var(--amber); }
  55% { transform: translateX(7px) scale(.97) skewX(3deg); filter: brightness(1.5); text-shadow: -6px 0 var(--red), 6px 0 #baffbd, 0 0 26px white; }
  100% { transform: translateX(0) scale(1); filter: brightness(1); }
}

@media (max-width: 680px) {
  .screen { padding: max(4px, env(safe-area-inset-top)) max(7px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(7px, env(safe-area-inset-left)); }
  .topbar { min-height: 0; align-items: center; }
  .header-username { width: 36%; max-width: 36%; }
  .topbar-readouts { gap: 6px; }
  .topbar-readouts > span { min-width: 34px; }
  .topbar-readouts small { font-size: 6px; }
  .topbar-readouts strong { font-size: 11px; }
  .tab-nav { padding: 0 0 4px; }
  .target-stage { min-height: 0; margin: 0; }
  .letter-target { font-size: clamp(104px, 34vmin, 188px); }
  .control-grid { display: none; }
}
@media (max-width: 380px) {
  .screen { padding-inline: max(6px, env(safe-area-inset-left)) max(6px, env(safe-area-inset-right)); }
  .header-username { width: 32%; max-width: 32%; font-size: 8px; }
  .topbar-readouts { flex: 0 0 auto; justify-content: flex-end; gap: 3px; }
  .topbar-readouts > span { min-width: 28px; }
  .topbar-readouts small { font-size: 6px; }
  .topbar-readouts strong { font-size: 9px; }
  .tab-button { padding-inline: 6px; font-size: 8px; }
  .game-dock { gap: 5px; }
  .dock-button { gap: 5px; font-size: 7px; }
}
@media (max-height: 430px) {
  .screen { grid-template-rows: 34px 32px minmax(0, 1fr); }
  .topbar { height: 34px; }
  .tab-nav { height: 32px; padding-bottom: 3px; }
  .tab-button { min-height: 27px; }
  .game-view { gap: 4px; }
  .letter-target { font-size: clamp(70px, 28vh, 112px); }
  .target-cluster { gap: 4px; }
  .research-button { min-height: 30px; }
  .health-readout { top: 8px; }
  .active-effects { bottom: 4px; }
  .game-dock { min-height: 32px; gap: 5px; }
  .dock-button, .prestige-action { min-height: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .powerup-button.powerup-popup { left: 8px; animation: none; }
  .letter-target { animation: none; }
  .damage-burst { animation-name: damageFade !important; animation-duration: 2.8s !important; animation-timing-function: linear !important; animation-fill-mode: forwards !important; }
}

/* Focused letter loop with optional navigation and a compact research strip. */
.screen { grid-template-rows: 48px minmax(0, 1fr); }
.topbar { z-index: 8; height: 48px; align-items: center; justify-content: space-between; overflow: visible; }
.main-menu { position: relative; z-index: 10; flex: none; }
.main-menu > summary {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--green);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  list-style: none;
}
.main-menu > summary::-webkit-details-marker { display: none; }
.main-menu > summary:hover, .main-menu[open] > summary { border-color: var(--green); color: var(--amber); background: rgba(50, 102, 57, .2); }
.menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  display: grid;
  min-width: 142px;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--line-bright);
  background: rgba(5, 13, 8, .98);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .65), inset 0 0 12px rgba(66, 145, 75, .12);
}
.menu-item {
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 9px;
  letter-spacing: .12em;
  text-align: left;
}
.menu-item:hover, .menu-item.active { border-color: var(--line-bright); color: var(--green); background: rgba(63, 122, 70, .16); }
.menu-item:focus-visible { outline: 2px dashed var(--amber); outline-offset: 1px; }
.header-username { width: min(44%, 360px); max-width: 44%; }
.topbar-readouts { gap: clamp(7px, 2vw, 16px); }
.topbar-readouts > span { min-width: 38px; }
main { min-height: 0; height: 100%; overflow: hidden; }
.game-view { grid-template-rows: minmax(0, 1fr) auto auto; gap: 6px; align-items: stretch; }
.target-panel { display: flex; min-height: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.target-stage { display: grid; flex: 1; width: 100%; min-height: 0; margin: 0; place-items: center; overflow: hidden; }
.health-readout { top: 9px; }
.target-cluster { display: grid; width: 100%; height: 100%; max-width: none; place-items: center; }
.letter-target { display: grid; width: min(88vw, 80dvh); aspect-ratio: 1; place-items: center; padding: 0; font-size: clamp(180px, min(130vw, 90dvh), 1000px); line-height: .76; }
.upgrade-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.upgrade-button {
  display: grid;
  min-width: 0;
  min-height: 58px;
  grid-template-rows: auto auto auto;
  align-content: center;
  justify-items: center;
  gap: 2px;
  padding: 4px 3px;
  text-align: center;
}
.upgrade-button > span { overflow: hidden; max-width: 100%; color: var(--muted); font-size: 7px; letter-spacing: .05em; text-overflow: ellipsis; white-space: nowrap; }
.upgrade-button > strong { color: var(--green); font-size: 14px; line-height: 1; }
.upgrade-button > small { color: var(--amber); font-size: 8px; }
.upgrade-button:disabled { opacity: .58; }
.game-dock { min-height: 36px; grid-template-columns: 1fr 1fr; gap: 6px; }
.dock-button, .prestige-action { min-height: 34px; }
.letter-target.is-critical { animation: criticalGlyphHit 300ms steps(4, end); }

@media (max-width: 680px) {
  .screen { padding: max(4px, env(safe-area-inset-top)) max(7px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(7px, env(safe-area-inset-left)); }
  .topbar { height: 46px; }
  .header-username { width: 34%; max-width: 34%; font-size: 10px; }
  .topbar-readouts { gap: 6px; }
  .topbar-readouts > span { min-width: 34px; }
  .topbar-readouts small { font-size: 6px; }
  .topbar-readouts strong { font-size: 10px; }
  .letter-target { width: min(88vw, 80dvh); font-size: clamp(160px, min(130vw, 90dvh), 900px); }
  .upgrade-row { gap: 4px; }
  .upgrade-button { min-height: 56px; }
}
@media (max-width: 380px) {
  .screen { padding-inline: max(6px, env(safe-area-inset-left)) max(6px, env(safe-area-inset-right)); }
  .header-username { width: 30%; max-width: 30%; font-size: 8px; }
  .main-menu > summary { width: 32px; height: 32px; }
  .topbar-readouts { gap: 3px; }
  .topbar-readouts > span { min-width: 28px; }
  .topbar-readouts strong { font-size: 9px; }
  .upgrade-button > span { font-size: 6px; }
  .upgrade-button > strong { font-size: 12px; }
}
@media (max-height: 430px) {
  .screen { grid-template-rows: 36px minmax(0, 1fr); }
  .topbar { height: 36px; }
  .main-menu > summary { width: 30px; height: 30px; }
  .game-view { gap: 4px; }
  .letter-target { width: min(76vw, 70dvh); font-size: min(76vw, 65dvh, 360px); }
  .health-readout { top: 5px; }
  .upgrade-button { min-height: 48px; }
  .game-dock { min-height: 30px; gap: 4px; }
  .dock-button, .prestige-action { min-height: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .letter-target.is-critical { animation: none; }
}

.quote-complete-burst {
  position: absolute;
  z-index: 6;
  top: 18%;
  left: 50%;
  max-width: 92%;
  padding: 5px 8px;
  border: 1px solid rgba(255, 199, 107, .7);
  color: #ffe0a2;
  background: rgba(5, 13, 8, .9);
  box-shadow: 0 0 12px rgba(255, 199, 107, .22), inset 0 0 8px rgba(255, 199, 107, .08);
  font-size: clamp(9px, 2.5vw, 15px);
  font-weight: 900;
  letter-spacing: .06em;
  line-height: 1.35;
  text-align: center;
  text-shadow: 0 0 8px rgba(255, 199, 107, .55);
  transform: translateX(-50%);
  animation: quoteSeal 3.4s steps(8, end) forwards;
}

@keyframes quoteSeal {
  0%, 6% { opacity: 0; transform: translate(-50%, 7px) scale(.96); }
  14%, 68% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -9px) scale(1.02); filter: blur(2px); }
}

@media (prefers-reduced-motion: reduce) {
  .quote-complete-burst { animation: none; opacity: 1; }
}

.helper-orbit { position: absolute; z-index: 3; inset: 6px; pointer-events: none; }
.helper-node {
  position: absolute;
  width: clamp(60px, 15vw, 78px);
  pointer-events: auto;
}
.helper-node-toggle {
  display: grid;
  width: 100%;
  min-height: 72px;
  grid-template-rows: 48px auto auto;
  align-content: center;
  justify-items: center;
  gap: 0;
  padding: 1px 2px;
  border: 1px solid rgba(78, 128, 84, .28);
  color: var(--green);
  background: rgba(4, 12, 7, .3);
  box-shadow: inset 0 0 9px rgba(88, 220, 100, .04);
  cursor: pointer;
  pointer-events: auto;
  text-align: center;
}
.helper-node-toggle:hover:not(:disabled) { border-color: var(--line-bright); background: rgba(4, 12, 7, .78); }
.helper-node:nth-child(1) { top: 22%; left: 2%; }
.helper-node:nth-child(2) { top: 22%; right: 2%; }
.helper-node:nth-child(3) { bottom: 18%; left: 2%; }
.helper-node:nth-child(4) { bottom: 18%; right: 2%; }
.helper-node.is-empty .helper-node-toggle { color: var(--amber); border-style: dashed; }
.helper-node.is-locked .helper-node-toggle { color: var(--muted); border-style: dotted; opacity: .75; }
.helper-node-toggle:disabled { cursor: default; opacity: .58; }
.helper-node-menu {
  position: absolute;
  z-index: 9;
  top: calc(100% + 4px);
  left: 0;
  display: grid;
  width: min(174px, 47vw);
  gap: 3px;
  padding: 4px;
  border: 1px solid rgba(117, 255, 138, .55);
  background: rgba(3, 10, 5, .96);
  box-shadow: 0 0 14px rgba(70, 255, 96, .13), inset 0 0 8px rgba(70, 255, 96, .06);
  pointer-events: auto;
}
.helper-node:nth-child(2) .helper-node-menu, .helper-node:nth-child(4) .helper-node-menu { right: 0; left: auto; }
.helper-node:nth-child(3) .helper-node-menu, .helper-node:nth-child(4) .helper-node-menu { top: auto; bottom: calc(100% + 4px); }
.helper-upgrade-button, .hq-upgrade-option {
  display: grid;
  min-width: 0;
  gap: 2px;
  padding: 5px 6px;
  border: 1px solid rgba(78, 128, 84, .4);
  color: var(--green);
  background: rgba(9, 23, 12, .92);
  cursor: pointer;
  text-align: left;
}
.helper-upgrade-button:hover:not(:disabled), .hq-upgrade-option:hover:not(:disabled) { border-color: var(--line-bright); background: rgba(17, 43, 22, .96); }
.helper-upgrade-button:disabled, .hq-upgrade-option:disabled { color: var(--muted); cursor: default; opacity: .55; }
.helper-upgrade-label, .hq-upgrade-option strong { font-size: 7px; letter-spacing: .06em; }
.helper-upgrade-detail, .hq-upgrade-option small { color: var(--amber); font-size: 6px; line-height: 1.25; }
.helper-blueprint { display: block; width: 100%; height: 48px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.35; stroke-linecap: square; stroke-linejoin: bevel; filter: drop-shadow(0 0 3px rgba(100, 255, 122, .28)); }
.helper-blueprint-ruler { stroke: var(--amber); stroke-dasharray: 1 2; opacity: .58; }
.helper-blueprint .tower-stage { display: none; }
.helper-blueprint .tower-stage.is-visible { display: inline; }
.helper-tower-base { stroke-width: 1.9; }
.helper-tower-mast { stroke-width: 1.7; }
.helper-tower-frame { stroke-width: 1.5; }
.helper-turret { stroke-width: 1.7; }
.helper-turret-detail { opacity: .65; }
.helper-turret-armor { stroke-width: 1.8; }
.helper-tower-wing { stroke-width: 1.6; }
.helper-tower-sensor { stroke: var(--amber); fill: rgba(255, 199, 107, .18); }
.helper-turret-ring { stroke: var(--amber); stroke-dasharray: 2 1; opacity: .85; }
.helper-barrel { stroke: var(--amber); stroke-width: 2; transform-box: view-box; transform-origin: 50px 36px; }
.helper-node:nth-child(1) .helper-barrel { transform: rotate(45deg); }
.helper-node:nth-child(2) .helper-barrel { transform: rotate(135deg); }
.helper-node:nth-child(3) .helper-barrel { transform: rotate(-45deg); }
.helper-node:nth-child(4) .helper-barrel { transform: rotate(-135deg); }
.helper-blueprint-crosshair { stroke: var(--amber); stroke-width: 1.5; }
.helper-node-name { max-width: 100%; color: inherit; font-size: 6px; line-height: 1.1; letter-spacing: .04em; white-space: nowrap; }
.helper-node-level, .helper-node-price { max-width: 100%; overflow: hidden; font-size: 5px; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.helper-node-level { color: var(--muted); }
.helper-node-price { color: var(--amber); }
.helper-node.is-max-tier .helper-blueprint { filter: drop-shadow(0 0 6px rgba(255, 199, 107, .42)) drop-shadow(0 0 5px rgba(100, 255, 122, .35)); }
.helper-node.is-firing .helper-node-toggle { color: #fff4bb; border-color: rgba(255, 214, 112, .8); box-shadow: 0 0 20px rgba(255, 214, 112, .35), inset 0 0 10px rgba(255, 214, 112, .12); }
.helper-node.is-firing .helper-blueprint { animation: helperBlueprintFire 300ms steps(3, end); }

.hq-control {
  position: absolute;
  z-index: 5;
  bottom: 1px;
  left: 50%;
  width: min(190px, 58vw);
  height: 78px;
  pointer-events: none;
  transform: translateX(-50%);
}
.hq-blueprint {
  position: absolute;
  inset: 0;
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  padding: 0;
  border: 0;
  color: var(--green);
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
}
.hq-blueprint:disabled { cursor: not-allowed; opacity: .82; filter: saturate(.68); }
.hq-blueprint:focus-visible { outline: 1px dashed var(--amber); outline-offset: -3px; }
.hq-building { position: absolute; inset: 0; display: block; width: 100%; height: 100%; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1; stroke-linecap: square; stroke-linejoin: bevel; filter: drop-shadow(0 0 4px rgba(100, 255, 122, .35)); pointer-events: none; }
.hq-building .blueprint-perimeter { stroke-width: 1.8; }
.hq-building .blueprint-security { stroke-dasharray: 3 2; opacity: .7; }
.hq-building .blueprint-wing { opacity: .62; }
.hq-building .blueprint-core { stroke-width: 1.4; }
.hq-building .blueprint-accent { stroke: var(--amber); opacity: .85; }
.hq-building .blueprint-dimension { stroke: var(--amber); stroke-dasharray: 1 2; opacity: .55; }
.hq-building .blueprint-crosshair { stroke: var(--amber); stroke-width: 1.5; }
.hq-building.is-active { filter: drop-shadow(0 0 7px rgba(147, 255, 158, .9)); }
.hq-readout { position: absolute; bottom: 1px; left: 50%; display: grid; max-width: 96%; justify-items: center; gap: 1px; padding: 1px 5px; color: var(--green); background: rgba(3, 10, 5, .92); text-shadow: 0 0 5px rgba(117, 255, 138, .5); transform: translateX(-50%); pointer-events: none; }
.hq-readout strong { font-size: 7px; letter-spacing: .12em; white-space: nowrap; }
.hq-readout small { color: var(--amber); font-size: 5px; letter-spacing: .06em; white-space: nowrap; }
.hq-upgrade-menu {
  position: absolute;
  z-index: 9;
  right: 50%;
  bottom: calc(100% - 5px);
  display: grid;
  width: min(190px, 56vw);
  gap: 3px;
  padding: 4px;
  border: 1px solid rgba(117, 255, 138, .55);
  background: rgba(3, 10, 5, .97);
  box-shadow: 0 0 14px rgba(70, 255, 96, .13), inset 0 0 8px rgba(70, 255, 96, .06);
  pointer-events: auto;
  transform: translateX(50%);
}
.hq-building.is-firing { animation: hqBeamPulse 300ms steps(3, end); }

.laser-beam {
  position: absolute;
  z-index: 1;
  height: 2px;
  transform-origin: 0 50%;
  pointer-events: none;
  animation: laserFlash 280ms steps(4, end) forwards;
}
.laser-helper { background: linear-gradient(90deg, rgba(76, 255, 121, .1), #9bff9b, #fff); box-shadow: 0 0 8px #75ff8a, 0 0 18px rgba(89, 255, 125, .75); }
.laser-hq { height: 3px; background: linear-gradient(90deg, rgba(255, 199, 107, .1), #ffc76b, #fff6d6); box-shadow: 0 0 9px var(--amber), 0 0 22px rgba(255, 199, 107, .85); }
.laser-auto { background: linear-gradient(90deg, rgba(114, 211, 255, .1), #72d3ff, #fff); box-shadow: 0 0 9px #72d3ff; }

.game-dock { grid-template-columns: minmax(0, 260px); justify-content: center; }
.letter-target { width: min(82vw, 72dvh); font-size: clamp(170px, min(120vw, 84dvh), 900px); }
.target-cluster { padding-bottom: 82px; }

.global-view { display: grid; height: 100%; min-height: 0; }
.global-panel { display: grid; min-height: 0; grid-template-rows: auto minmax(0, 1fr) auto auto auto; gap: 8px; padding: clamp(8px, 2vh, 16px); }
.global-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.global-heading-row h1 { margin: 2px 0 0; font-size: clamp(12px, 3vw, 18px); letter-spacing: .12em; }
.global-timer { color: var(--amber); font-size: clamp(9px, 2.5vw, 13px); font-weight: 900; }
.global-stage { position: relative; display: grid; min-height: 0; overflow: hidden; place-items: center; border: 1px solid rgba(78, 128, 84, .32); background: radial-gradient(circle, rgba(58, 115, 65, .11), transparent 60%); }
.global-status { position: absolute; z-index: 2; top: 8px; left: 50%; width: 96%; color: var(--amber); font-size: clamp(6px, 1.8vw, 9px); text-align: center; transform: translateX(-50%); }
.global-boss-health { position: absolute; z-index: 2; top: 26px; left: 50%; display: grid; width: min(86%, 460px); height: 15px; overflow: hidden; border: 1px solid rgba(111, 255, 133, .75); background: rgba(4, 12, 6, .88); box-shadow: 0 0 8px rgba(111, 255, 133, .24), inset 0 0 5px rgba(111, 255, 133, .2); transform: translateX(-50%); pointer-events: none; }
.global-boss-health-fill { position: absolute; inset: 0; width: 100%; background: linear-gradient(90deg, rgba(41, 139, 57, .84), rgba(120, 255, 139, .92)); }
.global-boss-health-label { position: relative; align-self: center; color: #061109; font-size: 8px; font-weight: 1000; letter-spacing: .32em; line-height: 1; text-align: center; text-shadow: 0 0 2px #c7ffd0; }
.global-target { width: 70vw; height: 70vw; max-width: 68dvh; max-height: 68dvh; padding: 0; border: 0; color: var(--green); background: transparent; font-size: clamp(160px, min(95vw, 68dvh), 700px); font-weight: 900; line-height: .8; text-shadow: 0 0 8px #b5ffbc, 0 0 34px rgba(93, 243, 111, .65); cursor: crosshair; }
.global-target:disabled { cursor: default; opacity: .72; }
.global-target.is-firing { animation: globalImpact 250ms steps(3, end); }
.letter-target, .global-target { touch-action: none; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.global-impact-layer { position: absolute; z-index: 3; inset: 0; pointer-events: none; }
.global-damage-burst { position: absolute; color: var(--green); font-size: clamp(11px, 3vw, 18px); font-weight: 900; text-shadow: 0 0 8px var(--green); animation: globalDamageFloat 2.1s steps(7, end) forwards; }
.global-damage-burst.is-critical { color: var(--amber); text-shadow: 0 0 12px var(--amber); }
.global-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.global-stats > span { display: grid; min-width: 0; gap: 3px; padding: 5px 3px; border: 1px solid var(--line); text-align: center; }
.global-stats small { color: var(--muted); font-size: clamp(5px, 1.5vw, 7px); letter-spacing: .04em; }
.global-stats strong { overflow: hidden; color: var(--green); font-size: clamp(8px, 2.4vw, 13px); text-overflow: ellipsis; white-space: nowrap; }
.global-message, .global-reward-message { margin: 0; color: var(--muted); font-size: 8px; line-height: 1.45; text-align: center; }
.global-reward-message { color: var(--amber); font-weight: 900; }

.quote-dialog { width: min(560px, calc(100vw - 24px)); max-height: min(86dvh, 760px); padding: 14px; border: 1px solid var(--line-bright); color: var(--green); background: rgba(5, 13, 8, .98); box-shadow: 0 0 30px rgba(0, 0, 0, .7), inset 0 0 20px rgba(87, 173, 96, .1); }
.quote-dialog::backdrop { background: rgba(0, 0, 0, .78); backdrop-filter: blur(2px); }
.quotes-bonus-total { margin: 2px 0 10px; color: var(--amber); font-size: 9px; font-weight: 900; }
.quote-collection { display: grid; max-height: 68dvh; gap: 5px; overflow: auto; margin: 0; padding: 0 3px 0 0; list-style: none; }
.quote-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 8px; padding: 7px; border: 1px solid rgba(78, 128, 84, .28); background: rgba(15, 32, 19, .5); }
.quote-entry-phrase { overflow: hidden; color: var(--muted); font-size: 8px; letter-spacing: .04em; text-overflow: ellipsis; }
.quote-entry-medal { color: var(--muted); font-size: 7px; white-space: nowrap; }
.quote-entry small { grid-column: 1 / -1; color: var(--muted); font-size: 6px; }
.quote-entry.is-found { border-color: rgba(255, 199, 107, .45); }
.quote-entry.is-found .quote-entry-phrase { color: var(--green); }
.quote-entry.is-found .quote-entry-medal { color: var(--amber); }

@keyframes laserFlash { 0% { opacity: 0; } 15% { opacity: 1; } 45% { opacity: .9; } 100% { opacity: 0; filter: blur(2px); } }
@keyframes hqBeamPulse { 0%, 100% { filter: brightness(1); transform: scale(1); } 40% { filter: brightness(2.2); transform: scale(1.14); } }
@keyframes helperBlueprintFire { 0%, 100% { filter: brightness(1) drop-shadow(0 0 3px rgba(100, 255, 122, .28)); } 40% { filter: brightness(2.4) drop-shadow(0 0 8px rgba(255, 214, 112, .9)); } }
@keyframes globalImpact { 0%, 100% { transform: scale(1); filter: brightness(1); } 35% { transform: scale(1.08) skewX(-4deg); filter: brightness(2.2); } }
@keyframes globalDamageFloat { 0% { opacity: 0; transform: translate(-50%, 5px); } 12%, 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -20px); filter: blur(2px); } }

@media (max-width: 420px) {
  .helper-node { width: 56px; }
  .helper-node-toggle { min-height: 66px; grid-template-rows: 42px auto auto; }
  .helper-blueprint { height: 42px; }
  .helper-node-name { font-size: 5px; }
  .helper-node-level, .helper-node-price { font-size: 4px; }
  .helper-node-menu { width: min(162px, 48vw); }
  .hq-control { width: min(180px, 58vw); height: 72px; }
  .hq-readout strong { font-size: 6px; }
  .global-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .letter-target { width: min(86vw, 78dvh); font-size: clamp(150px, min(86vw, 76dvh), 760px); }
}

@media (max-height: 430px) {
  .letter-target { width: min(72vw, 48dvh); height: auto; aspect-ratio: auto; font-size: min(72vw, 46dvh, 300px); }
  .target-cluster { padding-bottom: 58px; }
  .hq-control { width: min(150px, 48vw); height: 54px; }
  .hq-readout { bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .helper-node.is-firing .helper-blueprint, .hq-building.is-firing, .global-target.is-firing,
  .laser-beam, .global-damage-burst { animation-duration: 1ms !important; }
}
