:root {
  color-scheme: light;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #fffaf1;
  --line: #dfd3bf;
  --shadow: 0 14px 28px rgba(46, 35, 18, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.75);
  --block-shadow: 0 6px 0 rgba(30, 41, 59, 0.18), 0 10px 18px rgba(15, 23, 42, 0.12);
}

.dark {
  color-scheme: dark;
  --surface: rgba(21, 28, 49, 0.82);
  --surface-solid: #151c31;
  --line: #334155;
  --shadow: 0 14px 28px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.dark body {
  background: #0f172a;
  color: #e5e7eb;
}

* {
  box-sizing: border-box;
}

button,
input,
select,
textarea {
  font: inherit;
}

.site-return-footer {
  width: min(1120px, calc(100% - 24px));
  margin: 0 auto 28px;
  display: flex;
  justify-content: center;
}

.site-return-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-solid);
  color: #182044;
  padding: 0 18px;
  font-size: 0.92rem;
  font-weight: 850;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.site-return-link:hover,
.site-return-link:focus-visible {
  color: #0f5f8d;
  outline: 2px solid rgba(59, 130, 246, 0.45);
  outline-offset: 3px;
}

.dark .site-return-link {
  background: #151c31;
  color: #e5e7eb;
}

.app-shell {
  width: min(1120px, calc(100% - 24px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.panel-tight {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.sql-block {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  min-width: 58px;
  padding: 0 15px;
  border: 0;
  border-radius: 18px;
  color: #fff;
  font-weight: 850;
  letter-spacing: 0;
  font-size: 0.86rem;
  line-height: 1;
  box-shadow: var(--block-shadow);
  user-select: none;
  touch-action: manipulation;
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

.sql-block:hover,
.sql-block:focus-visible,
.sql-block.selected {
  transform: translateY(-2px);
  filter: saturate(1.08);
}

.sql-block:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(30, 41, 59, 0.18), 0 4px 10px rgba(15, 23, 42, 0.12);
}

.block-keyword {
  background: linear-gradient(#8b5cf6, #5b6ee1);
}

.block-source {
  background: linear-gradient(#21c981, #0f9f6e);
}

.block-column {
  background: linear-gradient(#f472b6, #db2777);
}

.block-value {
  background: linear-gradient(#60a5fa, #2563eb);
}

.block-operator {
  background: linear-gradient(#fbbf24, #ea580c);
}

.block-danger {
  background: linear-gradient(#fb7185, #e11d48);
}

.slot {
  min-height: 50px;
  min-width: 72px;
  border: 2px dashed #c8bca9;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.42);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.slot.slot-over {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
}

.slot.slot-invalid {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.road-node {
  position: relative;
  min-height: 76px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  box-shadow: 0 10px 20px rgba(46, 35, 18, 0.09);
}

.road-node.locked {
  opacity: 0.48;
  filter: grayscale(0.55);
}

.road-node.current {
  outline: 3px solid rgba(59, 130, 246, 0.3);
}

.road-node.completed {
  border-color: rgba(34, 197, 94, 0.55);
}

.road-node.needs_review {
  border-color: rgba(245, 158, 11, 0.72);
  background: rgba(255, 247, 237, 0.95);
}

.road-node.boss {
  border-color: rgba(124, 58, 237, 0.5);
}

.result-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.result-table th,
.result-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.result-table th {
  background: rgba(19, 185, 129, 0.16);
  font-weight: 850;
}

.result-table tr:last-child td {
  border-bottom: 0;
}

.tab-active {
  background: #ef4444;
  color: #fff;
  box-shadow: 0 6px 0 rgba(127, 29, 29, 0.18);
}

.toast {
  border-left: 4px solid currentColor;
}

.app-shell--shake {
  animation: app-shake 360ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes app-shake {
  10%,
  90% {
    transform: translateX(-2px);
  }

  20%,
  80% {
    transform: translateX(4px);
  }

  30%,
  50%,
  70% {
    transform: translateX(-6px);
  }

  40%,
  60% {
    transform: translateX(6px);
  }
}

.reduced-motion *,
.reduced-motion *::before,
.reduced-motion *::after {
  animation-duration: 1ms !important;
  scroll-behavior: auto !important;
  transition-duration: 1ms !important;
}

.reduced-motion .app-shell--shake {
  animation: none !important;
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 16px, 680px);
    padding-top: 14px;
  }

  .panel {
    border-radius: 20px;
  }

  .sql-block {
    min-height: 46px;
    min-width: 66px;
    font-size: 0.82rem;
    border-radius: 16px;
  }

  .slot {
    min-width: 68px;
  }
}

/* Visual polish layer. Kept additive so the existing app structure and behavior stay intact. */
:root {
  --surface: rgba(255, 252, 246, 0.88);
  --surface-solid: #fffaf1;
  --surface-raised: #ffffff;
  --line: #dccdb7;
  --line-strong: #c7b79f;
  --ink: #111827;
  --ink-muted: #607089;
  --shadow: 0 18px 42px rgba(55, 43, 25, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.78);
  --shadow-soft: 0 10px 24px rgba(55, 43, 25, 0.09);
  --block-shadow: 0 5px 0 rgba(30, 41, 59, 0.22), 0 12px 22px rgba(15, 23, 42, 0.14);
  --focus: 0 0 0 3px rgba(59, 130, 246, 0.28);
}

.dark {
  --surface: rgba(16, 24, 42, 0.9);
  --surface-solid: #111827;
  --surface-raised: #172033;
  --line: #334155;
  --line-strong: #475569;
  --ink: #e5e7eb;
  --ink-muted: #a7b3c7;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.25);
  --focus: 0 0 0 3px rgba(96, 165, 250, 0.3);
}

body {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.74), rgba(247, 240, 228, 0.82)),
    radial-gradient(circle at 18px 18px, rgba(239, 68, 68, 0.08) 1px, transparent 1.8px),
    linear-gradient(120deg, #f7efe2 0%, #eef7f1 46%, #f9f1e8 100%);
  background-size: auto, 28px 28px, auto;
}

.dark body {
  background:
    radial-gradient(circle at 18px 18px, rgba(148, 163, 184, 0.09) 1px, transparent 1.8px),
    linear-gradient(120deg, #0f172a 0%, #132033 52%, #171b2c 100%);
}

.app-shell {
  width: min(1180px, calc(100% - 28px));
  padding: 22px 0 46px;
}

.panel,
.panel-tight {
  border-radius: 8px;
  backdrop-filter: blur(14px);
}

.panel {
  position: relative;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), transparent 34%);
}

.panel > * {
  position: relative;
  z-index: 1;
}

.dark .panel::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 38%);
}

button {
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

button:not(:disabled):hover {
  transform: translateY(-1px);
}

button:not(:disabled):active {
  transform: translateY(1px);
}

button:focus-visible,
.sql-block:focus-visible,
.slot:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 0;
  box-shadow: var(--focus);
}

.game-header {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 252, 246, 0.72);
  box-shadow: var(--shadow-soft);
  padding: 14px;
}

.dark .game-header {
  background: rgba(15, 23, 42, 0.72);
}

.brand-mark {
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: linear-gradient(135deg, #ef4444, #f59e0b);
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.22);
}

.hud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.hud-pill {
  min-width: 112px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-raised);
  padding: 8px 12px 8px 9px;
  box-shadow: 0 5px 0 rgba(148, 118, 72, 0.11), 0 10px 18px rgba(15, 23, 42, 0.08);
}

.dark .hud-pill {
  background: #172033;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.22), 0 10px 18px rgba(0, 0, 0, 0.2);
}

.hud-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.hud-value {
  display: block;
  font-weight: 900;
  line-height: 1;
}

.hud-label {
  display: block;
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.campaign-track {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
  padding: 10px;
}

.dark .campaign-track {
  background: rgba(15, 23, 42, 0.56);
}

.campaign-track__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--ink-muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.campaign-track__rail {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.26);
}

.campaign-track__bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ef4444 0%, #f59e0b 45%, #13b981 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.32) inset;
}

.tab-active {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.stage-card {
  align-self: start;
  overflow: hidden;
}

.stage-card__top {
  display: grid;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(239, 68, 68, 0.09), rgba(19, 185, 129, 0.08)),
    rgba(255, 255, 255, 0.32);
  padding: 22px;
}

.dark .stage-card__top {
  background:
    linear-gradient(135deg, rgba(239, 68, 68, 0.14), rgba(19, 185, 129, 0.1)),
    rgba(15, 23, 42, 0.2);
}

.stage-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge--tutorial {
  border-color: rgba(124, 58, 237, 0.2);
  background: rgba(124, 58, 237, 0.11);
  color: #6d28d9;
}

.badge--mission {
  border-color: rgba(8, 145, 178, 0.2);
  background: rgba(8, 145, 178, 0.11);
  color: #0e7490;
}

.badge--safe {
  border-color: rgba(19, 185, 129, 0.22);
  background: rgba(19, 185, 129, 0.12);
  color: #047857;
}

.dark .badge--tutorial,
.dark .badge--mission,
.dark .badge--safe {
  color: #dbeafe;
}

.stage-title {
  max-width: 780px;
  font-size: clamp(1.45rem, 2.5vw, 2.35rem);
  font-weight: 950;
  line-height: 1.05;
}

.stage-copy {
  max-width: 780px;
  color: var(--ink-muted);
  font-size: 1rem;
  line-height: 1.55;
}

.objective-box {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 8px;
  background: rgba(255, 251, 235, 0.72);
  padding: 13px 14px;
}

.dark .objective-box {
  background: rgba(120, 53, 15, 0.17);
}

.objective-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #b45309;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dark .objective-label {
  color: #fbbf24;
}

.tutorial-steps {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
  margin-top: 2px;
}

.tutorial-step {
  height: 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.32);
}

.tutorial-step.is-complete {
  background: #13b981;
}

.tutorial-step.is-current {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.13);
}

.stage-body {
  padding: 20px;
}

.query-workbench {
  display: grid;
  gap: 16px;
}

.builder-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: var(--shadow-soft);
}

.dark .builder-section {
  background: rgba(15, 23, 42, 0.46);
}

.query-board {
  border-color: rgba(239, 68, 68, 0.28);
  background:
    linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(245, 158, 11, 0.08)),
    rgba(255, 255, 255, 0.55);
}

.dark .query-board {
  background:
    linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(245, 158, 11, 0.09)),
    rgba(15, 23, 42, 0.45);
}

.builder-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
}

.builder-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.builder-help {
  color: var(--ink-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.slot-row,
.block-tray {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 16px;
}

.slot {
  position: relative;
  min-height: 56px;
  min-width: 82px;
  border-color: var(--line-strong);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.32)),
    repeating-linear-gradient(135deg, rgba(148, 163, 184, 0.14) 0, rgba(148, 163, 184, 0.14) 6px, transparent 6px, transparent 12px);
  color: var(--ink-muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.dark .slot {
  background:
    linear-gradient(180deg, rgba(30, 41, 59, 0.86), rgba(15, 23, 42, 0.62)),
    repeating-linear-gradient(135deg, rgba(148, 163, 184, 0.12) 0, rgba(148, 163, 184, 0.12) 6px, transparent 6px, transparent 12px);
}

.slot:hover {
  border-color: #f59e0b;
}

.slot.slot-over {
  border-color: #13b981;
  background: rgba(19, 185, 129, 0.16);
  box-shadow: var(--focus);
}

.slot-placeholder {
  display: grid;
  gap: 2px;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.slot-number {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  color: #ef4444;
}

.sql-block {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.16);
}

.sql-block:hover,
.sql-block:focus-visible,
.sql-block.selected {
  box-shadow: 0 7px 0 rgba(30, 41, 59, 0.22), 0 16px 26px rgba(15, 23, 42, 0.16);
}

.sql-block.selected {
  outline: 3px solid rgba(255, 255, 255, 0.72);
  outline-offset: 2px;
  filter: saturate(1.18) brightness(1.04);
}

.builder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.primary-action,
.secondary-action,
.hint-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  min-height: 46px;
  padding: 0 18px;
  font-weight: 950;
}

.primary-action {
  border: 1px solid rgba(127, 29, 29, 0.2);
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 6px 0 rgba(127, 29, 29, 0.22), 0 12px 22px rgba(239, 68, 68, 0.22);
}

.primary-action:hover {
  box-shadow: 0 8px 0 rgba(127, 29, 29, 0.22), 0 16px 28px rgba(239, 68, 68, 0.24);
}

.secondary-action,
.hint-action {
  border: 1px solid var(--line);
  background: var(--surface-raised);
  color: inherit;
  box-shadow: 0 4px 0 rgba(148, 118, 72, 0.12);
}

.dark .secondary-action,
.dark .hint-action {
  background: #172033;
}

.hint-action {
  color: #b45309;
}

.schema-panel {
  align-self: start;
}

.schema-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.schema-title strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.schema-db-badge {
  border-radius: 999px;
  background: rgba(19, 185, 129, 0.12);
  color: #047857;
  padding: 4px 8px;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.dark .schema-db-badge {
  color: #a7f3d0;
}

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

.schema-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
}

.dark .schema-card {
  background: #172033;
}

.schema-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(19, 185, 129, 0.14), rgba(59, 130, 246, 0.08));
  padding: 10px 12px;
}

.schema-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  font-weight: 950;
}

.schema-count {
  color: var(--ink-muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.schema-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 0.9rem;
}

.schema-column:last-child {
  border-bottom: 0;
}

.schema-col-name {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.schema-type {
  border: 1px solid rgba(59, 130, 246, 0.16);
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.1);
  color: #1d4ed8;
  padding: 3px 7px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 900;
}

.dark .schema-type {
  color: #bfdbfe;
}

.schema-note {
  margin-top: 14px;
  border: 1px solid rgba(19, 185, 129, 0.22);
  border-radius: 8px;
  background: rgba(19, 185, 129, 0.08);
  padding: 12px;
  color: var(--ink-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-left-width: 5px;
  box-shadow: var(--shadow-soft);
}

.toast-title {
  display: block;
  margin-bottom: 2px;
  color: inherit;
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.result-card {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
}

.dark .result-card {
  background: #172033;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
}

.result-header strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.result-table {
  border: 0;
  border-radius: 0;
}

.result-table th {
  background: rgba(19, 185, 129, 0.14);
}

.result-table th,
.result-table td {
  padding: 11px 14px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(6px);
}

.modal-dialog {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  border: 1px solid rgba(245, 158, 11, 0.34);
  border-radius: 8px;
  background: var(--surface-raised);
  padding: 22px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28), 0 7px 0 rgba(146, 64, 14, 0.14);
}

.dark .modal-dialog {
  background: #172033;
}

.modal-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.modal-dialog h2 {
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 950;
  line-height: 1.15;
}

.modal-dialog p {
  margin-top: 6px;
  color: var(--ink-muted);
  line-height: 1.55;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 720px) {
  .app-shell {
    width: calc(100% - 14px);
    max-width: 680px;
    padding-top: 10px;
  }

  .game-header,
  .stage-card__top,
  .stage-body {
    padding: 14px;
  }

  .hud {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: stretch;
    width: 100%;
  }

  .hud-pill {
    min-width: 0;
    width: 100%;
    gap: 6px;
    padding: 7px 6px;
  }

  .hud-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
  }

  .hud-value {
    font-size: 1rem;
  }

  .hud-label {
    white-space: normal;
    font-size: 0.58rem;
    line-height: 1.05;
  }

  .campaign-track__meta {
    font-size: 0.66rem;
  }

  .stage-title {
    font-size: 1.45rem;
  }

  .slot-row,
  .block-tray {
    gap: 9px;
    padding: 12px;
  }

  .slot {
    min-width: calc(50% - 6px);
    flex: 1 1 calc(50% - 6px);
  }

  .sql-block {
    max-width: 100%;
    min-width: 62px;
    padding-inline: 12px;
    overflow-wrap: anywhere;
  }

  .primary-action,
  .secondary-action,
  .hint-action {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    padding-inline: 14px;
  }

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