:root {
  color-scheme: dark;
  --bg: #05070a;
  --panel: rgba(8, 15, 19, 0.82);
  --panel-strong: rgba(12, 23, 27, 0.94);
  --line: rgba(105, 255, 218, 0.22);
  --line-strong: rgba(38, 244, 199, 0.56);
  --text: #e8f1ff;
  --muted: #8da6b4;
  --cyan: #26f4c7;
  --cyan-soft: rgba(38, 244, 199, 0.17);
  --amber: #f6b94a;
  --amber-soft: rgba(246, 185, 74, 0.16);
  --danger: #ff6b4a;
  --danger-soft: rgba(255, 107, 74, 0.16);
  --ok: #7af28b;
  --radius: 8px;
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(38, 244, 199, 0.07), transparent 34%),
    linear-gradient(315deg, rgba(246, 185, 74, 0.06), transparent 38%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  overflow-x: hidden;
}

button,
summary {
  font: inherit;
}

button {
  cursor: pointer;
}

.noscript {
  position: fixed;
  inset: 1rem 1rem auto;
  z-index: 20;
  border: 1px solid var(--danger);
  background: var(--panel-strong);
  padding: 0.75rem 1rem;
  color: var(--text);
}

.stars,
.grid-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.stars {
  background-image:
    radial-gradient(circle, rgba(232, 241, 255, 0.62) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(38, 244, 199, 0.4) 0 1px, transparent 1.5px);
  background-position:
    0 0,
    3rem 4rem;
  background-size:
    8rem 8rem,
    11rem 11rem;
  opacity: 0.26;
}

.grid-backdrop {
  background:
    linear-gradient(rgba(38, 244, 199, 0.038) 1px, transparent 1px),
    linear-gradient(90deg, rgba(38, 244, 199, 0.038) 1px, transparent 1px);
  background-size: 3rem 3rem;
  mask-image: linear-gradient(to bottom, transparent, black 14%, black 84%, transparent);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 1720px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0.9rem;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 0.72rem;
}

.topbar,
.mission-strip,
.panel,
.hall-panel,
.guide-panel,
.command-deck,
.toast {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(10, 20, 25, 0.9), rgba(5, 8, 11, 0.7));
  box-shadow: 0 0 0 1px rgba(232, 241, 255, 0.03) inset, 0 18px 70px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(16px);
}

.topbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.72rem 1rem;
  border-radius: var(--radius);
}

.brand-block {
  display: grid;
  gap: 0.18rem;
}

.brand-kicker,
.panel-heading,
.metric-label,
.mission-strip span,
.event-header,
.status-pill,
.layer-readout,
.command,
.tab,
.sync-grid span,
.server-chip,
.download-button,
.download-note,
.guide-grid span,
.faq-list summary,
.event-log,
.client-card,
.mini-heading,
.task-list,
.stat-list,
.choice-row,
.badge-grid,
.toast {
  font-family: var(--mono);
}

.brand-kicker {
  color: var(--cyan);
  font-size: 0.73rem;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 3.7rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.topbar-status {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(232, 241, 255, 0.1);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(232, 241, 255, 0.04);
  font-size: 0.78rem;
  white-space: nowrap;
}

.status-pill.online {
  color: var(--cyan);
  border-color: var(--line);
}

.status-pill.warning {
  color: var(--amber);
  border-color: rgba(246, 185, 74, 0.34);
}

.status-pill.error {
  color: var(--danger);
  border-color: rgba(255, 107, 74, 0.34);
}

.dot {
  width: 0.52rem;
  height: 0.52rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 16px var(--cyan);
}

.status-pill.warning .dot {
  background: var(--amber);
  box-shadow: 0 0 16px var(--amber);
}

.status-pill.error .dot {
  background: var(--danger);
  box-shadow: 0 0 16px var(--danger);
}

.mission-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-radius: var(--radius);
}

.mission-strip > div {
  display: grid;
  gap: 0.22rem;
  min-width: 0;
  padding: 0.62rem 1rem;
  border-right: 1px solid rgba(232, 241, 255, 0.08);
}

.mission-strip > div:last-child {
  border-right: 0;
}

.mission-strip span {
  color: var(--muted);
  font-size: 0.72rem;
}

.mission-strip strong {
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(250px, 310px) minmax(440px, 1fr) minmax(300px, 380px);
  gap: 0.72rem;
  align-items: stretch;
  min-height: 0;
}

.panel,
.hall-panel,
.guide-panel {
  border-radius: var(--radius);
  padding: 0.78rem;
  min-width: 0;
}

.left-panel,
.right-panel,
.live-stage {
  min-height: 0;
}

.left-panel,
.right-panel {
  display: flex;
  flex-direction: column;
  gap: 0.68rem;
}

.live-stage {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.72rem;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--cyan);
  font-size: 0.76rem;
}

.panel-heading small {
  color: var(--muted);
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}

.metric-card,
.client-card,
.sync-grid article,
.guide-grid article,
.faq-list details,
.stat-board,
.quest-board,
.event-card,
.tip-card,
.terminal-card,
.inventory-card,
.stats-tool-card,
.badge {
  border: 1px solid rgba(232, 241, 255, 0.09);
  border-radius: var(--radius);
  background: rgba(232, 241, 255, 0.035);
}

.metric-card {
  display: grid;
  gap: 0.46rem;
  padding: 0.85rem;
}

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

.metric-card strong {
  font-family: var(--mono);
  font-size: clamp(1.18rem, 2.5vw, 1.74rem);
  color: var(--text);
  overflow-wrap: anywhere;
}

.bar {
  height: 0.48rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(232, 241, 255, 0.08);
}

.bar span {
  display: block;
  width: 30%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(38, 244, 199, 0.25), var(--cyan));
  box-shadow: 0 0 18px rgba(38, 244, 199, 0.34);
  transition: width 450ms ease;
}

.bar.climate span {
  background: linear-gradient(90deg, rgba(71, 159, 255, 0.3), #8fd0ff);
}

.bar.amber span {
  background: linear-gradient(90deg, rgba(246, 185, 74, 0.25), var(--amber));
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  margin-top: 0.15rem;
}

.tab,
.event-header button {
  min-height: 2.25rem;
  border: 1px solid rgba(232, 241, 255, 0.1);
  border-radius: 6px;
  background: rgba(232, 241, 255, 0.04);
  color: var(--muted);
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease, transform 180ms ease;
}

.tab:hover,
.event-header button:hover,
.command:hover,
.download-button:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.tab.active {
  color: var(--cyan);
  border-color: var(--line-strong);
  background: var(--cyan-soft);
}

.layer-readout {
  min-height: 5.6rem;
  border: 1px dashed rgba(38, 244, 199, 0.24);
  border-radius: var(--radius);
  padding: 0.8rem;
  color: #bdeee4;
  font-size: 0.78rem;
  line-height: 1.7;
  background: rgba(38, 244, 199, 0.045);
}

.hall-panel {
  display: grid;
  gap: 0.78rem;
}

.hall-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
}

.hall-heading h2 {
  margin-top: 0.2rem;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.server-chip {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.62rem;
  border: 1px solid rgba(246, 185, 74, 0.28);
  border-radius: 999px;
  color: #ffe4a6;
  background: rgba(246, 185, 74, 0.08);
  font-size: 0.76rem;
  white-space: nowrap;
}

.sync-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}

.sync-grid article {
  display: grid;
  gap: 0.35rem;
  min-height: 5.6rem;
  padding: 0.76rem;
}

.sync-grid span {
  color: var(--muted);
  font-size: 0.7rem;
}

.sync-grid strong {
  font-family: var(--mono);
  color: var(--text);
  font-size: clamp(1rem, 1.8vw, 1.28rem);
  align-self: end;
  overflow-wrap: anywhere;
}

.client-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(12rem, 15rem);
  gap: 0.82rem;
  align-items: center;
  padding: 0.9rem;
  background:
    linear-gradient(90deg, rgba(38, 244, 199, 0.08), transparent 62%),
    rgba(232, 241, 255, 0.035);
}

.client-card h3 {
  margin-top: 0.18rem;
  font-size: clamp(1.45rem, 2.6vw, 2.15rem);
  line-height: 1.05;
}

.client-card p {
  margin-top: 0.46rem;
  color: #b8cad5;
  font-size: 0.9rem;
  line-height: 1.65;
}

.download-button {
  min-height: 4.9rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--cyan-soft);
  color: #dffff8;
  display: grid;
  place-items: center;
  gap: 0.2rem;
  padding: 0.72rem;
}

.download-button span {
  color: #9ceede;
  font-size: 0.72rem;
}

.download-button strong {
  font-size: 1.05rem;
}

.download-button.installed {
  border-color: rgba(122, 242, 139, 0.42);
  background: rgba(122, 242, 139, 0.11);
  color: #dcffe1;
}

.download-note {
  grid-column: 1 / -1;
  color: var(--amber);
  font-size: 0.76rem;
}

.command-deck {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.5rem;
  border-radius: var(--radius);
  padding: 0.58rem;
}

.command {
  min-width: 0;
  min-height: 3rem;
  border: 1px solid rgba(232, 241, 255, 0.12);
  border-radius: 6px;
  background: rgba(232, 241, 255, 0.045);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  white-space: normal;
}

.command .icon {
  width: 1.35rem;
  height: 1.35rem;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(232, 241, 255, 0.13);
  border-radius: 50%;
  color: var(--cyan);
}

.command.primary {
  color: #dffff8;
  border-color: var(--line-strong);
  background: var(--cyan-soft);
}

.command.danger {
  color: #ffe3dc;
  border-color: rgba(255, 107, 74, 0.35);
  background: var(--danger-soft);
}

.command.is-busy,
.command.is-active {
  transform: translateY(1px);
  border-color: var(--amber);
  background: var(--amber-soft);
}

.guide-panel {
  display: grid;
  gap: 0.68rem;
}

.guide-grid,
.player-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.guide-grid article,
.stat-board,
.quest-board,
.event-card,
.tip-card,
.terminal-card,
.inventory-card,
.stats-tool-card {
  padding: 0.76rem;
}

.guide-grid span,
.mini-heading span {
  color: var(--cyan);
  font-size: 0.74rem;
}

.guide-grid p {
  margin-top: 0.35rem;
  color: #c2d4dc;
  font-size: 0.86rem;
  line-height: 1.65;
}

.mini-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.mini-heading button,
.choice-row button,
.tip-card button,
.terminal-form button,
.stat-tool-actions button {
  min-height: 2rem;
  border: 1px solid rgba(232, 241, 255, 0.1);
  border-radius: 6px;
  background: rgba(232, 241, 255, 0.04);
  color: var(--muted);
  font-size: 0.72rem;
}

.stat-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.stat-row {
  display: grid;
  grid-template-columns: 4.4rem 1fr 2.2rem;
  gap: 0.48rem;
  align-items: center;
  color: #c7d9df;
  font-size: 0.76rem;
}

.stat-track {
  height: 0.42rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(232, 241, 255, 0.08);
}

.stat-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(38, 244, 199, 0.25), var(--cyan));
}

.roll-comment,
.event-card p,
.tip-card p {
  margin-top: 0.62rem;
  color: #b8cad5;
  font-size: 0.84rem;
  line-height: 1.6;
}

.task-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.task-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.5rem;
  align-items: center;
  border: 1px solid rgba(232, 241, 255, 0.08);
  border-radius: 6px;
  padding: 0.55rem;
  color: #c7d9df;
  font-size: 0.76rem;
}

.task-item input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--cyan);
}

.task-item.done {
  color: var(--muted);
  background: rgba(122, 242, 139, 0.055);
}

.task-item.done .task-name {
  text-decoration: line-through;
}

.task-xp {
  color: var(--amber);
  white-space: nowrap;
}

.event-card h3,
.tip-card h3 {
  margin-top: 0.18rem;
  font-size: clamp(1.12rem, 2vw, 1.42rem);
}

.choice-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.tip-card button {
  width: 100%;
  margin-top: 0.65rem;
  color: #dffff8;
  border-color: var(--line-strong);
  background: var(--cyan-soft);
}

.stats-tool-card {
  grid-column: span 2;
  display: grid;
  gap: 0.62rem;
  background:
    linear-gradient(135deg, rgba(246, 185, 74, 0.07), transparent 58%),
    rgba(232, 241, 255, 0.035);
}

.stat-tool-input {
  width: 100%;
  min-height: 5rem;
  resize: vertical;
  border: 1px solid rgba(38, 244, 199, 0.16);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  padding: 0.68rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.55;
}

.stat-tool-input::placeholder {
  color: rgba(141, 166, 180, 0.74);
}

.stat-tool-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  font-family: var(--mono);
}

.stat-tool-actions button {
  min-height: 2.35rem;
}

.stat-tool-actions button:first-child {
  color: #dffff8;
  border-color: var(--line-strong);
  background: var(--cyan-soft);
}

.stat-result-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.45rem;
}

.stat-result {
  min-width: 0;
  min-height: 4.2rem;
  display: grid;
  align-content: space-between;
  gap: 0.25rem;
  border: 1px solid rgba(232, 241, 255, 0.08);
  border-radius: 6px;
  padding: 0.58rem;
  background: rgba(5, 7, 10, 0.22);
  font-family: var(--mono);
}

.stat-result span {
  color: var(--muted);
  font-size: 0.7rem;
}

.stat-result b {
  color: var(--amber);
  font-size: clamp(0.94rem, 1.7vw, 1.22rem);
  overflow-wrap: anywhere;
}

.stat-tool-note {
  color: #b8cad5;
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.55;
}

.terminal-card {
  grid-column: span 2;
  display: grid;
  gap: 0.62rem;
}

.terminal-output {
  min-height: 8rem;
  max-height: 12rem;
  overflow: auto;
  border: 1px solid rgba(38, 244, 199, 0.16);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.22);
  padding: 0.68rem;
  color: #bdeee4;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.55;
}

.terminal-output p + p {
  margin-top: 0.42rem;
}

.terminal-output b {
  color: var(--amber);
}

.terminal-form {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.45rem;
  align-items: center;
  font-family: var(--mono);
}

.terminal-form input {
  min-width: 0;
  min-height: 2.35rem;
  border: 1px solid rgba(232, 241, 255, 0.1);
  border-radius: 6px;
  background: rgba(232, 241, 255, 0.04);
  color: var(--text);
  padding: 0 0.65rem;
  font: inherit;
}

.terminal-form span {
  color: var(--cyan);
}

.inventory-card {
  grid-column: span 2;
  display: grid;
  gap: 0.62rem;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.inventory-item {
  min-height: 4.2rem;
  border: 1px solid rgba(232, 241, 255, 0.08);
  border-radius: 6px;
  padding: 0.58rem;
  background: rgba(232, 241, 255, 0.035);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #c7d9df;
}

.inventory-item b {
  display: block;
  color: var(--cyan);
  margin-bottom: 0.18rem;
}

.inventory-item.active {
  border-color: rgba(246, 185, 74, 0.42);
  background: rgba(246, 185, 74, 0.08);
}

.boss-panel {
  border: 1px solid rgba(255, 107, 74, 0.24);
  border-radius: 6px;
  padding: 0.7rem;
  background: rgba(255, 107, 74, 0.07);
  font-family: var(--mono);
}

.boss-panel span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}

.boss-panel strong {
  display: block;
  margin-top: 0.18rem;
  color: #ffe3dc;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
}

.boss-panel p {
  margin-top: 0.35rem;
  color: #d7b7af;
  font-size: 0.8rem;
  line-height: 1.5;
}

.faq-list {
  display: grid;
  gap: 0.48rem;
}

.faq-list details {
  padding: 0.72rem;
}

.faq-list summary {
  color: #dffff8;
  font-size: 0.78rem;
  line-height: 1.45;
  cursor: pointer;
}

.faq-list p {
  margin-top: 0.5rem;
  color: #b8cad5;
  font-size: 0.84rem;
  line-height: 1.65;
}

.achievement-shelf {
  display: grid;
  gap: 0.48rem;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.42rem;
}

.badge {
  min-height: 3.2rem;
  padding: 0.55rem;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.badge.unlocked {
  color: #dcffe1;
  border-color: rgba(122, 242, 139, 0.36);
  background: rgba(122, 242, 139, 0.08);
}

.badge b {
  display: block;
  margin-bottom: 0.14rem;
  color: inherit;
}

.event-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  color: var(--cyan);
  font-size: 0.76rem;
}

.event-header button {
  padding: 0 0.72rem;
  font-size: 0.72rem;
}

.event-log {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-height: 0;
  max-height: 34rem;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  scrollbar-color: rgba(38, 244, 199, 0.45) transparent;
}

.event-log li {
  border-left: 2px solid rgba(38, 244, 199, 0.42);
  background: rgba(232, 241, 255, 0.035);
  padding: 0.62rem 0.7rem;
  color: #bed3dc;
  font-size: 0.82rem;
  line-height: 1.55;
  animation: fade-up 240ms ease both;
}

.event-log li[data-tone="sync"] {
  border-left-color: rgba(122, 242, 139, 0.62);
}

.event-log li[data-tone="danger"] {
  border-left-color: rgba(255, 107, 74, 0.72);
}

.event-log time {
  display: block;
  margin-bottom: 0.18rem;
  color: var(--muted);
  font-size: 0.68rem;
}

.app-shell[data-alert="true"] .topbar,
.app-shell[data-alert="true"] .mission-strip,
.app-shell[data-alert="true"] .panel,
.app-shell[data-alert="true"] .hall-panel,
.app-shell[data-alert="true"] .guide-panel,
.app-shell[data-alert="true"] .command-deck {
  border-color: rgba(255, 107, 74, 0.45);
}

.app-shell[data-alert="true"] .dot {
  background: var(--danger);
  box-shadow: 0 0 16px var(--danger);
}

button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast-stack {
  position: fixed;
  right: 1rem;
  top: 1rem;
  z-index: 30;
  display: grid;
  gap: 0.55rem;
  width: min(92vw, 22rem);
  pointer-events: none;
}

.npc-ticker {
  position: fixed;
  left: 0.9rem;
  right: 0.9rem;
  bottom: 0.7rem;
  z-index: 22;
  height: 2.2rem;
  overflow: hidden;
  border: 1px solid rgba(38, 244, 199, 0.16);
  border-radius: var(--radius);
  background: rgba(5, 7, 10, 0.72);
  backdrop-filter: blur(12px);
  pointer-events: none;
}

.npc-ticker div {
  display: flex;
  gap: 2rem;
  align-items: center;
  width: max-content;
  min-width: 100%;
  height: 100%;
  color: #bdeee4;
  font-family: var(--mono);
  font-size: 0.76rem;
  white-space: nowrap;
  animation: ticker 36s linear infinite;
}

.npc-ticker span {
  color: var(--muted);
}

@keyframes ticker {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.toast {
  border-radius: var(--radius);
  padding: 0.78rem;
  color: #dcffe1;
  animation: fade-up 220ms ease both;
}

.toast span {
  display: block;
  color: var(--cyan);
  font-size: 0.72rem;
  margin-bottom: 0.2rem;
}

.toast strong {
  font-size: 0.92rem;
}

@media (max-width: 1220px) {
  .dashboard {
    grid-template-columns: minmax(240px, 300px) minmax(420px, 1fr);
  }

  .right-panel {
    grid-column: 1 / -1;
  }

  .event-log {
    min-height: 14rem;
    max-height: 20rem;
  }
}

@media (max-width: 860px) {
  .app-shell {
    padding: 0.72rem;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-status {
    justify-content: flex-start;
  }

  .mission-strip,
  .dashboard {
    grid-template-columns: 1fr;
  }

  .mission-strip > div {
    border-right: 0;
    border-bottom: 1px solid rgba(232, 241, 255, 0.08);
  }

  .mission-strip > div:last-child {
    border-bottom: 0;
  }

  .live-stage {
    grid-row: 1;
  }

  .left-panel {
    grid-row: 2;
  }

  .sync-grid,
  .guide-grid,
  .player-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-card {
    grid-template-columns: 1fr;
  }

  .download-note {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: 2.15rem;
  }

  .status-pill {
    white-space: normal;
  }

  .hall-heading {
    flex-direction: column;
  }

  .server-chip {
    white-space: normal;
  }

  .sync-grid,
  .guide-grid,
  .player-grid,
  .command-deck {
    grid-template-columns: 1fr;
  }

  .terminal-card,
  .inventory-card,
  .stats-tool-card {
    grid-column: auto;
  }

  .stat-tool-actions,
  .stat-result-grid {
    grid-template-columns: 1fr;
  }

  .stat-tool-actions button {
    min-height: 2.65rem;
  }

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

  .npc-ticker {
    left: 0.7rem;
    right: 0.7rem;
    bottom: 0.45rem;
  }

  .badge-grid,
  .choice-row {
    grid-template-columns: 1fr;
  }

  .stat-row {
    grid-template-columns: 3.8rem 1fr 2rem;
  }

  .command,
  .download-button {
    min-height: 3.45rem;
  }
}

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

  .npc-ticker div {
    animation: none;
  }
}
