:root {
  --night: #111a24;
  --night-soft: #172534;
  --stone: #263443;
  --stone-light: #4b6274;
  --cream: #f5e7c8;
  --sand: #e2bd83;
  --orange: #e48b4e;
  --ember: #f1a55c;
  --cyan: #73ead5;
  --violet: #b59bff;
  --rose: #f08c95;
  --line: rgba(245, 231, 200, 0.16);
  --shadow: rgba(5, 11, 18, 0.58);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--cream);
  background:
    radial-gradient(circle at 16% 8%, rgba(228, 139, 78, 0.2), transparent 25rem),
    radial-gradient(circle at 88% 24%, rgba(115, 234, 213, 0.13), transparent 30rem),
    linear-gradient(150deg, #0d151e 0%, #172331 52%, #0d151e 100%);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.25;
  background-image:
    linear-gradient(rgba(245, 231, 200, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 231, 200, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.page-shell {
  width: min(1240px, calc(100% - 36px));
  margin: 0 auto;
  padding: 18px 0 26px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  margin-bottom: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: block;
  width: 43px;
  height: 43px;
  border: 2px solid var(--cream);
  border-radius: 12px 4px 12px 4px;
  background: var(--night);
  box-shadow: 3px 3px 0 var(--orange);
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  content: "";
}

.brand-mark::before {
  inset: 9px 20px 9px 8px;
  background: var(--violet);
  clip-path: polygon(48% 0, 100% 50%, 48% 100%, 0 50%);
}

.brand-mark::after {
  top: 9px;
  right: 8px;
  bottom: 9px;
  left: 20px;
  background: var(--cyan);
  clip-path: polygon(48% 0, 100% 50%, 48% 100%, 0 50%);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 18px;
  letter-spacing: 0.12em;
}

.brand small {
  margin-top: 1px;
  color: rgba(245, 231, 200, 0.48);
  font-family: Consolas, monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.24em;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.model-chip {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: rgba(245, 231, 200, 0.58);
  background: rgba(17, 26, 36, 0.55);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.model-chip b {
  margin-right: 4px;
  color: var(--cyan);
}

.sound-button,
.pause-button {
  border: 2px solid var(--cream);
  color: var(--cream);
  background: var(--night);
  box-shadow: 2px 2px 0 var(--orange);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.sound-button:hover,
.pause-button:hover {
  background: var(--night-soft);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--orange);
}

.sound-button:active,
.pause-button:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.sound-button {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-family: Consolas, monospace;
  font-size: 16px;
  font-weight: 900;
}

.sound-button.is-muted {
  opacity: 0.48;
}

.game-shell {
  position: relative;
}

.game-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 3px solid var(--cream);
  border-radius: 22px 7px 22px 7px;
  background: var(--night);
  box-shadow:
    0 8px 0 #070d13,
    0 28px 80px rgba(0, 0, 0, 0.42);
  isolation: isolate;
}

.game-frame::before {
  position: absolute;
  inset: 0;
  z-index: 12;
  border: 4px solid rgba(255, 255, 255, 0.045);
  border-radius: 18px 4px 18px 4px;
  content: "";
  pointer-events: none;
}

#game {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 110 / 65;
  background: var(--night);
  image-rendering: pixelated;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  visibility: hidden;
  opacity: 0;
  transition: opacity 220ms ease, visibility 220ms;
}

.overlay.is-visible {
  visibility: visible;
  opacity: 1;
}

.title-screen {
  align-content: space-between;
  padding: clamp(22px, 4vw, 48px) clamp(26px, 5vw, 70px) 22px;
  background:
    linear-gradient(90deg, rgba(10, 17, 25, 0.96) 0%, rgba(10, 17, 25, 0.82) 55%, rgba(10, 17, 25, 0.2) 100%),
    radial-gradient(circle at 84% 45%, rgba(228, 139, 78, 0.15), transparent 24%);
}

.title-screen::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(245, 231, 200, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 231, 200, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  content: "";
  mask-image: linear-gradient(90deg, black, transparent 80%);
}

.title-layout {
  display: grid;
  grid-template-columns: minmax(470px, 1.2fr) minmax(260px, 0.62fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 9px;
  color: var(--cyan);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.eyebrow span {
  width: 22px;
  height: 2px;
  background: currentColor;
}

.title-copy h1 {
  margin: 0;
  font-size: clamp(58px, 8vw, 108px);
  font-weight: 950;
  letter-spacing: -0.09em;
  line-height: 0.92;
  text-shadow: 6px 6px 0 rgba(5, 11, 18, 0.6);
}

.title-copy h1 span {
  color: var(--ember);
}

.title-lead {
  margin: 18px 0 22px;
  color: rgba(245, 231, 200, 0.68);
  font-size: clamp(12px, 1.35vw, 15px);
  line-height: 1.8;
}

.role-pair {
  display: flex;
  align-items: center;
  width: min(650px, 100%);
  gap: 9px;
}

.role-card {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid rgba(245, 231, 200, 0.16);
  border-radius: 10px 3px 10px 3px;
  background: rgba(23, 37, 52, 0.68);
  backdrop-filter: blur(9px);
}

.role-card small,
.role-card b,
.role-card em {
  display: block;
}

.role-card small {
  color: rgba(245, 231, 200, 0.44);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.role-card b {
  margin-top: 1px;
  font-size: 14px;
}

.role-card em {
  margin-top: 2px;
  overflow: hidden;
  color: rgba(245, 231, 200, 0.48);
  font-size: 9px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-shade {
  border-left-color: var(--violet);
}

.role-runner {
  border-left-color: var(--cyan);
}

.relay-arrow {
  color: var(--sand);
  font-family: Consolas, monospace;
  font-size: 20px;
}

.portrait {
  display: block;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  background-image: url("assets/kenney-tiny-dungeon/Tilemap/tilemap_packed.png");
  background-repeat: no-repeat;
  background-size: 576px 528px;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.35));
}

.portrait[data-index="84"] {
  background-position: 0 -336px;
}

.portrait[data-index="99"] {
  background-position: -144px -384px;
}

.start-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.primary-button,
.secondary-button,
.text-button {
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  padding: 12px 17px 12px 22px;
  border: 2px solid var(--cream);
  border-radius: 9px 3px 9px 3px;
  color: var(--night);
  background: var(--ember);
  box-shadow: 4px 4px 0 var(--cream);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.primary-button:hover {
  background: #ffc078;
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--cream);
}

.primary-button:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--cream);
}

.primary-button.compact {
  padding: 11px 19px;
}

.secondary-button {
  padding: 11px 17px;
  border: 1px solid rgba(245, 231, 200, 0.32);
  border-radius: 8px;
  color: var(--cream);
  background: rgba(17, 26, 36, 0.72);
  font-size: 11px;
  font-weight: 800;
}

.secondary-button:hover {
  border-color: var(--cream);
  background: rgba(35, 51, 68, 0.9);
}

.secondary-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.text-button {
  padding: 9px 11px;
  border: 0;
  color: rgba(245, 231, 200, 0.52);
  background: transparent;
  font-size: 10px;
}

.text-button:hover {
  color: var(--cream);
}

kbd {
  display: inline-grid;
  min-width: 23px;
  min-height: 22px;
  padding: 2px 5px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 4px;
  color: inherit;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
  font-family: Consolas, monospace;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

.primary-button kbd {
  opacity: 0.56;
}

.coach-readout {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 14px 0 0;
  color: rgba(245, 231, 200, 0.44);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.coach-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 3px rgba(115, 234, 213, 0.14);
}

.system-panel {
  padding: 20px;
  border: 1px solid rgba(245, 231, 200, 0.2);
  border-radius: 14px 4px 14px 4px;
  background: rgba(13, 21, 30, 0.76);
  box-shadow: 7px 7px 0 rgba(5, 11, 18, 0.48);
  backdrop-filter: blur(10px);
}

.panel-kicker {
  margin: 0 0 13px;
  color: var(--sand);
  font-family: Consolas, monospace;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.system-panel article {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.system-panel article b {
  color: var(--cream);
  font-size: 11px;
}

.system-panel article p {
  margin: 6px 0 0;
  color: rgba(245, 231, 200, 0.52);
  font-size: 10px;
  line-height: 1.7;
}

.control-hint {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.control-hint span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: rgba(245, 231, 200, 0.48);
  font-size: 8px;
}

.level-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 17px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.level-chip {
  display: grid;
  width: 40px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(245, 231, 200, 0.18);
  border-radius: 6px;
  color: rgba(245, 231, 200, 0.36);
  background: rgba(23, 37, 52, 0.55);
  font-family: Consolas, monospace;
  font-size: 9px;
  font-weight: 900;
}

button.level-chip {
  cursor: pointer;
}

.level-chip.is-cleared {
  border-color: rgba(115, 234, 213, 0.36);
  color: var(--cyan);
}

.level-chip.is-current {
  color: var(--night);
  background: var(--cyan);
  box-shadow: 2px 2px 0 var(--cream);
}

.level-chip.is-locked {
  opacity: 0.45;
}

.chapter-arrow {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(245, 231, 200, 0.18);
  border-radius: 6px;
  color: var(--cream);
  background: rgba(23, 37, 52, 0.7);
  font-family: Consolas, monospace;
  font-size: 17px;
  cursor: pointer;
}

.chapter-arrow:hover:not(:disabled) {
  border-color: var(--cyan);
  color: var(--cyan);
}

.chapter-arrow:disabled {
  opacity: 0.2;
  cursor: default;
}

.chapter-nav-label {
  min-width: 112px;
  padding: 0 7px;
  color: var(--sand);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
}

.level-separator {
  width: 14px;
  height: 1px;
  background: var(--line);
}

.title-credit {
  margin: 11px 0 0;
  color: rgba(245, 231, 200, 0.27);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-align: right;
}

.pause-screen,
.diagnosis-screen,
.result-screen {
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  background: rgba(6, 11, 17, 0.82);
  backdrop-filter: blur(7px);
}

.dialog-card {
  width: min(480px, 93%);
  padding: clamp(24px, 4vw, 38px);
  border: 2px solid var(--cream);
  border-radius: 16px 5px 16px 5px;
  color: var(--night);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.42), transparent 52%),
    var(--cream);
  box-shadow: 8px 8px 0 #070d13;
  text-align: center;
  transform: translateY(8px);
  transition: transform 220ms ease;
}

.overlay.is-visible .dialog-card {
  transform: translateY(0);
}

.dialog-card .eyebrow {
  justify-content: center;
  color: #8c562f;
}

.dialog-card h2 {
  margin: 0 0 8px;
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: -0.06em;
}

.dialog-card > p:not(.eyebrow):not(.coach-note):not(.diagnosis-tip) {
  margin: 0;
  color: rgba(17, 26, 36, 0.62);
  font-size: 12px;
  line-height: 1.75;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}

.dialog-card .primary-button {
  border-color: var(--night);
  box-shadow: 3px 3px 0 var(--night);
}

.dialog-card .primary-button:hover {
  box-shadow: 4px 4px 0 var(--night);
}

.dialog-card .secondary-button {
  border-color: rgba(17, 26, 36, 0.22);
  color: var(--night);
  background: rgba(255, 255, 255, 0.26);
}

.dialog-card .secondary-button:hover {
  border-color: var(--night);
  background: rgba(255, 255, 255, 0.46);
}

.dialog-card .text-button {
  color: rgba(17, 26, 36, 0.48);
}

.dialog-card .text-button:hover {
  color: var(--night);
}

.diagnosis-card {
  position: relative;
}

.diagnosis-icon {
  display: grid;
  width: 56px;
  height: 56px;
  margin: -56px auto 19px;
  place-items: center;
  border: 2px solid var(--night);
  border-radius: 50%;
  color: var(--cream);
  background: #c8655f;
  box-shadow: 4px 4px 0 var(--night);
  font-family: Consolas, monospace;
  font-size: 25px;
  font-weight: 900;
}

.diagnosis-grid,
.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 18px;
}

.diagnosis-grid span,
.result-stats span {
  padding: 10px 6px;
  border: 1px solid rgba(17, 26, 36, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.25);
}

.diagnosis-grid small,
.diagnosis-grid b,
.result-stats small,
.result-stats b {
  display: block;
}

.diagnosis-grid small,
.result-stats small {
  margin-bottom: 4px;
  color: rgba(17, 26, 36, 0.42);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.diagnosis-grid b,
.result-stats b {
  color: rgba(17, 26, 36, 0.84);
  font-family: Consolas, "Microsoft YaHei", monospace;
  font-size: 11px;
}

.diagnosis-tip,
.coach-note {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--orange);
  color: rgba(17, 26, 36, 0.68);
  background: rgba(228, 139, 78, 0.12);
  font-size: 10px;
  line-height: 1.65;
  text-align: left;
}

.result-card {
  width: min(520px, 94%);
}

.result-gem {
  display: grid;
  width: 58px;
  height: 58px;
  margin: -59px auto 19px;
  place-items: center;
  border: 2px solid var(--night);
  border-radius: 13px 4px 13px 4px;
  color: var(--cream);
  background: #2d9f8c;
  box-shadow: 4px 4px 0 var(--night);
  font-size: 26px;
  transform: rotate(-4deg);
}

.result-card.is-final .result-gem {
  background: var(--orange);
}

.coach-note {
  border-left-color: #2d9f8c;
  background: rgba(45, 159, 140, 0.1);
}

.toast {
  position: absolute;
  z-index: 17;
  top: 13%;
  left: 50%;
  padding: 8px 14px;
  border: 1px solid var(--cream);
  border-radius: 5px;
  color: var(--night);
  background: var(--cream);
  box-shadow: 3px 3px 0 var(--orange);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.05em;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.pause-button {
  position: absolute;
  z-index: 14;
  right: 15px;
  bottom: 15px;
  display: none;
  width: 35px;
  height: 35px;
  border-radius: 9px;
  font-family: Consolas, monospace;
  font-weight: 900;
}

.pause-button.is-visible {
  display: block;
}

.touch-controls {
  position: absolute;
  z-index: 15;
  right: 12px;
  bottom: 12px;
  left: 12px;
  display: none;
  justify-content: space-between;
  pointer-events: none;
}

.touch-group {
  display: flex;
  align-items: flex-end;
  gap: 7px;
}

.touch-move {
  display: grid;
  grid-template-columns: repeat(3, 45px);
  grid-template-rows: repeat(2, 45px);
}

.touch-move button[data-touch="up"] {
  grid-column: 2;
}

.touch-move button[data-touch="left"] {
  grid-row: 2;
  grid-column: 1;
}

.touch-move button[data-touch="down"] {
  grid-row: 2;
  grid-column: 2;
}

.touch-move button[data-touch="right"] {
  grid-row: 2;
  grid-column: 3;
}

.touch-controls button {
  width: 45px;
  height: 45px;
  border: 1px solid rgba(245, 231, 200, 0.56);
  border-radius: 11px;
  color: var(--cream);
  background: rgba(9, 16, 23, 0.72);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.38);
  font-family: Consolas, "Microsoft YaHei", monospace;
  font-size: 14px;
  font-weight: 900;
  pointer-events: auto;
  touch-action: none;
  backdrop-filter: blur(4px);
}

.touch-controls button.is-pressed {
  color: var(--night);
  background: var(--cyan);
  transform: translateY(2px);
  box-shadow: none;
}

.game-caption {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 3px 0;
  color: rgba(245, 231, 200, 0.4);
  font-size: 9px;
}

.game-caption p {
  margin: 0;
}

.game-caption b {
  color: rgba(245, 231, 200, 0.68);
}

.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 3px rgba(115, 234, 213, 0.1);
  transform: translateY(-1px);
}

.credit {
  text-align: right;
}

@media (max-width: 900px) {
  .title-layout {
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 24px;
  }

  .system-panel {
    padding: 14px;
  }

  .role-card em {
    display: none;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 14px, 1240px);
    padding-top: 9px;
  }

  .topbar {
    min-height: 43px;
    margin-bottom: 7px;
  }

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

  .brand strong {
    font-size: 14px;
  }

  .brand small,
  .model-chip {
    display: none;
  }

  .game-frame {
    border-radius: 12px 4px 12px 4px;
  }

  .title-screen {
    padding: 17px 16px 11px;
  }

  .title-layout {
    display: block;
  }

  .system-panel,
  .title-lead br {
    display: none;
  }

  .title-copy h1 {
    font-size: clamp(48px, 15vw, 76px);
  }

  .title-lead {
    margin: 11px 0 14px;
    font-size: 10px;
  }

  .role-pair {
    margin-top: 1px;
  }

  .role-card {
    padding: 6px 8px;
  }

  .role-card .portrait {
    width: 36px;
    height: 36px;
    background-size: 432px 396px;
  }

  .portrait[data-index="84"] {
    background-position: 0 -252px;
  }

  .portrait[data-index="99"] {
    background-position: -108px -288px;
  }

  .role-card b {
    font-size: 11px;
  }

  .role-card small {
    font-size: 7px;
  }

  .start-row {
    margin-top: 13px;
  }

  .primary-button {
    gap: 15px;
    padding: 9px 13px 9px 16px;
    font-size: 10px;
  }

  .secondary-button {
    padding: 9px 12px;
    font-size: 9px;
  }

  .coach-readout {
    margin-top: 9px;
  }

  .level-strip {
    display: flex;
    justify-content: flex-start;
    gap: 4px;
    margin-top: 8px;
    padding-top: 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .level-strip::-webkit-scrollbar {
    display: none;
  }

  .level-chip {
    flex: 0 0 28px;
    width: 28px;
    height: 24px;
    font-size: 8px;
  }

  .chapter-arrow {
    flex: 0 0 26px;
    width: 26px;
    height: 24px;
    font-size: 14px;
  }

  .chapter-nav-label {
    flex: 0 0 82px;
    min-width: 82px;
    padding: 0 4px;
    font-size: 7px;
  }

  .pause-screen,
  .diagnosis-screen,
  .result-screen {
    align-items: start;
    padding: 12px;
  }

  .title-credit {
    display: none;
  }

  .game-caption {
    display: none;
  }

  .dialog-card {
    max-height: none;
    margin: 36px 0 12px;
    padding: 17px 14px 14px;
  }

  .dialog-card h2 {
    font-size: 25px;
  }

  .dialog-card > p:not(.eyebrow) {
    font-size: 10px;
  }

  .result-card > #result-copy,
  .diagnosis-card > #diagnosis-copy {
    display: none;
  }

  .diagnosis-icon,
  .result-gem {
    width: 44px;
    height: 44px;
    margin-top: -45px;
    margin-bottom: 12px;
    font-size: 20px;
  }

  .dialog-card .eyebrow {
    margin-bottom: 4px;
  }

  .diagnosis-grid,
  .result-stats {
    margin-top: 11px;
  }

  .diagnosis-tip,
  .coach-note {
    margin-top: 9px;
    padding: 7px 9px;
    font-size: 9px;
  }

  .dialog-actions {
    margin-top: 12px;
  }

  .dialog-card .primary-button,
  .dialog-card .secondary-button {
    padding: 9px 12px;
    font-size: 9px;
  }

  .dialog-card .text-button {
    font-size: 8px;
  }
}

@media (hover: none), (pointer: coarse) {
  .touch-controls {
    display: flex;
  }

  .pause-button.is-visible {
    right: 12px;
    bottom: 112px;
  }

  .game-caption {
    display: none;
  }
}

@media (max-width: 420px) {
  .touch-controls {
    right: 7px;
    bottom: 7px;
    left: 7px;
  }

  .touch-group {
    gap: 4px;
  }

  .touch-move {
    grid-template-columns: repeat(3, 38px);
    grid-template-rows: repeat(2, 38px);
  }

  .touch-actions {
    display: grid;
    grid-template-columns: repeat(3, 38px);
    grid-template-rows: repeat(2, 38px);
  }

  .touch-controls button {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    font-size: 12px;
  }

  .pause-button.is-visible {
    right: 8px;
    bottom: 92px;
  }
}

@media (max-height: 720px) and (min-width: 721px) {
  .page-shell {
    padding-top: 8px;
  }

  .topbar {
    min-height: 46px;
    margin-bottom: 6px;
  }

  .title-screen {
    padding-top: 17px;
    padding-bottom: 12px;
  }

  .title-lead {
    margin: 10px 0 12px;
  }

  .system-panel article {
    padding: 8px 0;
  }

  .start-row {
    margin-top: 11px;
  }

  .level-strip {
    margin-top: 8px;
    padding-top: 9px;
  }
}

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