:root {
  color-scheme: dark;
  --bg: #0d0d0e;
  --surface: rgba(20, 20, 22, 0.88);
  --line: #2b2b31;
  --text: #f2f0f5;
  --muted: #aaa6b2;
  --violet: #a78bfa;
  --signal: #7c3aed;
  --amber: #ffb86b;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --sans: "Space Grotesk", Inter, ui-sans-serif, system-ui, sans-serif;
}
* {
  box-sizing: border-box;
}
html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
}
button,
a,
summary {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 4px;
}
button {
  border: 0;
}
button:disabled {
  cursor: default;
}
#world,
#canvas-host {
  position: fixed;
  inset: 0;
}
#canvas-host canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at 50% 48%,
    transparent 42%,
    rgba(3, 3, 5, 0.2) 72%,
    rgba(3, 3, 5, 0.68) 120%
  );
}
.hud-panel {
  position: fixed;
  z-index: 5;
}
.eyebrow {
  font: 600 10px/1.4 var(--mono);
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 0;
}
.topbar {
  left: 20px;
  right: 20px;
  top: 18px;
  height: 60px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  background: linear-gradient(90deg, #141416f0, #141416b3);
  border-radius: 10px;
  padding: 0 16px;
  backdrop-filter: blur(16px);
}
.brand-mark {
  width: 28px;
  height: 30px;
  position: relative;
  margin-right: 12px;
}
.brand-mark i {
  position: absolute;
  width: 15px;
  height: 22px;
  border: 1px solid var(--violet);
  border-radius: 55% 55% 48% 48%;
  left: 6px;
  top: 3px;
}
.brand-mark i:nth-child(2) {
  height: 9px;
  top: 19px;
  left: 2px;
  width: 10px;
  border-color: #514366;
}
.brand-mark i:nth-child(3) {
  height: 9px;
  top: 19px;
  left: 16px;
  width: 10px;
  border-color: #514366;
}
.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.brand span {
  font: 500 8px/1 var(--mono);
  letter-spacing: 0.22em;
  color: var(--muted);
}
.brand strong {
  font-size: 15px;
  letter-spacing: 0.03em;
}
.world-status {
  margin-left: 28px;
  padding-left: 28px;
  border-left: 1px solid var(--line);
  display: flex;
  gap: 8px;
  align-items: center;
  font: 500 9px var(--mono);
  letter-spacing: 0.1em;
  color: #c8c3cf;
}
.world-status i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 10px #ffb86b66;
}
.top-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.icon-btn,
.square-btn {
  height: 32px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 11px;
  font: 500 9px var(--mono);
  letter-spacing: 0.05em;
  color: var(--muted);
}
.icon-btn b {
  color: var(--text);
  margin-left: 5px;
}
.icon-btn[aria-pressed="true"] {
  border-color: #6d579b;
  color: var(--violet);
}
.square-btn {
  width: 32px;
  padding: 0;
  font-size: 13px;
}
.icon-btn:hover,
.square-btn:hover {
  background: #222127;
  color: #fff;
}
.intro {
  left: 34px;
  top: 116px;
  width: 270px;
  pointer-events: none;
}
.intro h1 {
  font-size: clamp(30px, 3vw, 46px);
  font-weight: 550;
  letter-spacing: -0.045em;
  line-height: 1.02;
  margin: 12px 0 14px;
}
.intro > p:not(.eyebrow) {
  font-size: 13px;
  line-height: 1.65;
  color: #c2bdc9;
  margin: 0;
}
.intro-rule {
  width: 34px;
  height: 1px;
  background: var(--violet);
  margin: 25px 0 16px;
}
.sim-row {
  display: flex;
  justify-content: space-between;
  width: 230px;
  margin: 8px 0;
  font: 500 9px var(--mono);
  letter-spacing: 0.06em;
}
.sim-row span {
  color: #8c8794;
}
.sim-row strong {
  font-weight: 500;
  color: #c9c3d2;
  font-variant-numeric: tabular-nums;
}
.stage-legend {
  right: 34px;
  top: 116px;
  width: 184px;
}
.stage-legend ol {
  list-style: none;
  padding: 0;
  margin: 13px 0;
}
.stage-legend li {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  color: #8d8695;
  transition: color 0.3s;
}
.stage-legend li:not(:last-child):after {
  content: "";
  position: absolute;
  left: 3px;
  top: 31px;
  width: 1px;
  height: 29px;
  background: #39353f;
}
.stage-legend li > i {
  width: 7px;
  height: 7px;
  border: 1px solid currentColor;
  border-radius: 50%;
  z-index: 1;
  background: #111;
}
.stage-legend li > span {
  font: 500 9px var(--mono);
}
.stage-legend li div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.stage-legend strong {
  font: 500 10px var(--mono);
  letter-spacing: 0.07em;
}
.stage-legend small {
  font: 400 8px var(--mono);
  letter-spacing: 0.04em;
}
.stage-legend li.active {
  color: var(--violet);
}
.stage-legend li.active > i {
  background: var(--violet);
  box-shadow: 0 0 12px #a78bfa88;
}
.tour-control {
  left: 50%;
  transform: translate(-50%);
  top: 96px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 9px 10px 9px 14px;
  background: #0e0e10a3;
  border: 1px solid #2a2830;
  border-radius: 8px;
  backdrop-filter: blur(12px);
}
.tour-control > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  white-space: nowrap;
}
.tour-control small {
  font: 400 8px var(--mono);
  color: #8d8695;
  letter-spacing: 0.05em;
}
.primary-btn {
  height: 35px;
  background: var(--signal);
  border: 1px solid #9874eb;
  border-radius: 6px;
  padding: 0 14px;
  font: 600 9px var(--mono);
  letter-spacing: 0.07em;
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}
.primary-btn:hover {
  background: #8b51ed;
}
.play-glyph {
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid white;
}
.wing-nav {
  left: 50%;
  bottom: 37px;
  transform: translate(-50%);
  padding: 10px;
  background: #0f0f11db;
  border: 1px solid var(--line);
  border-radius: 9px;
  backdrop-filter: blur(16px);
}
.wing-nav > .eyebrow {
  display: block;
  text-align: center;
  margin-bottom: 8px;
  font-size: 8px;
}
#wing-chips {
  display: flex;
  gap: 5px;
}
#wing-chips button {
  min-height: 42px;
  background: #19181c;
  border: 1px solid #2d2b32;
  border-radius: 5px;
  padding: 5px 11px;
  font: 500 9px var(--mono);
  letter-spacing: 0.04em;
  color: #aaa5b1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "dot name idx" "dot stage idx";
  column-gap: 8px;
  row-gap: 2px;
  align-items: center;
  text-align: left;
}
#wing-chips button i {
  grid-area: dot;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}
#wing-chips button b {
  grid-area: name;
  font-weight: 600;
  white-space: nowrap;
}
#wing-chips button small {
  grid-area: stage;
  font: 400 7px var(--mono);
  letter-spacing: 0.1em;
  color: #8d8695;
}
#wing-chips button span {
  grid-area: idx;
  color: #948c9d;
  font-size: 8px;
  margin-left: 4px;
}
#wing-chips button:hover,
#wing-chips button.active {
  color: #fff;
  border-color: #776292;
  background: #24202c;
}
#wing-chips button.active i {
  background: var(--violet);
  box-shadow: 0 0 8px var(--violet);
}
.bottom-left {
  position: fixed;
  left: 34px;
  bottom: 50px;
  z-index: 5;
}
.text-btn {
  background: none;
  padding: 0;
  font: 500 10px var(--mono);
  letter-spacing: 0.08em;
  color: #d3cdda;
}
.text-btn span {
  color: var(--violet);
  font-size: 15px;
  margin-left: 6px;
}
.bottom-left p {
  font: 400 7px var(--mono);
  letter-spacing: 0.06em;
  color: #8d8695;
  margin: 8px 0 0;
}
.minimap-wrap {
  right: 28px;
  bottom: 34px;
  width: 150px;
  height: 174px;
  background: #0f0f11b8;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px;
  backdrop-filter: blur(12px);
}
.minimap-wrap > div {
  display: flex;
  justify-content: space-between;
}
.minimap-wrap > div b {
  font: 500 8px var(--mono);
  color: #8d8695;
}
#minimap {
  display: block;
  width: 126px;
  height: 126px;
  margin: 3px auto 0;
}
#quality-label {
  display: block;
  width: 100%;
  background: none;
  padding: 2px 0;
  text-align: center;
  font: 400 7px var(--mono);
  letter-spacing: 0.08em;
  color: #8d8695;
}
#quality-label:hover {
  color: #fff;
}
footer {
  position: fixed;
  z-index: 5;
  bottom: 11px;
  left: 34px;
  right: 34px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  font: 500 7px var(--mono);
  letter-spacing: 0.13em;
  color: #918a99;
}
#crosshair {
  display: none;
  position: fixed;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  transform: translate(-50%, -50%);
  z-index: 4;
  pointer-events: none;
}
#crosshair:before,
#crosshair:after {
  content: "";
  position: absolute;
  background: #d6cdea88;
}
#crosshair:before {
  width: 10px;
  height: 1px;
  top: 5px;
}
#crosshair:after {
  height: 10px;
  width: 1px;
  left: 5px;
}
body.free-mode #crosshair {
  display: block;
}
#toast {
  position: fixed;
  left: 50%;
  bottom: 132px;
  transform: translate(-50%, 10px);
  opacity: 0;
  background: #17161bdd;
  border: 1px solid #3a3543;
  border-radius: 6px;
  padding: 10px 14px;
  font: 500 9px var(--mono);
  letter-spacing: 0.04em;
  z-index: 20;
  pointer-events: none;
  transition: 0.25s;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%);
}
#loading {
  position: fixed;
  z-index: 30;
  inset: 0;
  background: #0d0d0e;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  transition: opacity 0.6s;
}
#loading span {
  font: 500 10px var(--mono);
  letter-spacing: 0.2em;
  color: #a39baa;
}
#loading .warm-egg {
  --warm: 0;
  display: block;
  width: 64px;
  height: 84px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(
    ellipse at 38% 30%,
    color-mix(in srgb, #fff2d6 calc(var(--warm) * 80%), #c9b8ff) 0%,
    color-mix(in srgb, #ff9a3c calc(var(--warm) * 100%), #6b4fd8) 45%,
    color-mix(in srgb, #8a2a0a calc(var(--warm) * 100%), #1e1640) 100%
  );
  box-shadow: 0 0 calc(8px + var(--warm) * 46px) calc(var(--warm) * 6px)
    color-mix(in srgb, #ff9a3c calc(var(--warm) * 100%), #6b4fd8 40%);
  transition: box-shadow 0.3s, background 0.3s;
  animation: warm-breathe 2.5s ease-in-out infinite;
}
#loading { --warm: 0; }
#loading .warm-egg { --warm: inherit; }
#loading strong {
  font: 600 18px var(--mono);
  color: #f3eee7;
  font-variant-numeric: tabular-nums;
}
@keyframes warm-breathe {
  50% { transform: scale(1.04); }
}
@media (prefers-reduced-motion: reduce) {
  #loading .warm-egg { animation: none; }
}
#loading i {
  display: block;
  width: 180px;
  height: 2px;
  background: #242128;
  overflow: hidden;
}
#loading b {
  display: block;
  width: 15%;
  height: 100%;
  background: var(--violet);
  animation: load 1.4s ease-in-out infinite;
}
@keyframes load {
  50% {
    width: 75%;
    transform: translate(30%);
  }
  to {
    width: 15%;
    transform: translate(1200%);
  }
}
#loading b.det {
  animation: none;
  transform: none;
  transition: width 0.25s ease-out;
}
#loading.done {
  opacity: 0;
  pointer-events: none;
}
.modal-card {
  position: fixed;
  z-index: 15;
  right: 34px;
  top: 100px;
  width: 330px;
  max-height: calc(100vh - 160px);
  overflow: auto;
  background: #121115f5;
  border: 1px solid #38333f;
  border-radius: 10px;
  padding: 24px;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 80px #0008;
}
.modal-card[hidden] {
  display: none;
}
.close-btn {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 28px;
  height: 28px;
  border-radius: 5px;
  background: transparent;
  color: #aaa3b2;
  font: 300 22px/1 var(--sans);
  z-index: 2;
}
.close-btn:hover {
  background: #2a2730;
  color: #fff;
}
.modal-card h2,
dialog h2 {
  font-size: 27px;
  line-height: 1.1;
  letter-spacing: -0.035em;
  margin: 12px 0 8px;
}
.genome {
  font: 400 10px var(--mono);
  color: #837b8d;
  margin: 0 0 18px;
}
.swatches {
  display: flex;
  height: 25px;
  gap: 4px;
}
.swatches i {
  flex: 1;
  border-radius: 3px;
  border: 1px solid #ffffff22;
}
.palette-name {
  font: 500 9px var(--mono);
  letter-spacing: 0.06em;
  color: #c9c1d2;
  margin: 7px 0 18px;
}
dl {
  margin: 0;
}
dl div {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #2b2830;
  padding: 9px 0;
  gap: 10px;
}
dt {
  font: 400 8px var(--mono);
  letter-spacing: 0.08em;
  color: #8c8495;
}
dd {
  font: 500 9px var(--mono);
  text-align: right;
  margin: 0;
  color: #ded7e6;
  text-transform: uppercase;
}
.rare-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.rare-row span {
  font: 500 8px var(--mono);
  padding: 5px 7px;
  border: 1px solid #59476c;
  border-radius: 4px;
  color: #c6a9f5;
}
.honest-note {
  font: 400 10px/1.5 var(--mono);
  color: #b7a8c8;
  border-left: 2px solid var(--signal);
  padding-left: 10px;
  margin: 18px 0;
}
.secondary-btn {
  width: 100%;
  height: 35px;
  background: #211d28;
  border: 1px solid #453a53;
  border-radius: 5px;
  font: 500 9px var(--mono);
  letter-spacing: 0.08em;
}
.secondary-btn:hover {
  background: #2b2435;
}
dialog {
  color: var(--text);
  background: #141316;
  border: 1px solid #38333f;
  border-radius: 12px;
  width: min(680px, calc(100vw - 32px));
  max-height: 82vh;
  padding: 34px;
  box-shadow: 0 30px 120px #000b;
}
dialog::backdrop {
  background: #070709bb;
  backdrop-filter: blur(8px);
}
.guide-lead {
  font-size: 14px;
  line-height: 1.7;
  color: #c8c1d0;
}
details {
  border-top: 1px solid #302c35;
  padding: 13px 0;
}
summary {
  font: 500 10px var(--mono);
  letter-spacing: 0.06em;
  cursor: pointer;
}
details p {
  font-size: 12px;
  line-height: 1.7;
  color: #aaa2b2;
}
.genome-table {
  margin-top: 14px;
}
.genome-table > div {
  display: grid;
  grid-template-columns: 90px 1fr;
  padding: 8px 0;
  border-top: 1px solid #28252c;
  font: 400 10px var(--mono);
  color: #b7afbf;
}
.genome-table > div:first-child {
  border: 0;
  font-size: 8px;
  color: #8d8695;
}
.genome-table code {
  color: var(--violet);
}
.credits {
  font: 400 9px/1.5 var(--mono);
  color: #8c8494;
  margin-top: 20px;
}
#summary-list section {
  border-top: 1px solid #302c35;
  padding: 14px 0;
}
#summary-list h3 {
  font: 500 11px var(--mono);
  color: var(--violet);
  letter-spacing: 0.08em;
}
#summary-list article {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
  padding: 7px 0;
  font: 400 10px/1.5 var(--mono);
  color: #b9b1c1;
}
#summary-list article b {
  color: #7f7788;
  font-weight: 400;
}
.skip-link {
  position: fixed;
  left: 20px;
  top: -60px;
  z-index: 100;
  background: var(--violet);
  color: #111;
  padding: 12px;
  border-radius: 5px;
}
.skip-link:focus {
  top: 10px;
}
#fallback {
  position: fixed;
  z-index: 40;
  inset: 0;
  background: #0d0d0e;
  padding: 15vw;
}
#fallback[hidden] {
  display: none;
}
#fallback h1 {
  font-size: 40px;
}
#fallback p {
  max-width: 520px;
  line-height: 1.6;
  color: #bbb3c3;
}
#fallback button {
  padding: 12px 18px;
  background: var(--signal);
  border-radius: 6px;
  margin-top: 20px;
}
#touch-controls {
  display: none;
}
body:not(.stick-on) #touch-controls {
  display: none;
}
body.stick-on #touch-controls {
  display: block;
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}
.touch-only {
  display: none;
}
@media (pointer: coarse) {
  .touch-only {
    display: inline-block;
  }
}
#touch-controls > span {
  position: absolute;
  right: 18px;
  bottom: 170px;
  font: 400 7px var(--mono);
  letter-spacing: 0.08em;
  color: #8d8695;
}
#joystick {
  position: absolute;
  left: 22px;
  bottom: 170px;
  width: 82px;
  height: 82px;
  border: 1px solid #75658a55;
  border-radius: 50%;
  background: #17141d44;
  pointer-events: auto;
  touch-action: none;
}
#joystick:before,
#joystick:after {
  content: "";
  position: absolute;
  background: #85749333;
}
#joystick:before {
  width: 1px;
  height: 60%;
  left: 50%;
  top: 20%;
}
#joystick:after {
  height: 1px;
  width: 60%;
  top: 50%;
  left: 20%;
}
#joystick i {
  position: absolute;
  left: 27px;
  top: 27px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #a78bfa33;
  border: 1px solid #a78bfa88;
  transform: translate(0);
}
#flash {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 52%, #fff6e4, #ffd9a0 45%, #b78cff55 100%);
}
.card-link {
  display: block;
  margin-top: 14px;
  padding: 8px 0 2px;
  text-align: center;
  font: 500 9px var(--mono);
  letter-spacing: 0.08em;
  color: var(--violet);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.card-link:hover {
  color: #fff;
}
body.hud-hidden .hud-panel,
body.hud-hidden .bottom-left,
body.hud-hidden footer,
body.hud-hidden #toast,
body.hud-hidden .modal-card,
body.hud-hidden #touch-controls,
body.hud-hidden .vignette,
body.hud-hidden #crosshair {
  display: none !important;
}
body.cine-mode .intro,
body.cine-mode .stage-legend,
body.cine-mode .wing-nav,
body.cine-mode .minimap-wrap,
body.cine-mode .bottom-left {
  opacity: 0;
  pointer-events: none;
}
.intro,
.stage-legend,
.wing-nav,
.minimap-wrap,
.bottom-left {
  transition: opacity 0.5s;
}
.card-corners:before,
.card-corners:after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: #76628e;
  pointer-events: none;
}
.card-corners:before {
  left: 8px;
  top: 8px;
  border-left: 1px solid;
  border-top: 1px solid;
}
.card-corners:after {
  right: 8px;
  bottom: 8px;
  border-right: 1px solid;
  border-bottom: 1px solid;
}
@media (max-width: 900px) {
  .world-status {
    display: none;
  }
  .intro {
    left: 22px;
    top: 98px;
  }
  .stage-legend {
    right: 20px;
  }
  .tour-control {
    top: auto;
    bottom: 142px;
  }
  .minimap-wrap {
    right: 16px;
    bottom: 104px;
    transform: scale(0.85);
    transform-origin: bottom right;
  }
  .bottom-left {
    left: 22px;
    bottom: 110px;
  }
  .topbar {
    left: 12px;
    right: 12px;
    top: 12px;
  }
  .icon-btn {
    font-size: 0;
  }
  .icon-btn .lbl::before {
    content: attr(data-short);
    font-size: 8px;
    margin-right: 5px;
    color: var(--muted);
  }
  .icon-btn b {
    font-size: 9px;
    margin: 0;
  }
  .wing-nav {
    bottom: 32px;
    width: calc(100% - 24px);
  }
  #wing-chips {
    justify-content: center;
  }
  #wing-chips button {
    padding: 0 8px;
    font-size: 8px;
  }
  footer {
    left: 20px;
    right: 20px;
  }
  .modal-card {
    right: 18px;
    top: 90px;
  }
  .intro h1 {
    font-size: 34px;
  }
}
@media (max-width: 600px) {
  .topbar {
    height: 52px;
    padding: 0 10px;
  }
  .brand strong {
    font-size: 12px;
  }
  .brand span {
    font-size: 7px;
  }
  .brand-mark {
    display: none;
  }
  #toast {
    bottom: 196px;
    width: calc(100% - 36px);
    text-align: center;
  }
  .top-actions {
    gap: 5px;
  }
  .icon-btn {
    height: 29px;
    padding: 0 8px;
  }
  .square-btn {
    width: 29px;
    height: 29px;
  }
  .intro {
    top: 82px;
    left: 18px;
    width: 210px;
  }
  .intro h1 {
    font-size: 29px;
    margin: 8px 0;
  }
  .intro > p:not(.eyebrow) {
    font-size: 11px;
  }
  .intro-rule,
  .sim-row {
    display: none;
  }
  .stage-legend {
    top: 85px;
    right: 14px;
    width: 95px;
  }
  .stage-legend > .eyebrow {
    display: none;
  }
  .stage-legend li {
    height: 33px;
    gap: 6px;
  }
  .stage-legend li > span,
  .stage-legend small {
    display: none;
  }
  .stage-legend strong {
    font-size: 7px;
  }
  .stage-legend li:not(:last-child):after {
    top: 23px;
    height: 20px;
  }
  .tour-control {
    bottom: 118px;
    gap: 10px;
    padding: 7px 8px;
  }
  .tour-control small {
    display: none;
  }
  .tour-control .eyebrow {
    font-size: 8px;
  }
  .primary-btn {
    height: 30px;
    font-size: 8px;
    padding: 0 10px;
  }
  .wing-nav {
    bottom: 28px;
    padding: 8px 5px;
  }
  .wing-nav > .eyebrow {
    display: none;
  }
  #wing-chips {
    gap: 3px;
  }
  #wing-chips button {
    min-height: 40px;
    padding: 4px 5px;
    flex: 1;
    min-width: 0;
    grid-template-columns: 1fr;
    grid-template-areas: "name" "stage";
    justify-items: center;
    text-align: center;
    font-size: 6px;
    row-gap: 3px;
  }
  #wing-chips button b {
    white-space: normal;
    font-size: 6px;
    line-height: 1.25;
    letter-spacing: 0.02em;
  }
  #wing-chips button small {
    font-size: 5.5px;
  }
  #wing-chips button i,
  #wing-chips button span {
    display: none;
  }
  .bottom-left {
    left: 18px;
    bottom: 85px;
  }
  .bottom-left p {
    display: none;
  }
  .text-btn {
    font-size: 8px;
  }
  .minimap-wrap {
    display: none;
  }
  footer {
    bottom: 9px;
    left: 14px;
    right: 14px;
    font-size: 6px;
  }
  footer span:last-child {
    display: none;
  }
  .modal-card {
    inset: auto 12px 82px;
    width: auto;
    max-height: 47vh;
    padding: 16px 18px;
  }
  .modal-card h2 {
    font-size: 20px;
    margin: 6px 0 4px;
  }
  .modal-card .genome {
    margin: 0 0 8px;
  }
  .modal-card .swatches {
    height: 16px;
  }
  .modal-card .palette-name {
    margin: 5px 0 8px;
  }
  .modal-card dl {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 16px;
  }
  .modal-card dl div {
    padding: 6px 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .modal-card dd {
    text-align: left;
  }
  .modal-card .card-corners {
    display: none;
  }
  .modal-card .honest-note {
    margin: 10px 0;
  }
  dialog {
    padding: 26px 20px;
  }
  .genome-table > div {
    grid-template-columns: 65px 1fr;
    font-size: 9px;
  }
  #summary-list article {
    grid-template-columns: 70px 1fr;
    font-size: 9px;
  }
}
/* 1.34.0: the campus streams in after the Atrium is up; a small corner status stands in for the loading screen */
#stream {
  position: fixed;
  left: 34px;
  bottom: 98px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
  font: 500 8px var(--mono);
  letter-spacing: 0.08em;
  color: #bdb3cf;
  pointer-events: none;
}
#stream[hidden] {
  display: none;
}
#stream b {
  color: var(--violet);
  font-weight: 600;
}
#stream i {
  position: relative;
  width: 90px;
  height: 2px;
  background: #2b2b31;
  overflow: hidden;
}
#stream i:after {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--p, 0%);
  background: var(--violet);
  box-shadow: 0 0 8px var(--violet);
  transition: width 0.3s;
}
body.hud-hidden #stream,
body.cine-mode #stream {
  display: none;
}
@media (max-width: 900px) {
  #stream {
    left: 22px;
    bottom: 152px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
  }
}

/* =====================================================================================================
   1.35.0: the playable world. Phones play upright (portrait) and sideways (landscape); safe-area insets are
   respected; nothing scrolls sideways; the thumbs reach the pad and the action buttons in both orientations.
   ===================================================================================================== */
:root {
  --sl: env(safe-area-inset-left, 0px);
  --sr: env(safe-area-inset-right, 0px);
  --st: env(safe-area-inset-top, 0px);
  --sb: env(safe-area-inset-bottom, 0px);
}
html,
body {
  overflow-x: hidden;
  overscroll-behavior: none;
}
body {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}
#world,
#canvas-host {
  height: calc(var(--vh, 1vh) * 100);
}
.topbar {
  left: calc(var(--sl) + 20px);
  right: calc(var(--sr) + 20px);
  top: calc(var(--st) + 18px);
}
.icon-btn[hidden] {
  display: none;
}
.icon-btn.ping {
  border-color: var(--violet);
  color: #fff;
  box-shadow: 0 0 16px #a78bfa88;
}
#journal-count {
  font-variant-numeric: tabular-nums;
}
/* ---- play mode: the Keeper -------------------------------------------------------------------- */
body.play-mode .intro,
body.play-mode .stage-legend,
body.play-mode .bottom-left,
body.play-mode footer,
body.play-mode .hw-tour-caption,
.keeper-btn {
  display: none;
}
body.play-mode .keeper-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  min-height: 0;
  height: 34px;
  padding: 0 12px;
}
.keeper-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin: 14px 0 10px;
}
.keeper-opt {
  display: grid;
  place-items: center;
  gap: 4px;
  text-align: center;
  min-height: 60px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #17141d;
  border: 1px solid #2f2a3b;
  color: var(--text);
  cursor: pointer;
}
.keeper-opt[aria-checked="true"] {
  border-color: #b497ff;
  box-shadow: 0 0 0 1px #b497ff inset, 0 0 18px #7c3aed44;
}
.keeper-opt b {
  font: 700 14px/1.1 var(--mono);
}
.keeper-opt small {
  font: 500 10px/1.3 var(--mono);
  color: #b3a9c6;
  letter-spacing: 0.04em;
}
/* full screen chooser (sideways / upright) and the turn-your-phone prompt */
#fs-menu {
  position: fixed;
  top: calc(var(--st) + 70px);
  right: calc(var(--sr) + 20px);
  z-index: 30;
  display: grid;
  gap: 8px;
  width: 220px;
  padding: 12px;
  background: #0e0e10ee;
  border: 1px solid #2a2830;
  border-radius: 10px;
  backdrop-filter: blur(12px);
}
#fs-menu[hidden],
#rotate-hint[hidden],
.fs-opt[hidden],
.fs-note[hidden] {
  display: none;
}
.fs-opt {
  display: grid;
  grid-template-columns: 30px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  text-align: left;
  min-height: 48px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #17141d;
  border: 1px solid #2f2a3b;
  color: var(--text);
  cursor: pointer;
}
.fs-opt b {
  font: 700 12px/1.1 var(--mono);
  letter-spacing: 0.06em;
}
.fs-opt small {
  grid-column: 2;
  font: 500 9px/1.2 var(--mono);
  color: #b3a9c6;
  letter-spacing: 0.08em;
}
.fs-opt .fs-phone {
  grid-row: span 2;
  justify-self: center;
}
.fs-opt[aria-checked="true"] {
  border-color: #b497ff;
  box-shadow: 0 0 0 1px #b497ff inset;
}
.fs-exit {
  grid-template-columns: 1fr;
  text-align: center;
}
.fs-note {
  margin: 2px 0 0;
  font: 500 10px/1.45 var(--mono);
  color: #b3a9c6;
}
.fs-phone {
  display: inline-block;
  width: 14px;
  height: 24px;
  border: 2px solid #b497ff;
  border-radius: 4px;
  position: relative;
}
.fs-phone::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 4px;
  height: 2px;
  margin-left: -2px;
  border-radius: 1px;
  background: #b497ff;
}
.fs-land {
  transform: rotate(90deg);
}
#rotate-hint {
  position: fixed;
  inset: auto 50% calc(var(--sb) + 40%) auto;
  transform: translateX(50%);
  z-index: 31;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  background: #0e0e10ee;
  border: 1px solid #b497ff;
  font: 700 11px/1.2 var(--mono);
  letter-spacing: 0.08em;
  color: var(--text);
}
#rotate-hint .fs-phone {
  animation: fs-turn 1.6s ease-in-out infinite;
}
#rotate-hint.to-upright .fs-phone {
  animation-name: fs-turn-back;
}
@keyframes fs-turn {
  0%, 30% { transform: rotate(0deg); }
  60%, 100% { transform: rotate(90deg); }
}
@keyframes fs-turn-back {
  0%, 30% { transform: rotate(90deg); }
  60%, 100% { transform: rotate(0deg); }
}
@media (prefers-reduced-motion: reduce) {
  #rotate-hint .fs-phone {
    animation: none;
  }
}
body.play-mode #crosshair {
  display: none !important;
}
body.play-mode .tour-control {
  left: calc(var(--sl) + 20px);
  top: calc(var(--st) + 84px);
  bottom: auto;
  right: auto;
  transform: none;
  gap: 14px;
}
body.play-mode .minimap-wrap {
  top: calc(var(--st) + 84px);
  right: calc(var(--sr) + 20px);
  bottom: auto;
  transform: none;
}
body.play-mode .hw-photo-tools {
  right: auto;
  left: calc(var(--sl) + 20px);
  bottom: auto;
  top: calc(var(--st) + 160px);
}
body.play-mode #toast {
  top: calc(var(--st) + 84px);
  bottom: auto;
}
body.play-mode .wing-nav {
  bottom: calc(var(--sb) + 18px);
}
#actions {
  position: fixed;
  right: calc(var(--sr) + 20px);
  bottom: calc(var(--sb) + 26px);
  z-index: 6;
  display: none;
  grid-template-columns: 62px 86px;
  grid-template-areas: "down ." "jump fly";
  gap: 12px;
  align-items: end;
  justify-items: center;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}
body.play-mode #actions {
  display: grid;
}
body.hud-hidden #actions,
body.cine-mode #actions {
  display: none !important;
}
.act {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #17141dcc;
  border: 1px solid #5d4f7a;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  backdrop-filter: blur(10px);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.act[hidden] {
  display: none;
}
.act b {
  font: 700 15px/1 var(--mono);
}
.act small {
  font: 500 6.5px/1 var(--mono);
  letter-spacing: 0.08em;
  color: #b3a9c6;
}
#act-down {
  grid-area: down;
}
#act-jump {
  grid-area: jump;
}
#act-fly {
  grid-area: fly;
}
/* 1.37.0 flight: the stick climbs and dives, the side buttons sprint, slow and shoot */
body.riding #actions {
  grid-template-columns: 62px 86px;
  grid-template-areas: "slow sprint" "fly shoot";
}
body.riding #act-fly {
  width: 62px;
  height: 62px;
}
body.riding #act-fly b {
  font-size: 13px;
}
#act-sprint {
  grid-area: sprint;
}
#act-slow {
  grid-area: slow;
}
#act-shoot {
  grid-area: shoot;
}
.act-shoot {
  background: linear-gradient(#ff5f7ad9, #c2304ad9);
  border-color: #ffb3c0;
  box-shadow: 0 0 26px #ff4d6d66;
}
.act-air b {
  font-size: 22px;
}
#air-hud {
  position: fixed;
  left: 50%;
  top: calc(var(--st) + 14px);
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border-radius: 999px;
  background: #17141dcc;
  border: 1px solid #5d4f7a;
  backdrop-filter: blur(10px);
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.08em;
  color: #b3a9c6;
  pointer-events: none;
}
#air-hud[hidden],
body.hud-hidden #air-hud {
  display: none;
}
#air-hud b {
  font: 700 15px/1 var(--mono);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
#air-shield {
  display: block;
  width: 86px;
  height: 6px;
  border-radius: 3px;
  background: #ffffff1f;
  overflow: hidden;
}
#air-shield u {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #7dffd9, #8b6df5);
  transition: width 0.25s;
}
.air-bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
#air-stamina {
  display: block;
  width: 86px;
  height: 3px;
  border-radius: 2px;
  background: #ffffff1a;
  overflow: hidden;
}
#air-stamina u {
  display: block;
  height: 100%;
  width: 100%;
  background: #ffd36b;
  transition: width 0.2s;
}
#air-hit {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  box-shadow: inset 0 0 120px 30px #ff2d55;
  transition: opacity 0.35s;
}
#air-hit.on {
  opacity: 0.55;
  transition: none;
}
@media (prefers-reduced-motion: reduce) {
  #air-hit.on {
    opacity: 0.3;
  }
}
.act-main {
  width: 86px;
  height: 86px;
  background: linear-gradient(#7c3aedd9, #5b25b8d9);
  border-color: #b497ff;
  box-shadow: 0 0 26px #7c3aed66;
}
.act-main b {
  font-size: 21px;
}
.act.busy {
  opacity: 0.55;
}
.act:active {
  transform: scale(0.94);
}
body.play-mode.has-touch #touch-controls {
  display: block;
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}
body.play-mode #touch-controls > span {
  display: none;
}
body.play-mode.has-touch #joystick {
  left: calc(var(--sl) + 24px);
  bottom: calc(var(--sb) + 26px);
  width: 132px;
  height: 132px;
  border-color: #9a86c277;
  background: #17141d66;
}
body.play-mode.has-touch #joystick i {
  left: calc(50% - 24px);
  top: calc(50% - 24px);
  width: 48px;
  height: 48px;
}
body.play-mode:not(.has-touch) #stick-btn {
  display: none;
}
#hint-pad {
  position: fixed;
  left: calc(var(--sl) + 34px);
  bottom: 14px;
  z-index: 5;
  display: none;
  max-width: 330px;
  font: 500 8px/1.5 var(--mono);
  letter-spacing: 0.1em;
  color: #a89fb6;
  pointer-events: none;
}
body.play-mode #hint-pad.on {
  display: block;
}
/* the care panel: shown when the Keeper stands next to a creature */
#care {
  display: none;
  position: fixed;
  z-index: 6;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--sb) + 112px);
  width: min(300px, calc(100vw - 32px));
  padding: 10px 12px 12px;
  background: #121115ee;
  border: 1px solid #453a53;
  border-radius: 10px;
  gap: 8px;
  backdrop-filter: blur(14px);
}
body.play-mode #care:not([hidden]) {
  display: grid;
}
.care-head {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.care-head strong {
  font-size: 14px;
  letter-spacing: -0.01em;
}
.care-meter {
  position: relative;
  height: 17px;
  border-radius: 4px;
  background: #25212d;
  overflow: hidden;
  border: 1px solid #3a3446;
}
.care-meter i {
  position: absolute;
  inset: 0;
  width: var(--w, 0%);
  background: linear-gradient(90deg, #ff9bb2, #ffd36b);
  transition: width 0.3s;
}
.care-meter span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 600 8px var(--mono);
  letter-spacing: 0.1em;
  color: #fff;
  text-shadow: 0 0 4px #000, 0 0 2px #000;
}
.care-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.care-btn {
  height: 42px;
  background: #211d28;
  border: 1px solid #5d4f7a;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.care-btn b {
  font: 700 11px var(--mono);
  letter-spacing: 0.1em;
}
.care-btn small {
  font: 500 8px var(--mono);
  color: #9a8fae;
  border: 1px solid #453a53;
  border-radius: 3px;
  padding: 2px 4px;
}
body.has-touch .care-btn small {
  display: none;
}
.care-btn:hover {
  background: #2b2435;
}
/* the first-flight guide */
#coach {
  left: 50%;
  transform: translateX(-50%);
  top: calc(var(--st) + 160px);
  width: min(430px, calc(100vw - 24px - var(--sl) - var(--sr)));
  padding: 12px 14px 12px;
  background: #121115ee;
  border: 1px solid #5d4f7a;
  border-left: 3px solid var(--violet);
  border-radius: 8px;
  backdrop-filter: blur(14px);
}
#coach[hidden] {
  display: none;
}
.coach-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.coach-head .text-btn {
  padding: 4px 6px;
  color: #c8b6ff;
}
#coach strong {
  display: block;
  font-size: 17px;
  margin: 4px 0 4px;
  letter-spacing: -0.02em;
}
#coach p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: #c8c1d0;
}
.coach-dots {
  display: flex;
  gap: 5px;
  margin-top: 10px;
}
.coach-dots i {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: #322d3a;
}
.coach-dots i.done {
  background: var(--violet);
}
.coach-dots i.now {
  background: #fff;
  box-shadow: 0 0 8px var(--violet);
}
#guide-pointer {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 7;
  pointer-events: none;
  display: none;
  will-change: transform;
}
#guide-pointer.on {
  display: block;
}
#guide-pointer i {
  position: absolute;
  left: -10px;
  top: -30px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 17px solid #c8b6ff;
  filter: drop-shadow(0 0 8px #7c3aed);
}
#guide-pointer.edge i {
  top: -12px;
  border-top: 0;
  border-bottom: 19px solid #c8b6ff;
}
#guide-pointer span {
  position: absolute;
  left: -32px;
  top: -2px;
  width: 64px;
  text-align: center;
  font: 600 9px var(--mono);
  letter-spacing: 0.08em;
  color: #e8defd;
  text-shadow: 0 1px 4px #000, 0 0 3px #000;
}
#guide-pointer.edge span {
  display: none;
}
#first-flight .secondary-btn {
  margin-top: 4px;
}
#first-flight .text-btn {
  display: block;
  margin: 12px auto 0;
  color: #9a8fae;
  letter-spacing: 0.06em;
}
#first-flight[hidden] {
  display: none;
}
/* the field journal */
.journal-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 14px 0 6px;
}
.journal-stats div {
  background: #1b1920;
  border: 1px solid #302c35;
  border-radius: 6px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.journal-stats b {
  font: 600 16px var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--violet);
}
.journal-stats span {
  font: 500 7.5px var(--mono);
  letter-spacing: 0.1em;
  color: #8d8695;
}
#journal-list section {
  border-top: 1px solid #302c35;
  padding: 12px 0;
}
#journal-list h3 {
  font: 500 11px var(--mono);
  color: var(--violet);
  letter-spacing: 0.08em;
  margin: 0 0 6px;
}
#journal-list article {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 10px;
  padding: 6px 0;
  font: 400 10px/1.5 var(--mono);
  color: #b9b1c1;
}
#journal-list article b {
  color: #7f7788;
  font-weight: 500;
}
#journal-list article.seen b {
  color: #d9ccff;
}
#journal-list article.unseen {
  opacity: 0.55;
}
dialog .secondary-btn {
  margin-top: 4px;
}
/* ---- phones ------------------------------------------------------------------------------------ */
body.is-phone #stick-btn {
  display: none;
}
body.is-phone .icon-btn b {
  display: none;
}
body.is-phone #journal-btn b {
  display: inline;
}
body.is-phone .icon-btn[aria-pressed="true"] {
  background: #2a2140;
}
body.is-phone.play-mode #hint-pad {
  display: none !important; /* the buttons on screen are the hint; a connected pad shows a toast */
}
body.is-phone.play-mode .hw-photo-tools,
body.is-phone.play-mode .wing-nav {
  display: none;
}
/* portrait phones: the pad lives bottom-left, the buttons bottom-right, a care panel rides above the pad */
body.is-portrait.is-phone .brand span {
  display: none;
}
body.is-portrait.is-phone.play-mode .tour-control {
  top: calc(var(--st) + 66px);
  left: calc(var(--sl) + 12px);
  padding: 5px 6px;
}
body.is-portrait.is-phone.play-mode .tour-control > div {
  display: none;
}
body.is-portrait.is-phone.play-mode .keeper-btn {
  padding: 0 10px;
  min-height: 34px;
}
@media (max-width: 600px) {
  #air-hud {
    left: auto;
    right: calc(var(--sr) + 12px);
    transform: none;
    top: calc(var(--st) + 70px);
    flex-wrap: wrap;
    width: 150px;
    gap: 5px 8px;
    padding: 7px 10px;
    border-radius: 10px;
  }
  #air-hud .eyebrow {
    font-size: 8px;
  }
  .air-bars {
    width: 100%;
  }
  #air-shield,
  #air-stamina {
    width: 100%;
  }
}
body.is-portrait.is-phone.play-mode #toast {
  top: calc(var(--st) + 112px);
  bottom: auto;
  width: calc(100vw - 32px);
}
body.is-portrait.is-phone.play-mode #care {
  bottom: calc(var(--sb) + 26px + 132px + 14px);
  left: calc(var(--sl) + 16px);
  right: auto;
  transform: none;
  width: min(300px, calc(100vw - 32px - var(--sl) - var(--sr)));
}
body.is-portrait.is-phone.play-mode #coach {
  top: calc(var(--st) + 112px);
}
body.is-portrait.is-phone #guide-pointer span {
  font-size: 8px;
}
body.is-portrait.is-phone.play-mode #stream {
  bottom: 190px;
}
/* sideways phones: short screens. Everything compact, the middle of the bottom edge left free for the care panel */
body.is-short .topbar {
  height: 40px;
  top: calc(var(--st) + 6px);
  padding: 0 10px;
}
body.is-short .brand-mark,
body.is-short .world-status,
body.is-short .brand span {
  display: none;
}
body.is-short .brand strong {
  font-size: 11px;
}
body.is-short .icon-btn,
body.is-short .square-btn {
  height: 26px;
}
body.is-short .square-btn {
  width: 26px;
}
body.is-short .stage-legend,
body.is-short .bottom-left,
body.is-short footer,
body.is-short .intro-rule,
body.is-short .sim-row,
body.is-short .intro > p:not(.eyebrow) {
  display: none;
}
body.is-short .intro {
  top: calc(var(--st) + 54px);
  left: calc(var(--sl) + 14px);
  width: 230px;
}
body.is-short .intro h1 {
  font-size: 22px;
  margin: 4px 0 0;
}
body.is-short .tour-control {
  top: calc(var(--st) + 50px);
  bottom: auto;
  left: auto;
  right: calc(var(--sr) + 14px);
  transform: none;
  padding: 5px 6px 5px 10px;
}
body.is-short .tour-control small {
  display: none;
}
body.is-short .wing-nav {
  bottom: calc(var(--sb) + 8px);
  padding: 6px;
  width: auto;
  max-width: calc(100vw - 24px - var(--sl) - var(--sr));
}
body.is-short .wing-nav > .eyebrow {
  display: none;
}
body.is-short #wing-chips button {
  min-height: 34px;
  padding: 3px 7px;
}
body.is-short #wing-chips button small,
body.is-short #wing-chips button span {
  display: none;
}
body.is-short .minimap-wrap {
  display: none;
}
body.is-short .modal-card {
  top: calc(var(--st) + 52px);
  right: calc(var(--sr) + 12px);
  left: auto;
  bottom: auto;
  width: min(380px, 52vw);
  max-height: calc(var(--vh, 1vh) * 100 - 64px);
  padding: 14px 16px;
}
body.is-short .modal-card h2 {
  font-size: 18px;
}
body.is-short dialog {
  padding: 16px 18px;
  max-height: calc(var(--vh, 1vh) * 100 - 24px);
  width: min(680px, calc(100vw - 32px - var(--sl) - var(--sr)));
}
body.is-short dialog h2 {
  font-size: 20px;
}
body.is-short #toast,
body.is-short.play-mode #toast {
  top: auto;
  bottom: calc(var(--sb) + 156px);
}
body.is-short #stream {
  bottom: calc(var(--sb) + 8px);
  left: calc(var(--sl) + 14px);
}
body.is-short.play-mode .intro,
body.is-short.play-mode .wing-nav,
body.is-short.play-mode #hint-pad:not(.pad) {
  display: none;
}
body.is-short.play-mode .tour-control {
  left: calc(var(--sl) + 14px);
  right: auto;
  top: calc(var(--st) + 50px);
}
body.is-short.play-mode .minimap-wrap {
  display: block;
  top: calc(var(--st) + 52px);
  right: calc(var(--sr) + 14px);
  width: 108px;
  height: 108px;
  padding: 5px;
}
body.is-short.play-mode .minimap-wrap > div,
body.is-short.play-mode #quality-label {
  display: none;
}
body.is-short.play-mode #minimap {
  width: 96px;
  height: 96px;
  margin: 0;
}
body.is-short.play-mode #coach {
  top: calc(var(--st) + 50px);
  width: min(400px, 46vw);
  padding: 8px 12px 9px;
}
body.is-short.play-mode #coach strong {
  font-size: 14px;
  margin: 2px 0;
}
body.is-short.play-mode #coach p {
  font-size: 11px;
  line-height: 1.4;
}
body.is-short.play-mode .coach-dots {
  margin-top: 6px;
}
body.is-short.play-mode #care {
  bottom: calc(var(--sb) + 20px);
  width: min(270px, calc(100vw - 2 * (var(--sl) + var(--sr) + 190px)));
  min-width: 210px;
  padding: 7px 10px 9px;
  gap: 6px;
}
body.is-short.play-mode .care-btn {
  height: 36px;
}
body.is-short.play-mode.has-touch #joystick {
  width: 116px;
  height: 116px;
  bottom: calc(var(--sb) + 18px);
  left: calc(var(--sl) + 28px);
}
body.is-short.play-mode #actions {
  bottom: calc(var(--sb) + 16px);
  right: calc(var(--sr) + 24px);
  gap: 10px;
}
body.is-short .hw-photo-tools {
  display: none;
}
@media (max-width: 900px) {
  .topbar {
    left: calc(var(--sl) + 12px);
    right: calc(var(--sr) + 12px);
    top: calc(var(--st) + 12px);
  }
  body.play-mode .tour-control {
    left: calc(var(--sl) + 14px);
    top: calc(var(--st) + 74px);
  }
  body.play-mode .minimap-wrap {
    top: calc(var(--st) + 74px);
    right: calc(var(--sr) + 14px);
  }
  body.is-short .topbar {
    top: calc(var(--st) + 6px);
  }
}
@media (max-width: 600px) {
  body.play-mode .minimap-wrap {
    display: none;
  }
  body.is-short.play-mode .minimap-wrap {
    display: block;
  }
  #coach {
    top: calc(var(--st) + 112px);
  }
}
@media (hover: none) and (pointer: coarse) {
  .act,
  .care-btn,
  .primary-btn {
    min-height: 44px;
  }
}
@media (min-width: 901px) and (min-height: 700px) {
  body.play-mode #care {
    bottom: calc(var(--sb) + 116px);
  }
}
@media (max-height: 699px) and (min-width: 901px) {
  body.play-mode .wing-nav {
    display: none;
  }
  body.play-mode #care {
    bottom: calc(var(--sb) + 30px);
  }
}
/* sideways phones: the same controls, thumb-reachable on the left and right edges, the middle kept free */
body.is-landscape.is-phone .brand span,
body.is-landscape.is-phone .world-status {
  display: none;
}
body.is-landscape.is-phone.play-mode #care {
  bottom: calc(var(--sb) + 20px);
}
body.is-landscape.is-phone.play-mode #touch-controls,
body.is-landscape.is-phone.play-mode #actions {
  touch-action: none;
}
body.riding .wing-nav,
body.riding .hw-photo-tools {
  display: none;
}
body.hud-hidden #guide-pointer,
body.hud-hidden #hint-pad,
body.hud-hidden #coach,
body.hud-hidden #first-flight {
  display: none !important;
}

/* 1.38.0 agent mode: a clean frame for recordings (the photo tools and toasts stay out of shot) */
body.agent-mode .hw-photo-tools,
body.agent-quiet #toast,
body.agent-mode #first-flight {
  display: none !important;
}

/* ---- 1.40.0 combat 2.0 and the upright phone HUD (owner: "brawl stars level", "keep all gameplay vertical on phone") ---- */
#float-stick {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 4;
  width: 0;
  height: 0;
  display: none;
  pointer-events: none;
}
body.play-mode.float-stick #float-stick {
  display: block;
}
body.play-mode.float-stick #joystick,
body.hud-hidden #float-stick,
body.cine-mode #float-stick {
  display: none !important;
}
#float-stick:before {
  content: "";
  position: absolute;
  left: -60px;
  top: -60px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 2px solid #b497ff66;
  background: radial-gradient(circle, #17141d22 40%, #17141d77);
  opacity: 0.4;
  transition: opacity 0.15s;
}
#float-stick i {
  position: absolute;
  left: -26px;
  top: -26px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e4dbff, #8b6df5 58%, #5b25b8);
  box-shadow: 0 0 18px #7c3aed88;
  opacity: 0.5;
}
#float-stick.on:before,
#float-stick.on i {
  opacity: 1;
}
/* three shot charges under the Elder */
#ammo {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 6px;
  background: #0d0b12aa;
  pointer-events: none;
}
#ammo[hidden],
body.hud-hidden #ammo {
  display: none;
}
#ammo i {
  position: relative;
  display: block;
  width: 22px;
  height: 7px;
  border-radius: 2px;
  background: #ffffff22;
  overflow: hidden;
}
#ammo i:after {
  content: "";
  position: absolute;
  inset: 0;
  transform-origin: left;
  transform: scaleX(var(--r, 0));
  background: #ffd36b88;
}
#ammo i.on:after {
  background: linear-gradient(90deg, #ffe08a, #ffb347);
}
/* the reticle: the mouse aim on a laptop, where the shots fly everywhere else; red when the aim help has a beast */
#aim-reticle {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 5;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid #ffffffcc;
  box-shadow: 0 0 0 1px #0008, inset 0 0 0 1px #0006;
  pointer-events: none;
  transition: width 0.12s, height 0.12s, border-color 0.12s;
}
#aim-reticle:after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  margin: -2px;
  border-radius: 50%;
  background: #fff;
}
#aim-reticle.lock {
  width: 26px;
  height: 26px;
  border-color: #ff4d6d;
}
#aim-reticle[hidden],
body.hud-hidden #aim-reticle {
  display: none;
}
/* damage numbers pop off the beasts; criticals are gold and bigger */
#dmg-layer {
  position: fixed;
  inset: 0;
  z-index: 5;
  overflow: hidden;
  pointer-events: none;
}
body.hud-hidden #dmg-layer,
body.hud-hidden #air-callout {
  display: none;
}
#dmg-layer span {
  position: absolute;
  left: 0;
  top: 0;
  font: 800 18px/1 var(--sans);
  font-variant-numeric: tabular-nums;
  color: #fff;
  -webkit-text-stroke: 1px #2a0b18;
  text-shadow: 0 2px 0 #2a0b18, 0 0 10px #ff4d6d88;
  opacity: 0;
  will-change: transform, opacity;
}
#dmg-layer span.crit {
  font-size: 22px;
  color: #ffd36b;
}
/* callouts: kill streaks, the super, waves, the tyrant */
#air-callout {
  position: fixed;
  left: 50%;
  top: calc(var(--st) + 22%);
  z-index: 6;
  transform: translateX(-50%);
  font: 800 30px/1 var(--sans);
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: #fff;
  -webkit-text-stroke: 1.5px #1a0a24;
  text-shadow: 0 3px 0 #1a0a24, 0 0 24px #7c3aedaa;
  opacity: 0;
  pointer-events: none;
}
#air-callout.on {
  animation: hw-callout 1.3s ease-out forwards;
}
#air-callout.streak {
  color: #ffd36b;
}
#air-callout.super {
  color: #9fe8ff;
}
#air-callout.boss {
  font-size: 34px;
  color: #ff6b8b;
}
#air-callout.lair,
#air-callout.wave {
  font-size: 24px;
  color: #ffb3c0;
}
@keyframes hw-callout {
  0% { opacity: 0; transform: translateX(-50%) scale(1.6); }
  12% { opacity: 1; transform: translateX(-50%) scale(0.94); }
  22% { transform: translateX(-50%) scale(1); }
  80% { opacity: 1; transform: translateX(-50%) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}
@keyframes hw-callout-calm {
  0%, 80% { opacity: 1; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  #air-callout.on {
    animation: hw-callout-calm 1.3s linear forwards;
  }
}
/* the tyrant's health */
#boss-bar {
  position: fixed;
  left: 50%;
  top: calc(var(--st) + 58px);
  z-index: 6;
  transform: translateX(-50%);
  display: grid;
  gap: 4px;
  width: min(420px, calc(100vw - 32px));
  text-align: center;
  font: 700 11px/1 var(--mono);
  letter-spacing: 0.14em;
  color: #ffb3c0;
  pointer-events: none;
}
#boss-bar i {
  display: block;
  height: 8px;
  border-radius: 4px;
  border: 1px solid #b81dff88;
  background: #ffffff1f;
  overflow: hidden;
}
#boss-bar u {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #b81dff, #ff4d6d);
  transition: width 0.2s;
}
#boss-bar[hidden],
body.hud-hidden #boss-bar {
  display: none;
}
/* the super: a ring fills with damage dealt; full, the button lights up */
#act-super {
  grid-area: super;
  position: relative;
  width: 70px;
  height: 70px;
}
#act-super:before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: conic-gradient(#9fe8ff calc(var(--c, 0) * 360deg), #ffffff14 0);
  -webkit-mask: radial-gradient(circle, transparent 61%, #000 62%);
  mask: radial-gradient(circle, transparent 61%, #000 62%);
  pointer-events: none;
}
#act-super b {
  font-size: 22px;
}
#act-super.ready {
  background: linear-gradient(#38c6ffd9, #1f6fd1d9);
  border-color: #c9f3ff;
  box-shadow: 0 0 28px #38c6ff88;
  animation: hw-super-ready 1s ease-in-out infinite;
}
#act-super.on {
  opacity: 0.6;
}
@keyframes hw-super-ready {
  50% { box-shadow: 0 0 42px #38c6ffcc; }
}
@media (prefers-reduced-motion: reduce) {
  #act-super.ready {
    animation: none;
  }
}
/* in the air: LAND out of the thumb's way top-left, SUPER above SHOOT, SPRINT and SLOW beside */
body.riding #actions {
  grid-template-columns: 56px 62px 96px;
  grid-template-areas: "fly slow super" ". sprint shoot";
  gap: 10px;
}
body.riding #act-fly {
  width: 56px;
  height: 56px;
}
body.riding .act-air {
  width: 58px;
  height: 58px;
}
body.riding #act-shoot {
  width: 96px;
  height: 96px;
}
/* upright phones in flight: a slim strip on top, nothing else in the sky */
body.is-phone.riding .topbar,
body.is-phone.riding .tour-control,
body.is-phone.riding .minimap-wrap {
  display: none !important;
}
body.is-phone.riding #air-hud {
  left: calc(var(--sl) + 12px);
  right: calc(var(--sr) + 12px);
  top: calc(var(--st) + 10px);
  width: auto;
  transform: none;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
}
body.is-phone.riding .air-bars {
  flex: 1;
}
body.is-phone.riding #air-shield {
  width: auto;
  height: 8px;
}
body.is-phone.riding #air-stamina {
  width: auto;
}
body.is-phone.riding #boss-bar {
  top: calc(var(--st) + 50px);
}
body.is-phone.riding #toast {
  top: calc(var(--st) + 86px);
}
body.is-phone.riding #air-callout {
  font-size: 26px;
}
/* a sideways phone: one clean card asks for upright */
#rotate-hint.full {
  inset: 0;
  z-index: 60;
  transform: none;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  border: 0;
  border-radius: 0;
  background: #0d0d0ef2;
  font-size: 14px;
}
/* in the air LAND steps back (it is not the main action) and SHOOT is red again (.act-main came later and won) */
body.riding #act-fly {
  background: #17141dcc;
  border-color: #5d4f7a;
  box-shadow: none;
}
body.riding #act-shoot {
  background: linear-gradient(#ff5f7ad9, #c2304ad9);
  border-color: #ffb3c0;
  box-shadow: 0 0 26px #ff4d6d66;
}
/* 1.40.0 (owner): never zoom by accident. Double-tap zoom is off everywhere; a field never zooms the page on focus. */
html,
body,
button,
a,
.act {
  touch-action: manipulation;
}
#canvas-host canvas,
#actions,
.act,
#touch-controls {
  touch-action: none;
}
@media (pointer: coarse) {
  input,
  select,
  textarea {
    font-size: max(16px, 1em);
  }
}
/* a hit flash that leaves an upright phone's sky readable */
@media (max-width: 600px) {
  #air-hit {
    box-shadow: inset 0 0 60px 8px #ff2d55;
  }
}
/* 1.40.1 (owner: "buttons are going over each other"): on phones the flight cluster is two columns so the floating
   stick's circle never meets it; LAND moves up to a small pill under the top strip, out of the thumbs' way */
body.is-phone.riding #actions {
  right: calc(var(--sr) + 14px);
  grid-template-columns: 54px 84px;
  grid-template-areas: "slow super" "sprint shoot";
  gap: 10px;
}
body.is-phone.riding .act-air {
  width: 54px;
  height: 54px;
}
body.is-phone.riding #act-super {
  width: 64px;
  height: 64px;
}
body.is-phone.riding #act-shoot {
  width: 84px;
  height: 84px;
}
body.is-phone.riding #act-fly {
  position: fixed;
  top: calc(var(--st) + 56px);
  right: calc(var(--sr) + 12px);
  width: auto;
  height: 36px;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  flex-direction: row;
}
body.is-phone.riding #act-fly b {
  font-size: 12px;
  letter-spacing: 0.08em;
}
body.is-phone.riding #act-fly small {
  display: none;
}
body.is-phone.riding #boss-bar {
  left: calc(var(--sl) + 12px);
  right: calc(var(--sr) + 104px);
  width: auto;
  transform: none;
  top: calc(var(--st) + 60px);
}
body.is-phone.riding #toast {
  top: calc(var(--st) + 104px);
}
