:root {
  color-scheme: dark;
  --ink: #edf3e9;
  --muted: #a6b3a9;
  --panel: #111c1def;
  --line: #536358;
  --yellow: #ffcf27;
  --blue: #58bdff;
  --green: #b3ed42;
  --accent: var(--blue);
  font-family: Arial, sans-serif;
  color: var(--ink);
  background: #111917;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}
body.team-Z {
  --accent: var(--green);
}
[hidden] {
  display: none !important;
}
button,
input,
select {
  font: inherit;
  color: inherit;
  background: #20302c;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 10px;
}
button {
  cursor: pointer;
  touch-action: none;
}
button:hover {
  border-color: var(--yellow);
  background: #2b3c33;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}
#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 5px 25px #0004;
}
#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
#hud button,
#hud #shop,
#hud #inventory {
  pointer-events: auto;
}
header {
  height: 58px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: #101919ed;
  border-bottom: 2px solid var(--yellow);
}
header strong {
  font-size: 15px;
  letter-spacing: 1px;
}
header strong span {
  color: var(--yellow);
}
header b {
  font-size: 14px;
  color: var(--yellow);
}
nav {
  display: flex;
  gap: 6px;
}
nav button {
  padding: 7px 11px;
  font-size: 12px;
}
#vitals {
  position: absolute;
  left: 18px;
  top: 74px;
  width: 284px;
  padding: 13px;
  display: grid;
  gap: 8px;
}
#role {
  color: var(--accent);
  font-size: 13px;
  text-transform: uppercase;
}
#cash {
  font-size: 18px;
  font-weight: bold;
}
progress {
  width: 100%;
  height: 8px;
  accent-color: var(--accent);
}
small {
  font-size: 11px;
  color: var(--muted);
}
#radar-panel {
  position: absolute;
  right: 18px;
  top: 74px;
  width: 212px;
  padding: 6px;
  display: grid;
  gap: 6px;
}
#radar {
  width: 198px;
  height: 198px;
  display: block;
}
#evac-distance {
  font-size: 11px;
  color: var(--yellow);
}
.bigmap #radar-panel {
  width: min(70vw, 620px);
  left: 50%;
  top: 50%;
  right: auto;
  transform: translate(-50%, -50%);
  z-index: 5;
}
.bigmap #radar {
  width: 100%;
  height: min(65vh, 570px);
}
#infection {
  position: absolute;
  top: 194px;
  left: 18px;
  max-width: 300px;
  font-size: 10px;
  font-weight: bold;
  color: var(--yellow);
  text-shadow: 0 1px 3px #000;
}
#banner {
  position: absolute;
  top: 39%;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 90%;
  text-align: center;
  background: #101919dd;
  font-size: 20px;
  font-weight: bold;
  color: var(--yellow);
}
#banner:empty {
  display: none;
}
#banner:not(:empty) {
  padding: 20px;
}
#toast {
  position: absolute;
  top: 24%;
  left: 50%;
  transform: translateX(-50%);
  max-width: 70%;
  padding: 10px;
  text-align: center;
  background: #111c1de8;
  font-size: 13px;
}
#toast:empty {
  display: none;
}
#inventory {
  position: absolute;
  bottom: 74px;
  left: 18px;
  display: flex;
  gap: 5px;
}
#inventory button {
  padding: 10px 8px;
  font-size: 12px;
  background: #111c1dee;
}
#controls {
  position: absolute;
  bottom: 18px;
  left: 18px;
  right: 18px;
  display: flex;
  gap: 7px;
  justify-content: flex-end;
}
#controls button {
  background: #111c1dee;
  font-size: 12px;
  padding: 12px 16px;
}
.attack {
  border-color: var(--yellow) !important;
  color: var(--yellow);
}
#shop {
  position: absolute;
  bottom: 126px;
  left: 18px;
  max-width: 650px;
  padding: 10px;
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 12px;
}
#shop strong {
  width: 100%;
  color: var(--yellow);
}
#shop button {
  font-size: 12px;
  padding: 8px;
}
#menu {
  position: fixed;
  inset: 0;
  overflow: auto;
  background: linear-gradient(
    115deg,
    #111c25ef 0%,
    #111c25ef 49.8%,
    #223016f2 50%
  );
  display: grid;
  place-items: center;
  padding: 28px;
}
.deploy-panel {
  width: 480px;
  max-width: 100%;
  padding: 25px 30px;
  border: 1px solid #58664e;
  background: #101817f5;
  box-shadow: 0 20px 90px #0008;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--yellow);
  margin: 0 0 16px;
}
h1 {
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 49px;
  line-height: 1;
  letter-spacing: 1px;
  margin: 0;
}
h1 span {
  color: var(--yellow);
}
.intro {
  font-size: 13px;
  color: var(--muted);
  margin: 13px 0 20px;
}
#status {
  font-size: 10px;
  color: var(--green);
  padding-bottom: 12px;
}
label {
  font-size: 10px;
  letter-spacing: 1px;
  display: block;
  margin: 12px 0 6px;
}
.profile-row {
  display: flex;
  gap: 6px;
}
select {
  flex: 1;
  min-width: 0;
  font-size: 12px;
}
input {
  width: 100%;
  font-size: 13px;
}
.team-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin: 18px 0;
}
.team-picker button {
  padding: 13px 10px;
  text-align: left;
  min-height: 82px;
}
.team-picker b {
  display: block;
  color: var(--blue);
  margin-bottom: 8px;
  font-size: 14px;
}
.team-picker button:last-child b {
  color: var(--green);
}
.team-picker small {
  font-size: 11px;
  line-height: 1.4;
  display: block;
}
.selected {
  border-color: var(--yellow);
  box-shadow: inset 0 0 0 1px var(--yellow);
}
.primary {
  width: 100%;
  background: var(--yellow);
  color: #111917;
  font-weight: bold;
  font-size: 17px;
  padding: 15px;
  border: none;
  letter-spacing: 2px;
}
.primary:hover {
  color: var(--ink);
}
.session-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.session-actions button {
  flex: 1;
}
#error {
  font-size: 12px;
  color: #ff9485;
  min-height: 14px;
  margin: 8px 0;
}
#service-notice {
  font-size: 12px;
  line-height: 1.6;
  color: #ffcf85;
  border-left: 3px solid currentColor;
  padding: 8px 12px;
  margin: 12px 0;
}
.instructions {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  margin: 14px 0;
}
.instructions b {
  color: var(--ink);
}
.rules {
  font-size: 10px;
  line-height: 1.6;
  color: #85978b;
  border-top: 1px solid #37483c;
  padding-top: 12px;
  margin-bottom: 0;
}
#joystick {
  position: fixed;
  width: 100px;
  height: 100px;
  border: 2px solid #ffffff66;
  border-radius: 50%;
  background: #ffffff16;
  pointer-events: none;
}
#knob {
  position: absolute;
  left: 30px;
  top: 30px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #edf3e980;
}
.touch #movement {
  display: none;
}
@media (max-width: 900px) {
  header {
    height: 43px;
    padding: 7px 10px;
    gap: 6px;
  }
  header strong {
    font-size: 10px;
  }
  header strong span {
    display: inline;
  }
  header b {
    font-size: 10px;
  }
  nav button {
    padding: 5px 7px;
    font-size: 10px;
  }
  #vitals {
    left: 10px;
    top: 52px;
    width: 218px;
    padding: 8px;
    gap: 4px;
  }
  #role {
    font-size: 10px;
  }
  #cash {
    font-size: 14px;
  }
  #population {
    font-size: 9px;
  }
  #infection {
    top: 145px;
    left: 10px;
    font-size: 9px;
    max-width: 220px;
  }
  #radar-panel {
    right: 10px;
    top: 52px;
    width: 134px;
    padding: 4px;
    gap: 2px;
  }
  #radar {
    width: 124px;
    height: 124px;
  }
  #evac-distance {
    font-size: 8px;
  }
  #inventory {
    bottom: 55px;
    left: 10px;
    gap: 3px;
  }
  #inventory button {
    font-size: 10px;
    padding: 7px 5px;
  }
  #controls {
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 10px;
    right: 10px;
    gap: 4px;
  }
  #controls button {
    padding: 9px;
    font-size: 10px;
  }
  #shop {
    bottom: 94px;
    left: 10px;
    max-width: 65%;
    padding: 7px;
    font-size: 10px;
    gap: 4px;
  }
  #shop button {
    font-size: 10px;
    padding: 5px;
  }
  #banner {
    font-size: 13px;
  }
  #banner:not(:empty) {
    padding: 12px;
  }
  #toast {
    top: 48px;
    max-width: 55%;
    font-size: 11px;
  }
  .deploy-panel {
    padding: 20px;
  }
  #menu {
    padding: 16px;
  }
  h1 {
    font-size: 40px;
  }
  .bigmap #radar-panel {
    width: min(72vw, 620px);
  }
}
@media (max-height: 500px) {
  #menu {
    display: block;
  }
  .deploy-panel {
    margin: auto;
    width: 630px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
  }
  .eyebrow,
  h1,
  .intro,
  #status,
  .instructions,
  .rules {
    grid-column: 1;
  }
  .eyebrow {
    margin-bottom: 8px;
  }
  h1 {
    font-size: 36px;
  }
  .intro {
    margin: 8px 0;
  }
  #status {
    padding-bottom: 0;
  }
  .profile-row,
  #name,
  .team-picker,
  #deploy,
  .session-actions,
  #error {
    grid-column: 2;
  }
  .deploy-panel label {
    display: none;
  }
  .profile-row {
    grid-row: 1/3;
    align-self: start;
  }
  #name {
    grid-row: 3;
  }
  .team-picker {
    grid-row: 4/7;
    margin: 9px 0;
  }
  .team-picker button {
    min-height: 70px;
    padding: 8px;
  }
  .team-picker b {
    font-size: 12px;
  }
  .team-picker small {
    font-size: 10px;
  }
  #deploy {
    grid-row: 7;
    font-size: 13px;
    padding: 10px;
  }
  .session-actions {
    grid-row: 8;
  }
  #error {
    grid-row: 9;
  }
  .instructions {
    grid-row: 5/9;
    font-size: 11px;
  }
  .rules {
    grid-row: 9/11;
    font-size: 9px;
    margin-top: 0;
  }
  .bigmap #radar {
    height: 65vh;
  }
}

.play-help {
  border: 1px solid #536358;
  border-left: 3px solid var(--yellow);
  padding: 10px 12px;
  margin: 14px 0;
  font-size: 11px;
  line-height: 1.5;
  background: #1b2923;
}
.play-help > b {
  color: var(--yellow);
  letter-spacing: 1px;
}
.play-help p {
  margin: 6px 0;
}
.play-help strong {
  color: var(--blue);
}
#help-bar {
  position: absolute;
  bottom: 126px;
  left: 18px;
  width: min(470px, 60vw);
  font-size: 11px;
  line-height: 1.5;
  background: #101919e8;
  border-left: 3px solid var(--yellow);
  padding: 8px 10px;
  color: #d3dfd5;
}
#help-bar b {
  color: var(--yellow);
}
#shop:not([hidden]) ~ #inventory {
  bottom: 74px;
}
body:has(#shop:not([hidden])) #help-bar {
  bottom: 240px;
}
@media (max-width: 900px) {
  #help-bar {
    left: 10px;
    bottom: 96px;
    width: 45%;
    font-size: 9px;
    padding: 5px 7px;
  }
  body:has(#shop:not([hidden])) #help-bar {
    bottom: 210px;
  }
}
@media (max-height: 500px) {
  .play-help {
    grid-column: 2;
    grid-row: 4/7;
    margin: 6px 0;
    font-size: 9px;
    padding: 6px;
  }
  .play-help p {
    margin: 3px 0;
  }
}

#bite-timer {
  z-index: 6;
  position: absolute;
  top: 74px;
  left: 50%;
  transform: translateX(-50%);
  width: 290px;
  padding: 12px 16px;
  display: grid;
  gap: 5px;
  text-align: center;
  background: #2b1714f2;
  border: 2px solid #ffca48;
  box-shadow: 0 3px 20px #0007;
}
#bite-timer small {
  font-size: 10px;
  color: #ffe2b1;
}
#bite-timer strong {
  font-size: 42px;
  line-height: 1;
  color: #ffcf27;
  font-variant-numeric: tabular-nums;
}
#bite-timer em {
  font-style: normal;
  font-size: 15px;
}
#bite-timer b {
  font-size: 10px;
  color: #ffe2b1;
}
#bite-progress {
  accent-color: #ffad48;
  width: 100%;
  height: 7px;
}
@media (max-width: 900px) {
  #bite-timer {
    top: 52px;
    width: 210px;
    padding: 6px 8px;
  }
  #bite-timer strong {
    font-size: 30px;
  }
  #bite-timer small,
  #bite-timer b {
    font-size: 8px;
  }
}
@media (max-width: 580px) {
  #bite-timer {
    top: 174px;
    width: 210px;
  }
  #toast {
    top: 300px;
  }
}

.planet-route {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin: 12px 0;
  color: #bac9c5;
  font-size: 9px;
  letter-spacing: 0.4px;
}
#planet-name {
  color: var(--planet-accent, #a3d477);
  font-size: 10px;
  letter-spacing: 0.5px;
}
#vitals {
  gap: 6px;
}
#infection {
  top: 209px;
}
@media (max-width: 900px) {
  #vitals {
    gap: 3px;
  }
  #planet-name {
    font-size: 8px;
  }
  #infection {
    top: 159px;
  }
  header b {
    font-size: 9px;
  }
}
@media (max-height: 500px) {
  .planet-route {
    grid-column: 1;
    grid-row: 4;
    font-size: 8px;
    gap: 3px;
    margin: 4px 0;
  }
  .planet-route span {
    padding: 3px;
  }
  .instructions {
    grid-row: 5/9;
  }
}

#controls {
  display: none;
}
.touch #controls {
  display: flex;
}
#desktop-hint {
  position: absolute;
  bottom: 18px;
  left: 18px;
  color: #e4eddfaa;
  font-size: 11px;
  pointer-events: none;
  text-shadow: 0 1px 3px #000;
}
.touch #desktop-hint {
  display: none;
}
#aim-cursor {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 8;
}
.cursor-locked #aim-cursor {
  display: block;
}
#aim-cursor::before,
#aim-cursor::after {
  content: "";
  position: absolute;
  background: #fff;
  box-shadow: 0 0 2px #000;
}
#aim-cursor::before {
  width: 18px;
  height: 2px;
  left: -9px;
  top: -1px;
}
#aim-cursor::after {
  width: 2px;
  height: 18px;
  left: -1px;
  top: -9px;
}
body:not(.touch) #help-bar {
  bottom: 48px;
}
body:not(.touch) #inventory {
  bottom: 86px;
}
body:not(.touch) #shop {
  bottom: 130px;
}
body:not(.touch):has(#shop:not([hidden])) #help-bar {
  bottom: 240px;
}
@media (max-width: 900px) {
  #desktop-hint {
    left: 10px;
    bottom: 12px;
    font-size: 9px;
  }
  body:not(.touch) #help-bar {
    bottom: 36px;
  }
  nav button {
    padding: 5px;
    font-size: 9px;
  }
}

#menu #shop {
  position: static;
  margin: 10px 0;
  max-width: 100%;
}
#menu-upgrades {
  grid-column: 2;
}

/* Species intelligence remains visible throughout the five-planet campaign. */
#threat-name {
  color: #ffb29c;
  font-size: 9px;
  letter-spacing: 0.5px;
}
.planet-route span small {
  display: block;
  margin-top: 5px;
  color: #c2d1cc;
  font-size: 8px;
  letter-spacing: 0;
}
#infection {
  top: 224px;
}
@media (max-width: 900px) {
  #threat-name {
    font-size: 8px;
  }
  #infection {
    top: 174px;
  }
}

.account-panel,
.room-panel {
  margin: 14px 0;
  padding: 10px;
  border: 1px solid #49645b;
  font-size: 11px;
}
summary {
  cursor: pointer;
}
.account-panel button,
.room-panel button {
  margin: 5px 4px 5px 0;
}
.account-panel output {
  display: block;
  overflow-wrap: anywhere;
  color: #ffcf1a;
  user-select: text;
}
.account-panel input,
.room-panel input {
  box-sizing: border-box;
  width: 100%;
}
#session-panel {
  position: absolute;
  right: 18px;
  top: 320px;
  width: 210px;
  font-size: 10px;
  max-height: 38vh;
  overflow: auto;
}
#session-panel button,
#session-panel select {
  font-size: 10px;
  margin: 5px 2px;
  max-width: 100%;
}
#session-panel ul {
  padding-left: 12px;
  max-height: 150px;
  overflow: auto;
}
#session-result {
  color: #ffcf1a;
}
@media (max-width: 900px) {
  #session-panel {
    top: 204px;
    right: 10px;
    width: 155px;
    max-height: 25vh;
  }
  #session-panel details {
    display: none;
  }
  #session-panel button,
  #session-panel select {
    font-size: 8px;
  }
  #session-panel p {
    margin: 2px;
  }
}

.deploy-panel #session-panel {
  position: static;
  width: auto;
  max-height: none;
  margin: 12px 0;
}
.deploy-panel #session-panel details {
  display: block;
}

/* Fit the visible Safari viewport, including browser chrome and the keyboard. */
#game,
#hud,
#menu {
  bottom: auto;
  height: var(--app-height, 100dvh);
}
#menu {
  touch-action: pan-y;
  overscroll-behavior: contain;
}
@media (max-width: 600px), (pointer: coarse) and (max-width: 1000px) {
  header {
    height: calc(54px + env(safe-area-inset-top));
    padding: calc(6px + env(safe-area-inset-top))
      max(10px, env(safe-area-inset-right)) 6px
      max(10px, env(safe-area-inset-left));
    gap: 8px;
  }
  header strong,
  nav [data-tap="fullscreen"],
  nav [data-tap="gfx"],
  nav #mutations {
    display: none;
  }
  header b {
    font-size: 11px;
    line-height: 1.3;
    min-width: 0;
  }
  nav {
    flex-shrink: 0;
    gap: 6px;
  }
  nav button {
    min-width: 44px;
    min-height: 40px;
    font-size: 12px;
    padding: 7px 10px;
  }
  #vitals {
    top: calc(62px + env(safe-area-inset-top));
    left: 8px;
    width: calc(100% - 124px);
    max-width: 260px;
    padding: 8px;
    gap: 4px;
  }
  #role {
    font-size: 10px;
    line-height: 1.3;
  }
  #cash {
    font-size: 13px;
  }
  #planet-name {
    font-size: 9px;
  }
  #threat-name {
    display: none;
  }
  #population {
    font-size: 9px;
    line-height: 1.3;
  }
  #radar-panel {
    top: calc(62px + env(safe-area-inset-top));
    right: 8px;
    width: 104px;
    padding: 3px;
  }
  #radar {
    width: 96px;
    height: 96px;
  }
  #evac-distance {
    font-size: 8px;
  }
  #infection {
    left: 8px;
    top: calc(190px + env(safe-area-inset-top));
    max-width: calc(100% - 16px);
    font-size: 10px;
  }
  #bite-timer {
    top: auto;
    bottom: calc(76px + env(safe-area-inset-bottom));
    left: 8px;
    transform: none;
    width: min(280px, calc(100% - 16px));
    padding: 6px 10px;
    gap: 3px;
    text-align: left;
  }
  #bite-timer strong {
    font-size: 24px;
  }
  #bite-timer small,
  #bite-timer b {
    font-size: 9px;
  }
  #help-bar,
  #desktop-hint {
    display: none;
  }
  #hud > #session-panel {
    display: none;
  }
  .waiting #hud > #session-panel,
  .has-result #hud > #session-panel {
    display: block;
    top: calc(218px + env(safe-area-inset-top));
    right: 8px;
    width: min(250px, calc(100% - 16px));
    max-height: 30%;
    padding: 8px;
  }
  #session-panel button,
  #session-panel select {
    min-height: 40px;
    font-size: 12px;
  }
  #controls {
    left: auto;
    right: max(8px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    gap: 6px;
  }
  #controls button {
    min-height: 48px;
    min-width: 64px;
    padding: 8px;
    font-size: 11px;
  }
  #controls [data-tap="evo"] {
    display: none;
  }
  .team-Z #controls [data-tap="evo"] {
    display: block;
  }
  #inventory {
    left: max(8px, env(safe-area-inset-left));
    bottom: max(10px, env(safe-area-inset-bottom));
    max-width: 72px;
  }
  #inventory button {
    min-height: 48px;
    max-width: 72px;
    font-size: 10px;
    padding: 5px;
  }
  #toast {
    top: auto;
    bottom: calc(210px + env(safe-area-inset-bottom));
    max-width: calc(100% - 24px);
    font-size: 12px;
  }
  #banner {
    max-width: calc(100% - 24px);
    font-size: 18px;
  }
  #menu {
    display: block;
    padding: max(12px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
  }
  .deploy-panel {
    display: block;
    width: 480px;
    max-width: 100%;
    margin: 0 auto;
    padding: 18px;
  }
  .deploy-panel label {
    display: block;
  }
  h1 {
    font-size: clamp(30px, 9vw, 42px);
  }
  .eyebrow {
    margin-bottom: 10px;
  }
  .intro {
    font-size: 13px;
    margin: 10px 0;
  }
  input,
  select {
    font-size: 16px;
  }
  #name {
    width: 100%;
    min-height: 44px;
  }
  #deploy {
    width: 100%;
    min-height: 48px;
    margin-top: 10px;
    font-size: 16px;
  }
  .account-panel,
  .room-panel {
    margin: 10px 0;
  }
  .play-help {
    font-size: 12px;
    padding: 10px;
    margin: 10px 0;
  }
  .planet-route {
    gap: 4px;
    font-size: 9px;
  }
  .instructions {
    font-size: 12px;
  }
  .bigmap #radar-panel {
    top: 50%;
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%);
    width: min(88vw, 70dvh);
  }
  .bigmap #radar {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
  }
}
@media (pointer: coarse) and (max-height: 500px) {
  #vitals {
    width: 220px;
  }
  #infection {
    top: calc(184px + env(safe-area-inset-top));
  }
  #bite-timer {
    top: calc(62px + env(safe-area-inset-top));
    left: auto;
    right: 120px;
    bottom: auto;
    width: min(200px, 26vw);
  }
  .waiting #hud > #session-panel,
  .has-result #hud > #session-panel {
    top: calc(62px + env(safe-area-inset-top));
    right: 120px;
  }
}

@media (pointer: coarse) and (max-height: 500px) {
  #toast {
    bottom: calc(70px + env(safe-area-inset-bottom));
    max-width: 280px;
  }
}

.advancing #hud > #session-panel,
.advancing #toast,
.advancing #controls,
.advancing #inventory,
.advancing #infection,
.advancing #help-bar {
  display: none !important;
}

#level-transition {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 35%, #203440f5, #081114fa 75%);
  pointer-events: auto;
}
#level-transition::before {
  content: "";
  position: absolute;
  inset: -50%;
  background: repeating-linear-gradient(
    115deg,
    transparent 0 100px,
    #d4edff12 101px 103px,
    transparent 104px 190px
  );
  animation: transfer-stars 1.8s linear infinite;
}
.transfer-card {
  position: relative;
  width: min(420px, 100%);
  text-align: center;
}
.transfer-flight {
  position: relative;
  width: 150px;
  height: 110px;
  margin: 0 auto 24px;
}
.transfer-planet {
  position: absolute;
  width: 78px;
  height: 78px;
  left: 36px;
  top: 16px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 30% 25%,
    #eef9ff,
    var(--destination-accent) 38%,
    #101d29 85%
  );
  box-shadow: 0 0 45px #8bbadb30;
}
.transfer-craft {
  position: absolute;
  width: 26px;
  height: 18px;
  left: 62px;
  top: 46px;
  background: var(--yellow);
  clip-path: polygon(100% 50%, 0 0, 24% 50%, 0 100%);
  animation: transfer-flight 2.4s ease-in-out infinite;
}
.transfer-eyebrow {
  color: #a7bcc5;
  letter-spacing: 3px;
  font-size: 10px;
  margin: 0 0 12px;
}
.transfer-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(24px, 5vw, 36px);
  line-height: 1.2;
}
#transfer-target {
  color: var(--destination-accent);
  letter-spacing: 2px;
  font-size: 13px;
  margin: 14px 0 24px;
}
.transfer-track {
  height: 4px;
  overflow: hidden;
  border-radius: 3px;
  background: #ffffff18;
}
#transfer-progress {
  display: block;
  width: 0;
  height: 100%;
  background: var(--destination-accent);
  transition: width 0.25s linear;
}
.transfer-caption {
  font-size: 12px;
  color: #a7bcc5;
  margin: 14px 0 0;
}
.transferring #banner {
  visibility: hidden;
}
#menu {
  z-index: 30;
}
@keyframes transfer-stars {
  to {
    transform: translate3d(170px, -65px, 0);
  }
}
@keyframes transfer-flight {
  0%,
  100% {
    transform: translate(-58px, 28px) rotate(-25deg);
    opacity: 0.35;
  }
  45%,
  55% {
    transform: translate(58px, -28px) rotate(-25deg);
    opacity: 1;
  }
}
@media (max-height: 400px) {
  .transfer-flight {
    height: 80px;
    margin-bottom: 8px;
    transform: scale(0.7);
  }
  .transfer-eyebrow {
    margin-bottom: 6px;
  }
  #transfer-target {
    margin: 8px 0 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #level-transition::before,
  .transfer-craft {
    animation: none;
  }
  #transfer-progress {
    transition: none;
  }
}

.mode-caption {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  letter-spacing: 1px;
  margin: 8px 0 14px;
}
#friends-lobby {
  position: fixed;
  inset: 0;
  height: var(--app-height, 100dvh);
  z-index: 25;
  overflow: auto;
  touch-action: pan-y;
  padding: max(20px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  background: radial-gradient(ellipse at top, #233a45, #0b1418 80%);
}
.lobby-card {
  max-width: 480px;
  margin: 20px auto;
  padding: 24px;
  background: #101c23;
  border: 1px solid #536b73;
  text-align: center;
}
.lobby-card h1 {
  font-size: clamp(28px, 8vw, 40px);
}
.lobby-card > p {
  color: #bdcdd3;
  font-size: 13px;
}
#lobby-code {
  display: block;
  font-size: clamp(42px, 12vw, 64px);
  color: var(--yellow);
  letter-spacing: 8px;
  margin: 18px 0;
  font-variant-numeric: tabular-nums;
}
#lobby-roster {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 8px;
  text-align: left;
}
#lobby-roster li {
  padding: 12px;
  background: #1d3038;
  border-left: 5px solid var(--player-clothing);
  font-size: 14px;
  overflow-wrap: anywhere;
}
#lobby-countdown {
  display: block;
  color: var(--yellow);
  font-size: 64px;
  margin: 12px 0;
  font-variant-numeric: tabular-nums;
}
#start-match,
#leave-lobby {
  width: 100%;
  min-height: 46px;
  margin-top: 10px;
}
#lobby-copy-status {
  min-height: 16px;
}
.waiting #hud > #session-panel {
  display: none !important;
}

/* Mission dashboard. Scoped to the menu so gameplay keeps its existing layout. */
#menu {
  --home-ink: #f0f3f7;
  --home-muted: #8895a8;
  --home-line: #ffffff14;
  --home-acid: #d5f574;
  display: block;
  padding: max(24px, env(safe-area-inset-top))
    max(32px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom))
    max(32px, env(safe-area-inset-left));
  color: var(--home-ink);
  background:
    radial-gradient(ellipse at 25% 36%, #142f3b66, transparent 46%),
    radial-gradient(ellipse at 90% 0%, #292d2433, transparent 40%), #080e17;
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
}
#menu::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(#ccdfff40 0.6px, transparent 0.7px);
  background-size: 73px 79px;
  opacity: 0.25;
}
#menu .deploy-panel {
  position: relative;
  display: block;
  width: min(1220px, 100%);
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: none;
}
#menu .mission-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 52px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--home-line);
}
#menu .mission-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--home-ink);
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
}
#menu .mission-brand svg {
  width: 26px;
  height: 26px;
  color: var(--home-acid);
  margin-right: 5px;
}
#menu .mission-brand > span {
  color: #64717e;
  font-weight: 400;
}
#menu #status {
  padding: 8px 12px;
  border: 1px solid #badd921f;
  border-radius: 30px;
  color: #b8d69e;
  font-family: monospace;
  font-size: 10px;
  margin: 0;
  letter-spacing: 0.3px;
}
#menu #status::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 8px;
  box-shadow: 0 0 9px #a5e88f55;
}
#menu .mission-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  gap: 65px;
  padding: 56px 20px 42px;
  align-items: start;
}
#menu .mission-hero {
  position: relative;
  min-width: 0;
}
#menu .eyebrow {
  color: var(--home-muted);
  font-family: monospace;
  font-size: 10px;
  letter-spacing: 1.7px;
  line-height: 1.6;
  margin: 0 0 20px;
}
#menu .mission-hero .eyebrow > span {
  display: inline-block;
  width: 19px;
  height: 2px;
  background: var(--home-acid);
  vertical-align: middle;
  margin-right: 8px;
}
#menu h1 {
  font-family: "Arial Black", "Avenir Next", sans-serif;
  font-size: clamp(46px, 5.7vw, 78px);
  line-height: 0.98;
  letter-spacing: -4px;
  font-weight: 900;
  margin: 0;
}
#menu h1 span {
  color: var(--home-acid);
}
#menu .intro {
  color: #a2adbd;
  font-size: 15px;
  line-height: 1.65;
  margin: 20px 0 0;
}
#menu .planet-scene {
  position: relative;
  height: 280px;
  margin-top: 5px;
  overflow: hidden;
}
#menu .planet-globe {
  position: absolute;
  width: 260px;
  height: 260px;
  top: 14px;
  left: 50%;
  transform: translateX(-50%) rotate(-15deg);
  border-radius: 50%;
  box-shadow:
    -10px -5px 35px #6cc2cf18,
    0 0 70px #60a9b512;
}
#menu .planet-globe::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(115deg, transparent 25%, #020812c9 95%);
}
#menu .planet-globe svg {
  display: block;
  width: 100%;
  height: 100%;
}
#menu .orbit {
  position: absolute;
  top: 53%;
  left: 50%;
  width: 430px;
  height: 146px;
  border: 1px solid #9cb6cb30;
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(-24deg);
}
#menu .orbit-two {
  width: 480px;
  height: 228px;
  transform: translate(-50%, -50%) rotate(17deg);
  border-style: dashed;
  border-color: #9cb6cb16;
}
#menu .orbit-dot {
  position: absolute;
  top: 72px;
  right: 17%;
  width: 6px;
  height: 6px;
  background: var(--home-acid);
  box-shadow: 0 0 15px #d5f57490;
  border-radius: 50%;
}
#menu .planet-coordinate {
  position: absolute;
  top: 70px;
  left: 1px;
  font: 9px/1.8 monospace;
  color: #6b8394;
  letter-spacing: 1px;
}
#menu .planet-coordinate b {
  display: block;
  color: #cedbe3;
  font-size: 15px;
  letter-spacing: 3px;
  font-weight: 400;
}
#menu .planet-coordinate span {
  display: block;
  margin-top: 6px;
  font-size: 8px;
}
#menu .signal-tag {
  position: absolute;
  bottom: 28px;
  right: 0;
  padding: 7px 9px;
  background: #0a1924dd;
  border: 1px solid #65c6d52e;
  color: #8ebdc9;
  font: 8px monospace;
  letter-spacing: 0.7px;
}
#menu .signal-tag i {
  display: inline-block;
  height: 4px;
  width: 4px;
  background: #7bd6d9;
  margin-right: 6px;
  border-radius: 50%;
}
#menu .mission-stats {
  display: flex;
  gap: 27px;
  border-top: 1px solid var(--home-line);
  padding-top: 17px;
}
#menu .mission-stats > span {
  display: flex;
  align-items: center;
  gap: 9px;
  font: 8px/1.4 monospace;
  color: #7f90a0;
  letter-spacing: 0.7px;
}
#menu .mission-stats b {
  font:
    23px "Avenir Next",
    sans-serif;
  color: #d6dde5;
}
#menu .launch-panel {
  position: relative;
  border: 1px solid #a1b4cc24;
  border-radius: 12px;
  padding: 26px;
  background: linear-gradient(145deg, #16212de6, #101924e6);
  box-shadow:
    0 20px 70px #0003,
    inset 0 1px #ffffff05;
}
#menu .launch-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}
#menu .launch-heading .eyebrow {
  font-size: 9px;
  letter-spacing: 1px;
  color: #b6c5a0;
  margin: 0;
}
#menu .launch-icon {
  color: var(--home-acid);
  font-size: 24px;
}
#menu h2 {
  font-size: 30px;
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -1px;
  margin: 22px 0 12px;
}
#menu .launch-subtitle {
  color: var(--home-muted);
  font-size: 12px;
  line-height: 1.65;
  margin: 0 0 23px;
  max-width: 260px;
}
#menu label {
  font: 9px monospace;
  color: #a6b2c1;
  letter-spacing: 1.4px;
  margin: 15px 0 8px;
}
#menu input,
#menu select {
  min-height: 46px;
  border-radius: 5px;
  padding: 12px;
  color: #e2e9f0;
  background: #090f18a6;
  border: 1px solid #92a5bc30;
  font-size: 14px;
}
#menu input:focus-visible {
  outline-color: var(--home-acid);
}
#menu button {
  border-radius: 5px;
  background: #1d2b39;
  border-color: #8295ac35;
  color: #dbe6f0;
  min-height: 44px;
  font-size: 12px;
  transition:
    background 0.16s,
    border-color 0.16s;
}
#menu button:hover {
  background: #293c4b;
  border-color: #c3dfb28c;
}
#menu button:focus-visible,
#menu summary:focus-visible {
  outline: 2px solid var(--home-acid);
  outline-offset: 3px;
}
#menu #deploy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  min-height: 54px;
  padding: 12px 18px;
  color: #17210a;
  background: var(--home-acid);
  border: 1px solid #e6ffaf;
  font-size: 16px;
  letter-spacing: 1px;
  box-shadow: 0 4px 20px #b9e16610;
}
#menu #deploy:hover {
  background: #e3ff94;
}
#menu #deploy > span:last-child {
  font-size: 25px;
  font-weight: 400;
}
#menu .mode-caption {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: 8px/1.5 monospace;
  letter-spacing: 0.2px;
  color: #94a1b1;
  margin: 11px 0 25px;
}
#menu .mode-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--home-acid);
}
#menu .launch-divider {
  text-align: center;
  position: relative;
  border-top: 1px solid var(--home-line);
  margin-bottom: 18px;
}
#menu .launch-divider span {
  position: relative;
  top: -7px;
  background: #131e2a;
  color: #748699;
  font: 8px monospace;
  letter-spacing: 1px;
  padding: 0 10px;
}
#menu .room-panel {
  margin: 0;
  border: 1px solid #9aaec32e;
  border-radius: 5px;
  padding: 0;
  background: #0b141d55;
}
#menu .room-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 12px;
  cursor: pointer;
  color: #d6e0e9;
  font-size: 12px;
  list-style: none;
}
#menu .room-panel summary::-webkit-details-marker {
  display: none;
}
#menu .room-panel summary > span:last-child {
  color: #a9b7c4;
  font-size: 18px;
}
#menu .room-panel[open] summary > span:last-child {
  transform: rotate(45deg);
}
#menu .room-panel[open] {
  padding-bottom: 12px;
}
#menu .room-panel > p {
  margin: 4px 12px 12px;
  color: var(--home-muted);
  font-size: 11px;
  line-height: 1.65;
}
#menu #create-room {
  display: flex;
  width: calc(100% - 24px);
  align-items: center;
  justify-content: space-between;
  margin: 0 12px;
}
#menu .room-panel label {
  margin-left: 12px;
}
#menu .code-entry {
  display: flex;
  gap: 8px;
  margin: 0 12px;
}
#menu .code-entry input {
  min-width: 0;
  width: 0;
  flex: 1;
  font-family: monospace;
  letter-spacing: 3px;
}
#menu .code-entry button {
  padding: 8px 10px;
  white-space: nowrap;
}
#menu .launch-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #778999;
  font-size: 10px;
  margin: 12px 0 0;
}
#menu .launch-footer svg {
  width: 13px;
  height: 13px;
}
#menu .session-actions {
  margin-top: 14px;
}
#menu .session-actions:has(button:not([hidden])) {
  border-top: 1px solid var(--home-line);
  padding-top: 14px;
}
#menu #error:empty {
  display: none;
}
#menu .worlds-section {
  padding: 20px 0 30px;
  border-top: 1px solid var(--home-line);
}
#menu .section-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  color: #8292a4;
  font: 9px monospace;
  letter-spacing: 1.5px;
}
#menu .section-caption > :last-child {
  color: #485969;
  font-size: 8px;
}
#menu .planet-route {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  margin: 0;
}
#menu .world-stop {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 5px 10px;
  align-items: center;
  padding: 16px 18px;
  border-left: 1px solid var(--home-line);
}
#menu .world-stop:first-child {
  border-left: 0;
  padding-left: 0;
}
#menu .world-number {
  position: absolute;
  right: 14px;
  top: 5px;
  color: #4c5c6d;
  font: 8px monospace;
}
#menu .world-stop i {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 30% 25%,
    #91bda7,
    #37636d 48%,
    #102330 80%
  );
  box-shadow: 0 0 16px #92b9a612;
}
#menu .world-stop b {
  display: block;
  font:
    11px "Avenir Next",
    sans-serif;
  letter-spacing: 1.2px;
}
#menu .world-stop small {
  display: block;
  color: #778a9c;
  font:
    9px/1.5 "Avenir Next",
    sans-serif;
  margin-top: 3px;
}
#menu .world-type {
  grid-column: 1/-1;
  margin-top: 9px;
  color: #596d7d;
  font: 7px monospace;
  letter-spacing: 1px;
}
#menu .mars i {
  background: radial-gradient(
    circle at 30% 25%,
    #e0a085,
    #9a513d 48%,
    #331c22 85%
  );
}
#menu .glacia i {
  background: radial-gradient(
    circle at 30% 25%,
    #d4f6fa,
    #719eae 48%,
    #26384f 85%
  );
}
#menu .viridia i {
  background: radial-gradient(
    circle at 30% 25%,
    #d4a2e6,
    #80588e 48%,
    #2f1c3d 85%
  );
}
#menu .pyra i {
  background: radial-gradient(
    circle at 30% 25%,
    #ffc77c,
    #b8563d 48%,
    #3d1a25 85%
  );
}
#menu .play-help {
  padding: 25px 0;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--home-line);
  background: none;
}
#menu .play-help .section-caption b {
  color: #98a8b8;
  font-weight: 400;
}
#menu .field-notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px;
}
#menu .field-notes article {
  position: relative;
  padding-left: 30px;
}
#menu .note-number {
  position: absolute;
  top: 3px;
  left: 0;
  color: #6a8374;
  font: 10px monospace;
}
#menu .field-notes h3 {
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 8px;
}
#menu .field-notes p {
  font-size: 11px;
  line-height: 1.8;
  margin: 0;
  color: #7f91a3;
}
#menu .mission-footer {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  border-top: 1px solid var(--home-line);
  margin-top: 6px;
  padding: 22px 0 4px;
}
#menu .instructions {
  margin: 0;
  padding: 0;
  color: #667d90;
  font-size: 10px;
  line-height: 1.8;
  max-width: 680px;
}
#menu .instructions b {
  display: block;
  color: #8398a8;
  font: 8px monospace;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}
#menu .rules {
  margin: 0;
  padding: 0;
  white-space: nowrap;
  color: #667d90;
  font: 8px/1.8 monospace;
  letter-spacing: 1px;
}
#menu .rules span {
  display: block;
  color: #42586b;
}
@media (min-width: 1600px) {
  #menu {
    padding-top: 45px;
  }
  #menu .mission-main {
    padding-top: 68px;
  }
}
@media (max-width: 1000px) {
  #menu .mission-main {
    gap: 32px;
    padding: 38px 0 32px;
    grid-template-columns: minmax(0, 1fr) 330px;
  }
  #menu h1 {
    font-size: 54px;
    letter-spacing: -3px;
  }
  #menu .launch-panel {
    padding: 22px;
  }
  #menu .world-stop {
    padding: 15px 10px;
  }
  #menu .world-stop small {
    font-size: 8px;
  }
  #menu .planet-coordinate {
    top: 35px;
  }
  #menu .mission-stats {
    gap: 15px;
  }
  #menu .mission-stats > span {
    font-size: 7px;
    gap: 5px;
  }
}
@media (max-width: 720px) {
  #menu {
    padding: max(16px, env(safe-area-inset-top))
      max(18px, env(safe-area-inset-right))
      max(18px, env(safe-area-inset-bottom))
      max(18px, env(safe-area-inset-left));
  }
  #menu .mission-topbar {
    padding-bottom: 14px;
    gap: 8px;
    flex-wrap: wrap;
  }
  #menu .mission-brand {
    font-size: 9px;
    letter-spacing: 0.7px;
    gap: 6px;
  }
  #menu .mission-brand svg {
    width: 22px;
    height: 22px;
    margin-right: 2px;
  }
  #menu #status {
    font-size: 8px;
    padding: 6px 8px;
  }
  #menu .mission-main {
    display: flex;
    flex-direction: column;
    padding: 26px 0 28px;
    gap: 25px;
  }
  #menu .mission-hero {
    width: 100%;
  }
  #menu .mission-hero .eyebrow {
    font-size: 8px;
    margin-bottom: 12px;
    letter-spacing: 1.2px;
  }
  #menu h1 {
    font-size: clamp(42px, 9vw, 62px);
    letter-spacing: -2.5px;
  }
  #menu .intro {
    font-size: 12px;
    margin: 12px 0 0;
  }
  #menu .intro br {
    display: none;
  }
  #menu .planet-scene,
  #menu .mission-stats {
    display: none;
  }
  #menu .launch-panel {
    width: 100%;
    padding: 20px;
  }
  #menu .launch-heading .eyebrow {
    font-size: 8px;
  }
  #menu h2 {
    font-size: 24px;
    margin: 13px 0 9px;
  }
  #menu h2 br {
    display: none;
  }
  #menu .launch-subtitle {
    font-size: 11px;
    max-width: none;
    margin-bottom: 17px;
  }
  #menu .planet-route {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  #menu .world-stop {
    border: 1px solid var(--home-line);
    border-radius: 5px;
    padding: 16px;
  }
  #menu .world-stop:first-child {
    border-left: 1px solid var(--home-line);
    padding-left: 16px;
  }
  #menu .world-stop:last-child {
    grid-column: 1/-1;
  }
  #menu .world-stop small {
    font-size: 10px;
  }
  #menu .section-caption {
    font-size: 8px;
    letter-spacing: 1px;
  }
  #menu .field-notes {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  #menu .field-notes p {
    font-size: 12px;
  }
  #menu .mission-footer {
    display: block;
    padding-top: 20px;
  }
  #menu .rules {
    display: flex;
    gap: 18px;
    margin-top: 20px;
  }
  #menu input,
  #menu select {
    font-size: 16px;
  }
}
@media (max-width: 420px) {
  #menu .mission-topbar {
    min-height: 32px;
  }
  #menu #status {
    border: 0;
    padding: 0;
    font-size: 8px;
  }
  #menu .mission-brand {
    font-size: 8px;
  }
  #menu .mission-main {
    padding-top: 20px;
    gap: 20px;
  }
  #menu .launch-heading,
  #menu .launch-subtitle,
  #menu .launch-panel h2 {
    display: none;
  }
  #menu .launch-panel {
    padding: 18px;
  }
  #menu .launch-panel > label:first-of-type {
    margin-top: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  #menu button {
    transition: none;
  }
}

#menu #live-menu-notice {
  border-left: 2px solid var(--home-acid);
  background: #d5f57408;
  color: #c7d5ad;
  padding: 10px 12px;
  margin: 16px 0 0;
  font-size: 11px;
  line-height: 1.6;
}

/* Fixed right-thumb movement control, shown only while touch play is active. */
#joystick {
  left: auto;
  right: max(16px, env(safe-area-inset-right));
  top: calc(var(--app-height, 100dvh) - 116px - env(safe-area-inset-bottom));
  bottom: auto;
  z-index: 7;
  pointer-events: auto;
  touch-action: none;
  border-color: #b9d8e58c;
  background: radial-gradient(circle, #2b4c6099, #14293399);
  box-shadow:
    0 3px 18px #0004,
    inset 0 0 0 6px #ffffff08;
}
#knob {
  left: calc(50% - 18px);
  top: calc(50% - 18px);
  pointer-events: none;
  background: #d7ecf2b3;
  border: 1px solid #effbff80;
}
body:not(.touch) #joystick,
.advancing #joystick,
.transferring #joystick {
  display: none !important;
}
.touch #controls {
  left: max(12px, env(safe-area-inset-left));
  right: auto;
  bottom: max(14px, env(safe-area-inset-bottom));
  max-width: calc(100% - 148px);
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
}
.touch #inventory {
  left: auto;
  right: max(12px, env(safe-area-inset-right));
  bottom: calc(132px + env(safe-area-inset-bottom));
  max-width: 112px;
}
@media (pointer: coarse) and (min-height: 501px) {
  #bite-timer {
    max-width: calc(100% - 148px);
  }
}
@media (pointer: coarse) and (max-height: 500px) {
  .touch #inventory {
    left: max(220px, env(safe-area-inset-left));
    right: auto;
    bottom: max(14px, env(safe-area-inset-bottom));
  }
}
