@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=IBM+Plex+Mono:wght@500;600;700&family=Manrope:wght@500;700;800&display=swap');

:root {
  --night: #07120f;
  --ink: #f2f0df;
  --muted: #b9b08e;
  --grass: #54c46e;
  --moss: #20583b;
  --ember: #f26a3d;
  --gold: #efc35c;
  --aqua: #58dfcf;
  --danger: #f34e55;
  --panel: rgba(8, 18, 16, 0.72);
  --panel-solid: rgba(8, 18, 16, 0.92);
  --border: rgba(239, 195, 92, 0.3);
  --font-body: 'Manrope', system-ui, sans-serif;
  --font-display: 'DM Serif Display', serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: var(--night);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

button,
a {
  font: inherit;
}

#app {
  position: relative;
  isolation: isolate;
}

#gameCanvas {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  background: var(--night);
  touch-action: none;
}

.moon-haze,
.pixel-grain,
.lightning-flash,
.damage-flash,
.labels-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.moon-haze {
  z-index: 1;
  opacity: 0.74;
  background:
    radial-gradient(circle at 72% 16%, rgba(242, 240, 223, 0.28), transparent 11%),
    radial-gradient(circle at 45% 55%, rgba(84, 196, 110, 0.12), transparent 35%);
  mix-blend-mode: screen;
}

.pixel-grain {
  z-index: 5;
  opacity: 0.14;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 4px 4px;
  mask-image: radial-gradient(circle, black 48%, transparent 87%);
}

.lightning-flash {
  z-index: 4;
  opacity: 0;
  background:
    radial-gradient(circle at 48% 18%, rgba(255, 255, 255, 0.72), transparent 17%),
    linear-gradient(180deg, rgba(183, 220, 255, 0.5), rgba(255, 255, 255, 0.16) 48%, transparent 82%);
  mix-blend-mode: screen;
  transition: opacity 80ms ease-out;
}

.damage-flash {
  z-index: 9;
  opacity: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.62), rgba(243, 78, 85, 0.46) 44%, transparent 72%);
  transition: opacity 150ms ease;
}

.damage-flash.show {
  opacity: 1;
}

.labels-layer {
  z-index: 7;
  overflow: hidden;
}

.game-bar {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: 14px;
  right: 14px;
  z-index: 12;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(14, 32, 24, 0.86), rgba(4, 12, 15, 0.66)),
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(239, 195, 92, 0.08) 18px 19px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38), inset 0 -1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(14px);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(239, 195, 92, 0.26);
  border-radius: 8px;
  background: rgba(239, 195, 92, 0.08);
}

.brand-mark img {
  display: block;
  width: 32px;
  height: auto;
  filter: drop-shadow(0 0 12px rgba(84, 196, 110, 0.5));
}

.game-title {
  min-width: 0;
}

.game-title span,
.readout span,
.typing-strip span,
.message-panel p {
  display: block;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.game-title h1 {
  overflow: hidden;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.42rem, 2.8vw, 2rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.1;
  text-overflow: ellipsis;
  text-shadow: 0 0 18px rgba(88, 223, 207, 0.34);
  white-space: nowrap;
}

.game-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button,
.message-panel > button {
  min-height: 44px;
  border: 1px solid rgba(239, 195, 92, 0.38);
  border-radius: 8px;
  background: rgba(239, 195, 92, 0.1);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  transition: transform 160ms ease, border-color 160ms ease, filter 160ms ease;
}

.icon-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  font-family: var(--font-mono);
  font-size: 0.94rem;
}

.svg-button {
  overflow: hidden;
  padding: 0;
  background:
    radial-gradient(circle at 32% 26%, rgba(88, 223, 207, 0.18), transparent 34%),
    rgba(239, 195, 92, 0.1);
}

.button-svg {
  width: 34px;
  height: 34px;
  overflow: visible;
}

.button-ring {
  fill: rgba(7, 18, 15, 0.52);
  stroke: rgba(239, 195, 92, 0.42);
  stroke-width: 2;
  transform-origin: 24px 24px;
  transition: fill 180ms ease, stroke 180ms ease, transform 180ms ease;
}

.svg-button:not(:disabled):hover .button-ring {
  fill: rgba(88, 223, 207, 0.13);
  stroke: rgba(88, 223, 207, 0.82);
  transform: scale(1.04);
}

.play-glyph,
.pause-glyph rect,
.speaker-glyph {
  fill: currentColor;
  transform-origin: 24px 24px;
  transition: opacity 170ms ease, transform 210ms cubic-bezier(0.2, 0.9, 0.2, 1), fill 170ms ease;
}

.transport-button .pause-glyph {
  opacity: 0;
  transform: scaleX(0.72);
  transform-origin: 24px 24px;
  transition: opacity 170ms ease, transform 210ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.transport-button .play-glyph {
  opacity: 1;
  transform: translateX(1px) scale(1);
}

.transport-button.is-playing .pause-glyph {
  opacity: 1;
  transform: scaleX(1);
}

.transport-button.is-playing .play-glyph {
  opacity: 0;
  transform: translateX(5px) scale(0.62);
}

.sound-wave,
.mute-slash {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sound-wave {
  stroke-width: 2.4;
  transform-origin: 26px 24px;
}

.sound-wave-one {
  animation: sound-wave-pulse 950ms ease-in-out infinite;
}

.sound-wave-two {
  animation: sound-wave-pulse 950ms ease-in-out 130ms infinite;
}

.mute-slash {
  opacity: 0;
  stroke: var(--danger);
  stroke-width: 3.2;
  stroke-dasharray: 29;
  stroke-dashoffset: 29;
  filter: drop-shadow(0 0 5px rgba(243, 78, 85, 0.5));
  transition: opacity 170ms ease, stroke-dashoffset 210ms ease;
}

.icon-button:not(:disabled):hover,
.message-panel > button:hover {
  border-color: rgba(88, 223, 207, 0.74);
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.icon-button:disabled {
  cursor: default;
  opacity: 0.36;
}

.icon-button.is-muted {
  color: var(--muted);
}

.icon-button.is-muted .sound-wave {
  opacity: 0.2;
  animation-play-state: paused;
  transform: translateX(-2px) scaleX(0.62);
}

.icon-button.is-muted .mute-slash {
  opacity: 1;
  stroke-dashoffset: 0;
}

.hud-grid {
  position: fixed;
  top: calc(max(14px, env(safe-area-inset-top)) + 82px);
  left: 14px;
  z-index: 11;
  display: grid;
  width: min(238px, calc(100vw - 28px));
  gap: 8px;
  pointer-events: none;
}

.readout {
  display: grid;
  grid-template-columns: minmax(72px, 1fr) auto;
  align-items: baseline;
  gap: 10px;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid rgba(88, 223, 207, 0.22);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: inset 0 0 18px rgba(88, 223, 207, 0.06);
  backdrop-filter: blur(10px);
}

.readout strong {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}

.life-readout {
  grid-template-columns: auto minmax(122px, auto);
}

.life-meter {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  min-width: 122px;
  min-height: 24px;
}

.life-heart {
  display: block;
  width: 22px;
  height: 22px;
  transform-origin: center;
}

.life-heart svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 0 8px rgba(243, 78, 85, 0.28));
}

.life-heart .heart-shell {
  fill: rgba(242, 240, 223, 0.1);
  stroke: rgba(242, 240, 223, 0.56);
  stroke-width: 1.5;
}

.life-heart .heart-fill {
  fill: var(--danger);
  stroke: rgba(255, 232, 190, 0.86);
  stroke-width: 1;
  transition: clip-path 260ms cubic-bezier(0.2, 0.9, 0.2, 1), filter 160ms ease;
}

.life-heart.is-full .heart-fill {
  clip-path: inset(0 0 0 0);
}

.life-heart.is-half .heart-fill {
  clip-path: inset(0 50% 0 0);
}

.life-heart.is-empty .heart-fill {
  clip-path: inset(0 100% 0 0);
  filter: saturate(0.4);
}

.life-heart.is-hit {
  animation: heart-hit 420ms ease;
}

.life-heart.is-hit .heart-shell {
  animation: heart-shell-flash 420ms ease;
}

.typing-strip {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 12;
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: min(680px, calc(100vw - 28px));
  min-height: 58px;
  padding: 10px 14px;
  border: 1px solid rgba(239, 195, 92, 0.42);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(8, 18, 16, 0.86), rgba(33, 15, 15, 0.78));
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.4), inset 0 0 24px rgba(242, 106, 61, 0.08);
  transform: translateX(-50%);
  backdrop-filter: blur(14px);
}

.typing-strip strong {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: clamp(1rem, 3vw, 1.28rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.typing-strip small {
  color: var(--aqua);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.typing-strip.mistake {
  border-color: rgba(243, 78, 85, 0.82);
  animation: shake 190ms linear;
}

.message-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 14;
  display: grid;
  width: min(460px, calc(100vw - 36px));
  gap: 14px;
  padding: 24px;
  border: 1px solid rgba(239, 195, 92, 0.4);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(10, 28, 20, 0.94), rgba(9, 11, 15, 0.9)),
    repeating-linear-gradient(0deg, transparent 0 22px, rgba(84, 196, 110, 0.08) 22px 23px);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.52), inset 0 0 30px rgba(88, 223, 207, 0.07);
  transform: translate(-50%, -50%);
  backdrop-filter: blur(18px);
}

.message-panel[hidden] {
  display: none;
}

.message-panel h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 10vw, 4.8rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 0.96;
  text-wrap: balance;
}

.message-panel .message-copy {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.45;
  text-transform: none;
  white-space: pre-line;
}

.message-panel.is-cleared .message-copy {
  font-size: 0.84rem;
  line-height: 1.7;
}

.message-score {
  color: var(--aqua);
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
}

.message-panel > button {
  width: 100%;
  padding: 0 18px;
  background: linear-gradient(135deg, rgba(242, 106, 61, 0.92), rgba(239, 195, 92, 0.92));
  color: #1a120b;
}

.support-link {
  justify-self: center;
  color: rgba(242, 240, 223, 0.58);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 160ms ease, opacity 160ms ease;
}

.support-link:hover,
.support-link:focus-visible {
  color: var(--gold);
}

.word-tag {
  position: absolute;
  display: grid;
  min-width: 104px;
  max-width: 210px;
  gap: 3px;
  padding: 7px 9px 8px;
  border: 1px solid rgba(242, 240, 223, 0.38);
  border-radius: 7px;
  background: rgba(4, 9, 10, 0.74);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38), inset 0 0 18px rgba(88, 223, 207, 0.06);
  color: var(--ink);
  font-family: var(--font-mono);
  line-height: 1;
  text-align: center;
  text-shadow: 0 1px 0 #000;
  transform: translate(-50%, -100%);
  transform-origin: center bottom;
  transition: border-color 100ms ease, background 100ms ease, box-shadow 100ms ease, filter 100ms ease, opacity 100ms ease;
}

.word-tag .name {
  color: var(--gold);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.word-tag .prompt-kind {
  justify-self: center;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(88, 223, 207, 0.12);
  color: var(--aqua);
  font-size: 0.54rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.1;
  text-transform: uppercase;
}

.word-tag .definition {
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.35;
  white-space: normal;
}

.word-tag .prompt {
  font-size: clamp(0.82rem, 2vw, 1.05rem);
  font-weight: 700;
  overflow-wrap: break-word;
}

.word-tag .typed {
  color: var(--aqua);
}

.word-tag .remaining {
  color: var(--ink);
}

.word-tag .given-tok {
  color: rgba(242, 240, 223, 0.35);
}

.word-tag .given-sup {
  color: rgba(242, 240, 223, 0.28);
}

.word-tag .threat-meter {
  display: block;
  width: 100%;
  height: 3px;
  margin-top: 2px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(242, 240, 223, 0.12);
}

.word-tag .threat-meter i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--aqua), var(--gold));
  transform: scaleX(var(--threat-progress, 0));
  transform-origin: left;
  transition: transform 120ms linear, background 120ms ease;
}

.word-tag::after {
  position: absolute;
  left: 50%;
  bottom: -18px;
  width: 1px;
  height: 18px;
  background: linear-gradient(rgba(242, 240, 223, 0.6), rgba(242, 240, 223, 0));
  content: '';
  transform: translateX(-50%);
}

.word-tag.is-target {
  border-color: rgba(88, 223, 207, 0.9);
  background: rgba(7, 24, 25, 0.9);
  box-shadow: 0 0 0 1px rgba(88, 223, 207, 0.42), 0 0 28px rgba(88, 223, 207, 0.34), inset 0 0 22px rgba(88, 223, 207, 0.1);
  filter: brightness(1.1);
}

.word-tag.is-target .prompt-kind {
  background: rgba(88, 223, 207, 0.2);
  color: #d7fffa;
}

.word-tag.is-target::after {
  bottom: -24px;
  height: 24px;
  background: linear-gradient(rgba(88, 223, 207, 0.92), rgba(88, 223, 207, 0));
  box-shadow: 0 0 12px rgba(88, 223, 207, 0.46);
}

.word-tag.is-warning {
  border-color: rgba(239, 195, 92, 0.68);
}

.word-tag.is-warning .threat-meter i {
  background: linear-gradient(90deg, var(--gold), var(--ember));
}

.word-tag.is-danger {
  border-color: rgba(243, 78, 85, 0.86);
  background: rgba(29, 8, 10, 0.88);
}

.word-tag.is-danger .threat-meter i,
.word-tag.is-critical .threat-meter i {
  background: linear-gradient(90deg, var(--ember), var(--danger));
}

.word-tag.is-critical {
  animation: critical-pulse 520ms ease-in-out infinite;
}

.word-tag.is-hidden {
  opacity: 0;
}

.word-tag.is-revealing {
  animation: label-pop 280ms ease-out;
}

.word-tag.is-medic {
  border-color: rgba(255, 143, 179, 0.8);
  background:
    linear-gradient(135deg, rgba(58, 7, 24, 0.92), rgba(4, 14, 14, 0.86)),
    linear-gradient(90deg, rgba(255, 49, 95, 0.22), transparent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.36), 0 0 24px rgba(255, 49, 95, 0.3), inset 0 0 18px rgba(242, 240, 223, 0.08);
}

.word-tag.is-medic .prompt-kind {
  background: rgba(255, 49, 95, 0.24);
  color: #ffe1ea;
}

.word-tag.is-medic .threat-meter i {
  background: linear-gradient(90deg, #ff8fb3, #ff315f);
}

.word-tag.is-boss {
  min-width: 160px;
  max-width: 300px;
  gap: 6px;
  padding: 10px 13px 11px;
  border-color: color-mix(in srgb, var(--boss-accent, var(--danger)) 62%, transparent);
  background:
    linear-gradient(135deg, rgba(22, 4, 4, 0.9), rgba(4, 9, 10, 0.88)),
    linear-gradient(90deg, color-mix(in srgb, var(--boss-accent, var(--danger)) 20%, transparent), transparent);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.48), inset 0 0 18px color-mix(in srgb, var(--boss-accent, var(--danger)) 16%, transparent);
}

.word-tag.is-boss .prompt-kind {
  background: color-mix(in srgb, var(--boss-accent, var(--danger)) 18%, transparent);
  color: color-mix(in srgb, var(--boss-glow, var(--gold)) 82%, white 18%);
}

.word-tag.is-boss .definition {
  font-size: 0.8rem;
}

.word-tag.is-boss .prompt {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
}

.word-tag.is-boss.is-target {
  border-color: color-mix(in srgb, var(--boss-accent, var(--danger)) 90%, white 10%);
  background:
    linear-gradient(135deg, rgba(36, 6, 6, 0.94), rgba(5, 18, 19, 0.9)),
    linear-gradient(90deg, color-mix(in srgb, var(--boss-accent, var(--danger)) 28%, transparent), transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--boss-accent, var(--danger)) 48%, transparent), 0 0 32px color-mix(in srgb, var(--boss-glow, var(--gold)) 32%, transparent), inset 0 0 24px color-mix(in srgb, var(--boss-accent, var(--danger)) 18%, transparent);
}

.word-tag.is-boss.is-danger {
  border-color: color-mix(in srgb, var(--boss-accent, var(--danger)) 82%, white 18%);
}

.word-tag[data-kind="equation"] .definition,
.word-tag[data-kind="equation"] .prompt-kind {
  color: #ffe39a;
}

.word-tag[data-kind="equation"] .definition {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.word-tag[data-kind="equation"] .prompt-kind {
  background: rgba(239, 195, 92, 0.18);
}

#comboValue.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.score-popup {
  position: fixed;
  z-index: 20;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0;
  pointer-events: none;
  text-shadow: 0 0 12px rgba(239, 195, 92, 0.72);
  transform: translate(-50%, -100%);
  animation: score-float 820ms ease-out forwards;
  white-space: nowrap;
}

@keyframes score-float {
  0% {
    opacity: 1;
    transform: translate(-50%, -100%);
  }

  70% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(-50%, calc(-100% - 48px));
  }
}

.run-glossary {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid rgba(88, 223, 207, 0.18);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
}

.run-glossary[hidden] {
  display: none;
}

.glossary-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 6px 10px;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(242, 240, 223, 0.06);
  align-items: baseline;
}

.glossary-item:last-child {
  border-bottom: none;
}

.glossary-item.is-defeated .gl-term {
  color: var(--aqua);
}

.glossary-item.is-leaked .gl-term {
  color: var(--ember);
}

.gl-term {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: lowercase;
}

.gl-def {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.35;
}

.glossary-item.is-equation {
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
}

.glossary-item.is-equation .gl-term {
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.keyboard-input {
  position: fixed;
  left: 50%;
  bottom: 0;
  width: 1px;
  height: 1px;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.score-popup.is-heal {
  color: #b9ffcf;
  text-shadow: 0 0 14px rgba(45, 212, 191, 0.58);
}

.score-popup.is-missed-heal {
  color: #ff8fb3;
  text-shadow: 0 0 14px rgba(255, 49, 95, 0.52);
}

.boss-banner {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 16;
  transform: translate(-50%, -50%);
  pointer-events: none;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 7vw, 4rem);
  font-weight: 400;
  color: var(--danger);
  text-align: center;
  text-shadow: 0 0 32px rgba(243, 78, 85, 0.62);
  letter-spacing: 0.04em;
  opacity: 0;
  white-space: nowrap;
}

.boss-banner.is-medic-hint {
  color: #ff8fb3;
  text-shadow: 0 0 32px rgba(255, 49, 95, 0.58);
}

.boss-banner.is-active {
  animation: boss-banner-flash 1.9s ease-out forwards;
}

@keyframes boss-banner-flash {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.72);
    letter-spacing: 0.12em;
  }

  18% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.04);
    letter-spacing: 0.04em;
  }

  48% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(-50%);
  }

  25% {
    transform: translateX(calc(-50% - 8px));
  }

  75% {
    transform: translateX(calc(-50% + 8px));
  }
}

@keyframes label-pop {
  0% {
    opacity: 0;
    filter: brightness(1.8);
  }

  45% {
    opacity: 1;
    filter: brightness(1.35);
  }

  100% {
    opacity: 1;
    filter: brightness(1);
  }
}

@keyframes critical-pulse {
  0%,
  100% {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38), inset 0 0 18px rgba(88, 223, 207, 0.06);
  }

  50% {
    box-shadow: 0 0 0 1px rgba(243, 78, 85, 0.56), 0 0 28px rgba(243, 78, 85, 0.34), inset 0 0 22px rgba(243, 78, 85, 0.12);
  }
}

@keyframes heart-hit {
  0% {
    transform: scale(1);
  }

  28% {
    transform: scale(1.26) rotate(-8deg);
    filter: brightness(1.5);
  }

  58% {
    transform: scale(0.86) rotate(5deg);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes heart-shell-flash {
  0%,
  100% {
    stroke: rgba(242, 240, 223, 0.56);
  }

  35% {
    stroke: rgba(255, 232, 190, 0.98);
  }
}

@keyframes sound-wave-pulse {
  0%,
  100% {
    opacity: 0.58;
    transform: scaleX(0.82);
  }

  50% {
    opacity: 1;
    transform: scaleX(1.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sound-wave {
    animation: none;
  }

  .button-ring,
  .play-glyph,
  .pause-glyph,
  .pause-glyph rect,
  .speaker-glyph,
  .mute-slash {
    transition: none;
  }
}

@media (max-width: 760px) {
  .game-bar {
    gap: 10px;
    min-height: 58px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .brand-mark img {
    width: 29px;
  }

  .hud-grid {
    top: calc(max(14px, env(safe-area-inset-top)) + 72px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: calc(100vw - 28px);
  }

  .readout {
    min-height: 38px;
  }

  .life-readout {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }

  .life-meter {
    justify-content: flex-start;
    min-width: 0;
  }

  .life-heart {
    width: 19px;
    height: 19px;
  }

  .typing-strip {
    grid-template-columns: 1fr;
    gap: 4px;
    min-height: 72px;
    text-align: center;
  }

  .typing-strip small {
    justify-self: center;
  }

  .message-panel {
    padding: 20px;
  }

}

@media (pointer: coarse) {
  .icon-button,
  .message-panel > button {
    min-height: 48px;
  }
}

/* — God Mode — */

.god-mode-veil {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(circle, transparent 52%, rgba(255, 196, 0, 0.08) 100%);
  opacity: 0;
  transition: opacity 1.4s ease;
}

body.is-god-mode .god-mode-veil {
  opacity: 1;
}

.god-mode-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 200, 50, 0.44);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(28, 20, 4, 0.92), rgba(18, 14, 2, 0.88));
  box-shadow: 0 0 16px rgba(255, 196, 0, 0.08), inset 0 0 12px rgba(255, 196, 0, 0.05);
  backdrop-filter: blur(10px);
  color: #ffd060;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-shadow: 0 0 10px rgba(255, 196, 0, 0.72);
  animation:
    godMode-appear 0.52s cubic-bezier(0.2, 0.9, 0.2, 1) both,
    godMode-pulse 2.8s ease-in-out 0.52s infinite;
}

@keyframes godMode-appear {
  from {
    opacity: 0;
    transform: scaleY(0.5);
    letter-spacing: 0.32em;
  }
  to {
    opacity: 1;
    transform: scaleY(1);
    letter-spacing: 0.14em;
  }
}

@keyframes godMode-pulse {
  0%, 100% {
    border-color: rgba(255, 200, 50, 0.38);
    box-shadow: 0 0 12px rgba(255, 196, 0, 0.06), inset 0 0 10px rgba(255, 196, 0, 0.03);
  }
  50% {
    border-color: rgba(255, 200, 50, 0.78);
    box-shadow: 0 0 30px rgba(255, 196, 0, 0.26), inset 0 0 18px rgba(255, 196, 0, 0.11);
  }
}

body.is-god-mode .life-heart svg {
  filter: drop-shadow(0 0 8px rgba(255, 196, 0, 0.58));
}

body.is-god-mode .life-heart .heart-fill {
  fill: #ffd060;
  stroke: rgba(255, 240, 150, 0.86);
}

body.is-god-mode .life-heart .heart-shell {
  stroke: rgba(255, 220, 80, 0.52);
}

body.is-god-mode .damage-flash.show {
  background: radial-gradient(circle, rgba(255, 255, 200, 0.58), rgba(255, 200, 50, 0.3) 44%, transparent 72%);
}
