:root {
  color-scheme: dark;
  --bg: #181b18;
  --panel: #17110c;
  --panel-2: #21170f;
  --ink: #fff8ea;
  --muted: #bba98d;
  --line: #4a3422;
  --rim: #8e6236;
  --wood: #2b1b11;
  --player: #61d8ff;
  --player-dim: rgba(97, 216, 255, 0.2);
  --enemy: #ff6b55;
  --enemy-dim: rgba(255, 107, 85, 0.2);
  --player-hp: #6f9eaa;
  --enemy-hp: #d29a72;
  --phosphor-off: #503721;
  --phosphor-on: #ff9f35;
  --phosphor-label: #f1b84b;
  --phosphor-hot: #ffd28c;
  --gold: var(--phosphor-label);
  --good: #9cff9a;
  --warn: #ffd166;
  --danger: #ff5b52;
  --mechanism-damage: #ff5b52;
  --mechanism-block: #4f7cff;
  --mechanism-heal: #64d98b;
  --mechanism-burn: #ff8a3d;
  --mechanism-poison: #b678ff;
  --mechanism-skip: #ffd166;
  --mechanism-rewind: #ff5bd1;
  --mechanism-resume: #a7f25c;
  --mechanism-pause: #8ee8ff;
  --mechanism-repeat: #d7def2;
  --glyph-line: var(--phosphor-off);
  --glyph-line-dim: rgba(80, 55, 33, 0.72);
  --glyph-post: "111111111111111111111111111111111111";
  --slot-w: 48px;
  --slot-h: 70px;
  --slot-font-size: 3.55rem;
  --beat-ms: 821.92ms;
  --half-beat-ms: 410.96ms;
  --quarter-beat-ms: 205.48ms;
  --beat-flash-ms: 131.51ms;
  --beat-echo-ms: 690.41ms;
  --double-beat-ms: 1643.84ms;
  --read-font: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    monospace;
  --device-font: "DSEG14Modern", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    monospace;
  --tooltip-font: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    monospace;
  --display-font: "DSEG14Modern", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    monospace;
  --seven-segment-font: "DSEG7Modern", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    monospace;
  --i18n-decorative-font: "DSEG14Modern", ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, monospace;
  --i18n-read-font: "Share Tech Mono", ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, monospace;
}

@font-face {
  font-family: "Share Tech Mono";
  src: url("assets/fonts/ShareTechMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DSEG14Modern";
  src: url("assets/fonts/DSEG14Modern-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "DSEG7Modern";
  src: url("assets/fonts/DSEG7Modern-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "DSEGWeather";
  src: url("assets/fonts/DSEGWeather.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Time Base Fusion Pixel Subset";
  src: url("assets/fonts/i18n/time-base-fusion-pixel-zh-hans.woff2?v=23") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Time Base Sarasa Mono SC Subset";
  src: url("assets/fonts/i18n/time-base-sarasa-mono-sc-regular.woff2?v=23") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Time Base Handjet Subset";
  src: url("assets/fonts/i18n/time-base-handjet-regular.woff2?v=3") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Time Base Iosevka Fixed Subset";
  src: url("assets/fonts/i18n/time-base-iosevka-fixed-regular.woff2?v=2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

[data-i18n-font="decorative"],
.i18n-decorative {
  font-family: var(--i18n-decorative-font);
}

[data-i18n-font="read"],
.i18n-readable {
  font-family: var(--i18n-read-font);
}

html[data-locale="zh-CN"] .i18n-readable {
  line-height: 1.45;
  letter-spacing: 0;
  word-break: normal;
  overflow-wrap: anywhere;
}

html[data-locale="zh-CN"] .i18n-decorative {
  letter-spacing: 0;
}

.i18n-canonical-token {
  font-family: "DSEG14Modern", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    monospace;
}

html[data-locale="ru"] .i18n-readable {
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
  overflow-wrap: anywhere;
}

.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;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--read-font);
}

/* VFD optics: smoked face glass, cathode filaments, and control-grid texture. */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 3000;
  pointer-events: none;
}

body::before {
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0 23px,
      rgba(255, 231, 190, 0.024) 23px 24px,
      transparent 24px 47px
    ),
    repeating-linear-gradient(
      60deg,
      rgba(191, 170, 135, 0.012) 0 1px,
      transparent 1px 8px
    ),
    repeating-linear-gradient(
      -60deg,
      rgba(191, 170, 135, 0.01) 0 1px,
      transparent 1px 8px
    ),
    radial-gradient(
      circle at center,
      rgba(255, 255, 255, 0.045) 0 0.35px,
      transparent 0.75px
    );
  background-size: auto, auto, auto, 4px 4px;
  mix-blend-mode: screen;
  opacity: 0.72;
}

body::after {
  background:
    linear-gradient(
      104deg,
      transparent 0 13%,
      rgba(255, 248, 232, 0.018) 20%,
      rgba(255, 248, 232, 0.006) 29%,
      transparent 38%
    ),
    linear-gradient(
      90deg,
      rgba(75, 39, 13, 0.028),
      transparent 42%,
      rgba(25, 71, 82, 0.014)
    ),
    radial-gradient(
      ellipse at 50% 46%,
      transparent 54%,
      rgba(0, 0, 0, 0.13) 78%,
      rgba(0, 0, 0, 0.31) 100%
    ),
    rgba(12, 8, 5, 0.025);
  -webkit-backdrop-filter: contrast(1.035) saturate(0.94);
  backdrop-filter: contrast(1.035) saturate(0.94);
}

body.start-active {
  overflow: hidden;
}

body.start-active .app {
  display: none;
}

.start-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--bg);
  font-family: var(--display-font);
}

.start-screen[hidden] {
  display: none;
}

.start-device {
  display: grid;
  gap: 12px;
  width: min(720px, calc(100vw - 24px));
  padding: 16px 20px;
  color: var(--muted);
}

.device-rail {
  width: 100%;
  overflow: hidden;
  color: var(--gold);
  font-family: var(--display-font);
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 0 9px currentColor;
  white-space: nowrap;
}

.device-rail.dim {
  color: var(--glyph-line-dim);
}

.dseg-frame,
.dseg-edge {
  position: absolute;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--glyph-line-dim);
  font-family: var(--display-font);
  font-size: 7px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 1px;
  pointer-events: none;
  text-shadow: 0 0 8px currentColor;
}

.dseg-frame {
  inset: 0;
  z-index: 30;
  overflow: hidden;
}

.dseg-edge.top,
.dseg-edge.bottom {
  left: 7px;
  right: 7px;
  height: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dseg-edge.top {
  top: 1px;
}

.dseg-edge.bottom {
  bottom: 1px;
}

.dseg-edge.left,
.dseg-edge.right {
  top: 7px;
  bottom: 7px;
  width: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.dseg-edge.left {
  left: 1px;
}

.dseg-edge.right {
  right: 1px;
}

.dseg-edge > b {
  display: block;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  line-height: 1;
}

.dseg-edge > b:nth-child(9n + 4) {
  opacity: 0.62;
}

.dseg-edge > b:nth-child(13n + 7) {
  opacity: 0.9;
  filter: brightness(1.16);
}

.start-device {
  position: relative;
}

.start-device-header {
  display: grid;
  justify-items: center;
  gap: 7px;
  text-align: center;
}

.start-device-header strong {
  color: var(--gold);
  font-family: var(--device-font);
  font-size: 2rem;
  line-height: 1;
  text-shadow: 0 0 18px rgba(241, 184, 75, 0.32);
}

.start-device-header > span {
  color: var(--ink);
  font-size: 0.8rem;
}

.start-device-header > small {
  color: var(--muted);
  font-family: var(--display-font);
  font-size: 0.64rem;
  line-height: 1.4;
}

.start-reactive-letter {
  color: var(--phosphor-hot);
  text-shadow:
    0 0 10px var(--gold),
    0 0 24px rgba(241, 184, 75, 0.44);
}

.start-countdown {
  position: relative;
  display: grid;
  grid-template-columns: 96px 1fr;
  align-items: center;
  justify-self: center;
  gap: 20px;
  width: min(420px, 100%);
  min-height: 100px;
  cursor: pointer;
  outline: none;
}

.start-countdown::before {
  content: "";
  position: absolute;
  inset: -8px -12px;
  border: 1px solid transparent;
  pointer-events: none;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease;
}

.start-countdown:focus-visible::before {
  border-color: var(--gold);
  box-shadow: 0 0 18px rgba(241, 184, 75, 0.18);
}

.start-countdown.awaiting-activation::before {
  border-color: rgba(241, 184, 75, 0.24);
  box-shadow:
    inset 0 0 22px rgba(241, 184, 75, 0.035),
    0 0 24px rgba(241, 184, 75, 0.07);
  animation: start-sync-frame-breathe 1800ms ease-in-out infinite;
}

.start-countdown.paused > strong {
  color: var(--muted);
  text-shadow: none;
}

.start-countdown.awaiting-activation > strong {
  color: var(--gold);
  text-shadow: 0 0 12px rgba(241, 184, 75, 0.46);
  animation: start-sync-digit-breathe 1800ms ease-in-out infinite;
}

.countdown-frame,
.start-countdown > strong {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  font-family: var(--seven-segment-font);
  font-size: 5.4rem;
  line-height: 1;
}

.countdown-frame {
  color: var(--phosphor-off);
  opacity: 0.56;
}

.start-countdown > strong {
  position: relative;
  color: var(--gold);
  text-shadow: 0 0 14px currentColor;
}

.countdown-copy {
  display: grid;
  gap: 8px;
}

.countdown-copy > span {
  color: var(--ink);
  font-size: 1rem;
}

.countdown-copy small {
  color: var(--muted);
  font-family: var(--display-font);
  font-size: 0.72rem;
}

#startActivationHint {
  color: var(--gold);
  font-size: 0.62rem;
  letter-spacing: 0.035em;
  text-shadow: 0 0 9px rgba(241, 184, 75, 0.28);
}

#startActivationHint[hidden] {
  display: none;
}

.start-diagnostic,
.id-field,
.avatar-label,
.avatar-picker,
.start-actions,
#profileError {
  transition:
    opacity 220ms ease,
    filter 220ms ease;
}

.start-screen.awaiting-sync .start-diagnostic,
.start-screen.awaiting-sync .id-field,
.start-screen.awaiting-sync .avatar-label,
.start-screen.awaiting-sync .avatar-picker,
.start-screen.awaiting-sync .start-actions,
.start-screen.awaiting-sync #profileError {
  opacity: 0.26;
  filter: saturate(0.35);
}

.start-screen.awaiting-sync button:disabled {
  opacity: 1;
}

@keyframes start-sync-frame-breathe {
  0%,
  100% {
    opacity: 0.58;
  }
  50% {
    opacity: 1;
  }
}

@keyframes start-sync-digit-breathe {
  0%,
  100% {
    opacity: 0.72;
  }
  50% {
    opacity: 1;
  }
}

.start-diagnostic {
  display: grid;
  gap: 5px;
  width: min(500px, 100%);
  justify-self: center;
  color: var(--muted);
  font-family: var(--device-font);
}

.start-diagnostic > span {
  position: relative;
  display: grid;
  grid-template-columns: max-content 1fr max-content;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
  font-size: 0.6rem;
  line-height: 1.25;
}

.start-diagnostic > span[hidden] {
  display: none;
}

.start-diagnostic > span::before {
  content: "";
  grid-column: 2;
  align-self: center;
  border-top: 1px dotted var(--glyph-line-dim);
}

.start-diagnostic small,
.start-diagnostic b {
  font: inherit;
  letter-spacing: 0.025em;
}

.start-diagnostic small {
  grid-column: 1;
}

.start-diagnostic b {
  grid-column: 3;
  color: var(--phosphor-label);
  font-family: var(--display-font);
  font-weight: 700;
  text-align: right;
  text-shadow: 0 0 6px rgba(241, 184, 75, 0.2);
}

.start-diagnostic.accepted b {
  color: var(--player);
  text-shadow: 0 0 8px rgba(97, 216, 255, 0.3);
}

.id-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.72rem;
}

.id-input-shell {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  color: var(--glyph-line);
  font-family: var(--display-font);
  font-size: 1.05rem;
}

.device-bracket {
  color: var(--gold);
  font-family: var(--display-font);
}

.id-field input {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  border: 0;
  background: transparent;
  color: transparent;
  caret-color: var(--gold);
  padding: 10px 0;
  font-family: var(--display-font);
  font-size: 1.05rem;
  text-transform: uppercase;
  outline: none;
  letter-spacing: 0;
}

.player-id-display {
  grid-column: 2;
  grid-row: 1;
  z-index: 1;
  overflow: hidden;
  color: var(--gold);
  pointer-events: none;
  white-space: nowrap;
}

.avatar-label {
  color: var(--muted);
  font-size: 0.72rem;
}

.avatar-picker {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}

.avatar-picker button {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: 1fr auto;
  align-items: center;
  min-width: 0;
  min-height: 64px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-family: "DSEGWeather";
  font-size: 2.2rem;
  padding: 0;
}

.avatar-picker button > span {
  grid-row: 1;
  color: var(--glyph-line-dim);
  font-family: var(--read-font);
  font-size: 0.72rem;
}

.avatar-picker button > b {
  grid-column: 2;
  grid-row: 1;
  color: inherit;
  font: inherit;
  font-weight: 400;
}

.avatar-picker button > small {
  grid-column: 1 / -1;
  grid-row: 2;
  color: var(--glyph-line-dim);
  font-family: var(--display-font);
  font-size: 0.52rem;
  line-height: 1;
}

.avatar-picker button.selected {
  color: var(--gold);
  text-shadow: 0 0 18px currentColor;
}

.start-countdown.countdown-no-signal .countdown-copy {
  opacity: 0.7;
}

.start-screen button:hover {
  background: transparent;
  color: var(--gold);
}

.start-screen button::before,
.start-screen button::after {
  content: none;
}

.start-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  gap: 8px;
}

.start-actions button {
  justify-self: center;
  display: inline-flex;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--gold);
  font-family: var(--read-font);
  font-size: 1rem;
  padding: 8px 12px;
}

.start-route-hint {
  color: var(--muted);
  font-family: var(--read-font);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  text-align: center;
}

#profileError {
  min-height: 1em;
  color: var(--enemy);
  font-family: var(--read-font);
  font-size: 0.68rem;
  text-align: center;
}

.tempo-controls {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 2600;
  display: grid;
  gap: 16px;
  width: min(390px, calc(100vw - 28px));
  padding: 22px;
  border: 1px solid var(--rim);
  background:
    linear-gradient(rgba(255, 159, 53, 0.035), rgba(255, 159, 53, 0.015)),
    var(--bg);
  box-shadow:
    0 0 0 9999px rgba(8, 9, 7, 0.82),
    0 0 36px rgba(241, 184, 75, 0.18);
  color: var(--ink);
  font-family: var(--read-font);
  transform: translate(-50%, -50%);
  max-height: calc(100dvh - 28px);
  overflow-y: auto;
}

.tempo-controls[hidden] {
  display: none;
}

.tempo-controls header,
.tempo-controls label,
.tempo-controls > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.tempo-controls header label {
  flex: 1;
}

.tempo-controls label span,
.tempo-controls small {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.tempo-controls strong {
  color: var(--gold);
  font-family: var(--display-font);
}

.tempo-controls input {
  width: 100%;
  accent-color: var(--gold);
}

.tempo-controls button,
.tempo-button {
  border: 0;
  background: transparent;
  color: var(--gold);
  font-family: var(--read-font);
  cursor: pointer;
  white-space: nowrap;
}

.locale-settings {
  display: grid;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--rim);
}

.locale-settings label {
  display: block;
  color: var(--gold);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.locale-settings select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--rim);
  border-radius: 0;
  background: var(--bg);
  color: var(--ink);
  padding: 8px 10px;
  font-size: max(16px, 0.9rem);
}

.locale-settings select:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.locale-settings .locale-partial-notice {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
  letter-spacing: 0;
}

.guided-run-guide {
  position: fixed;
  inset: 0;
  z-index: 1500;
  pointer-events: none;
}

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

.guided-run-card {
  position: absolute;
  bottom: 20px;
  left: 50%;
  display: grid;
  gap: 8px;
  width: min(520px, calc(100vw - 28px));
  padding: 16px 18px;
  border: 1px solid var(--gold);
  background: rgba(16, 14, 10, 0.97);
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.56),
    0 0 20px rgba(241, 184, 75, 0.13);
  color: var(--muted);
  font-family: var(--tooltip-font);
  pointer-events: auto;
  transform: translateX(-50%);
}

.guided-run-card > small {
  color: var(--gold);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
}

.guided-run-card > strong {
  color: var(--ink);
  font-size: 1rem;
  letter-spacing: 0.06em;
}

.guided-run-card p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
}

.guided-run-card > div {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.guided-run-card button {
  border: 0;
  background: transparent;
  color: var(--gold);
  font-family: var(--tooltip-font);
  cursor: pointer;
}

.guided-run-card button:disabled {
  color: var(--glyph-line-dim);
  cursor: default;
}

.guided-run-target,
.guided-run-reference {
  position: relative !important;
}

.guided-run-target {
  z-index: 1503 !important;
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  background-color: rgba(241, 184, 75, 0.055) !important;
  box-shadow: 0 0 24px rgba(241, 184, 75, 0.36) !important;
  animation: guided-run-pulse var(--double-beat-ms) step-end infinite;
}

.guided-run-target.guided-run-spotlight-anchor {
  z-index: 1502 !important;
  box-shadow:
    0 0 0 9999px rgba(8, 9, 7, 0.54),
    0 0 24px rgba(241, 184, 75, 0.36) !important;
}

.guided-run-choice-group {
  outline-offset: 6px;
  background-color: rgba(241, 184, 75, 0.035) !important;
}

.guided-run-reference {
  z-index: 1504 !important;
  outline: 1px dashed rgba(156, 255, 154, 0.82);
  outline-offset: 3px;
  background-color: rgba(156, 255, 154, 0.025) !important;
  box-shadow: 0 0 14px rgba(156, 255, 154, 0.16) !important;
}

@keyframes guided-run-pulse {
  50% {
    outline-color: var(--phosphor-hot);
    filter: brightness(1.18);
  }
}

@media (max-width: 620px) {
  .start-device {
    gap: 9px;
    padding: 10px 12px;
  }

  .start-device-header strong {
    font-size: 1.45rem;
  }

  .start-device-header > span {
    font-size: 0.66rem;
  }

  .start-device-header > small {
    font-size: 0.52rem;
  }

  .start-countdown {
    grid-template-columns: 72px 1fr;
    min-height: 74px;
  }

  .countdown-frame,
  .start-countdown > strong {
    width: 72px;
    height: 72px;
    font-size: 4rem;
  }

  .start-diagnostic {
    gap: 3px;
  }

  .start-diagnostic > span {
    font-size: 0.48rem;
  }

  .avatar-picker button {
    min-height: 44px;
    font-size: 1.55rem;
  }

  .start-actions {
    gap: 2px;
  }

  .start-actions button {
    gap: 4px;
    font-size: 0.68rem;
    padding: 7px 2px;
  }

  .start-route-hint {
    font-size: 0.52rem;
  }
}

button {
  position: relative;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  padding: 0.65rem 0.85rem;
}

button:hover {
  background: transparent;
  color: var(--gold);
}

button::before,
button::after {
  content: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.event-corner.blocked {
  cursor: not-allowed;
  opacity: 0.45;
}

.app {
  position: relative;
  width: min(1180px, calc(100vw - 12px));
  margin: 0 auto;
  padding: 10px 8px 18px;
  font-family: var(--display-font);
}

.topbar,
.arena,
.panel,
.shelf,
.combat-rail,
.countdown-panel {
  position: relative;
  border: 0;
  background: transparent;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 8px 10px;
  border-radius: 0;
  box-shadow: none;
}

.topbar > strong {
  color: var(--muted);
  font-family: var(--display-font);
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-family: var(--display-font);
  font-size: clamp(2.1rem, 6vw, 5.5rem);
  line-height: 0.9;
  text-transform: uppercase;
}

h2 {
  font-size: 1rem;
}

.zero-mark {
  display: inline-grid;
  place-items: center;
  width: 0.78em;
  height: 0.78em;
  margin: 0 0.02em;
  border: 0;
  border-radius: 0;
  color: transparent;
  transform: translateY(0.08em);
  box-shadow: 0 0 22px rgba(241, 184, 75, 0.24);
}

.run-stats {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.run-stats span {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  font-size: 0.8rem;
}

.run-stats > span {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  line-height: 1;
}

.run-stats strong {
  color: var(--ink);
  font-family: var(--display-font);
  line-height: 1;
}

.operator-claim-readout {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 0;
  color: var(--muted);
  font-family: var(--device-font);
  font-size: 0.68rem;
  line-height: 1;
  white-space: nowrap;
}

.operator-claim-readout > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  color: var(--muted);
  font-size: inherit;
  line-height: 1;
}

.operator-claim-readout > span:first-child strong {
  color: var(--player);
  font-size: 0.72rem;
  text-shadow: 0 0 6px rgba(97, 216, 255, 0.24);
}

.operator-claim-readout > small {
  color: var(--player-hp);
  font-family: var(--display-font);
  font-size: 0.54rem;
  font-style: normal;
}

.operator-claim-readout > em {
  color: var(--phosphor-label);
  font-family: var(--display-font);
  font-size: 0.48rem;
  font-style: normal;
  text-shadow: 0 0 6px rgba(241, 184, 75, 0.24);
}

.operator-claim-readout[data-floating-tooltip="true"] > .word-tooltip {
  display: none;
}

.resource-readout {
  position: relative;
}

.resource-delta {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 85;
  display: block;
  width: max-content;
  max-width: min(260px, calc(100vw - 16px));
  padding: 3px 0;
  border-block: 1px solid currentColor;
  background: rgba(24, 27, 24, 0.96);
  color: var(--gold);
  font-family: var(--tooltip-font);
  font-size: 0.54rem;
  font-weight: 400;
  line-height: 1.25;
  pointer-events: none;
  text-align: right;
  white-space: nowrap;
  animation: resource-delta-lock var(--double-beat-ms) step-end both;
}

.resource-delta[hidden] {
  display: none;
}

.resource-delta.gain {
  color: var(--good);
}

.resource-delta.loss {
  color: var(--enemy);
}

.resource-delta.critical {
  color: var(--danger);
  text-shadow: 0 0 10px currentColor;
}

@keyframes resource-delta-lock {
  0%,
  18% {
    opacity: 0.35;
  }

  19%,
  100% {
    opacity: 1;
  }
}

.tempo-button {
  padding: 0;
  font-size: 0.72rem;
  white-space: nowrap;
}

.topbar-icon-button {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid transparent;
  color: var(--gold);
  transition:
    border-color 120ms ease,
    background-color 120ms ease,
    color 120ms ease;
}

.topbar-icon-button:hover {
  border-color: var(--rim);
  background: rgba(241, 184, 75, 0.08);
  color: var(--ink);
}

.topbar-icon-button:focus-visible {
  border-color: var(--gold);
  outline: 1px solid var(--gold);
  outline-offset: 2px;
}

.topbar-icon-button svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.keyword-reference-button {
  min-width: 1.2rem;
  color: var(--gold);
  font-weight: 700;
}

.keyword-reference {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(8, 9, 7, 0.84);
  font-family: var(--tooltip-font);
}

.keyword-reference.i18n-readable {
  --tooltip-font: var(--i18n-read-font);
}

.keyword-reference[hidden] {
  display: none;
}

.keyword-reference-card {
  display: grid;
  gap: 14px;
  width: min(720px, 100%);
  max-height: calc(100dvh - 28px);
  overflow-y: auto;
  padding: 20px;
  border: 1px solid var(--rim);
  background:
    linear-gradient(rgba(255, 159, 53, 0.035), rgba(255, 159, 53, 0.015)),
    var(--bg);
  box-shadow:
    0 0 36px rgba(241, 184, 75, 0.18),
    inset 0 0 24px rgba(241, 184, 75, 0.025);
  color: var(--ink);
}

.keyword-reference-card > header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rim);
}

.keyword-reference-card > header > span {
  display: grid;
  gap: 4px;
}

.keyword-reference-card > header small {
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
}

.keyword-reference-card > header strong {
  color: var(--gold);
  font-size: 1.05rem;
  letter-spacing: 0.06em;
}

.keyword-reference-card button {
  border: 0;
  background: transparent;
  color: var(--gold);
  font-family: var(--tooltip-font);
  cursor: pointer;
  white-space: nowrap;
}

.keyword-reference-card button:focus-visible,
.keyword-reference-button:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 3px;
}

.keyword-reference-card > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.keyword-reference-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.keyword-reference-group {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
}

.keyword-reference-group > h3 {
  margin: 0;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(142, 98, 54, 0.5);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.1em;
}

.keyword-reference-entry {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  padding: 7px 8px;
  border-left: 2px solid var(--keyword-color);
  background: color-mix(in srgb, var(--keyword-color) 5%, transparent);
}

.keyword-reference-entry > b {
  align-self: start;
  color: var(--keyword-color);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-shadow: 0 0 7px color-mix(in srgb, var(--keyword-color) 45%, transparent);
}

.keyword-reference-entry > b small {
  display: block;
  padding-top: 3px;
  color: var(--gold);
  font-size: 0.5rem;
  letter-spacing: 0.08em;
}

.keyword-reference-entry > span {
  min-width: 0;
  color: var(--ink);
  font-size: 0.72rem;
  line-height: 1.4;
}

.keyword-reference-footer {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--good);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
}

.keyword-mechanism-damage {
  --keyword-color: var(--mechanism-damage);
}

.keyword-mechanism-block {
  --keyword-color: var(--mechanism-block);
}

.keyword-mechanism-heal {
  --keyword-color: var(--mechanism-heal);
}

.keyword-mechanism-burn {
  --keyword-color: var(--mechanism-burn);
}

.keyword-mechanism-poison {
  --keyword-color: var(--mechanism-poison);
}

.keyword-mechanism-skip {
  --keyword-color: var(--mechanism-skip);
}

.keyword-mechanism-rewind {
  --keyword-color: var(--mechanism-rewind);
}

.keyword-mechanism-resume {
  --keyword-color: var(--mechanism-resume);
}

.keyword-mechanism-pause {
  --keyword-color: var(--mechanism-pause);
}

.keyword-mechanism-repeat {
  --keyword-color: var(--mechanism-repeat);
}

.arena {
  position: relative;
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr) 260px;
  gap: 8px;
  margin-top: 8px;
  padding: 8px;
  border-radius: 0;
  background: transparent;
}

.battle-fx-layer {
  position: absolute;
  inset: 0;
  z-index: 55;
  overflow: visible;
  pointer-events: none;
  font-family: "DSEG14Modern";
}

.battle-fx-layer,
.battle-fx-layer * {
  box-sizing: border-box;
  font-family: "DSEG14Modern";
}

.battle-fx-source,
.battle-fx-impact {
  position: absolute;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--fx-color);
  font-size: 1.15rem;
  line-height: 1;
  text-shadow:
    0 0 8px currentColor,
    0 0 18px currentColor;
  transform: translate(-50%, -50%);
}

.battle-fx-source::before,
.battle-fx-impact::before {
  content: "8";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--fx-color);
  opacity: 0.2;
}

.battle-fx-source {
  animation: battle-source-lock var(--fx-source-ms) step-end both;
}

.battle-fx-impact {
  font-size: 1.45rem;
  animation: battle-target-lock var(--fx-impact-ms) step-end both;
}

.battle-projectile {
  position: absolute;
  height: 20px;
  color: var(--fx-color);
  opacity: 0;
  transform: translateY(-50%) rotate(var(--fx-angle));
  transform-origin: 0 50%;
  animation: battle-route-live var(--fx-flight-ms) step-end var(--fx-delay-ms) both;
}

.battle-projectile-track {
  position: absolute;
  inset: 50% 0 auto;
  height: 0.7rem;
  overflow: hidden;
  color: var(--fx-color);
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  line-height: 0.7rem;
  opacity: 0.2;
  text-shadow: 0 0 7px currentColor;
  transform: translateY(-50%);
  white-space: nowrap;
}

.battle-projectile-glyph {
  position: absolute;
  left: 0;
  top: 50%;
  display: grid;
  place-items: center;
  min-width: 1em;
  color: var(--fx-color);
  font-size: 0.92rem;
  line-height: 1;
  text-shadow:
    0 0 8px currentColor,
    0 0 16px currentColor;
  transform: translate(-50%, -50%);
  animation: battle-projectile-flight var(--fx-flight-ms) linear var(--fx-delay-ms) both;
}

.battle-fx-float {
  position: absolute;
  right: auto;
  top: auto;
  z-index: 3;
  color: var(--fx-color);
  font-family: "DSEG14Modern";
  font-size: var(--fx-font-size, 0.78rem);
  letter-spacing: 0.02em;
  line-height: 1;
  pointer-events: none;
  white-space: nowrap;
  text-shadow:
    0 0 8px currentColor,
    0 0 18px currentColor;
  transform: translate(-50%, -50%);
  animation: battle-effect-float var(--fx-float-ms) step-end both;
}

.battle-fx-float.damage,
.battle-fx-float.block,
.battle-fx-float.heal,
.battle-fx-float.status,
.battle-fx-float.clock {
  color: var(--fx-color);
}

.countdown-zero-array {
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 50%;
  width: 150px;
  height: 90px;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.countdown-device-zero {
  position: absolute;
  display: grid;
  place-items: center;
  width: 10px;
  height: 13px;
  color: rgba(0, 0, 0, 0.86);
  font-family: var(--seven-segment-font);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0.88;
  text-shadow: 0 0 1px rgba(241, 184, 75, 0.12);
  transform: translate(-50%, -50%);
  -webkit-text-stroke: 0.25px rgba(241, 184, 75, 0.08);
}

.countdown-ring.clock-anomaly-skip .countdown-device-zero.anomalous {
  --clock-anomaly-color: var(--mechanism-skip, #ffd166);
}

.countdown-ring.clock-anomaly-rewind .countdown-device-zero.anomalous {
  --clock-anomaly-color: var(--mechanism-rewind, #ef69de);
}

.countdown-device-zero.anomalous {
  color: var(--clock-anomaly-color);
  opacity: 1;
  text-shadow:
    0 0 5px currentColor,
    0 0 12px currentColor;
  -webkit-text-stroke: 0;
  animation: countdown-zero-anomaly var(--anomaly-duration) steps(5)
    var(--anomaly-delay) both;
}

body.clock-anomaly-skip .clock-line-glyph-anomalous {
  --clock-anomaly-line-color: var(--mechanism-skip, #ffd166);
}

body.clock-anomaly-rewind .clock-line-glyph-anomalous {
  --clock-anomaly-line-color: var(--mechanism-rewind, #ef69de);
}

.dseg-edge > b.clock-line-glyph-anomalous {
  color: var(--clock-anomaly-line-color);
  opacity: 1;
  text-shadow:
    0 0 4px currentColor,
    0 0 10px currentColor;
  animation: clock-line-glyph-anomaly var(--anomaly-line-duration) steps(5)
    var(--anomaly-line-delay) both;
}

.shelf > .dseg-frame .dseg-edge > b.stall-status-frame-glyph {
  color: var(--stall-status-frame-color);
  opacity: 1;
  filter: brightness(1.16);
  text-shadow:
    0 0 4px currentColor,
    0 0 10px currentColor;
}

.shelf > .dseg-frame .dseg-edge > b.stall-status-block {
  --stall-status-frame-color: var(--mechanism-block, #4f7cff);
}

.shelf > .dseg-frame .dseg-edge > b.stall-status-burn {
  --stall-status-frame-color: var(--mechanism-burn, #ff8a3d);
}

.shelf > .dseg-frame .dseg-edge > b.stall-status-poison {
  --stall-status-frame-color: var(--mechanism-poison, #b678ff);
}

.countdown-ring.clock-anomaly-active {
  z-index: 57;
}

.countdown-ring.clock-anomaly-active .countdown-number {
  animation: clock-anomaly-count 90ms steps(2) infinite;
}

@keyframes countdown-zero-anomaly {
  0% {
    opacity: 0.2;
    filter: brightness(0.45);
  }
  14%, 42% {
    opacity: 1;
    filter: brightness(1.85);
  }
  43%, 56% {
    opacity: 0.46;
    filter: brightness(0.78);
  }
  57%, 84% {
    opacity: 0.92;
    filter: brightness(1.35);
  }
  100% {
    opacity: 0.18;
    filter: brightness(0.65);
  }
}

@keyframes clock-line-glyph-anomaly {
  0% {
    opacity: 0.25;
    filter: brightness(0.5);
  }
  18%, 48% {
    opacity: 1;
    filter: brightness(1.75);
  }
  49%, 62% {
    opacity: 0.5;
    filter: brightness(0.82);
  }
  63%, 88% {
    opacity: 0.96;
    filter: brightness(1.3);
  }
  100% {
    opacity: 0.2;
    filter: brightness(0.64);
  }
}

@keyframes clock-anomaly-count {
  0%, 48% { filter: brightness(2); transform: translateY(-0.04em) scale(1.04); }
  49%, 100% { filter: brightness(1); transform: translateY(-0.04em) scale(0.98); }
}

@media (max-width: 760px) {
  .countdown-zero-array {
    width: 116px;
    height: 70px;
  }

  .countdown-device-zero {
    font-size: 0.48rem;
  }
}

.bazaar-side {
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  justify-items: center;
  gap: 8px;
  min-width: 0;
}

.left-market {
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.side-flow-slot {
  width: 100%;
  min-height: 220px;
  min-width: 0;
}

.combat-rail,
.shelf,
.countdown-panel,
.side-token,
.side-spacer {
  border-radius: 0;
  padding: 8px;
}

.side-spacer {
  width: 100%;
  min-height: 82px;
}

.event-corner-slot {
  position: relative;
  display: grid;
  grid-auto-rows: 1fr;
  gap: 4px;
  height: 82px;
  padding: 0;
}

.event-corner-slot:has(#eventStepButton:not([hidden])):has(#eventAltButton:not([hidden])) {
  height: 124px;
}

.event-corner {
  align-content: center;
  gap: 6px;
  min-height: 0;
}

.event-corner[hidden] {
  display: none !important;
}

.event-corner span {
  color: var(--gold);
  font-family: var(--display-font);
  font-size: 0.82rem;
}

.event-corner small {
  color: var(--muted);
  font-family: var(--tooltip-font);
  font-size: 0.62rem;
  text-transform: none;
}

.side-token {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 82px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

button.side-token {
  padding: 12px 8px;
}

.chest-token {
  gap: 5px;
}

.chest-token[aria-pressed="true"] span {
  color: var(--gold);
}

.chest-token:disabled span,
.chest-token:disabled strong {
  color: var(--muted);
}

.mock-token {
  align-content: center;
  gap: 5px;
  min-height: 62px;
}

.mock-token span {
  color: var(--gold);
  font-family: var(--display-font);
  font-size: 0.82rem;
}

.mock-token small {
  color: var(--muted);
  font-family: var(--tooltip-font);
  font-size: 0.58rem;
  font-weight: 400;
  text-transform: none;
}

.mock-token[aria-pressed="true"],
.mock-control {
  box-shadow: 0 0 0 1px rgba(156, 255, 154, 0.18) inset;
}

.mock-token[aria-pressed="true"] span,
.mock-control span {
  color: var(--good);
}

.mock-token:disabled {
  cursor: not-allowed;
  opacity: 0.34;
}

body.mock-active {
  --bg: #0b140d;
  --panel: #0c160e;
  --panel-2: #102116;
  --ink: #effff0;
  --muted: #86ad8b;
  --line: #21472a;
  --rim: #4a8253;
  --wood: #132619;
  --phosphor-off: #234a2a;
  --phosphor-on: #6dff7b;
  --phosphor-label: #9cff9a;
  --phosphor-hot: #d8ffda;
  --glyph-line-dim: rgba(35, 74, 42, 0.72);
  background:
    radial-gradient(circle at 50% 42%, rgba(55, 126, 66, 0.1), transparent 58%),
    var(--bg);
}

body.mock-active::before {
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0 23px,
      rgba(183, 255, 188, 0.026) 23px 24px,
      transparent 24px 47px
    ),
    repeating-linear-gradient(
      60deg,
      rgba(127, 208, 136, 0.014) 0 1px,
      transparent 1px 8px
    ),
    repeating-linear-gradient(
      -60deg,
      rgba(127, 208, 136, 0.012) 0 1px,
      transparent 1px 8px
    ),
    radial-gradient(
      circle at center,
      rgba(214, 255, 216, 0.05) 0 0.35px,
      transparent 0.75px
    );
  background-size: auto, auto, auto, 4px 4px;
}

body.mock-active::after {
  background:
    linear-gradient(
      104deg,
      transparent 0 13%,
      rgba(193, 255, 198, 0.022) 20%,
      rgba(193, 255, 198, 0.008) 29%,
      transparent 38%
    ),
    linear-gradient(
      90deg,
      rgba(18, 73, 29, 0.06),
      rgba(38, 112, 52, 0.025) 48%,
      rgba(18, 73, 29, 0.06)
    ),
    radial-gradient(
      ellipse at 50% 46%,
      transparent 50%,
      rgba(3, 20, 7, 0.18) 78%,
      rgba(0, 8, 2, 0.38) 100%
    ),
    rgba(18, 76, 29, 0.025);
  -webkit-backdrop-filter: contrast(1.045) saturate(0.94);
  backdrop-filter: contrast(1.045) saturate(0.94);
}

.mock-active .event-corner-slot {
  height: 82px;
  min-height: 82px;
}

.mock-active .event-corner-slot .event-corner {
  min-height: 0;
  padding: 3px 5px;
  gap: 0;
}

.mock-active .event-corner-slot .event-corner span {
  font-size: 0.68rem;
}

.mock-active .event-corner-slot .event-corner small {
  display: none;
}

.mock-control {
  min-height: 0;
}

.chest-token strong {
  color: var(--gold);
  font-family: var(--display-font);
}

.economy-token {
  align-content: center;
  gap: 6px;
  justify-items: stretch;
  overflow: visible;
  text-align: left;
}

.economy-token span {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.economy-token strong {
  color: var(--gold);
  font-family: var(--display-font);
}

.economy-token .economy-resource-delta {
  position: static;
  align-self: stretch;
  width: 100%;
  max-width: 100%;
  padding: 5px 0 0;
  border-top: 1px solid currentColor;
  border-bottom: 0;
  background: transparent;
  font-size: 0.52rem;
  line-height: 1.3;
  text-align: right;
  text-transform: none;
  white-space: normal;
}

.route-received {
  outline: 1px solid var(--gold);
  outline-offset: -2px;
  animation: route-received-lock var(--double-beat-ms) step-end both;
}

.player-shelf.route-received {
  outline-color: var(--player);
}

@keyframes route-received-lock {
  0%,
  48% {
    filter: brightness(1.35);
    box-shadow: 0 0 18px rgba(241, 184, 75, 0.28);
  }

  49%,
  100% {
    filter: none;
    box-shadow: none;
  }
}

.combat-rail {
  position: relative;
  display: block;
  background: transparent;
  min-height: 0;
  overflow: visible;
}

.portrait {
  display: grid;
  place-items: center;
  width: 96px;
  aspect-ratio: 1;
  margin: 0 auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-family: var(--display-font);
  font-size: 3rem;
  font-weight: 900;
  box-shadow: none;
}

.player-portrait {
  color: var(--player);
}

.enemy-portrait {
  color: var(--enemy);
}

.combatant-info {
  display: grid;
  gap: 5px;
}

.identity-line,
.panel header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.identity-line span,
.shelf header span {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.78rem;
}

.identity-line strong {
  font-family: var(--display-font);
  font-size: 1rem;
}

.status-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  height: 21px;
  min-height: 21px;
  min-width: 0;
  overflow: hidden;
}

.status-row span {
  flex: 0 0 auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.25rem 0.45rem;
  font-size: 0.72rem;
  white-space: nowrap;
}

.status-row strong {
  font-family: var(--display-font);
  color: var(--ink);
}

.hp-track {
  position: relative;
  height: 10px;
  overflow: visible;
  border-radius: 0;
  background: transparent;
}

.hp-track::before {
  content: none;
}

.hp-track div {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  align-items: center;
  gap: 1px;
  height: 100%;
  width: 100%;
  overflow: visible;
  background: transparent;
}

.hp-zero-array {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  top: 50%;
  height: 30px;
  pointer-events: none;
  transform: translateY(-50%);
}

.hp-device-zero {
  position: absolute;
  display: grid;
  place-items: center;
  width: 8px;
  height: 10px;
  color: rgba(0, 0, 0, 0.84);
  font-family: var(--seven-segment-font);
  font-size: 0.46rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0.82;
  text-shadow: 0 0 1px rgba(241, 184, 75, 0.1);
  transform: translate(-50%, -50%);
  -webkit-text-stroke: 0.2px rgba(241, 184, 75, 0.07);
}

.hp-device-zero.anomalous {
  color: var(--hp-anomaly-color);
  opacity: 1;
  text-shadow:
    0 0 5px currentColor,
    0 0 12px currentColor;
  -webkit-text-stroke: 0;
  animation: hp-zero-anomaly var(--hp-anomaly-duration) steps(5)
    var(--hp-anomaly-delay) both;
}

.hp-segment {
  display: block;
  min-width: 0;
  overflow: visible;
  color: var(--glyph-line-dim);
  font-family: var(--display-font);
  font-size: 8px;
  line-height: 1;
  text-align: center;
  text-shadow: none;
}

#playerHpBar .hp-segment.lit {
  color: var(--player-hp);
  text-shadow: 0 0 8px currentColor;
}

#enemyHpBar .hp-segment.lit {
  color: var(--enemy-hp);
  text-shadow: 0 0 8px currentColor;
}

#playerHpBar .hp-segment.hp-status.hp-block,
#enemyHpBar .hp-segment.hp-status.hp-block {
  color: var(--mechanism-block);
  filter: brightness(var(--hp-block-brightness, 1));
  text-shadow: 0 0 8px currentColor;
}

#playerHpBar .hp-segment.hp-status.hp-burn,
#enemyHpBar .hp-segment.hp-status.hp-burn {
  color: var(--mechanism-burn);
  text-shadow: 0 0 8px currentColor;
  animation: hp-burn-idle var(--beat-ms) steps(1, end) infinite;
}

#playerHpBar .hp-segment.hp-status.hp-poison,
#enemyHpBar .hp-segment.hp-status.hp-poison {
  color: var(--mechanism-poison);
  text-shadow: 0 0 8px currentColor;
  animation:
    hp-poison-idle var(--double-beat-ms) steps(4, end) var(--hp-wave-delay) infinite;
}

#playerHpBar .hp-segment.hp-status.hp-burn.hp-poison,
#enemyHpBar .hp-segment.hp-status.hp-burn.hp-poison {
  animation:
    hp-burn-poison-idle var(--double-beat-ms) steps(1, end) var(--hp-wave-delay) infinite;
}

#playerHpBar .hp-segment.hp-status:not(.lit),
#enemyHpBar .hp-segment.hp-status:not(.lit) {
  opacity: 0.38;
  text-shadow: 0 0 5px currentColor;
}

#playerHpBar .hp-segment.hp-status.hp-block:not(.lit),
#enemyHpBar .hp-segment.hp-status.hp-block:not(.lit) {
  opacity: 1;
  text-shadow: 0 0 8px currentColor;
}

#playerHpBar .hp-segment.hp-status.hp-block.hp-burn:not(.lit),
#enemyHpBar .hp-segment.hp-status.hp-block.hp-burn:not(.lit),
#playerHpBar .hp-segment.hp-status.hp-block.hp-poison:not(.lit),
#enemyHpBar .hp-segment.hp-status.hp-block.hp-poison:not(.lit) {
  opacity: 0.72;
}

#playerHpBar.hp-status-bar.hp-status-pulse .hp-segment,
#enemyHpBar.hp-status-bar.hp-status-pulse .hp-segment {
  color: var(--hp-pulse-color);
  opacity: 1;
  text-shadow:
    0 0 9px currentColor,
    0 0 18px currentColor;
  animation: hp-status-impact var(--beat-flash-ms) steps(2, end) both;
}

.bazaar-board {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto auto;
  gap: 6px;
  min-width: 0;
  border: 0;
  border-radius: 0;
  padding: 8px;
  background: transparent;
}

.hero-hud {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 300px) 1fr;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.enemy-hud {
  margin-bottom: 2px;
}

.player-hud {
  margin-top: 2px;
}

.hud-slots {
  display: grid;
  grid-template-columns: repeat(3, 28px);
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.hud-slots > span {
  position: relative;
  display: block;
  aspect-ratio: 1;
  border: 0;
  background: transparent;
  opacity: 0.7;
}

.hud-slots > span::before {
  content: "0";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--glyph-line-dim);
  font-family: var(--display-font);
  font-size: 1.25rem;
  text-shadow: 0 0 8px currentColor;
}

.hud-slots .hud-token::before {
  content: attr(data-glyph);
  color: var(--gold);
}

.hud-slots .hud-token.skill::before {
  color: var(--player);
}

.hud-slots .hud-token.skill.skill-fx-active {
  z-index: 4;
  opacity: 1;
}

.hud-slots .hud-token.skill.skill-fx-active::before {
  color: var(--fx-color);
  text-shadow:
    0 0 8px currentColor,
    0 0 18px currentColor;
  animation: battle-skill-source-lock var(--fx-source-ms) step-end both;
}

.hud-slots .hud-token.skill.skill-fx-active::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 1px solid var(--fx-color);
  opacity: 0;
  pointer-events: none;
  animation: battle-skill-source-frame var(--fx-source-ms) step-end both;
}

.hud-slots .hud-token.buff::before {
  color: var(--good);
}

.hud-token {
  cursor: help;
}

.hud-slots .hud-token.skill.route-suspended {
  filter: grayscale(1);
  opacity: 0.52;
}

.hud-slots .hud-token.skill.route-suspended::before {
  color: var(--muted);
  text-shadow: none;
  animation: none;
}

.hud-slots .hud-token.skill.route-suspended::after {
  content: attr(data-suspended-beats);
  position: absolute;
  right: -0.18rem;
  bottom: -0.15rem;
  z-index: 3;
  min-width: 0.82rem;
  color: var(--enemy);
  font: 0.62rem/1 var(--tooltip-font);
  text-align: center;
  text-shadow: 0 0 6px currentColor;
}

.utility-letter.choice-start[data-choice-badge]::after {
  content: attr(data-choice-badge);
  position: absolute;
  top: 0.18rem;
  left: 0.14rem;
  z-index: 4;
  color: var(--good);
  font-family: var(--tooltip-font);
  font-size: 0.68rem;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 0 8px rgba(105, 255, 166, 0.55);
  pointer-events: none;
}

.player-identity,
.enemy-identity {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

#playerAvatar,
#enemyAvatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  font-family: "DSEGWeather";
  font-size: 1.25rem;
  font-weight: 400;
}

.player-identity-line,
.enemy-identity-line {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 8px;
}

.player-identity-line .player-identity,
.enemy-identity-line .enemy-identity {
  justify-self: start;
}

.player-identity-line #playerAvatar,
.enemy-identity-line #enemyAvatar {
  justify-self: center;
  font-size: 2.5rem;
  line-height: 0.9;
}

.player-identity-line > #playerHp,
.enemy-identity-line > #enemyHp {
  justify-self: end;
}

#playerAvatar {
  color: var(--player);
}

#enemyAvatar {
  color: var(--enemy);
}

#enemyAvatar.elite-portrait-signal {
  color: var(--gold);
  font-family: "DSEG14Modern";
  font-size: 0.78rem;
  letter-spacing: -0.09em;
  text-shadow: none;
}

.elite-scan-portrait {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 174px;
  margin: 0;
  padding: 6px 4px 5px;
  overflow: hidden;
  border-block: 1px solid var(--rim);
  background: color-mix(in srgb, var(--enemy) 2%, transparent);
}

.elite-scan-portrait__grid {
  display: grid;
  grid-template-columns: repeat(var(--elite-portrait-columns), 1em);
  grid-auto-rows: 1em;
  place-items: center;
  width: max-content;
  color: var(--gold);
  font-family: "DSEG14Modern";
  font-size: 14px;
  font-weight: 700;
  font-variant-ligatures: none;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  text-shadow: none;
}

.elite-scan-portrait__grid span {
  display: block;
  width: 1em;
  text-align: center;
}

.elite-scan-portrait .tone-d {
  color: color-mix(in srgb, var(--gold) 11%, #080a09);
}

.elite-scan-portrait .tone-s {
  color: var(--gold);
}

.elite-scan-portrait .tone-a {
  color: color-mix(in srgb, var(--gold) 72%, var(--enemy));
}

.elite-scan-portrait .tone-h {
  color: var(--phosphor-hot);
}

.elite-scan-portrait figcaption {
  color: var(--muted);
  font-family: var(--display-font);
  font-size: 0.52rem;
  letter-spacing: 0.06em;
}

#playerAvatar::before,
#playerAvatar::after {
  position: absolute;
  pointer-events: none;
}

#playerAvatar::before {
  content: attr(data-signal-glyph);
  inset: 0;
  color: var(--player);
  opacity: 0;
  text-shadow: 0 0 8px currentColor;
}

#playerAvatar::after {
  content: attr(data-witness-marks);
  top: -4px;
  left: calc(100% + 3px);
  color: var(--player-hp);
  font-family: var(--display-font);
  font-size: 0.34rem;
  letter-spacing: 1px;
  line-height: 1;
  opacity: 0.58;
  text-shadow: 0 0 5px currentColor;
  white-space: nowrap;
}

#playerAvatar.signal-desync {
  animation: operator-signal-desync var(--double-beat-ms) steps(2, end) infinite;
}

#playerAvatar.signal-lock::before {
  animation: operator-lock-afterimage var(--beat-ms) steps(2, end) infinite;
}

@keyframes operator-signal-desync {
  0%,
  74% {
    filter: none;
    opacity: 1;
    transform: translateX(0);
  }

  75%,
  87% {
    filter: brightness(1.45);
    opacity: 0.64;
    transform: translateX(-1px);
  }

  88%,
  100% {
    filter: none;
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes operator-lock-afterimage {
  0%,
  49% {
    opacity: 0;
    transform: translateX(-3px);
  }

  50%,
  74% {
    opacity: 0.28;
    transform: translateX(3px);
  }

  75%,
  100% {
    opacity: 0.12;
    transform: translateX(-2px);
  }
}

.player-identity i,
.enemy-identity i {
  color: var(--muted);
  font-style: normal;
}

.shelf {
  --display-font: var(--seven-segment-font);

  display: grid;
  gap: 8px;
  min-height: 0;
  background: transparent;
  font-family: var(--display-font);
}

.shelf header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.shelf header small {
  color: var(--muted);
  font-family: var(--tooltip-font);
  font-size: 0.76rem;
}

.enemy-shelf {
  box-shadow: none;
}

.player-shelf {
  box-shadow: none;
}

.app.chest-open .enemy-hud {
  display: none;
}

.app.chest-open .enemy-shelf {
  position: relative;
  outline: 1px solid rgba(156, 255, 154, 0.58);
  outline-offset: -2px;
  background:
    linear-gradient(180deg, rgba(156, 255, 154, 0.055), transparent 62%);
}

.app.chest-open .enemy-shelf::after {
  content: "↓";
  position: absolute;
  z-index: 8;
  right: 50%;
  bottom: -17px;
  color: var(--player);
  font-family: var(--display-font);
  font-size: 1.15rem;
  line-height: 1;
  pointer-events: none;
  text-shadow: 0 0 12px currentColor;
  transform: translateX(50%);
}

.app.chest-open .enemy-shelf > header span,
.app.chest-open .enemy-shelf > header small,
.app.chest-open .player-shelf > header span,
.app.chest-open .player-shelf > header small {
  color: var(--player);
}

.app.onboarding-equip .enemy-shelf,
.app.onboarding-equip .player-shelf {
  box-shadow: inset 0 0 24px rgba(156, 255, 154, 0.035);
}

.board {
  display: block;
  min-width: 0;
  overflow: visible;
  padding-bottom: 4px;
}

.protocol-line {
  position: relative;
  display: grid;
  grid-template-columns: repeat(10, var(--slot-w));
  grid-template-rows: repeat(2, var(--slot-h));
  align-items: end;
  justify-content: start;
  column-gap: 4px;
  row-gap: 10px;
  min-height: 180px;
  width: 100%;
  justify-content: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 8px 8px 20px;
  box-shadow: none;
}

.protocol-line::before {
  content: none;
}

.protocol-line::after {
  content: none;
}

.protocol-line.addressed::after {
  position: absolute;
  right: 10px;
  bottom: 2px;
  color: var(--glyph-line-dim);
  content: "ADDR 00 → 19";
  font-family: var(--tooltip-font);
  font-size: 0.46rem;
  letter-spacing: 0.07em;
  opacity: 0.78;
}

.protocol-address {
  position: absolute;
  top: 2px;
  left: 2px;
  z-index: 6;
  color: var(--glyph-line);
  font-family: var(--display-font);
  font-size: 0.38rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0.72;
  pointer-events: none;
  text-shadow: 0 0 5px currentColor;
}

.protocol-line[data-phase="battle"] .protocol-address,
.protocol-line[data-phase="replay"] .protocol-address {
  opacity: 0.34;
}

.protocol-line[data-phase="prep"] .protocol-address,
.protocol-line[data-phase="chest"] .protocol-address {
  color: var(--rim);
  opacity: 0.94;
}

.protocol-line.player .scan-lock .protocol-address {
  color: var(--player);
  animation: protocol-address-lock var(--quarter-beat-ms) step-end var(--scan-delay) both;
}

.protocol-line.enemy .scan-lock .protocol-address {
  color: var(--enemy);
  animation: protocol-address-lock var(--quarter-beat-ms) step-end var(--scan-delay) both;
}

@keyframes protocol-address-lock {
  0% {
    opacity: 0.26;
    filter: brightness(0.75);
  }

  35% {
    opacity: 1;
    filter: brightness(2);
  }

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

.protocol-line.player {
  box-shadow: none;
}

.protocol-line.enemy {
  box-shadow: none;
}

.space-cell {
  position: relative;
  display: inline-grid;
  place-items: center;
  align-self: end;
  min-width: var(--slot-w);
  width: var(--slot-w);
  height: var(--slot-h);
  font-family: var(--display-font);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 159, 53, 0.2);
  box-shadow: none;
  overflow: hidden;
}

.space-cell::after {
  content: "-";
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-family: var(--display-font);
  font-size: var(--slot-font-size);
  opacity: 0.55;
  text-shadow: 0 0 10px currentColor;
}

.space-cell::before {
  content: "8";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--phosphor-off);
  font-family: var(--display-font);
  font-size: var(--slot-font-size);
  line-height: 1;
  text-shadow: 0 0 8px currentColor;
  opacity: 0.46;
  z-index: 0;
  pointer-events: none;
}

.empty-cell {
  position: relative;
  display: inline-grid;
  place-items: center;
  align-self: end;
  min-width: var(--slot-w);
  width: var(--slot-w);
  height: var(--slot-h);
  font-family: var(--display-font);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  opacity: 0.62;
  overflow: hidden;
}

.locked-cell {
  position: relative;
  display: inline-grid;
  place-items: center;
  align-self: end;
  min-width: var(--slot-w);
  width: var(--slot-w);
  height: var(--slot-h);
  overflow: hidden;
  opacity: 0.22;
}

.locked-cell::before {
  content: "-";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--glyph-line-dim);
  font-family: var(--display-font);
  font-size: var(--slot-font-size);
  line-height: 1;
}

.empty-cell::after {
  content: "";
}

.empty-cell::before {
  content: "8";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--phosphor-off);
  font-family: var(--display-font);
  font-size: var(--slot-font-size);
  line-height: 1;
  text-shadow: 0 0 8px currentColor;
  opacity: 0.3;
  z-index: 0;
  pointer-events: none;
}

.letter {
  position: relative;
  display: inline-grid;
  place-items: center;
  align-self: end;
  min-width: var(--slot-w);
  width: var(--slot-w);
  height: var(--slot-h);
  font-family: var(--display-font);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 159, 53, 0.78);
  text-shadow:
    0 0 8px rgba(255, 159, 53, 0.8),
    0 0 18px rgba(255, 159, 53, 0.55),
    0 0 32px rgba(255, 159, 53, 0.28);
  box-shadow: none;
  transform-style: preserve-3d;
  perspective: 240px;
  overflow: hidden;
  transition: none;
}

.letter::before {
  content: "8";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--phosphor-off);
  font-family: var(--display-font);
  font-size: var(--slot-font-size);
  line-height: 1;
  text-shadow: 0 0 8px currentColor;
  opacity: 0.55;
  z-index: 0;
  pointer-events: none;
}

.letter.trigger {
  color: var(--phosphor-on);
}

.letter.word-active {
  color: rgba(255, 210, 140, 0.9);
  text-shadow:
    0 0 8px rgba(255, 159, 53, 0.72),
    0 0 18px rgba(255, 159, 53, 0.38);
}

.letter.word-paused {
  color: rgba(126, 144, 160, 0.72);
  filter: saturate(0.2);
  opacity: 0.64;
}

.letter.word-resumed {
  color: rgba(118, 255, 190, 0.94);
  text-shadow:
    0 0 8px rgba(75, 255, 168, 0.72),
    0 0 18px rgba(75, 255, 168, 0.34);
}

.protocol-line.player .letter.active {
  color: var(--phosphor-hot);
  box-shadow: none;
  text-shadow:
    0 0 10px var(--player),
    0 0 24px rgba(255, 159, 53, 0.42);
  transform: none;
}

.protocol-line.enemy .letter.active {
  color: var(--phosphor-hot);
  box-shadow: none;
  text-shadow:
    0 0 10px var(--enemy),
    0 0 24px rgba(255, 159, 53, 0.42);
  transform: none;
}

.letter.flip {
  animation: digital-snap var(--beat-flash-ms) step-end both;
}

.letter.flip::before {
  animation: dseg-backdrop-pulse var(--beat-flash-ms) step-end both;
}

.letter-glyph {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: var(--slot-font-size);
  line-height: 1;
}

.letter.fusion-start .letter-glyph::before {
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: -2px;
  width: 2px;
  background: repeating-linear-gradient(
    180deg,
    currentColor 0 3px,
    transparent 3px 5px
  );
  box-shadow: 0 0 6px currentColor;
  content: "";
  opacity: 0.72;
}

.letter.wired-start .letter-glyph::before {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: -2px;
  width: 2px;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  content: "";
  opacity: 0.9;
}

.utility-letter.fusion-start {
  box-shadow:
    inset 2px 0 rgba(241, 184, 75, 0.52),
    inset 0 1px rgba(241, 184, 75, 0.16),
    inset 0 -1px rgba(241, 184, 75, 0.16);
}

.utility-letter.wired-start {
  box-shadow:
    inset 2px 0 var(--phosphor-on),
    inset 0 1px rgba(241, 184, 75, 0.16),
    inset 0 -1px rgba(241, 184, 75, 0.16);
}

.tooltip-rule.conjunction-structure,
.tooltip-rule.conjunction-interface {
  color: var(--gold);
}

.tooltip-rule.conjunction-module {
  border-left: 2px solid var(--phosphor-on);
  padding-left: 0.5rem;
}

.conjunction-offer-tooltip .conjunction-operation-chain {
  border-left: 2px solid var(--gold);
  padding-left: 0.5rem;
}

.conjunction-offer-empty {
  color: var(--muted);
  font-family: var(--tooltip-font);
  letter-spacing: 0.08em;
}

@media (max-width: 560px) {
  .conjunction-offer-protocol {
    grid-template-columns: repeat(10, minmax(0, 1fr));
    box-sizing: border-box;
  }

  .conjunction-offer-protocol > .tube-cell {
    min-width: 0;
    width: auto;
  }
}

.interaction-pace-fallback {
  position: absolute;
  top: 3px;
  right: 3px;
  z-index: 6;
  color: var(--muted);
  font-family: var(--tooltip-font);
  font-size: 0.4rem;
  font-style: normal;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  pointer-events: none;
  text-shadow: none;
}

.letter.word-readout-anchor {
  overflow: visible;
}

.word-protocol-readout {
  position: absolute;
  left: 2px;
  top: -8px;
  z-index: 8;
  width: max-content;
  max-width: 150px;
  overflow: hidden;
  visibility: hidden;
  color: var(--phosphor-hot);
  font-family: var(--display-font);
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  text-overflow: ellipsis;
  text-shadow:
    0 0 4px currentColor,
    0 0 9px currentColor;
  white-space: nowrap;
}

.word-protocol-piece {
  color: var(--readout-color, var(--phosphor-hot));
}

.letter.word-readout-active .word-protocol-readout {
  visibility: visible;
  opacity: 1;
}

.protocol-line .letter.word-readout-active .protocol-address {
  opacity: 0;
  animation: none;
}

.letter.word-dyed {
  color: var(--mechanism-visual-color, var(--dye-color));
  text-shadow:
    0 0 8px color-mix(
      in srgb,
      var(--mechanism-visual-color, var(--dye-color)) 62%,
      transparent
    );
}

.letter.word-dyed.word-paused {
  color: rgba(126, 144, 160, 0.72);
  text-shadow: none;
}

.letter.word-dyed.word-resumed {
  color: rgba(118, 255, 190, 0.94);
  text-shadow:
    0 0 8px rgba(75, 255, 168, 0.72),
    0 0 18px rgba(75, 255, 168, 0.34);
}

.letter.word-dyed::after,
.letter.dye-choice::after {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 2px;
  left: 3px;
  z-index: 3;
  height: 3px;
  background: var(--dye-color);
  box-shadow: 0 0 7px var(--dye-color);
  pointer-events: none;
}

.letter.dye-pattern-double::after {
  height: 5px;
  border-block: 1px solid var(--dye-color);
  background: transparent;
}

.letter.dye-pattern-dash::after,
.letter.dye-pattern-right::after,
.letter.dye-pattern-left::after,
.letter.dye-pattern-up::after {
  background: repeating-linear-gradient(
    90deg,
    var(--dye-color) 0 7px,
    transparent 7px 11px
  );
}

.letter.dye-pattern-dot::after {
  background: repeating-linear-gradient(
    90deg,
    var(--dye-color) 0 3px,
    transparent 3px 8px
  );
}

.letter.dye-pattern-cross::after {
  height: 4px;
  background:
    linear-gradient(45deg, transparent 35%, var(--dye-color) 35% 65%, transparent 65%),
    linear-gradient(-45deg, transparent 35%, var(--dye-color) 35% 65%, transparent 65%);
  background-size: 8px 4px;
}

.letter.dye-pattern-echo::after {
  height: 5px;
  background: repeating-linear-gradient(
    90deg,
    var(--dye-color) 0 2px,
    transparent 2px 4px,
    var(--dye-color) 4px 8px,
    transparent 8px 12px
  );
}

.letter.dye-pattern-bracket::after {
  height: 5px;
  border-inline: 2px solid var(--dye-color);
  border-bottom: 1px solid var(--dye-color);
  background: transparent;
}

.letter.dye-end .letter-glyph::after {
  content: attr(data-dye-code);
  position: absolute;
  right: 1px;
  bottom: 7px;
  color: var(--dye-color);
  font-family: var(--tooltip-font);
  font-size: 0.42rem;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 0 5px var(--dye-color);
}

.letter.word-dyed.word-active::after,
.letter.word-dyed.active::after {
  animation: dye-pulse var(--quarter-beat-ms) step-end both;
}

@keyframes dye-pulse {
  50% {
    filter: brightness(2);
    opacity: 0.55;
  }
}

.word-tooltip {
  position: absolute;
  left: 50%;
  z-index: 40;
  display: none;
  gap: 7px;
  min-width: 210px;
  max-width: min(250px, calc(100vw - 16px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(23, 17, 12, 0.98);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.58),
    0 0 14px rgba(241, 184, 75, 0.08);
  color: var(--ink);
  font-family: var(--tooltip-font);
  opacity: 0;
  pointer-events: none;
  text-align: left;
  text-shadow: none;
  transform: translate(-50%, 0);
  transition: none;
}

.word-tooltip.i18n-readable {
  --tooltip-font: var(--i18n-read-font);
}

.word-tooltip.ability-tooltip {
  gap: 7px;
  width: min(230px, calc(100vw - 16px));
  min-width: min(230px, calc(100vw - 16px));
}

.word-tooltip.compound-tooltip,
.word-tooltip.feature-tooltip {
  gap: 9px;
  width: min(320px, calc(100vw - 20px));
  min-width: min(300px, calc(100vw - 20px));
  max-width: min(320px, calc(100vw - 20px));
}

.word-tooltip.compound-tooltip.data-hold,
.word-tooltip.feature-tooltip.data-hold {
  width: min(360px, calc(100vw - 20px));
  min-width: min(340px, calc(100vw - 20px));
  max-width: min(360px, calc(100vw - 20px));
}

.operator-claim-tooltip .operator-claim-authority {
  color: var(--player);
}

.operator-memory-list {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.operator-memory-entry {
  display: grid;
  gap: 3px;
}

.operator-memory-entry + .operator-memory-entry {
  padding-top: 7px;
  border-top: 1px dotted var(--line);
}

.operator-memory-entry > small {
  color: var(--phosphor-label);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
}

.operator-memory-entry > span {
  color: var(--ink);
  font-size: 0.75rem;
  line-height: 1.35;
}

.protocol-line.enemy .word-tooltip {
  top: calc(100% + 12px);
}

.protocol-line.player .word-tooltip {
  bottom: calc(100% + 12px);
  transform: translate(-50%, 0);
}

.letter:hover,
.letter:focus-visible {
  z-index: 25;
  overflow: visible;
}

.letter:hover .word-tooltip,
.letter:focus-visible .word-tooltip {
  display: grid;
  opacity: 1;
  transform: translate(-50%, 0);
}

.letter[data-floating-tooltip="true"] > .word-tooltip {
  display: none;
}

.word-tooltip.floating-tooltip {
  position: fixed;
  inset: auto;
  z-index: 3200;
  display: grid;
  opacity: 1;
  pointer-events: none;
  transform: none;
  transition: none;
}

.word-tooltip.floating-tooltip.data-hold {
  border-color: var(--rim);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.58),
    0 0 18px rgba(241, 184, 75, 0.13);
  max-height: calc(100dvh - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
  pointer-events: auto;
}

.word-tooltip .tooltip-data-hold {
  padding-top: 7px;
  border-top: 1px solid var(--line);
  color: var(--gold);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
}

.word-tooltip.elite-outcome-tooltip {
  gap: 8px;
  width: min(280px, calc(100vw - 16px));
  min-width: min(250px, calc(100vw - 16px));
}

.elite-outcome-tooltip .elite-outcome-identity {
  color: var(--danger);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
}

.elite-outcome-tooltip .elite-outcome-quote {
  padding-block: 8px;
  border-block: 1px solid rgba(255, 91, 82, 0.36);
  color: var(--ink);
  font-size: 0.82rem;
  font-style: italic;
}

.elite-outcome-tooltip .elite-outcome-action {
  color: var(--muted);
}

.word-tooltip.event-signal-tooltip,
.word-tooltip.elite-choice-tooltip {
  gap: 0;
  width: min(360px, calc(100vw - 20px));
  min-width: min(320px, calc(100vw - 20px));
  max-width: min(360px, calc(100vw - 20px));
  padding: 13px 14px;
}

.event-signal-tooltip .event-signal-title,
.elite-choice-tooltip .elite-choice-title {
  padding-bottom: 5px;
  color: var(--gold);
  font-size: 0.96rem;
  letter-spacing: 0.06em;
}

.event-signal-tooltip .event-signal-source,
.elite-choice-tooltip .elite-choice-archive {
  padding-bottom: 9px;
  color: var(--phosphor-hot);
  font-size: 0.69rem;
  letter-spacing: 0.08em;
}

.event-signal-tooltip .event-signal-quote,
.elite-choice-tooltip .elite-choice-quote {
  padding-block: 10px;
  border-block: 1px solid rgba(241, 184, 75, 0.3);
  color: var(--ink);
  font-size: 0.8rem;
  line-height: 1.5;
}

.event-signal-tooltip .event-signal-rule,
.elite-choice-tooltip .elite-choice-action {
  padding-top: 9px;
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0.025em;
  line-height: 1.45;
}

.event-signal-tooltip.event-summary-tooltip .event-signal-rule {
  padding-block: 10px 0;
  border-top: 1px solid rgba(241, 184, 75, 0.3);
  color: var(--ink);
  font-size: 0.8rem;
  line-height: 1.5;
}

.word-tooltip strong {
  color: var(--gold);
  font-family: var(--tooltip-font);
  font-size: 1rem;
  line-height: 1.15;
}

.word-tooltip em,
.word-tooltip small {
  color: var(--ink);
  font-family: var(--tooltip-font);
  font-size: 0.8rem;
  font-style: normal;
  line-height: 1.4;
}

.word-tooltip span {
  color: var(--muted);
  font-family: var(--tooltip-font);
  font-size: 0.8rem;
  line-height: 1.45;
}

.word-tooltip .tooltip-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
}

.word-tooltip .tooltip-title b {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.word-tooltip .tooltip-address {
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0.05em;
}

.word-tooltip .tooltip-quick {
  display: grid;
  gap: 7px;
}

.word-tooltip.floating-tooltip.data-hold .tooltip-quick {
  display: none;
}

.word-tooltip .tooltip-quick-grid {
  display: grid;
  gap: 4px;
}

.word-tooltip .tooltip-quick-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  padding-block: 4px;
  border-bottom: 1px solid rgba(142, 98, 54, 0.24);
}

.word-tooltip .tooltip-quick-row:last-child {
  border-bottom: 0;
}

.word-tooltip .tooltip-quick-row b {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.07em;
}

.word-tooltip .tooltip-quick-row i {
  min-width: 0;
  color: var(--ink);
  font-size: 0.8rem;
  font-style: normal;
  line-height: 1.4;
  text-align: right;
  overflow-wrap: anywhere;
}

.word-tooltip .tooltip-details {
  display: none;
}

.word-tooltip.floating-tooltip.data-hold .tooltip-details {
  display: grid;
  gap: 8px;
  padding-top: 9px;
  border-top: 1px solid rgba(142, 98, 54, 0.5);
}

.word-tooltip .tooltip-details-label {
  color: var(--gold);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.word-tooltip .tooltip-word-kind {
  display: inline-block;
  margin-left: 6px;
  color: var(--muted);
  font-size: 0.52rem;
  font-weight: 400;
  letter-spacing: 0.09em;
  vertical-align: baseline;
}

.word-tooltip .tooltip-new-keyword {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px 9px;
  padding: 7px 8px;
  border-left: 2px solid var(--keyword-color);
  background: color-mix(in srgb, var(--keyword-color) 7%, transparent);
}

.word-tooltip .tooltip-new-keyword > b {
  grid-column: 1 / -1;
  color: var(--gold);
  font-size: 0.58rem;
  font-weight: 400;
  letter-spacing: 0.09em;
}

.word-tooltip .tooltip-new-keyword > strong {
  color: var(--keyword-color);
  font-size: 0.68rem;
  font-weight: 400;
}

.word-tooltip .tooltip-new-keyword > span {
  color: var(--ink);
  font-size: 0.72rem;
  line-height: 1.4;
}

.word-tooltip .tooltip-keywords {
  display: grid;
  gap: 6px;
}

.word-tooltip .tooltip-keywords > b {
  color: var(--gold);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.word-tooltip .tooltip-keyword-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 9px;
  min-width: 0;
  padding: 6px 7px;
  border-left: 2px solid var(--keyword-color);
  background: color-mix(in srgb, var(--keyword-color) 5%, transparent);
}

.word-tooltip .tooltip-keyword-row > strong {
  color: var(--keyword-color);
  font-size: 0.65rem;
  font-weight: 400;
  line-height: 1.35;
  text-shadow: 0 0 7px color-mix(in srgb, var(--keyword-color) 45%, transparent);
}

.word-tooltip .tooltip-keyword-row > span {
  min-width: 0;
  color: var(--ink);
  font-size: 0.7rem;
  line-height: 1.4;
}

.word-tooltip.compound-tooltip .tooltip-title,
.word-tooltip.feature-tooltip .tooltip-title {
  align-items: flex-start;
  flex-direction: column;
  gap: 6px;
}

.word-tooltip.compound-tooltip .tooltip-title strong,
.word-tooltip.feature-tooltip .tooltip-title strong {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.word-tooltip .tooltip-effects {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.word-tooltip .tooltip-effects span {
  padding: 2px 6px;
  border: 1px solid rgba(142, 98, 54, 0.55);
  background: rgba(241, 184, 75, 0.06);
  color: var(--ink);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  line-height: 1.25;
}

.word-tooltip .tooltip-effects i {
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
}

.word-tooltip .tooltip-summary {
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(142, 98, 54, 0.5);
  color: var(--ink);
  font-size: 0.82rem;
}

.word-tooltip .tooltip-compound-summary,
.word-tooltip .tooltip-feature-summary {
  display: grid;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(142, 98, 54, 0.5);
}

.word-tooltip .tooltip-share {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.word-tooltip .tooltip-budget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 5px;
}

.word-tooltip .tooltip-budget-row {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 6px 7px;
  border-left: 2px solid var(--gold-dim);
  background: rgba(255, 255, 255, 0.025);
}

.word-tooltip .tooltip-budget-row b {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.05em;
}

.word-tooltip .tooltip-budget-row i {
  color: var(--ink);
  font-size: 0.78rem;
  font-style: normal;
  white-space: nowrap;
}

.word-tooltip.feature-tooltip .tooltip-budget-row i {
  white-space: normal;
}

.word-tooltip.contribution-tooltip {
  gap: 9px;
  width: min(280px, calc(100vw - 16px));
  min-width: min(250px, calc(100vw - 16px));
  max-width: min(280px, calc(100vw - 16px));
}

.word-tooltip .contribution-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.word-tooltip .contribution-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
}

.word-tooltip .contribution-row i {
  color: var(--ink);
  font-size: 0.92rem;
}

.word-tooltip .contribution-row small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.35;
}

.word-tooltip .contribution-empty {
  padding-block: 4px;
}

.word-tooltip .contribution-source {
  font-size: 0.68rem;
}

.word-tooltip.aura-tooltip .tooltip-pace-head,
.word-tooltip.aura-tooltip .tooltip-pace-row {
  grid-template-columns: minmax(0, 1fr) 92px;
}

.word-tooltip.aura-tooltip .tooltip-pace-row {
  align-items: start;
}

.word-tooltip.aura-tooltip .tooltip-pace-row b {
  overflow-wrap: anywhere;
}

.word-tooltip .tooltip-context {
  color: var(--good);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
}

.word-tooltip .tooltip-dye {
  padding: 6px 7px;
  border-left: 3px solid var(--dye-color);
  background: color-mix(in srgb, var(--dye-color) 12%, transparent);
  color: var(--ink);
}

.word-tooltip .tooltip-pace {
  display: grid;
  gap: 3px;
}

.word-tooltip .tooltip-pace-head {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(142, 98, 54, 0.32);
}

.word-tooltip .tooltip-pace-head b,
.word-tooltip .tooltip-pace-head i {
  color: var(--muted);
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.07em;
}

.word-tooltip .tooltip-pace-head i {
  text-align: right;
}

.word-tooltip .tooltip-pace-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: baseline;
  gap: 10px;
  min-height: 20px;
}

.word-tooltip .tooltip-pace-row b {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 400;
}

.word-tooltip .tooltip-pace-row i {
  color: var(--ink);
  font-size: 0.82rem;
  font-style: normal;
  text-align: right;
}

.word-tooltip .tooltip-live {
  padding: 6px 7px;
  border-left: 2px solid var(--good);
  background: rgba(105, 255, 166, 0.06);
  color: var(--good);
}

.word-tooltip .tooltip-rule {
  color: var(--muted);
}

.word-tooltip .tooltip-mechanism-number {
  color: var(--mechanism-number-color);
  font: inherit;
  font-weight: 700;
  text-shadow: 0 0 7px color-mix(in srgb, var(--mechanism-number-color) 55%, transparent);
}

.word-tooltip .tooltip-mechanism-number.mechanism-damage {
  --mechanism-number-color: var(--mechanism-damage);
}

.word-tooltip .tooltip-mechanism-number.mechanism-block {
  --mechanism-number-color: var(--mechanism-block);
}

.word-tooltip .tooltip-mechanism-number.mechanism-heal {
  --mechanism-number-color: var(--mechanism-heal);
}

.word-tooltip .tooltip-mechanism-number.mechanism-burn {
  --mechanism-number-color: var(--mechanism-burn);
}

.word-tooltip .tooltip-mechanism-number.mechanism-poison {
  --mechanism-number-color: var(--mechanism-poison);
}

.word-tooltip .tooltip-mechanism-number.mechanism-skip {
  --mechanism-number-color: var(--mechanism-skip);
}

.word-tooltip .tooltip-mechanism-number.mechanism-rewind {
  --mechanism-number-color: var(--mechanism-rewind);
}

.word-tooltip .tooltip-mechanism-number.mechanism-resume {
  --mechanism-number-color: var(--mechanism-resume);
}

.word-tooltip .tooltip-mechanism-number.mechanism-pause {
  --mechanism-number-color: var(--mechanism-pause);
}

.word-tooltip .tooltip-mechanism-number.mechanism-repeat {
  --mechanism-number-color: var(--mechanism-repeat);
}

.countdown-panel {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 3px;
  min-height: 220px;
  background: transparent;
  padding: 2px 0;
}

.countdown-control-hint {
  min-height: 1em;
  color: var(--muted);
  font-family: var(--tooltip-font);
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-align: center;
}

.countdown-control-hint.battle-control {
  max-width: 132px;
  color: var(--gold);
}

.countdown-control-hint.paused {
  color: var(--good);
}

.countdown-control-hint.result-control {
  max-width: 128px;
  color: var(--good);
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.35;
}

.countdown-command-line {
  display: flex;
  justify-content: center;
  gap: 5px;
  min-height: 18px;
}

.countdown-command-line button {
  padding: 2px;
  background: transparent;
  color: var(--glyph-line);
  font-family: var(--tooltip-font);
  font-size: 0.54rem;
  line-height: 1;
}

.countdown-command-line button:hover:not(:disabled),
.countdown-command-line button:focus-visible,
.countdown-command-line button[aria-expanded="true"] {
  color: var(--gold);
  outline: none;
  text-shadow: 0 0 8px currentColor;
}

.countdown-command-line button:disabled {
  color: var(--glyph-line-dim);
  opacity: 0.42;
}

.mapping-tooltip {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  z-index: 60;
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 6px 12px;
  width: max-content;
  padding: 10px;
  background: var(--bg);
  color: var(--gold);
  font-family: var(--tooltip-font);
  font-size: 0.72rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  transition: none;
}

.mapping-tooltip .no-signal {
  color: var(--muted);
}

.mapping-tooltip .mapping-rule {
  grid-column: 1 / -1;
  padding-top: 5px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.03em;
}

.countdown-panel:hover .mapping-tooltip,
.countdown-panel.mapping-open .mapping-tooltip {
  opacity: 1;
}

.countdown-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 96px;
  aspect-ratio: 1;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.countdown-ring:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 4px;
}

.game-countdown-frame,
.countdown-number {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  font-family: var(--seven-segment-font);
  font-size: 5.4rem;
  line-height: 1;
}

.game-countdown-frame {
  color: var(--phosphor-off);
  opacity: 0.56;
  pointer-events: none;
}

.countdown-ring.flash .game-countdown-frame {
  animation: countdown-brightness var(--beat-flash-ms) step-end both;
}

.countdown-ring.flash .countdown-number {
  animation: countdown-brightness var(--beat-flash-ms) step-end both;
}

.countdown-ring.paused .countdown-number {
  color: var(--muted);
  text-shadow: none;
}

.countdown-ring.result-ready .countdown-number {
  color: var(--good);
  animation: result-ready-pulse var(--double-beat-ms) step-end infinite;
}

.countdown-ring.armed .countdown-number {
  color: var(--good);
}

.countdown-ring.buff-charged-player .countdown-number {
  color: var(--good);
  text-shadow:
    0 0 10px var(--good),
    0 0 26px rgba(105, 255, 166, 0.5);
}

.countdown-ring.buff-charged-enemy .countdown-number {
  color: var(--danger);
  text-shadow:
    0 0 10px var(--danger),
    0 0 26px rgba(255, 91, 82, 0.5);
}

.countdown-ring.buff-charged-player.buff-charged-enemy .countdown-number {
  color: var(--gold);
  text-shadow:
    -4px 0 14px var(--good),
    4px 0 14px var(--danger);
}

.pace-preview-active {
  color: var(--phosphor-hot);
  text-shadow:
    0 0 10px var(--gold),
    0 0 24px rgba(241, 184, 75, 0.44);
}

.action-notice {
  color: var(--danger) !important;
  text-shadow: 0 0 10px rgba(255, 91, 82, 0.52);
}

.countdown-number {
  position: relative;
  z-index: 1;
  border-radius: 0;
  background: transparent;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 14px currentColor;
}

.panel {
  border-radius: 0;
  padding: 14px 10px;
  min-height: 0;
  box-shadow: none;
}

.flow-panel:not(.active) {
  opacity: 0.62;
}

.flow-content {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.flow-panel {
  width: 100%;
  max-height: 510px;
  overflow-x: hidden;
  overflow-y: auto;
}

.release-trace {
  display: grid;
  gap: 3px;
  border-block: 1px solid var(--rim);
  font-family: var(--tooltip-font);
}

.release-trace.preview {
  animation: release-trace-focus var(--beat-ms) step-end both;
}

@keyframes release-trace-focus {
  from {
    border-color: var(--gold);
    box-shadow: inset 2px 0 0 rgba(241, 184, 75, 0.7);
  }

  to {
    border-color: var(--rim);
    box-shadow: none;
  }
}

.flow-panel:has(.release-trace) > header {
  display: grid;
  justify-items: stretch;
  gap: 3px;
}

.flow-panel:has(.release-trace) > header > h2 {
  color: var(--ink);
  font-family: var(--tooltip-font);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
}

.flow-panel:has(.release-trace) > header > span {
  max-width: none;
  font-family: var(--tooltip-font);
  font-size: 0.58rem;
  line-height: 1.3;
  text-align: left;
}

.release-trace-row {
  display: grid;
  grid-template-columns: 22px 48px minmax(0, 1fr) 46px;
  align-items: baseline;
  gap: 3px;
  min-width: 0;
  padding: 5px 1px;
  border-bottom: 1px solid var(--glyph-line-dim);
}

.release-trace-row:last-of-type {
  border-bottom: 0;
}

.release-trace-row.replay-active {
  background: linear-gradient(90deg, rgba(241, 184, 75, 0.12), transparent 72%);
  box-shadow: inset 2px 0 0 var(--gold);
}

.release-trace-row > small {
  color: var(--gold);
  font-family: var(--display-font);
  font-size: 0.58rem;
}

.release-trace-row > b {
  font-size: 0.48rem;
  letter-spacing: 0.04em;
}

.release-trace-row.player > b,
.release-trace-row.player > strong {
  color: var(--player);
}

.release-trace-row.enemy > b,
.release-trace-row.enemy > strong {
  color: var(--enemy);
}

.release-trace-row > strong {
  min-width: 0;
  overflow: hidden;
  font-family: var(--device-font);
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.release-trace-row > span {
  color: var(--ink);
  font-family: var(--display-font);
  font-size: 0.55rem;
  text-align: right;
}

.release-trace-row > em {
  grid-column: 2 / -1;
  color: var(--muted);
  font-size: 0.48rem;
  font-style: normal;
  letter-spacing: 0.03em;
}

.release-trace-rule,
.release-trace-idle {
  margin: 0;
  padding: 6px 1px;
  color: var(--muted);
  font-size: 0.53rem;
  line-height: 1.35;
}

.release-trace-rule {
  color: var(--gold);
}

.letter.release-trace-cell {
  z-index: 18;
  outline: 1px solid currentColor;
  outline-offset: -2px;
  filter: brightness(1.35);
}

.protocol-line.player .letter.release-trace-cell {
  color: var(--player);
}

.protocol-line.enemy .letter.release-trace-cell {
  color: var(--enemy);
}

.letter.release-trace-cell .protocol-address {
  color: currentColor;
  opacity: 1;
}

.release-order-badge {
  position: absolute;
  right: 2px;
  bottom: 2px;
  z-index: 20;
  color: currentColor;
  font-family: var(--display-font);
  font-size: 0.35rem;
  font-style: normal;
  line-height: 1;
  pointer-events: none;
}

.enemy-shelf .flow-panel {
  height: 174px;
  max-height: 174px;
  overflow: hidden;
  padding: 0;
  background: transparent;
}

.enemy-shelf .flow-panel > header {
  display: none;
}

.enemy-shelf .flow-content {
  margin-top: 0;
}

.enemy-shelf .flow-content > .protocol-line {
  flex: 0 0 174px;
}

.buff-offer-previewing #playerBoard .letter {
  opacity: 0.28;
}

.buff-offer-previewing #playerBoard .letter:has(.pace-preview-active) {
  filter: brightness(1.35);
  opacity: 1;
}

.protocol-line.utility {
  min-height: 174px;
}

.utility-letter {
  cursor: pointer;
  background: rgba(255, 159, 53, 0.018);
  box-shadow:
    inset 0 1px rgba(241, 184, 75, 0.16),
    inset 0 -1px rgba(241, 184, 75, 0.16);
  transition:
    background 80ms step-end,
    box-shadow 80ms step-end,
    transform 80ms step-end;
}

.utility-letter.choice-start {
  box-shadow:
    inset 1px 0 rgba(241, 184, 75, 0.16),
    inset 0 1px rgba(241, 184, 75, 0.16),
    inset 0 -1px rgba(241, 184, 75, 0.16);
}

.utility-letter.choice-end {
  box-shadow:
    inset -1px 0 rgba(241, 184, 75, 0.16),
    inset 0 1px rgba(241, 184, 75, 0.16),
    inset 0 -1px rgba(241, 184, 75, 0.16);
}

.utility-letter.choice-hover {
  z-index: 5;
  background: rgba(241, 184, 75, 0.1);
  box-shadow:
    inset 0 2px var(--gold),
    inset 0 -2px var(--gold);
  color: var(--phosphor-hot);
  text-shadow: 0 0 12px currentColor;
  transform: translateY(-2px);
}

.utility-letter.choice-hover.choice-start {
  box-shadow:
    inset 2px 0 var(--gold),
    inset 0 2px var(--gold),
    inset 0 -2px var(--gold);
}

.utility-letter.choice-hover.choice-end {
  box-shadow:
    inset -2px 0 var(--gold),
    inset 0 2px var(--gold),
    inset 0 -2px var(--gold);
}

.utility-letter.mechanism-colorized {
  color: var(--mechanism-visual-color);
  text-shadow:
    0 0 8px color-mix(in srgb, var(--mechanism-visual-color) 62%, transparent);
}

.utility-letter.mechanism-colorized.choice-hover {
  color: var(--mechanism-visual-color);
  background: color-mix(in srgb, var(--mechanism-visual-color) 10%, transparent);
  box-shadow:
    inset 0 2px var(--mechanism-visual-color),
    inset 0 -2px var(--mechanism-visual-color);
  text-shadow: 0 0 12px var(--mechanism-visual-color);
}

.utility-letter.mechanism-colorized.choice-hover.choice-start {
  box-shadow:
    inset 2px 0 var(--mechanism-visual-color),
    inset 0 2px var(--mechanism-visual-color),
    inset 0 -2px var(--mechanism-visual-color);
}

.utility-letter.mechanism-colorized.choice-hover.choice-end {
  box-shadow:
    inset -2px 0 var(--mechanism-visual-color),
    inset 0 2px var(--mechanism-visual-color),
    inset 0 -2px var(--mechanism-visual-color);
}

.utility-letter.warning {
  box-shadow:
    inset 0 1px rgba(255, 209, 102, 0.46),
    inset 0 -1px rgba(255, 209, 102, 0.46);
}

.utility-letter.selected {
  color: var(--player);
  text-shadow:
    0 0 10px var(--player),
    0 0 24px rgba(97, 216, 255, 0.38);
}

.protocol-line.player-stats .utility-letter {
  color: var(--player);
}

.utility-letter.disabled {
  cursor: not-allowed;
  filter: brightness(0.45);
  opacity: 0.58;
}

.protocol-line.utility .word-tooltip {
  top: calc(100% + 12px);
}

.protocol-line.player .letter.selectable {
  cursor: pointer;
}

.protocol-line.player .letter.owned-word-target {
  background:
    linear-gradient(rgba(97, 216, 255, 0.12), rgba(97, 216, 255, 0.04)),
    var(--panel-strong);
  box-shadow:
    inset 0 1px rgba(97, 216, 255, 0.62),
    inset 0 -1px rgba(97, 216, 255, 0.62);
}

.protocol-line.player .letter.owned-word-target-start {
  border-left-color: rgba(97, 216, 255, 0.72);
  box-shadow:
    inset 1px 0 rgba(97, 216, 255, 0.62),
    inset 0 1px rgba(97, 216, 255, 0.62),
    inset 0 -1px rgba(97, 216, 255, 0.62);
}

.protocol-line.player .letter.owned-word-target-end {
  border-right-color: rgba(97, 216, 255, 0.72);
}

.protocol-line.player .letter.owned-word-target:hover,
.protocol-line.player .letter.owned-word-target:focus-visible {
  color: var(--player);
  filter: brightness(1.32);
  text-shadow: 0 0 10px rgba(97, 216, 255, 0.8);
}

.protocol-line.player .letter.owned-word-target-blocked {
  cursor: not-allowed;
  filter: grayscale(0.8) brightness(0.62);
  opacity: 0.68;
}

.protocol-line.player .letter[draggable="true"] {
  cursor: grab;
}

.protocol-line.player .letter.dragging {
  filter: brightness(1.6);
  opacity: 0.42;
}

.protocol-line.player .drag-target::before {
  color: var(--player);
  filter: brightness(1.6);
}

.flow-panel header {
  align-items: flex-start;
}

.flow-panel header span {
  max-width: 130px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.25;
  text-align: right;
}

.screen-shake {
  animation: shake var(--quarter-beat-ms) linear;
}

@keyframes digital-snap {
  0% {
    filter: brightness(1.45);
  }
  100% {
    filter: brightness(1);
  }
}

@keyframes countdown-brightness {
  0% {
    filter: brightness(1.8);
    text-shadow:
      0 0 16px currentColor,
      0 0 34px rgba(241, 184, 75, 0.34);
  }
  100% {
    filter: brightness(1);
  }
}

@keyframes result-ready-pulse {
  50% {
    color: var(--phosphor-hot);
    filter: brightness(1.35);
    text-shadow:
      0 0 12px currentColor,
      0 0 28px rgba(156, 255, 154, 0.42);
  }
}

@keyframes battle-source-lock {
  0% {
    opacity: 0;
    filter: brightness(2);
    transform: translate(-50%, -50%) scale(0.55);
  }
  24%,
  76% {
    opacity: 1;
    filter: brightness(1.8);
    transform: translate(-50%, -50%) scale(1.14);
  }
  100% {
    opacity: 0;
    filter: brightness(1);
    transform: translate(-50%, -50%) scale(0.9);
  }
}

@keyframes battle-skill-source-lock {
  0% {
    filter: brightness(2);
    transform: scale(0.7);
  }
  24%,
  76% {
    filter: brightness(1.9);
    transform: scale(1.18);
  }
  100% {
    filter: brightness(1);
    transform: scale(0.94);
  }
}

@keyframes battle-skill-source-frame {
  0% {
    opacity: 0;
    transform: scale(0.72);
  }
  24%,
  76% {
    opacity: 0.75;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.22);
  }
}

@keyframes battle-route-live {
  0% {
    opacity: 0;
    filter: brightness(1.8);
  }
  8%,
  82% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    filter: brightness(0.8);
  }
}

@keyframes battle-projectile-flight {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.72);
  }
  6% {
    opacity: 1;
  }
  88% {
    opacity: 1;
    filter: brightness(1.2);
  }
  100% {
    opacity: 0;
    filter: brightness(2);
    transform: translate(calc(var(--fx-distance) - 50%), -50%) scale(1.18);
  }
}

@keyframes battle-target-lock {
  0% {
    opacity: 0;
    filter: brightness(2.2);
    transform: translate(-50%, -50%) scale(0.45);
  }
  18%,
  58% {
    opacity: 1;
    filter: brightness(1.8);
    transform: translate(-50%, -50%) scale(1.35);
  }
  100% {
    opacity: 0;
    filter: brightness(1);
    transform: translate(-50%, -50%) scale(0.9);
  }
}

@keyframes battle-effect-float {
  0% {
    opacity: 0;
    filter: brightness(2);
    transform: translate(-50%, -50%) scale(0.75);
  }
  12%,
  72% {
    opacity: 1;
    filter: brightness(1.35);
  }
  100% {
    opacity: 0;
    filter: brightness(0.75);
    transform:
      translate(
        calc(-50% + var(--fx-float-x)),
        calc(-50% + var(--fx-float-y))
      )
      scale(1);
  }
}

@keyframes dseg-backdrop-pulse {
  0% {
    opacity: 0.82;
    filter: brightness(1.35);
  }
  100% {
    opacity: 0.68;
    filter: brightness(1);
  }
}

@keyframes hp-burn-idle {
  0%,
  14%,
  34%,
  54%,
  74%,
  100% {
    filter: brightness(var(--hp-burn-brightness, 1));
  }
  15%,
  28%,
  55%,
  68% {
    filter: brightness(1.7);
  }
}

@keyframes hp-poison-idle {
  0%,
  100% {
    filter: brightness(var(--hp-poison-brightness, 1)) saturate(0.9);
  }
  50% {
    filter: brightness(1.45) saturate(1.3);
  }
}

@keyframes hp-burn-poison-idle {
  0%,
  44%,
  100% {
    color: var(--mechanism-poison);
    filter: brightness(var(--hp-poison-brightness, 1)) saturate(0.9);
  }
  45%,
  54%,
  65%,
  74% {
    color: var(--mechanism-burn);
    filter: brightness(1.7);
  }
  55%,
  64%,
  75%,
  86% {
    color: var(--mechanism-burn);
    filter: brightness(var(--hp-burn-brightness, 1));
  }
  87%,
  99% {
    color: var(--mechanism-poison);
    filter: brightness(1.45) saturate(1.3);
  }
}

@keyframes hp-status-impact {
  0% {
    filter: brightness(2.4);
  }
  58% {
    filter: brightness(1.45);
  }
  100% {
    filter: brightness(0.9);
  }
}

@keyframes hp-zero-anomaly {
  0% {
    opacity: 0.18;
    filter: brightness(0.5);
    transform: translate(-50%, -50%) scale(0.76);
  }
  14%,
  42% {
    opacity: 1;
    filter: brightness(1.9);
    transform: translate(-50%, -50%) scale(1.14);
  }
  43%,
  56% {
    opacity: 0.42;
    filter: brightness(0.76);
    transform: translate(-50%, -50%) scale(0.92);
  }
  57%,
  84% {
    opacity: 0.94;
    filter: brightness(1.4);
    transform: translate(-50%, -50%) scale(1.06);
  }
  100% {
    opacity: 0.14;
    filter: brightness(0.62);
    transform: translate(-50%, -50%) scale(0.84);
  }
}

@keyframes shake {
  25% {
    transform: translateX(-5px);
  }
  50% {
    transform: translateX(5px);
  }
  75% {
    transform: translateX(-3px);
  }
}

@media (max-width: 995px) {
  :root {
    --slot-w: 42px;
    --slot-font-size: 3.1rem;
  }

  .app {
    width: min(860px, calc(100vw - 12px));
  }

  .arena {
    grid-template-columns: 92px minmax(0, 1fr) 210px;
  }

  .topbar {
    align-items: center;
  }

  .hero-hud {
    grid-template-columns: 72px minmax(180px, 1fr) 72px;
  }

  .hud-slots {
    grid-template-columns: repeat(3, 20px);
    gap: 4px;
  }

  .side-token,
  .side-spacer {
    min-height: 58px;
    font-size: 0.62rem;
  }

  .event-corner-slot {
    height: 58px;
  }

  .event-corner-slot:has(#eventStepButton:not([hidden])):has(#eventAltButton:not([hidden])) {
    height: 96px;
  }

  .countdown-panel {
    min-height: 180px;
  }

  .countdown-ring {
    width: 72px;
  }

  .countdown-number {
    font-size: 2.35rem;
  }

  .rewards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 840px) {
  .arena {
    grid-template-columns: 1fr;
  }

  .bazaar-side {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: auto;
  }

  .left-market {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .countdown-panel {
    min-height: 0;
    min-width: 0;
  }

  .right-market > #flowHome:has(.release-trace) {
    grid-column: 1 / -1;
  }

  .countdown-panel.mapping-open {
    z-index: 90;
  }

  .countdown-panel:not(.mapping-open) .mapping-tooltip {
    display: none;
  }

  .countdown-panel.mapping-open .mapping-tooltip {
    position: fixed;
    top: 6px;
    right: auto;
    bottom: auto;
    left: 6px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: calc(100vw - 12px);
    padding: 9px 6px;
    border-block: 1px solid var(--rim);
    background: rgba(24, 27, 24, 0.97);
    font-size: 0.6rem;
    text-align: center;
    transform: none;
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-wrap: wrap;
    gap: 4px;
  }

  .topbar > strong {
    width: 100%;
  }
}

@media (max-width: 560px) {
  :root {
    --slot-w: 30px;
    --slot-h: 44px;
    --slot-font-size: 2.2rem;
  }

  .arena {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-wrap: wrap;
    gap: 4px;
  }

  .run-stats {
    display: grid;
    grid-template-columns: repeat(6, max-content);
    width: 100%;
    justify-content: space-between;
    gap: 4px;
  }

  .keyword-reference {
    align-items: end;
    padding: 6px;
  }

  .keyword-reference-card {
    gap: 11px;
    max-height: calc(100dvh - 12px);
    padding: 14px 12px;
  }

  .keyword-reference-card > header {
    gap: 10px;
  }

  .keyword-reference-card > header strong {
    font-size: 0.9rem;
  }

  .keyword-reference-groups {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .keyword-reference-entry {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .operator-claim-readout {
    justify-self: start;
    font-size: 0.58rem;
  }

  .operator-claim-readout > small {
    display: none;
  }

  .protocol-line {
    column-gap: 3px;
    row-gap: 8px;
    min-height: 125px;
    padding-inline: 4px;
  }

  .protocol-address {
    top: 1px;
    left: 1px;
    font-size: 0.3rem;
  }

  .word-protocol-readout {
    top: -7px;
    left: 1px;
    max-width: 96px;
    font-size: 0.44rem;
  }

  .bazaar-side {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto;
  }

  .left-market {
    grid-template-columns: repeat(2, 1fr);
  }

  .mock-active .event-corner-slot {
    height: 82px;
  }

  .countdown-panel {
    min-height: 0;
  }

}

/* Isolated, deterministic artwork view: index.html?cover=itchio */
.cover-screen[hidden] {
  display: none;
}

body.cover-active {
  width: 100vw;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
}

body.cover-active > :not(.cover-screen) {
  display: none !important;
}

body.cover-active .cover-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 48%, rgba(241, 184, 75, 0.055), transparent 48%),
    linear-gradient(145deg, #1d211e 0%, #141714 52%, #1a1d1a 100%);
  opacity: 0;
}

body.cover-active.cover-ready .cover-screen {
  opacity: 1;
}

body.cover-active *,
body.cover-active *::before,
body.cover-active *::after {
  animation: none !important;
  transition: none !important;
}

.cover-device {
  position: relative;
  width: min(100vw, 630px);
  height: min(100vh, 500px);
  overflow: hidden;
  border: 1px solid var(--rim);
  background:
    linear-gradient(rgba(255, 248, 234, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 248, 234, 0.012) 1px, transparent 1px),
    radial-gradient(circle at 50% 57%, rgba(241, 184, 75, 0.07), transparent 38%),
    linear-gradient(180deg, #1b1e1b 0%, #121512 46%, #171a17 100%);
  background-size: 5px 5px, 5px 5px, auto, auto;
  box-shadow:
    inset 0 0 0 3px #080705,
    inset 0 0 0 4px rgba(142, 98, 54, 0.5),
    inset 0 0 48px rgba(0, 0, 0, 0.9),
    0 0 36px rgba(0, 0, 0, 0.9);
}

.cover-device::before,
.cover-device::after {
  content: "";
  position: absolute;
  z-index: 3;
  pointer-events: none;
}

.cover-device::before {
  inset: 8px;
  border: 1px solid rgba(255, 210, 140, 0.08);
  clip-path: polygon(
    0 18px,
    18px 0,
    calc(100% - 18px) 0,
    100% 18px,
    100% calc(100% - 18px),
    calc(100% - 18px) 100%,
    18px 100%,
    0 calc(100% - 18px)
  );
}

.cover-device::after {
  inset: 0;
  background:
    linear-gradient(104deg, transparent 0 18%, rgba(255, 248, 232, 0.03) 29%, transparent 43%),
    radial-gradient(ellipse at 50% 45%, transparent 52%, rgba(0, 0, 0, 0.48) 100%);
  mix-blend-mode: screen;
}

.cover-mark {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(30px, 7vh, 44px);
  width: min(82%, 520px);
  height: 72%;
  margin: 11% auto 0;
}

.cover-title {
  display: grid;
  justify-items: center;
  gap: 13px;
  width: 100%;
  text-align: center;
}

.cover-title h1 {
  margin: 0;
  color: var(--gold);
  font-family: var(--device-font);
  font-size: clamp(1.7rem, 5.4vw, 2.45rem);
  line-height: 1;
  white-space: nowrap;
  text-shadow: 0 0 18px rgba(241, 184, 75, 0.32);
}

.cover-title-rail {
  width: 100%;
  height: 10px;
  overflow: hidden;
  color: var(--gold);
  font-family: var(--display-font);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  text-shadow: 0 0 9px currentColor;
}

.cover-title-rail-dim {
  color: var(--glyph-line-dim);
}

.cover-clock {
  position: relative;
  display: grid;
  place-items: center;
  align-self: center;
  justify-self: center;
  aspect-ratio: 1;
  width: min(100%, 270px);
  min-height: 0;
  background:
    radial-gradient(circle, rgba(241, 184, 75, 0.075), transparent 64%);
}

.cover-countdown-frame,
.cover-clock > strong {
  grid-area: 1 / 1;
  align-self: center;
  font-family: var(--seven-segment-font);
  font-size: clamp(9rem, 35vw, 14rem);
  font-weight: 700;
  line-height: 1;
}

.cover-countdown-frame {
  color: var(--phosphor-off);
  opacity: 0.56;
}

.cover-clock > strong {
  position: relative;
  color: var(--gold);
  text-shadow: 0 0 14px currentColor;
}

.cover-motion-pair[hidden] {
  display: none;
}

body.cover-active.cover-motion .cover-clock {
  aspect-ratio: 3 / 2;
  width: min(100%, 360px);
}

body.cover-active.cover-motion .cover-countdown-frame,
body.cover-active.cover-motion .cover-clock > strong {
  display: none;
}

body.cover-active.cover-motion .cover-motion-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  justify-items: center;
  gap: 24px;
  width: 100%;
  font-family: var(--seven-segment-font);
  font-size: clamp(6.5rem, 22vw, 8.5rem);
  font-weight: 700;
  line-height: 1;
}

.cover-motion-digit {
  color: var(--gold);
  text-shadow: 0 0 14px currentColor;
}

.cover-motion-letter {
  color: var(--player);
  text-shadow:
    0 0 12px currentColor,
    0 0 30px rgba(97, 216, 255, 0.28);
}

.cover-motion-letter.cover-motion-unmapped {
  color: var(--phosphor-off);
  opacity: 0.7;
  text-shadow: none;
}

@media (max-height: 360px) {
  .cover-mark {
    grid-template-columns: 1fr minmax(0, 1.3fr);
    grid-template-rows: 1fr;
    align-items: center;
    gap: 24px;
    width: 76%;
    height: 72%;
    margin-top: 8%;
  }

  .cover-title h1 {
    white-space: normal;
  }

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

@media (prefers-reduced-motion: reduce) {
  .countdown-zero-array *,
  .hp-zero-array *,
  .clock-line-glyph-anomalous {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }

  .start-countdown.awaiting-activation::before,
  .start-countdown.awaiting-activation > strong {
    animation: none;
  }

  #playerAvatar.signal-desync,
  #playerAvatar.signal-lock::before {
    animation-duration: 1ms;
    animation-iteration-count: 1;
  }
}

.primary-action {
  position: relative;
  z-index: 2;
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  filter: brightness(1.18);
}

.shelf header > span:has(#playerShelfTitle) {
  display: grid;
  gap: 2px;
}

#playerShelfTitle {
  color: var(--player);
  font-family: var(--display-font);
  font-size: 0.78rem;
}

#playerShelfPurpose,
#chestPurpose {
  display: block;
  color: var(--muted);
  font-family: var(--tooltip-font);
  font-size: 0.56rem;
  font-weight: 400;
  line-height: 1.2;
  text-transform: uppercase;
}

.player-shelf-interaction-hint {
  display: block;
  color: var(--gold);
  font-family: var(--tooltip-font);
  font-size: 0.5rem;
  font-weight: 400;
  line-height: 1.2;
  text-transform: uppercase;
}

.touch-interaction-hint {
  display: none;
}

.chest-token {
  grid-template-columns: minmax(0, 1fr) auto;
  text-align: left;
}

.chest-token > span,
.chest-token > small {
  justify-self: start;
}

.chest-token > strong {
  grid-row: 1 / span 2;
  grid-column: 2;
}

.market-offer-list {
  display: grid;
  gap: 6px;
}

.market-offer-protocol {
  min-height: 174px;
}

.market-offer-summary-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px;
}

.market-offer-summary {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 6px 4px;
  border-block: 1px solid var(--glyph-line-dim);
}

.market-offer-summary {
  color: var(--ink);
  font-family: var(--tooltip-font);
  font-size: 0.62rem;
  line-height: 1.25;
}

.market-offer-summary strong {
  color: var(--gold);
  font-weight: 400;
}

.market-offer-summary small {
  color: var(--muted);
  font-size: 0.58rem;
}

.market-offer-summary.touch-selected {
  border-color: var(--gold);
  background: linear-gradient(90deg, rgba(241, 184, 75, 0.08), transparent 72%);
}

.market-offer-protocol .utility-letter.touch-selected {
  color: var(--phosphor-hot);
  box-shadow:
    inset 0 2px var(--gold),
    inset 0 -2px var(--gold);
}

.market-touch-confirm {
  color: var(--gold);
  font-size: 0.62rem;
}

.touch-confirm-live {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.onboarding-cause {
  position: fixed;
  z-index: 110;
  top: 10px;
  left: 50%;
  display: grid;
  gap: 3px;
  width: min(520px, calc(100vw - 20px));
  padding: 10px 14px;
  border-block: 1px solid var(--gold);
  background: rgba(24, 27, 24, 0.96);
  color: var(--phosphor-hot);
  font-family: var(--tooltip-font);
  font-size: 0.68rem;
  line-height: 1.35;
  text-align: center;
  transform: translateX(-50%);
  box-shadow: 0 0 20px rgba(241, 184, 75, 0.18);
  pointer-events: none;
}

.onboarding-cause[hidden] {
  display: none;
}

.onboarding-cause strong {
  color: var(--gold);
  font-weight: 400;
}

.app.onboarding-hold .countdown-panel {
  filter: brightness(1.18);
}

.battle-auto-copy {
  color: var(--gold);
}

@media (max-width: 840px) {
  .market-offer-summary-list {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
}

@media (max-width: 560px) {
  #playerShelfPurpose,
  #chestPurpose,
  .player-shelf-interaction-hint {
    font-size: 0.5rem;
  }

  .market-offer-summary {
    font-size: 0.58rem;
  }

  .market-offer-summary-list {
    grid-template-columns: 1fr;
  }

  .onboarding-cause {
    top: 4px;
    width: calc(100vw - 8px);
    padding: 8px;
    font-size: 0.62rem;
  }
}

@media (hover: none), (pointer: coarse) {
  .pointer-interaction-hint {
    display: none;
  }

  .touch-interaction-hint {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  .primary-action,
  .market-offer-summary.touch-selected,
  .onboarding-cause {
    animation: none !important;
  }
}
