@font-face {
  font-family: Press;
  src: url("../assets/fonts/press-start.ttf") format("truetype");
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #101715;
  --panel: #18211e;
  --panel-dark: #121b18;
  --line: #34433a;
  --text: #f2e8cf;
  --muted: #a6b3a6;
  --ember: #ffc475;
  --ember-dark: #52311d;
  --pixel: Press, "Courier New", monospace;
  --body: system-ui, sans-serif;
  font-family: var(--body);
  color: var(--text);
  background: var(--bg);
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 70% 5%, #20312a 0, transparent 52%),
    radial-gradient(ellipse at 25% 100%, #17221b, transparent 54%), var(--bg);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(#879a7d30 0.65px, transparent 0.7px) 0 0/8px 8px;
  mask-image: linear-gradient(#0008, transparent 74%);
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
button:disabled {
  cursor: default;
}
button:focus-visible,
canvas:focus-visible {
  outline: 2px solid #fff0a9;
  outline-offset: 4px;
}
.arcade {
  position: relative;
  width: min(1100px, calc(100% - 64px));
  margin: 0 auto;
  padding: clamp(20px, 4.25vh, 48px) 0 26px;
}
.masthead,
.utilities,
.wordmark,
.record {
  display: flex;
  align-items: center;
}
.masthead {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 17px;
}
.wordmark {
  gap: 11px;
  font: normal clamp(10px, 1.5vw, 14px) / 1.6 var(--pixel);
  letter-spacing: 0.045em;
  color: #f6e7c2;
}
.wordmark canvas {
  width: 38px;
  height: 38px;
  background: #2e2820;
  border: 1px solid #655037;
  box-shadow: inset 0 0 0 2px #1d211a;
  image-rendering: pixelated;
}
.utilities {
  gap: 17px;
}
.record {
  gap: 7px;
  font-size: 0.84rem;
  color: var(--muted);
  white-space: nowrap;
}
.record span:first-child,
.record strong {
  color: var(--ember);
}
.record strong {
  font-variant-numeric: tabular-nums;
}
.subtle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 37px;
  padding: 5px 12px;
  border: 1px solid #465349;
  background: #202b24;
  font-size: 0.85rem;
  font-weight: 650;
  white-space: nowrap;
}
.subtle:hover:not(:disabled) {
  background: #354237;
  border-color: #899b80;
}
.subtle:disabled {
  opacity: 0.46;
}
.cabinet {
  position: relative;
  border: 1px solid #566456;
  background: var(--panel);
  box-shadow:
    0 0 0 3px #101813,
    0 0 0 4px #2e3a30,
    0 24px 70px #050b08a6;
}
.cabinet::before,
.cabinet::after {
  position: absolute;
  z-index: 3;
  content: "";
  width: 7px;
  height: 7px;
  pointer-events: none;
}
.cabinet::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid #ac9571;
  border-left: 2px solid #ac9571;
}
.cabinet::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 2px solid #ac9571;
  border-right: 2px solid #ac9571;
}
.hud {
  display: grid;
  grid-template-columns: 1fr 2.25fr 1.05fr 0.82fr;
  align-items: center;
  min-height: 68px;
  background: var(--panel);
  border-bottom: 1px solid #58624e;
}
.hud > div {
  min-width: 0;
  padding: 10px 19px;
  border-inline-end: 1px solid var(--line);
}
.hud > div:last-child {
  border: 0;
}
.hud-label {
  display: block;
  font-size: 0.7rem;
  line-height: 1.2;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.hud strong {
  font: normal 0.78rem/1.35 var(--pixel);
  white-space: nowrap;
}
.hud strong small {
  font-size: 0.62rem;
  color: #9caa98;
}
.wave-meter {
  display: grid;
  column-gap: 12px;
  grid-template-columns: auto 1fr;
  align-items: center;
}
.wave-meter .hud-label {
  grid-column: 1/-1;
}
.wave-pips {
  display: flex;
  gap: 3px;
  justify-content: end;
}
.wave-pips span {
  width: 6px;
  height: 9px;
  background: #344239;
}
.wave-pips [data-state="current"] {
  background: #ecc16f;
}
.wave-pips [data-state="done"] {
  background: #84b286;
}
.core-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}
.core-caption strong {
  color: #e8bd80;
  font-size: 0.67rem;
}
.health-bar {
  height: 11px;
  background: #101710;
  border: 1px solid #423e2a;
  padding: 1px;
}
.health-bar span {
  display: block;
  height: 100%;
  width: 100%;
  background: repeating-linear-gradient(
    90deg,
    #f8ae61 0,
    #f8ae61 12px,
    #e39247 12px,
    #e39247 14px
  );
  transition: width 0.15s;
}
.health-bar[data-low="true"] span {
  background: repeating-linear-gradient(
    90deg,
    #e97368 0,
    #e97368 12px,
    #b95149 12px,
    #b95149 14px
  );
}
.spark-meter {
  display: flex;
  gap: 10px;
  align-items: center;
}
.spark-icon {
  color: var(--ember);
  font-size: 1.42rem;
}
.clock-meter {
  text-align: right;
}
.viewport {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #1e3024;
  aspect-ratio: 480/254;
}
#arena {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  touch-action: manipulation;
}
.viewport[data-phase="combat"] #arena {
  cursor: crosshair;
}
.wave-notice {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  max-width: calc(100% - 20px);
  padding: 7px 9px;
  background: #16231bee;
  border: 1px solid #8a7856;
  color: #e4dcc1;
  font-size: 0.8rem;
  pointer-events: none;
}
.wave-notice strong {
  color: #ffd39a;
  white-space: nowrap;
}
.intro,
.overlay {
  position: absolute;
  inset: 0;
}
.intro {
  display: flex;
  align-items: center;
  background: linear-gradient(
    90deg,
    #101a14fa 0%,
    #111d15f0 19%,
    #132018dd 31%,
    #131f17a6 44%,
    #14221939 62%,
    transparent 81%
  );
}
.intro-copy {
  width: 61%;
  padding: 0 0 1.2% clamp(26px, 6.15vw, 83px);
}
.kicker {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 19px;
  color: #f3ba77;
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}
.kicker > span {
  height: 8px;
  width: 8px;
  transform: rotate(45deg);
  background: #f8bc72;
  box-shadow: 0 0 0 3px #f1bf7829;
}
.intro h1 {
  width: max-content;
  max-width: 100%;
  margin: 0;
  font: normal clamp(25px, 5.25vw, 68px) / 1.18 var(--pixel);
  letter-spacing: -0.096em;
  color: #fff0d0;
  text-shadow:
    0 5px #705237,
    3px 8px #111710;
}
.intro h1 span {
  color: #ffc578;
}
.pitch {
  max-width: 33ch;
  margin: 22px 0 25px;
  color: #e5e6d1;
  font-size: clamp(1rem, 1.7vw, 1.18rem);
  line-height: 1.56;
}
.intro-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px 13px;
}
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 49px;
  padding: 9px 19px;
  border: 0;
  background: #ffc37e;
  box-shadow:
    inset 0 1px #ffdfa6,
    inset 0 -4px #d88746,
    0 0 0 2px #735237,
    0 5px 0 2px #18170f;
  color: #2a1b12;
  font-size: 1rem;
  font-weight: 830;
}
.primary:hover {
  background: #ffda9d;
}
.primary:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 1px #ffdfa6,
    inset 0 -2px #d88746,
    0 0 0 2px #735237,
    0 3px 0 2px #18170f;
}
.play-mark {
  width: 11px;
  height: 13px;
  background: #714421;
  clip-path: polygon(
    0 0,
    27% 0,
    27% 15%,
    54% 15%,
    54% 31%,
    80% 31%,
    80% 45%,
    100% 45%,
    100% 61%,
    80% 61%,
    80% 74%,
    54% 74%,
    54% 88%,
    27% 88%,
    27% 100%,
    0 100%
  );
}
.intro-stat {
  margin: 17px 0 0;
  font-size: 0.82rem;
  font-weight: 650;
  color: #aab6a3;
}
.intro-stat span {
  margin: 0 4px;
  color: #edba77;
}
.map-badge {
  position: absolute;
  right: 18px;
  bottom: 16px;
  padding: 7px 10px;
  border: 1px solid #82967862;
  background: #19261dd9;
  color: #d7dec3;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.13em;
}
.map-badge span {
  color: #ffc378;
  margin-right: 5px;
}
.action-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  min-height: 65px;
  padding: 9px 14px;
  border-top: 1px solid #566456;
  background: var(--panel-dark);
}
.spells {
  display: flex;
  gap: 6px;
}
.spell {
  --spell: #e9ae6d;
  display: grid;
  min-width: 112px;
  grid-template-columns: 30px 1fr;
  gap: 6px;
  align-items: center;
  text-align: left;
  padding: 4px 8px 4px 4px;
  min-height: 42px;
  background: #202b24;
  border: 1px solid #465349;
}
.spell#ward {
  --spell: #9ad6d7;
}
.spell[aria-pressed="true"] {
  background: color-mix(in srgb, var(--spell) 15%, #19241e);
  border-color: var(--spell);
  box-shadow: inset 0 -2px var(--spell);
}
.spell:not(:disabled):hover {
  border-color: var(--spell);
  background: color-mix(in srgb, var(--spell) 23%, #19241e);
}
.spell:disabled {
  opacity: 0.68;
}
.spell canvas {
  width: 30px;
  height: 30px;
  image-rendering: pixelated;
}
.spell strong,
.spell small {
  display: block;
}
.spell strong {
  font-size: 0.87rem;
  line-height: 1.2;
  color: #f5e9d2;
}
.spell small {
  color: #bbc1af;
  font-size: 0.72rem;
  margin-top: 2px;
  white-space: nowrap;
}
.spell-info {
  text-align: center;
}
.charges {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #f5d39c;
  font-size: 0.84rem;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.charges #charge-pips {
  display: flex;
  gap: 5px;
  margin-inline: 3px;
}
.charges #charge-pips span {
  display: block;
  width: 8px;
  height: 8px;
  transform: rotate(45deg);
  border: 1px solid #8a7350;
  background: #232820;
}
.charges #charge-pips [data-filled="true"] {
  background: #fac77d;
  border-color: #fac77d;
  box-shadow: 0 0 8px #fac77d58;
}
.hint {
  margin: 0;
  color: #b8c2b3;
  font-size: 0.88rem;
  text-align: center;
  line-height: 1.35;
}
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 25px;
  padding: 16px 1px 0;
  color: #a3afa1;
  font-size: 0.8rem;
}
.controls > div {
  display: flex;
  align-items: center;
  gap: 4px;
}
.controls kbd:last-of-type {
  margin-right: 4px;
}
kbd {
  display: inline-block;
  padding: 2px 5px;
  min-width: 18px;
  text-align: center;
  border: 1px solid #44544a;
  border-radius: 2px;
  background: #1d2822;
  color: #dce0cb;
  font: 600 0.72rem/1.25 var(--body);
}
.overlay {
  display: grid;
  place-items: center;
  overflow: auto;
  overscroll-behavior: contain;
  background: #0d1813c9;
  padding: 14px;
  z-index: 2;
}
.dialog {
  width: min(100%, 778px);
  padding: clamp(16px, 3vw, 34px);
  background: #1b2821;
  border: 1px solid #78836a;
  box-shadow:
    inset 0 0 0 3px #243327,
    0 0 0 3px #111a13,
    0 20px 45px #070d09b8;
  text-align: center;
}
.dialog .kicker {
  justify-content: center;
  margin-bottom: 14px;
}
.dialog h2 {
  font: normal clamp(17px, 3.4vw, 32px) / 1.45 var(--pixel);
  color: #fff0cc;
  margin: 0;
  overflow-wrap: anywhere;
}
.dialog-detail {
  color: #c8d2c0;
  font-size: 0.9rem;
  margin: 12px 0 20px;
}
.viewport[data-phase="upgrade"] {
  aspect-ratio: auto;
  min-height: 0;
}
.viewport[data-phase="upgrade"] #arena {
  position: absolute;
  inset: 0;
  object-fit: cover;
}
.viewport[data-phase="upgrade"] .overlay {
  position: relative;
  z-index: 1;
  min-height: 460px;
  overflow: visible;
}
.tree-dialog {
  width: min(100%, 930px);
  padding: clamp(12px, 2vw, 24px);
  text-align: left;
}
.tree-dialog:focus {
  outline: 0;
}
.tree-dialog .kicker {
  justify-content: flex-start;
  margin-bottom: 8px;
}
.tree-dialog h2 {
  font-size: clamp(19px, 2.6vw, 28px);
}
.tree-dialog .dialog-detail {
  margin: 8px 0 10px;
}
.tree-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.points {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  color: #f9d89c;
  font-size: 0.85rem;
  font-weight: 650;
}
.points strong {
  font-variant-numeric: tabular-nums;
}
.branch-picker {
  display: none;
}
.branches {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.rune-branch {
  min-width: 0;
  padding: 9px 7px;
  background: #17251dc9;
  border: 1px solid #4a5e4d;
}
.rune-branch h3 {
  margin: 0 0 8px;
  color: var(--rune-color);
  font-size: 0.77rem;
  line-height: 1.25;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}
.branch-layout {
  --edge: #627260;
  --row: calc((100% - 36px) / 4);
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, 1fr);
  gap: 12px 4px;
  isolation: isolate;
}
.branch-layout::before,
.branch-layout::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset-inline: 24%;
  top: var(--row);
  height: 12px;
  background:
    linear-gradient(var(--edge), var(--edge)) center top/1px 50% no-repeat,
    linear-gradient(var(--edge), var(--edge)) center/100% 1px no-repeat,
    linear-gradient(var(--edge), var(--edge)) left bottom/1px 50% no-repeat,
    linear-gradient(var(--edge), var(--edge)) right bottom/1px 50% no-repeat;
}
.branch-layout::after {
  top: calc(var(--row) * 2 + 12px);
  transform: rotate(180deg);
}
.rune-node {
  position: relative;
  display: grid;
  grid-template-columns: 21px 1fr auto;
  gap: 3px;
  align-items: center;
  min-height: 44px;
  min-width: 0;
  padding: 4px;
  background: #24352a;
  border: 1px solid #65765f;
  text-align: left;
}
.rune-node[data-slot="root"] {
  grid-area: 1/2/2/4;
}
.rune-node[data-slot="left"] {
  grid-area: 2/1/3/3;
}
.rune-node[data-slot="right"] {
  grid-area: 2/3/3/5;
}
.rune-node[data-slot="end"] {
  grid-area: 3/2/4/4;
}
.rune-node[data-slot="capstone"] {
  grid-area: 4/2/5/4;
}
.rune-node[data-slot="capstone"]::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 1px);
  left: 50%;
  height: 12px;
  border-left: 1px solid var(--edge);
  pointer-events: none;
}
.rune-node[data-status="locked"] {
  background: #1b2820;
  border-color: #475a4d;
  color: #b5c3b5;
}
.rune-node[data-status="max"] {
  border-color: color-mix(in srgb, var(--rune-color) 70%, #52674f);
}
.rune-node:hover,
.rune-node[aria-pressed="true"] {
  border-color: var(--rune-color);
  background: #304235;
}
.rune-node[aria-pressed="true"] {
  box-shadow: inset 0 -2px var(--rune-color);
}
.rune-node canvas {
  width: 21px;
  height: 21px;
  grid-row: 1/3;
  image-rendering: pixelated;
}
.rune-node[data-status="locked"] canvas {
  opacity: 0.62;
}
.rune-node strong {
  grid-column: 2/-1;
  align-self: end;
  font-size: 0.75rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.rune-marker {
  align-self: center;
  color: #a39e81;
  font-size: 0.67rem;
  line-height: 1;
}
.rune-node[data-affordable="true"] .rune-marker,
.rune-node[data-status="max"] .rune-marker {
  color: var(--rune-color);
}
.rune-level {
  display: flex;
  min-width: 0;
  gap: 2px;
  align-items: center;
}
.rune-level span {
  width: 7px;
  height: 4px;
  background: #475746;
}
.rune-level [data-filled="true"] {
  background: var(--rune-color);
}
.rune-inspector {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 83px;
  padding: 9px 11px;
  margin: 9px 0 0;
  background: #17241dc9;
  border: 1px solid #526452;
}
.rune-inspector strong {
  font-size: 0.88rem;
  color: #f4dfb3;
}
.rune-inspector p {
  font-size: 0.82rem;
  line-height: 1.4;
  color: #d1decb;
  margin: 3px 0 0;
}
.rune-inspector #rune-requirement {
  color: #deb782;
}
.rune-inspector #rune-requirement:empty {
  display: none;
}
.tree-dialog .dialog-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 11px;
}
.tree-dialog #reset-progress {
  margin-inline-end: auto;
}
.tree-dialog .primary {
  min-height: 40px;
  font-size: 0.9rem;
}
.tree-dialog .primary:disabled {
  opacity: 0.65;
}
.dialog-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
}
.reset-dialog {
  width: min(450px, calc(100% - 32px));
  color: var(--text);
  text-align: left;
}
.reset-dialog h2 {
  font-size: clamp(14px, 4.5vw, 20px);
}
.reset-dialog .dialog-detail {
  margin: 15px 0 20px;
  line-height: 1.5;
}
.reset-dialog .dialog-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
}
.reset-dialog::backdrop,
.balance-dialog::backdrop {
  background: #080d0ae0;
}
.subtle.reset-button {
  border-color: #9b6357;
  background: #382924;
  color: #ffd1c1;
}
.subtle.reset-button:hover:not(:disabled) {
  border-color: #d08977;
  background: #52372f;
}
.balance-dialog {
  width: min(520px, calc(100% - 28px));
  max-height: calc(100dvh - 28px);
  color: var(--text);
  text-align: left;
  overflow: auto;
}
.balance-dialog h2 {
  font-size: clamp(17px, 4vw, 24px);
  margin-bottom: 16px;
}
.balance-group {
  min-width: 0;
  display: grid;
  align-items: center;
  grid-template-columns: auto minmax(55px, 1fr) 3rem;
  gap: 8px 11px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #526452;
  background: #17241d;
  font-size: 0.86rem;
}
.balance-group legend,
.balance-group output {
  color: #f9d89c;
  font-weight: 700;
}
.balance-group legend {
  padding-inline: 5px;
}
.balance-group label {
  font-weight: 650;
}
.balance-group input {
  margin: 0;
  width: 100%;
  accent-color: var(--ember);
  cursor: pointer;
}
.balance-group input:focus-visible {
  outline: 2px solid #fff0a9;
  outline-offset: 3px;
}
.balance-group output {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.balance-example {
  grid-column: 1/-1;
  margin: 3px 0 0;
  color: #b9c6b7;
  font-size: 0.79rem;
  line-height: 1.45;
}
.balance-example strong {
  color: #f9d89c;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.balance-dialog .dialog-detail {
  line-height: 1.5;
  margin: 12px 0 16px;
}
.balance-dialog .dialog-actions {
  justify-content: flex-end;
  gap: 9px;
}
@media (min-width: 900px) and (min-height: 600px) {
  .arcade {
    width: min(1100px, calc(100% - 64px), calc((100vh - 232px) * 1.89));
  }
}
@media (max-width: 850px) {
  .wave-meter .wave-pips {
    display: none;
  }
  .hud > div {
    padding-inline: 12px;
  }
  .arcade {
    width: calc(100% - 40px);
  }
}
@media (max-width: 620px) {
  .arcade {
    width: calc(100% - 22px);
    padding-top: 14px;
  }
  .masthead {
    margin-bottom: 12px;
  }
  .utilities {
    gap: 8px;
  }
  .record {
    gap: 4px;
  }
  .subtle {
    min-height: 34px;
    padding-inline: 8px;
  }
  .hud {
    min-height: 56px;
    grid-template-columns: 0.86fr 1.53fr 0.73fr 0.76fr;
  }
  .hud > div {
    padding: 8px 7px;
  }
  .hud-label {
    font-size: 0.59rem;
    letter-spacing: 0.055em;
  }
  .hud strong {
    font-size: 0.62rem;
  }
  .core-caption {
    display: block;
  }
  .core-caption .hud-label {
    margin-bottom: 0;
  }
  .core-caption strong {
    display: block;
    margin: 2px 0 4px;
    font-size: 0.53rem;
  }
  .hud strong small {
    font-size: 0.48rem;
  }
  .health-bar {
    height: 7px;
  }
  .spark-meter {
    gap: 3px;
  }
  .spark-icon {
    font-size: 0.85rem;
  }
  .viewport {
    aspect-ratio: auto;
    min-height: 320px;
  }
  .viewport[data-phase="combat"],
  .viewport[data-phase="paused"] {
    min-height: 0;
  }
  #arena {
    position: absolute;
    inset: 0;
    object-fit: contain;
  }
  .viewport[data-phase="combat"] #arena,
  .viewport[data-phase="paused"] #arena {
    position: static;
    height: auto;
  }
  .viewport[data-phase="title"] #arena {
    object-fit: cover;
    object-position: 64% center;
    opacity: 0.73;
  }
  .intro {
    background: linear-gradient(
      90deg,
      #111a14fa 0%,
      #121c15d9 32%,
      #1320188c 71%,
      #13201832 100%
    );
  }
  .intro-copy {
    width: 95%;
    padding: 0 16px;
  }
  .intro h1 {
    font-size: clamp(25px, 7.35vw, 42px);
  }
  .kicker {
    font-size: 0.61rem;
    margin-bottom: 15px;
  }
  .pitch {
    font-size: 0.91rem;
    max-width: 26ch;
    margin: 16px 0 19px;
  }
  .primary {
    min-height: 41px;
    font-size: 0.91rem;
    padding-inline: 14px;
  }
  .intro-stat {
    margin-top: 13px;
    font-size: 0.74rem;
  }
  .map-badge {
    bottom: 6px;
    right: 6px;
    font-size: 0.53rem;
    padding: 4px 6px;
  }
  .action-bar {
    gap: 7px;
    padding: 6px;
    min-height: 56px;
  }
  .spells {
    gap: 3px;
  }
  .spell {
    min-width: 0;
    grid-template-columns: 19px 1fr;
    gap: 2px;
    padding: 3px;
  }
  .spell canvas {
    width: 19px;
    height: 19px;
  }
  .spell strong {
    font-size: 0.68rem;
  }
  .spell small {
    font-size: 0.57rem;
    display: none;
  }
  .charges {
    gap: 4px;
    font-size: 0.65rem;
  }
  .charges #charge-pips {
    gap: 3px;
    margin: 0;
  }
  .charges #charge-pips span {
    width: 5px;
    height: 5px;
  }
  .hint {
    font-size: 0.7rem;
  }
  .controls {
    gap: 8px 13px;
    padding-top: 13px;
    font-size: 0.69rem;
  }
  .controls kbd {
    font-size: 0.64rem;
  }
  .dialog {
    padding: 13px 10px;
  }
  .dialog-detail {
    margin: 7px 0 11px;
    font-size: 0.77rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 760px) {
  .tree-toolbar {
    justify-content: space-between;
  }
  .branch-picker {
    display: flex;
    gap: 4px;
  }
  .branch-picker button {
    min-height: 32px;
    padding: 2px 8px;
    border: 1px solid #4a5e4d;
    background: #202f24;
    font-size: 0.77rem;
    font-weight: 700;
  }
  .branch-picker button[aria-pressed="true"] {
    color: #ffe6b2;
    border-color: #ceab72;
    background: #364032;
  }
  .branches {
    grid-template-columns: 1fr;
  }
  .rune-branch[data-active="false"] {
    display: none;
  }
  .rune-node {
    grid-template-columns: 24px 1fr auto;
    min-height: 46px;
    padding-inline: 6px;
  }
  .rune-node canvas {
    width: 24px;
    height: 24px;
  }
  .rune-node strong {
    font-size: 0.81rem;
  }
  .rune-branch h3 {
    display: none;
  }
}
@media (max-width: 620px) {
  .viewport[data-phase="falling"] {
    min-height: 0;
  }
  .viewport[data-phase="falling"] #arena {
    position: static;
    height: auto;
  }
  .viewport[data-phase="upgrade"] .overlay {
    min-height: 0;
    padding: 8px;
  }
  .points {
    font-size: 0.73rem;
  }
  .tree-toolbar {
    flex-wrap: wrap;
    gap: 6px;
  }
  .wave-notice {
    top: 5px;
    left: 5px;
    max-width: calc(100% - 10px);
    padding: 4px 6px;
    font-size: 0.68rem;
  }
  .rune-inspector {
    padding: 7px;
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }
  .rune-inspector #invest {
    justify-self: start;
    min-height: 32px;
  }
  .tree-dialog .primary {
    min-height: 35px;
  }
  .tree-dialog .dialog-actions {
    gap: 9px;
  }
  .tree-dialog #reset-progress {
    flex-basis: 100%;
    margin-inline-end: 0;
  }
  .balance-group {
    grid-template-columns: auto minmax(42px, 1fr) 2.65rem;
    gap: 8px;
    padding-inline: 8px;
  }
}
@media (max-width: 360px) {
  .action-bar {
    grid-template-columns: 1fr auto;
  }
  .action-bar .spell-info {
    grid-column: 1/-1;
    grid-row: 2;
  }
  .action-bar .spells {
    grid-column: 1;
    grid-row: 1;
  }
  .action-bar #pause {
    grid-column: 2;
    grid-row: 1;
  }
}
