:root {
  --font-display: "Orbitron", "Segoe UI", sans-serif;
  --font-base: "Exo 2", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "Consolas", monospace;
  --pointer-x: 72vw;
  --pointer-y: 22vh;
  --bg-0: #040a12;
  --bg-1: #08111d;
  --bg-2: #0d1c2d;
  --panel: rgba(7, 18, 31, 0.84);
  --panel-strong: rgba(8, 24, 40, 0.94);
  --panel-soft: rgba(12, 34, 54, 0.68);
  --line: rgba(74, 205, 255, 0.24);
  --line-strong: rgba(74, 205, 255, 0.72);
  --line-hot: rgba(29, 244, 255, 0.96);
  --text: #d9f8ff;
  --text-dim: #7fa8bb;
  --text-faint: #4d6b7d;
  --cyan: #22d3ee;
  --cyan-strong: #09b8ff;
  --teal: #14f1c6;
  --green: #63ffa7;
  --amber: #ffd166;
  --red: #ff6b8b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 0 1px rgba(34, 211, 238, 0.18), 0 0 32px rgba(9, 184, 255, 0.12);
  --focus-ring: 0 0 0 4px rgba(34, 211, 238, 0.14);
}

body.light {
  --bg-0: #04111c;
  --bg-1: #081725;
  --bg-2: #10273a;
  --panel: rgba(8, 21, 34, 0.86);
  --panel-strong: rgba(10, 27, 43, 0.94);
  --panel-soft: rgba(12, 36, 56, 0.72);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-base);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(34, 211, 238, 0.16), transparent 24%),
    radial-gradient(circle at 86% 12%, rgba(20, 241, 198, 0.11), transparent 16%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg-1) 48%, var(--bg-0) 100%);
  transition: background 0.3s ease, color 0.3s ease;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  background:
    linear-gradient(rgba(74, 205, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74, 205, 255, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.6), transparent 86%);
}

body::after {
  background:
    radial-gradient(circle 220px at var(--pointer-x) var(--pointer-y), rgba(34, 211, 238, 0.2), transparent 68%),
    radial-gradient(circle 100px at var(--pointer-x) var(--pointer-y), rgba(20, 241, 198, 0.1), transparent 72%);
  transition: background 0.06s linear;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
}

.anime-shell {
  position: relative;
  min-height: 100vh;
  padding: 14px 16px 28px;
  overflow: hidden;
}

.anime-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 4px);
  mix-blend-mode: soft-light;
  opacity: 0.28;
  pointer-events: none;
  z-index: 1;
}

.anime-container {
  position: relative;
  z-index: 2;
  width: min(1320px, 100%);
  margin: 0 auto;
}

.manga-rays,
.ink-cloud,
.dot-screen {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.manga-rays {
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.06), transparent 30%),
    linear-gradient(315deg, rgba(20, 241, 198, 0.05), transparent 24%);
}

.ink-cloud {
  width: 440px;
  height: 440px;
  border-radius: 999px;
  filter: blur(70px);
  opacity: 0.85;
}

.ink-cloud-a {
  inset: -120px auto auto -120px;
  background: rgba(9, 184, 255, 0.18);
}

.ink-cloud-b {
  inset: auto -160px -140px auto;
  background: rgba(20, 241, 198, 0.14);
}

.dot-screen {
  background-image: radial-gradient(rgba(105, 221, 255, 0.08) 0.8px, transparent 0.8px);
  background-size: 18px 18px;
  opacity: 0.35;
}

.panel-frame {
  position: relative;
  background:
    linear-gradient(180deg, rgba(18, 52, 78, 0.18), transparent 40%),
    var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), var(--shadow-glow);
  backdrop-filter: blur(18px);
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.panel-frame::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(74, 205, 255, 0.08);
  pointer-events: none;
}

.panel-frame::after {
  content: "";
  position: absolute;
  top: 0;
  left: 26px;
  width: 92px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--line-hot), transparent);
  box-shadow: 0 0 18px rgba(29, 244, 255, 0.45);
  pointer-events: none;
}

.panel-frame:hover {
  border-color: rgba(74, 205, 255, 0.34);
  box-shadow: var(--shadow), 0 0 0 1px rgba(34, 211, 238, 0.22), 0 0 38px rgba(9, 184, 255, 0.12);
}

.hero-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  padding: 18px 20px;
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.08), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 46%),
    var(--panel-strong);
}

.hero-main,
.mission-column,
.battle-column,
.field-group,
.launch-copy {
  display: flex;
  flex-direction: column;
}

.hero-main,
.mission-column,
.battle-column {
  gap: 14px;
}

.hero-main {
  max-width: 860px;
}

.hero-stamps,
.hero-topline,
.hero-actions,
.control-deck,
.copy-actions,
.filter-tabs,
.task-actions,
.command-actions,
.credit-copy,
.panel-topline,
.intel-topline,
.burst-topline,
.radar-row,
.task-query-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-stamps,
.hero-actions,
.copy-actions,
.filter-tabs,
.task-actions {
  flex-wrap: wrap;
}

.hero-topline {
  justify-content: space-between;
  align-items: flex-start;
}

.hero-actions {
  gap: 10px;
}

.hero-actions .button-primary,
.hero-actions .button-secondary {
  min-height: 42px;
  padding: 0 14px;
}

.stamp-badge,
.panel-ribbon,
.signal-tag,
.episode-index,
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  background: rgba(10, 33, 53, 0.86);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(34, 211, 238, 0.26);
}

.status-badge {
  color: var(--text);
}

.tone-success.status-badge {
  color: var(--green);
}

.tone-warning.status-badge {
  color: var(--amber);
}

.tone-danger.status-badge {
  color: var(--red);
}

.hero-kicker {
  margin: 0 0 6px;
  color: var(--teal);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 4.5rem);
  line-height: 0.9;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ebfdff;
  text-shadow:
    0 0 14px rgba(34, 211, 238, 0.26),
    0 0 32px rgba(9, 184, 255, 0.18);
}

.hero-subtitle,
.panel-copy,
.episode-note,
.signal-note,
.helper-text,
.credit-line,
.burst-note,
.command-note {
  color: var(--text-dim);
}

.hero-subtitle {
  margin: 6px 0 0;
  max-width: 48ch;
  font-size: 0.95rem;
  line-height: 1.55;
}

.control-deck {
  justify-content: flex-end;
  gap: 10px;
}

.lang-toggle,
.icon-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 38px;
  border: 1px solid var(--line-strong);
  background: rgba(7, 18, 31, 0.92);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

.lang-toggle:hover,
.icon-toggle:hover {
  border-color: var(--line-hot);
  color: var(--cyan);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.18), 0 0 22px rgba(9, 184, 255, 0.18);
  transform: translateY(-1px);
}

.burst-card {
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.08), transparent 34%),
    var(--panel-soft);
  border: 1px solid var(--line);
}

.burst-topline,
.panel-topline,
.intel-topline,
.radar-row,
.credit-copy,
.task-query-row {
  justify-content: space-between;
}

.burst-title {
  margin: 10px 0 6px;
  font-family: var(--font-display);
  font-size: 1.32rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.signal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.signal-card {
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(34, 211, 238, 0.08), transparent 34%),
    rgba(8, 25, 40, 0.72);
  border: 1px solid rgba(74, 205, 255, 0.18);
}

.signal-value {
  display: block;
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 1.08rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.signal-note {
  display: block;
  margin-top: 6px;
  font-size: 0.8rem;
  line-height: 1.45;
}

.story-board {
  display: grid;
  grid-template-columns: minmax(290px, 340px) minmax(0, 1fr);
  gap: 20px;
  margin-top: 12px;
}

.mission-column,
.battle-column {
  gap: 20px;
}

.mission-panel,
.radar-panel,
.command-stage,
.credit-strip {
  padding: 22px;
}

.command-stage--main {
  padding: 26px;
}

.duel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.panel-head {
  margin-bottom: 18px;
}

.panel-title {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-copy {
  margin: 10px 0 0;
  font-size: 0.92rem;
  line-height: 1.7;
}

.guide-list {
  display: grid;
  gap: 14px;
}

.guide-episode {
  display: grid;
  gap: 10px;
  padding: 16px;
  background: rgba(8, 25, 40, 0.56);
  border: 1px solid rgba(74, 205, 255, 0.14);
}

.guide-episode.tone-green {
  border-left: 3px solid var(--green);
}

.guide-episode.tone-blue {
  border-left: 3px solid var(--cyan);
}

.guide-episode.tone-yellow {
  border-left: 3px solid var(--amber);
}

.episode-title {
  margin: 0 0 6px;
  font-size: 1rem;
}

.episode-note {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.65;
}

.radar-list {
  display: grid;
  gap: 10px;
}

.radar-row {
  padding: 12px 14px;
  background: rgba(8, 25, 40, 0.54);
  border: 1px solid rgba(74, 205, 255, 0.14);
}

.radar-label {
  font-weight: 600;
  color: var(--text);
}

.command-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.command-card,
.intel-card,
.result-stage,
.empty-panel,
.launch-panel,
.usage-card {
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(34, 211, 238, 0.06), transparent 28%),
    rgba(8, 25, 40, 0.56);
  border: 1px solid rgba(74, 205, 255, 0.16);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.command-card:hover,
.intel-card:hover,
.result-stage:hover,
.launch-panel:hover,
.usage-card:hover {
  transform: translateY(-2px);
  border-color: rgba(74, 205, 255, 0.32);
  box-shadow: 0 0 26px rgba(9, 184, 255, 0.08);
}

.command-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.step-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line-strong);
  background: rgba(9, 184, 255, 0.14);
  color: var(--cyan);
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: inset 0 0 22px rgba(34, 211, 238, 0.1);
}

.command-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.command-note {
  margin-top: 4px;
  font-size: 0.88rem;
}

.field-group {
  gap: 10px;
}

.channel-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.channel-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(74, 205, 255, 0.18);
  background: rgba(5, 16, 27, 0.84);
  color: var(--text-dim);
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.channel-chip:hover {
  border-color: var(--line-hot);
  color: var(--cyan);
}

.channel-chip.is-active {
  border-color: rgba(34, 211, 238, 0.52);
  background: linear-gradient(135deg, rgba(9, 184, 255, 0.18), rgba(20, 241, 198, 0.08));
  color: var(--cyan);
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.12), 0 0 18px rgba(9, 184, 255, 0.08);
}

.channel-chip:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

.command-actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.command-actions .input-field {
  flex: 1 1 auto;
  min-width: 0;
}

.command-actions .button-primary,
.command-actions .button-secondary,
.command-actions .button-link,
.task-actions .button-primary,
.task-actions .button-secondary,
.task-actions .button-link {
  flex: 0 0 auto;
}

.input-field {
  width: 100%;
  min-height: 50px;
  padding: 14px 16px;
  border: 1px solid rgba(74, 205, 255, 0.18);
  background: rgba(4, 14, 24, 0.86);
  color: var(--text);
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.input-field::placeholder {
  color: var(--text-faint);
}

.input-field:focus {
  border-color: var(--line-hot);
  box-shadow: var(--focus-ring), 0 0 26px rgba(9, 184, 255, 0.08);
  transform: translateY(-1px);
}

.input-field.success {
  border-color: rgba(99, 255, 167, 0.48);
}

.input-field.error {
  border-color: rgba(255, 107, 139, 0.48);
}

.token-field {
  min-height: 168px;
  resize: vertical;
  font-family: var(--font-mono);
  line-height: 1.55;
}

.button-primary,
.button-secondary,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  color: var(--text);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-mono);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.button-primary,
.button-link {
  background: linear-gradient(135deg, rgba(9, 184, 255, 0.24), rgba(20, 241, 198, 0.14));
}

.button-secondary {
  background: rgba(6, 18, 30, 0.78);
}

.button-primary:hover,
.button-secondary:hover,
.button-link:hover,
.channel-chip:hover,
.launch-button:hover {
  border-color: var(--line-hot);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.16), 0 0 20px rgba(9, 184, 255, 0.12);
  transform: translateY(-1px);
  color: var(--cyan);
}

.launch-button--channel2 {
  background: linear-gradient(135deg, rgba(17, 88, 255, 0.22), rgba(9, 184, 255, 0.18));
}

.button-primary--large {
  min-width: 220px;
  min-height: 54px;
}

.button-link:disabled,
.button-primary:disabled,
.button-secondary:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.helper-text,
.status-inline {
  font-size: 0.9rem;
}

.status-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
}

.status-success {
  color: var(--green);
}

.status-error {
  color: var(--red);
}

.status-info {
  color: var(--text-dim);
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(74, 205, 255, 0.18);
  border-top-color: var(--line-hot);
  animation: spin 0.8s linear infinite;
}

.intel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.intel-topline {
  justify-content: space-between;
  margin-bottom: 14px;
}

.intel-topline h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.task-summary {
  display: grid;
  gap: 12px;
}

.task-identity {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.72rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.metric-value {
  display: block;
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.info-grid {
  display: grid;
  gap: 12px;
}

.task-kv {
  display: grid;
  grid-template-columns: 122px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  font-size: 0.92rem;
  word-break: break-word;
}

.task-kv strong {
  color: var(--text-dim);
  font-weight: 600;
}

.task-kv--wide {
  grid-template-columns: 1fr;
}

.verified-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.verified-list li {
  padding: 12px 14px;
  background: rgba(4, 14, 24, 0.54);
  border: 1px solid rgba(74, 205, 255, 0.14);
  line-height: 1.65;
  word-break: break-word;
}

.task-progress {
  height: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(74, 205, 255, 0.12);
}

.task-progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--cyan-strong), var(--teal));
  box-shadow: 0 0 18px rgba(9, 184, 255, 0.24);
  transition: width 0.24s ease;
}

.launch-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  background:
    linear-gradient(135deg, rgba(9, 184, 255, 0.1), rgba(20, 241, 198, 0.06)),
    rgba(8, 25, 40, 0.66);
}

.launch-copy {
  gap: 6px;
}

.launch-copy h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.launch-copy p {
  margin: 0;
  line-height: 1.7;
  color: var(--text-dim);
}

.lookup-console,
.batch-console {
  display: grid;
  gap: 14px;
}

.result-stage,
.empty-panel {
  margin-top: 18px;
}

.empty-panel {
  color: var(--text-dim);
  text-align: center;
}

.power-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.power-pill {
  display: flex;
  flex-direction: column;
  padding: 14px;
  background: rgba(8, 25, 40, 0.62);
  border: 1px solid rgba(74, 205, 255, 0.14);
}

.power-pill strong {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.power-pill em {
  margin-top: 6px;
  color: var(--text-dim);
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.filter-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(74, 205, 255, 0.22);
  background: rgba(6, 18, 30, 0.74);
  color: var(--text-dim);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.filter-tab.is-active,
.filter-tab:hover {
  border-color: var(--line-hot);
  color: var(--cyan);
  box-shadow: 0 0 18px rgba(9, 184, 255, 0.12);
  transform: translateY(-1px);
}

.usage-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.query-result pre,
.modal-message pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.6;
}

.credit-strip {
  margin-top: 20px;
  padding: 18px 22px;
}

.credit-copy {
  justify-content: space-between;
  flex-wrap: wrap;
}

.credit-line {
  margin: 0;
  line-height: 1.7;
}

.modal-root {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(2, 8, 14, 0.72);
  backdrop-filter: blur(8px);
  z-index: 1000;
}

.modal-root.is-open {
  display: flex;
}

.modal-card {
  position: relative;
  overflow: hidden;
  width: min(560px, 100%);
  padding: 24px;
  background: var(--panel-strong);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow), var(--shadow-glow);
}

.modal-card--loading {
  border-color: rgba(74, 205, 255, 0.34);
}

.modal-card--success {
  border-color: rgba(99, 255, 167, 0.36);
  box-shadow: var(--shadow), 0 0 40px rgba(99, 255, 167, 0.12), var(--shadow-glow);
}

.modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: 1px solid var(--line-strong);
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.modal-icon.success {
  color: var(--green);
}

.modal-icon.error {
  color: var(--red);
}

.modal-icon.info {
  color: var(--cyan);
}

.modal-icon.loading {
  color: var(--cyan);
}

.modal-spinner {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid rgba(74, 205, 255, 0.18);
  border-top-color: var(--line-hot);
  animation: spin 0.8s linear infinite;
}

.modal-title {
  margin: 16px 0 10px;
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.fireworks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.firework {
  position: absolute;
  left: var(--firework-x);
  top: var(--firework-y);
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: hsl(var(--firework-hue) 95% 66%);
  box-shadow:
    0 0 0 0 rgba(255, 255, 255, 0.7),
    0 0 18px hsl(var(--firework-hue) 95% 66%);
  transform: translate(-50%, -50%) scale(0.18);
  opacity: 0;
  animation: firework-burst 1.8s ease-out infinite;
  animation-delay: var(--firework-delay);
}

.firework::before,
.firework::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: inherit;
}

.firework::before {
  transform: rotate(45deg) scale(1.9, 0.22);
}

.firework::after {
  transform: rotate(-45deg) scale(1.9, 0.22);
}

.not-found {
  padding: 72px 24px;
  text-align: center;
}

.not-found h1 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 3rem;
  letter-spacing: 0.1em;
}

html[dir="rtl"] .hero-stage,
html[dir="rtl"] .story-board,
html[dir="rtl"] .duel-grid,
html[dir="rtl"] .command-grid,
html[dir="rtl"] .intel-grid,
html[dir="rtl"] .power-bar,
html[dir="rtl"] .signal-grid {
  direction: rtl;
}

html[dir="rtl"] .hero-topline,
html[dir="rtl"] .hero-actions,
html[dir="rtl"] .hero-stamps,
html[dir="rtl"] .control-deck,
html[dir="rtl"] .copy-actions,
html[dir="rtl"] .filter-tabs,
html[dir="rtl"] .task-actions,
html[dir="rtl"] .command-actions,
html[dir="rtl"] .credit-copy,
html[dir="rtl"] .panel-topline,
html[dir="rtl"] .intel-topline,
html[dir="rtl"] .burst-topline,
html[dir="rtl"] .radar-row,
html[dir="rtl"] .task-query-row,
html[dir="rtl"] .command-head {
  flex-direction: row-reverse;
}

html[dir="rtl"] .task-kv {
  grid-template-columns: minmax(0, 1fr) 122px;
}

html[dir="rtl"] .control-deck {
  justify-content: flex-start;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes firework-burst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.16);
    box-shadow:
      0 0 0 0 rgba(255, 255, 255, 0.7),
      0 0 8px hsl(var(--firework-hue) 95% 66%);
  }

  18% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.9);
    box-shadow:
      0 0 0 16px rgba(255, 255, 255, 0),
      0 0 22px hsl(var(--firework-hue) 95% 66%),
      24px 0 0 -2px hsl(var(--firework-hue) 95% 66%),
      -24px 0 0 -2px hsl(var(--firework-hue) 95% 66%),
      0 24px 0 -2px hsl(var(--firework-hue) 95% 66%),
      0 -24px 0 -2px hsl(var(--firework-hue) 95% 66%),
      17px 17px 0 -2px hsl(var(--firework-hue) 95% 66%),
      -17px 17px 0 -2px hsl(var(--firework-hue) 95% 66%),
      17px -17px 0 -2px hsl(var(--firework-hue) 95% 66%),
      -17px -17px 0 -2px hsl(var(--firework-hue) 95% 66%);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow:
      0 0 0 28px rgba(255, 255, 255, 0),
      0 0 10px rgba(255, 255, 255, 0);
  }
}

@media (max-width: 1120px) {
  .hero-stage,
  .story-board,
  .duel-grid,
  .command-grid,
  .intel-grid,
  .power-bar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body::after {
    display: none;
  }

  .anime-shell {
    padding-inline: 12px;
    padding-top: 14px;
  }

  .command-stage,
  .modal-card {
    padding: 18px;
  }

  .hero-stage,
  .mission-column,
  .duel-grid > .command-stage:first-child,
  .credit-strip {
    display: none;
  }

  .story-board {
    margin-top: 0;
  }

  .battle-column {
    gap: 16px;
  }

  .hero-actions,
  .command-actions,
  .task-actions,
  .task-query-row,
  .launch-panel,
  .credit-copy {
    flex-direction: column;
    align-items: stretch;
  }

  .button-primary,
  .button-secondary,
  .button-link,
  .button-primary--large {
    width: 100%;
  }

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

  .task-kv {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .panel-topline,
  .intel-topline,
  .radar-row,
  .burst-topline {
    flex-direction: column;
    align-items: flex-start;
  }
}
