:root {
  color-scheme: dark;
  --ink: #effff7;
  --muted: #a8c9bc;
  --emerald: #35d394;
  --jade: #15966b;
  --mint: #a5ffda;
  --cyan: #6ce9df;
  --gold: #f0ca82;
  --panel: rgba(4, 28, 23, 0.66);
  --line: rgba(185, 255, 224, 0.17);
  --shadow: rgba(1, 12, 10, 0.48);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #03140f;
}

body {
  color: var(--ink);
  font-family: "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 4px;
}

.app,
#game-canvas,
#hud-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

.app.is-playing[data-control-mode="mouse"] #game-canvas {
  cursor: crosshair;
}

#game-canvas {
  display: block;
  background:
    radial-gradient(circle at 72% 44%, rgba(47, 189, 191, 0.18), transparent 35%),
    linear-gradient(#021718, #073a35 62%, #556149);
}

#hud-overlay {
  z-index: 3;
  pointer-events: none;
}

.vignette,
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.vignette {
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(1, 15, 12, 0.82), transparent 52%),
    linear-gradient(180deg, rgba(1, 17, 13, 0.34), transparent 32%),
    radial-gradient(circle at 54% 45%, transparent 34%, rgba(0, 13, 10, 0.56) 115%);
}

.grain {
  z-index: 2;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.screen,
.gameplay-screen,
.topbar,
.footer,
.diagnostics,
.fatal-error,
.modal-backdrop,
.boost-wash {
  position: fixed;
  z-index: 3;
}

.topbar {
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(1.25rem, 3vw, 2.3rem) clamp(1.4rem, 5vw, 5rem);
}

.brand-chip {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  color: var(--ink);
  font-family: "Arial Narrow", "Segoe UI", sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-decoration: none;
}

.brand-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--mint);
  box-shadow: 0 0 18px var(--mint);
}

.phase-chip {
  margin: 0;
  color: rgba(222, 248, 237, 0.58);
  font-size: 0.67rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.phase-chip span {
  margin-right: 0.65rem;
  color: var(--gold);
}

.title-screen {
  inset: 0;
  display: grid;
  grid-template-columns: minmax(280px, 560px) 1fr;
  align-items: center;
  padding: 7rem clamp(1.5rem, 8vw, 8rem) 5rem;
}

.title-copy {
  animation: title-arrive 1.1s var(--ease-out) both;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--mint);
  font-size: clamp(0.67rem, 0.9vw, 0.78rem);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

h1,
h2,
p {
  text-wrap: balance;
}

h1 {
  max-width: 8ch;
  margin: 0;
  font-family: "Arial Narrow", "Segoe UI", sans-serif;
  font-size: clamp(4.1rem, 9.2vw, 8.8rem);
  font-weight: 700;
  letter-spacing: -0.09em;
  line-height: 0.72;
  text-shadow: 0 12px 48px rgba(0, 15, 12, 0.5);
}

.title-snake,
.title-fight {
  display: block;
}

.title-snake {
  color: #f2fff8;
}

.title-fight {
  margin-left: 0.38em;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(164, 255, 216, 0.76);
}

.tagline {
  margin: clamp(1.7rem, 3.4vw, 2.8rem) 0 2.2rem;
  color: var(--muted);
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  line-height: 1.55;
}

.menu {
  width: min(100%, 420px);
}

.button {
  border: 0;
  border-radius: 0.8rem;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition:
    transform 180ms var(--ease-out),
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button:active {
  transform: translateY(0);
}

.button-primary {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.1rem 1rem 1.3rem;
  background: linear-gradient(115deg, #11865f, #39c98f);
  box-shadow: 0 12px 38px rgba(5, 104, 73, 0.36);
  text-transform: uppercase;
}

.button-primary:hover {
  box-shadow: 0 17px 46px rgba(20, 175, 123, 0.44);
}

.button-key {
  padding: 0.42rem 0.52rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.45rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.58rem;
  letter-spacing: 0.11em;
}

.menu-secondary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  margin-top: 0.6rem;
}

.button-secondary {
  padding: 0.78rem 0.5rem;
  border: 1px solid var(--line);
  background: rgba(4, 31, 25, 0.5);
  backdrop-filter: blur(14px);
  color: rgba(231, 251, 242, 0.72);
  font-size: 0.72rem;
}

.button-secondary:hover {
  border-color: rgba(159, 255, 213, 0.4);
  background: rgba(10, 67, 52, 0.7);
  color: white;
}

.build-note {
  margin: 1.1rem 0 0;
  color: rgba(205, 238, 223, 0.38);
  font-size: 0.67rem;
  letter-spacing: 0.04em;
}

.world-note {
  position: absolute;
  right: clamp(1.5rem, 5vw, 5rem);
  bottom: clamp(4.5rem, 10vh, 7rem);
  display: flex;
  gap: 0.85rem;
  align-items: center;
  animation: fade-in 1.5s 0.4s both;
}

.world-note-line {
  width: 2.5rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}

.world-note span,
.world-note strong {
  display: block;
  text-align: right;
}

.world-note span {
  color: var(--gold);
  font-size: 0.57rem;
  letter-spacing: 0.17em;
}

.world-note strong {
  margin-top: 0.28rem;
  color: rgba(231, 250, 241, 0.64);
  font-size: 0.68rem;
  font-weight: 500;
}

.footer {
  right: clamp(1.4rem, 5vw, 5rem);
  bottom: 1.4rem;
  left: clamp(1.4rem, 5vw, 5rem);
  display: flex;
  justify-content: space-between;
  color: rgba(203, 237, 222, 0.34);
  font-size: 0.58rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.footer kbd {
  padding: 0.16rem 0.3rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.25rem;
  font-family: inherit;
}

.loading-screen {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-content: center;
  background:
    radial-gradient(circle at 50% 45%, #0c4637, transparent 42%),
    #03140f;
  text-align: center;
  transition: opacity 600ms ease, visibility 600ms ease;
}

.loading-screen.is-complete {
  visibility: hidden;
  opacity: 0;
}

.loading-mark {
  display: flex;
  gap: 0.28rem;
  align-items: center;
  justify-content: center;
  height: 2rem;
}

.loading-mark span {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 999px;
  background: var(--mint);
  box-shadow: 0 0 18px rgba(169, 255, 218, 0.75);
  animation: loading-wave 1.15s ease-in-out infinite;
}

.loading-mark span:nth-child(2) {
  animation-delay: 100ms;
}

.loading-mark span:nth-child(3) {
  animation-delay: 200ms;
}

.loading-label {
  margin-top: 0.9rem;
  color: rgba(219, 248, 235, 0.48);
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.modal-backdrop {
  z-index: 8;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(1, 13, 10, 0.62);
  backdrop-filter: blur(13px);
}

.glass-card {
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background:
    linear-gradient(145deg, rgba(14, 63, 49, 0.76), rgba(3, 24, 19, 0.86));
  box-shadow: 0 25px 80px rgba(0, 10, 8, 0.5);
  backdrop-filter: blur(20px);
}

.modal {
  position: relative;
  width: min(92vw, 430px);
  max-height: calc(100dvh - 3rem);
  overflow-y: auto;
  padding: 2.2rem;
  animation: modal-arrive 300ms var(--ease-out) both;
}

.modal h2,
.preview-card h2,
.fatal-error h2 {
  margin: 0 0 1rem;
  font-family: "Arial Narrow", "Segoe UI", sans-serif;
  font-size: clamp(1.8rem, 5vw, 2.45rem);
  letter-spacing: -0.045em;
}

.icon-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: grid;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  place-items: center;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  font-size: 1.15rem;
}

.control-grid {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.5rem;
}

.control-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.key-cluster {
  padding: 0.55rem 0.4rem;
  border: 1px solid rgba(112, 235, 220, 0.32);
  border-radius: 0.5rem;
  background: rgba(36, 177, 151, 0.13);
  color: #b9fff0;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
}

.food-legend {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  margin-top: 1.35rem;
}

.food-legend-title {
  grid-column: 1 / -1;
  margin: 0;
  color: rgba(220, 246, 234, 0.5);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.food-legend > div {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.45rem;
  align-items: center;
  padding: 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 0.55rem;
  background: rgba(1, 18, 14, 0.25);
}

.food-legend strong {
  font-size: 0.67rem;
}

.food-legend small {
  grid-column: 2;
  color: rgba(220, 241, 232, 0.48);
  font-size: 0.55rem;
}

.bot-legend {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-top: 1rem;
}

.bot-legend > div {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.12rem 0.48rem;
  align-items: center;
  padding: 0.52rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.48rem;
  background: rgba(0, 0, 0, 0.12);
}

.bot-legend strong {
  font-size: 0.68rem;
}

.bot-legend small {
  grid-column: 2;
  color: rgba(220, 241, 232, 0.48);
  font-size: 0.52rem;
}

.bot-swatch {
  grid-row: 1 / span 2;
  width: 0.76rem;
  height: 0.76rem;
  transform: rotate(45deg);
}

.bot-grazer {
  border-radius: 50% 50% 32% 50%;
  background: #ff914d;
  box-shadow: 0 0 10px rgba(255, 145, 77, 0.56);
}

.bot-hunter {
  border-radius: 58% 12% 58% 12%;
  background: #ff4fb8;
  box-shadow: 0 0 11px rgba(255, 79, 184, 0.62);
}

.bot-brute {
  width: 0.9rem;
  height: 0.9rem;
  border: 2px solid #ffe2a2;
  background: #f0b44c;
  box-shadow: 0 0 12px rgba(240, 180, 76, 0.58);
}

.food-swatch {
  grid-row: 1 / span 2;
  display: block;
  border-radius: 999px;
}

.food-common {
  width: 0.62rem;
  height: 0.62rem;
  background: #ff4056;
  box-shadow: 0 0 9px rgba(255, 64, 86, 0.56);
}

.food-rare {
  width: 0.82rem;
  height: 0.82rem;
  background: #2f6bff;
  box-shadow: 0 0 12px rgba(47, 107, 255, 0.7);
}

.food-amethyst {
  width: 1rem;
  height: 1rem;
  border: 2px solid #ffb7ff;
  background: #d854ff;
  box-shadow: 0 0 15px rgba(216, 84, 255, 0.68);
}

.modal-footnote {
  margin: 1.5rem 0 0;
  color: rgba(220, 210, 240, 0.42);
  font-size: 0.72rem;
}

.record-empty {
  display: grid;
  min-height: 10rem;
  place-content: center;
  color: var(--muted);
  text-align: center;
}

.record-empty span {
  color: var(--gold);
  font-size: 2.2rem;
}

.record-empty p {
  max-width: 23ch;
  margin: 0.7rem 0 0;
  font-size: 0.88rem;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.setting-row strong,
.setting-row small {
  display: block;
}

.setting-row strong {
  font-size: 0.88rem;
}

.setting-row small {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.68rem;
}

.setting-row input[type="checkbox"] {
  width: 2.8rem;
  height: 1.45rem;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: background 180ms ease;
}

.setting-row input[type="checkbox"]::after {
  display: block;
  width: 1rem;
  height: 1rem;
  margin: 0.17rem;
  border-radius: 50%;
  background: #d7cee8;
  content: "";
  transition: transform 180ms var(--ease-out);
}

.setting-row input[type="checkbox"]:checked {
  background: var(--jade);
}

.setting-row input[type="checkbox"]:checked::after {
  transform: translateX(1.3rem);
  background: white;
}

.setting-row select {
  width: min(12rem, 48vw);
  padding: 0.62rem 2rem 0.62rem 0.75rem;
  border: 1px solid rgba(169, 255, 218, 0.22);
  border-radius: 0.55rem;
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--mint) 50%) calc(100% - 1rem) 50% / 5px 5px no-repeat,
    linear-gradient(135deg, var(--mint) 50%, transparent 50%) calc(100% - 0.7rem) 50% / 5px 5px no-repeat,
    rgba(3, 30, 24, 0.78);
  color: #effff7;
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
}

.setting-row select:focus-visible {
  border-color: var(--mint);
  outline: 2px solid rgba(169, 255, 218, 0.18);
  outline-offset: 2px;
}

.setting-row select option {
  background: #073128;
  color: #effff7;
}

.settings-modal {
  width: min(94vw, 780px);
  max-height: 92vh;
  padding: 1.55rem 2rem 1.3rem;
  overflow-y: auto;
  scrollbar-color: rgba(169, 255, 218, 0.28) transparent;
}

.settings-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.8rem;
}

.settings-group {
  min-width: 0;
}

.settings-modal h2 {
  margin-bottom: 0.6rem;
}

.settings-modal .setting-row {
  padding: 0.6rem 0;
}

.settings-section-title {
  margin: 0.15rem 0 0.25rem;
  color: var(--gold);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.setting-volume {
  gap: 1rem;
}

.range-control {
  display: grid;
  width: min(12rem, 44vw);
  grid-template-columns: 2.4rem 1fr;
  gap: 0.55rem;
  align-items: center;
}

.range-control output {
  color: var(--gold);
  font-size: 0.64rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.range-control input[type="range"] {
  width: 100%;
  height: 0.3rem;
  appearance: none;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(47, 157, 255, 0.76), rgba(216, 84, 255, 0.72));
  cursor: pointer;
}

.range-control input[type="range"]::-webkit-slider-thumb {
  width: 0.9rem;
  height: 0.9rem;
  appearance: none;
  border: 2px solid #effff7;
  border-radius: 50%;
  background: #d854ff;
  box-shadow: 0 0 10px rgba(216, 84, 255, 0.45);
}

.audio-note {
  margin: 0.85rem 0 0;
  color: rgba(220, 241, 232, 0.4);
  font-size: 0.62rem;
}

.preview-screen {
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.preview-card {
  width: min(92vw, 520px);
  padding: clamp(2rem, 5vw, 3.2rem);
  text-align: center;
}

.preview-card p:not(.eyebrow) {
  margin: 0 auto 1.8rem;
  color: var(--muted);
  line-height: 1.7;
}

.preview-card .button {
  width: auto;
  margin: auto;
  padding-inline: 1.5rem;
}

.gameplay-screen {
  inset: 0;
  pointer-events: none;
}

.kill-card {
  position: absolute;
  z-index: 6;
  top: clamp(4.6rem, 8vh, 6.2rem);
  left: 50%;
  display: grid;
  min-width: min(19rem, calc(100vw - 2rem));
  padding: 0.72rem 1.4rem 0.8rem;
  transform: translate(-50%, -18px) scale(0.96);
  border: 1px solid rgba(255, 122, 202, 0.34);
  border-radius: 0.8rem;
  opacity: 0;
  background:
    linear-gradient(90deg, transparent, rgba(91, 35, 119, 0.76), transparent),
    rgba(7, 13, 28, 0.76);
  box-shadow:
    0 14px 44px rgba(0, 0, 0, 0.36),
    0 0 32px rgba(216, 84, 255, 0.12);
  backdrop-filter: blur(8px);
  text-align: center;
  transition:
    opacity 180ms ease,
    transform 220ms var(--ease-out);
}

.kill-card.is-visible {
  transform: translate(-50%, 0) scale(1);
  opacity: 1;
}

.kill-card.is-leaving {
  transform: translate(-50%, -10px) scale(0.98);
  opacity: 0;
}

.kill-card-label {
  color: #ff7aca;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.24em;
}

.kill-card strong {
  margin-top: 0.12rem;
  color: #fff5fd;
  font-family: "Arial Narrow", "Segoe UI", sans-serif;
  font-size: 1.28rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.kill-card small {
  color: rgba(221, 228, 250, 0.56);
  font-size: 0.59rem;
  letter-spacing: 0.06em;
}

.kill-card b {
  color: rgba(245, 247, 255, 0.82);
}

.kill-card em {
  margin-top: 0.22rem;
  color: #8fb8ff;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.app.is-playing .vignette {
  background:
    linear-gradient(180deg, rgba(1, 15, 12, 0.24), transparent 32%),
    radial-gradient(circle at 50% 48%, transparent 48%, rgba(0, 12, 9, 0.46) 112%);
}

.app.is-playing .footer {
  display: none;
}

.app.is-playing .topbar {
  opacity: 0.78;
}

.movement-status {
  position: absolute;
  top: clamp(5.2rem, 11vh, 7rem);
  left: clamp(1.4rem, 4vw, 4rem);
  width: min(270px, calc(100vw - 2.8rem));
  padding: 0.85rem 0.9rem;
  border: 1px solid rgba(170, 255, 219, 0.14);
  border-radius: 0.85rem;
  background: rgba(2, 24, 19, 0.34);
  box-shadow: 0 14px 40px rgba(0, 12, 9, 0.2);
  backdrop-filter: blur(6px);
}

.hud-kicker {
  margin: 0;
  color: var(--mint);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hud-heading {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.hud-mode {
  padding: 0.25rem 0.42rem;
  border: 1px solid rgba(108, 233, 223, 0.18);
  border-radius: 999px;
  color: rgba(184, 255, 232, 0.68);
  font-size: 0.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hud-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.hud-stats p {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin: 0;
  padding: 0.65rem 0.7rem;
  border: 1px solid rgba(181, 255, 223, 0.1);
  border-radius: 0.55rem;
  background: rgba(1, 18, 14, 0.24);
}

.hud-stats span,
.boost-meter span,
.lunge-meter span,
.zoom-readout span,
.zoom-readout small {
  color: rgba(210, 241, 228, 0.52);
  font-size: 0.57rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hud-stats strong {
  color: #effff7;
  font-size: 0.82rem;
}

.boost-meter {
  margin-top: 0.8rem;
}

.lunge-meter {
  margin-top: 0.65rem;
}

.boost-meter > div:first-child,
.lunge-meter > div:first-child {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.38rem;
}

.boost-meter strong {
  color: var(--gold);
  font-size: 0.64rem;
}

.lunge-meter strong {
  color: #a9c8ff;
  font-size: 0.64rem;
  text-transform: capitalize;
}

.boost-track {
  height: 0.26rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}

.lunge-track {
  height: 0.23rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}

.boost-track span {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(1);
  transform-origin: left center;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--mint), var(--gold));
  box-shadow: 0 0 14px rgba(108, 233, 223, 0.5);
  transition: transform 90ms linear;
}

.lunge-track span {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(1);
  transform-origin: left center;
  border-radius: inherit;
  transition: transform 90ms linear;
}

.lunge-track span {
  background: linear-gradient(90deg, #6557c8, #8fb8ff);
  box-shadow: 0 0 12px rgba(113, 136, 255, 0.4);
}

.app.is-lunging .lunge-meter {
  filter: brightness(1.35);
}

.app.is-super-lunging .lunge-meter {
  filter: brightness(1.65) saturate(1.35);
}

.app.is-super-lunging .lunge-track span {
  background: linear-gradient(90deg, #5c72ff, #b059ff, #f2a7ff);
  box-shadow: 0 0 18px rgba(174, 88, 255, 0.72);
}

.movement-hint {
  position: absolute;
  bottom: clamp(1.5rem, 5vh, 3.5rem);
  left: clamp(1.4rem, 4vw, 4rem);
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 0.5rem 1rem;
  padding: 0.85rem 0.95rem;
  border-left: 1px solid rgba(165, 255, 218, 0.25);
  background: linear-gradient(90deg, rgba(1, 20, 16, 0.48), transparent);
}

.movement-hint p {
  display: flex;
  gap: 0.28rem;
  align-items: center;
  margin: 0;
}

.movement-hint kbd {
  min-width: 1.55rem;
  padding: 0.23rem 0.32rem;
  border: 1px solid rgba(186, 255, 226, 0.18);
  border-radius: 0.3rem;
  background: rgba(7, 49, 39, 0.58);
  color: rgba(237, 255, 247, 0.84);
  font-family: inherit;
  font-size: 0.52rem;
  font-weight: 700;
  text-align: center;
}

.movement-hint span {
  margin-left: 0.2rem;
  color: rgba(212, 239, 227, 0.52);
  font-size: 0.58rem;
}

.zoom-readout {
  position: absolute;
  right: clamp(1.4rem, 4vw, 4rem);
  bottom: clamp(1.5rem, 5vh, 3.5rem);
  display: grid;
  justify-items: end;
  min-width: 8rem;
  padding: 0.8rem 0.9rem;
  border-right: 1px solid rgba(108, 233, 223, 0.3);
  background: linear-gradient(270deg, rgba(1, 24, 20, 0.52), transparent);
}

.zoom-readout strong {
  margin: 0.15rem 0;
  color: var(--cyan);
  font-size: 1.1rem;
}

.phase-boundary {
  position: absolute;
  right: 50%;
  bottom: 1rem;
  margin: 0;
  transform: translateX(50%);
  color: rgba(220, 247, 235, 0.52);
  text-shadow: 0 1px 8px rgba(0, 18, 14, 0.75);
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.game-over {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(92vw, 380px);
  padding: 2rem;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  text-align: center;
  animation: modal-arrive 300ms var(--ease-out) both;
}

.game-over h2 {
  margin: 0.35rem 0 0.75rem;
  font-family: "Arial Narrow", "Segoe UI", sans-serif;
  font-size: clamp(2rem, 5vw, 2.7rem);
  letter-spacing: -0.055em;
}

.game-over > p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.game-over-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin: 1.35rem 0;
}

.game-over-stats p {
  margin: 0;
  padding: 0.8rem;
  border: 1px solid rgba(181, 255, 223, 0.13);
  border-radius: 0.55rem;
  background: rgba(1, 18, 14, 0.32);
}

.game-over-stats span,
.game-over-stats strong {
  display: block;
}

.game-over-stats span {
  color: rgba(210, 241, 228, 0.52);
  font-size: 0.57rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.game-over-stats strong {
  margin-top: 0.25rem;
  color: var(--gold);
  font-size: 1.25rem;
}

.game-over-actions {
  display: grid;
  gap: 0.6rem;
}

.game-over-actions .button-secondary {
  padding: 0.78rem;
}

.boost-wash {
  z-index: 2;
  inset: 0;
  opacity: var(--boost-intensity, 0);
  pointer-events: none;
  background:
    radial-gradient(
      circle at 50% 56%,
      transparent 34%,
      rgba(93, 255, 221, 0.055) 62%,
      rgba(86, 242, 215, 0.2) 100%
    ),
    repeating-conic-gradient(
      from 2deg at 50% 56%,
      transparent 0deg 10.5deg,
      rgba(196, 255, 236, 0.035) 10.7deg 11deg
    );
  mix-blend-mode: screen;
  transition: opacity 40ms linear;
}


.diagnostics {
  z-index: 10;
  top: 5rem;
  right: 1.5rem;
  width: 230px;
  padding: 0.85rem;
  border: 1px solid rgba(169, 255, 218, 0.22);
  border-radius: 0.65rem;
  background: rgba(5, 8, 17, 0.86);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.35);
  color: #dfffee;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.66rem;
}

.diagnostics > div {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.diagnostic-status {
  color: var(--mint);
}

.diagnostics dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.42rem;
  margin: 0;
}

.diagnostics dt {
  color: rgba(223, 255, 238, 0.48);
}

.diagnostics dd {
  margin: 0;
  text-align: right;
}

.diagnostics > p {
  margin: 0.75rem 0 0;
  color: rgba(223, 255, 238, 0.38);
}

.fatal-error {
  z-index: 30;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: start;
  padding: clamp(2rem, 10vw, 9rem);
  background:
    radial-gradient(circle at 70% 40%, rgba(26, 125, 96, 0.28), transparent 40%),
    #031611;
}

.fatal-error > p:not(.eyebrow) {
  max-width: 52ch;
  color: var(--muted);
  line-height: 1.7;
}

.fatal-error .button {
  width: auto;
  margin-top: 1rem;
}

.is-hidden {
  display: none !important;
}

@keyframes title-arrive {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes modal-arrive {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

@keyframes loading-wave {
  0%,
  100% {
    transform: translateY(0) scale(0.78);
    opacity: 0.42;
  }
  50% {
    transform: translateY(-0.45rem) scale(1);
    opacity: 1;
  }
}

@media (max-width: 760px), (max-height: 680px) {
  .title-screen {
    grid-template-columns: 1fr;
    padding-top: 6.5rem;
  }

  .title-copy {
    align-self: center;
  }

  h1 {
    font-size: clamp(3.7rem, 19vw, 6rem);
  }

  .world-note {
    display: none;
  }

  .movement-status {
    top: 4.4rem;
  }

  .movement-hint {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .phase-boundary {
    display: none;
  }

  .settings-columns {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .bot-legend {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 761px) and (max-height: 760px) {
  #how-to-play {
    padding: 1.25rem 2.2rem;
  }

  #how-to-play h2 {
    margin-bottom: 0.55rem;
    font-size: 2.05rem;
  }

  #how-to-play .control-grid {
    gap: 0.38rem 0.75rem;
    margin-top: 0.65rem;
  }

  #how-to-play .key-cluster {
    padding-block: 0.38rem;
  }

  #how-to-play .food-legend {
    gap: 0.4rem;
    margin-top: 0.72rem;
  }

  #how-to-play .food-legend > div,
  #how-to-play .bot-legend > div {
    padding: 0.42rem;
  }

  #how-to-play .bot-legend {
    gap: 0.4rem;
    margin-top: 0.62rem;
  }

  #how-to-play .modal-footnote {
    margin-top: 0.7rem;
    font-size: 0.65rem;
    line-height: 1.35;
  }
}

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