/* Bright workshop production UI. Gameplay remains the live PlayCanvas scene. */
@font-face {
  font-family: Workshop;
  src: local("Arial Black");
  font-weight: 900;
}
:root {
  --paper: #f4f1e8;
  --surface: #fffdf7;
  --ink: #24322e;
  --muted: #626c63;
  --line: #d8d9cb;
  --orange: #c64d18;
  --orange-dark: #ae4214;
  --soft-orange: #f9e5d4;
  --green: #34705b;
  --blue: #386a7c;
  --red: #aa3c2d;
  --shadow: 0 20px 70px #293b2c16;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button {
  color: inherit;
}
button:disabled {
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
button,
a {
  touch-action: manipulation;
}
button {
  transition:
    background 0.15s,
    box-shadow 0.15s,
    transform 0.15s;
}
button:hover:not(:disabled) {
  box-shadow: 0 4px 12px #25372c15;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(30px, 3vw, 46px);
  font-weight: 850;
  letter-spacing: -1.5px;
  line-height: 1.16;
}
h2 {
  font-size: 25px;
  letter-spacing: -0.7px;
}
h3 {
  font-size: 18px;
}
p {
  line-height: 1.7;
}
.muted {
  color: var(--muted);
}
.mono,
.eyebrow,
kbd {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
}
small {
  font-size: 12px;
  line-height: 1.6;
}
svg.ico {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
  vertical-align: middle;
}
.btn {
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 12px 20px;
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
}
.btn.primary {
  background: var(--orange);
  border-color: var(--orange-dark);
  color: white;
  box-shadow: 0 3px 0 var(--orange-dark);
}
.btn.primary:hover {
  background: #b84012;
}
.btn.quiet {
  background: transparent;
  border-color: transparent;
}
.btn.dark {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}
.btn.danger {
  background: var(--red);
  color: white;
  border-color: var(--red);
}
.btn:disabled {
  background: #e8e7dc;
  color: #70766c;
  border-color: #d4d5c8;
  box-shadow: none;
}
.iconbtn {
  width: 48px;
  height: 48px;
  padding: 0;
  flex: none;
}
.chip {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
  background: #e9eadf;
  line-height: 1.4;
}
.chip.orange {
  color: #92401e;
  background: var(--soft-orange);
}
.chip.green {
  background: #dfebe2;
  color: #285f4e;
}
.chip.blue {
  background: #e2eced;
  color: #2f6273;
}
.chip.red {
  background: #f4ded6;
  color: #8c2f24;
}
.chip svg {
  width: 16px;
  height: 16px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.spread {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.divider {
  height: 1px;
  background: var(--line);
  margin: 8px 0;
}
.titleblock {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.titleblock > p:last-child {
  color: var(--muted);
}
.block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
}
.stamp {
  width: 42px;
  height: 42px;
  background: var(--ink);
  color: var(--paper);
  display: grid;
  place-items: center;
  border-radius: 11px;
  transform: rotate(-7deg);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 800;
  color: var(--ink);
}
.brand span {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.brand small {
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--muted);
  font-weight: 600;
}
.topbar {
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.topnav {
  display: flex;
  align-items: center;
  gap: 16px;
}
.topnav .separator {
  height: 24px;
  width: 1px;
  background: var(--line);
}
.shell {
  height: 100dvh;
  min-height: 320px;
  padding: 0 max(5vw, var(--safe-right)) 0 max(5vw, var(--safe-left));
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 90% 10%, #d9dfcb77, transparent 55%),
    var(--paper);
}
.shell-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 32px 0 24px;
}
.footer {
  height: 56px;
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  gap: 12px;
}
kbd {
  border: 1px solid #cbd0c4;
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 3px 6px;
  font-size: 11px;
  color: inherit;
  background: #fff5;
}
.footer a {
  color: var(--muted);
}
.screen-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 24px;
}
.screen-heading .eyebrow {
  margin-bottom: 8px;
}
.screen-heading p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
} /* HOME: a quiet menu beside a large original voxel diorama. */
.home-layout {
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(400px, 1.3fr);
  gap: 4vw;
  align-items: center;
  max-width: 1440px;
  margin: auto;
}
.home-copy {
  padding: 18px 0;
}
.home-copy h1 {
  font-size: clamp(60px, 6.2vw, 92px);
  line-height: 1.05;
  letter-spacing: -5px;
  margin: 20px 0;
}
.home-copy h1 span {
  color: var(--orange);
}
.home-copy > .description {
  font-size: 17px;
  line-height: 1.9;
  color: var(--muted);
  margin-bottom: 28px;
}
.continue {
  width: 100%;
  justify-content: space-between;
  text-align: left;
  min-height: 76px;
  padding: 14px 22px;
}
.continue span {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 19px;
}
.continue small {
  color: #ffead6;
  font-size: 12px;
  font-weight: 500;
}
.mode-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.mode-tile {
  display: flex;
  align-items: center;
  text-align: left;
  gap: 12px;
  padding: 17px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 76px;
}
.mode-tile span {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-weight: 750;
}
.mode-tile small {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
.mode-tile > .ico {
  color: var(--orange);
}
.home-low {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}
.home-low button {
  font-size: 12px;
  padding: 8px 0;
  min-height: 44px;
  background: none;
  border: 0;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.hero {
  position: relative;
  min-height: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}
.hero:before {
  content: "";
  position: absolute;
  width: 85%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #e6e8d8;
  z-index: -1;
}
.hero:after {
  content: "BUILD. BLAST. BEGIN AGAIN.";
  position: absolute;
  right: 0;
  bottom: 24px;
  font:
    10px ui-monospace,
    monospace;
  letter-spacing: 3px;
  color: #757b6c;
}
.hero > img {
  width: 120%;
  max-width: 920px;
  margin-left: -4%;
  filter: drop-shadow(0 22px 20px #58604319);
  transform: rotate(-3deg);
}
.hero-caption {
  position: absolute;
  right: 16px;
  top: 20px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.hero-caption > span {
  border-left: 2px solid var(--orange);
  padding-left: 10px;
  font-size: 12px;
  line-height: 1.8;
}
.hero .floating-tnt {
  position: absolute;
  width: 115px;
  left: 6%;
  bottom: 16%;
  transform: rotate(12deg);
  margin: 0;
}
.hero-label {
  position: absolute;
  left: 4%;
  top: 22%;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--muted);
  border-bottom: 1px solid #a5ad94;
  padding: 7px 0;
}
.home-version {
  font-size: 12px;
  padding: 10px 14px;
  border: 1px dashed #b2b9a2;
  border-radius: 10px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
  color: var(--muted);
} /* SELECTION */
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tab {
  min-height: 48px;
  background: none;
  border: 1px solid transparent;
  padding: 12px 18px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 700;
}
.tab[aria-selected="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}
.chapter-tabs {
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.campaign-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.mission-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.mission-card:hover {
  border-color: #a3ad92;
}
.mission-card .picture {
  height: 205px;
  background: radial-gradient(ellipse, #d8dfc5, #e8eadc);
  position: relative;
  overflow: hidden;
}
.mission-card .picture > img {
  width: 112%;
  height: 100%;
  margin-left: -6%;
  object-fit: contain;
}
.mission-card .number {
  position: absolute;
  left: 15px;
  top: 12px;
  font:
    750 12px ui-monospace,
    monospace;
  color: #596551;
}
.mission-card .medal-corner {
  position: absolute;
  right: 12px;
  top: 12px;
}
.mission-card.locked .picture {
  filter: saturate(0.45);
}
.mission-card .card-copy {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}
.mission-card h3 {
  font-size: 18px;
}
.mission-card p {
  font-size: 12px;
  color: var(--muted);
  min-height: 36px;
}
.mission-card .btn {
  width: 100%;
  margin-top: auto;
  min-height: 46px;
  font-size: 13px;
}
.card-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}
.chapter-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding: 17px 20px;
  background: #e6e9db;
  border-radius: 12px;
  font-size: 13px;
}
.chapter-note .ico {
  color: var(--green);
}
.list-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.list-grid .picture {
  height: 140px;
}
.map-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.map-card {
  display: grid;
  grid-template-columns: 45% 1fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  min-height: 215px;
}
.map-card > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #e5e8d5;
}
.map-card > div {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.map-card p {
  font-size: 12px;
  color: var(--muted);
}
.map-card .btn {
  align-self: flex-start;
  margin-top: auto;
  font-size: 13px;
} /* BRIEFING */
.briefing {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 32px;
  align-items: start;
}
.brief-art {
  background: #e5e8d7;
  border: 1px solid #d8deca;
  border-radius: 20px;
  min-height: 405px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.brief-art > img {
  width: 100%;
  height: 350px;
  object-fit: contain;
}
.brief-art > .chip {
  position: absolute;
  top: 20px;
  left: 20px;
}
.brief-caption {
  padding: 0 24px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
.brief-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.objective-line {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #e5e5d9;
}
.objective-line:last-child {
  border: 0;
}
.objective-line .ico {
  color: var(--green);
  margin-top: 1px;
}
.objective-line strong {
  font-size: 14px;
  display: block;
}
.objective-line small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}
.tools-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tool-mini {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  background: #ebece1;
  border-radius: 9px;
  font-size: 12px;
}
.tool-mini img {
  width: 38px;
  height: 32px;
  object-fit: contain;
}
.medal-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.medal-tier {
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
}
.medal-tier strong {
  display: flex;
  gap: 5px;
  align-items: center;
  font-size: 13px;
}
.medal-tier small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}
.medal-tier.gold {
  background: #f6ecd6;
  border-color: #dec995;
}
.brief-start {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brief-start .primary {
  flex: 1;
}
.brief-budget {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #e9ebdf;
  border-radius: 12px;
  font-size: 12px;
}
.brief-budget strong {
  font:
    750 28px ui-monospace,
    monospace;
} /* HUD is over an actual current-game capture; all controls are a UI simulation. */
.game {
  position: relative;
  height: 100dvh;
  overflow: hidden;
  background: transparent;
}
.game-top {
  position: absolute;
  top: max(20px, var(--safe-top));
  left: max(24px, var(--safe-left));
  right: max(24px, var(--safe-right));
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.game-label {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fffdf7f5;
  border: 1px solid #fff8;
  border-radius: 12px;
  padding: 13px 16px;
  max-width: 380px;
  box-shadow: 0 4px 16px #21352a12;
}
.game-label > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.game-label strong {
  font-size: 14px;
}
.game-label small {
  font-size: 11px;
  color: var(--muted);
}
.hud-buttons {
  display: flex;
  gap: 8px;
}
.hud-buttons .btn {
  background: #fffdf7f2;
}
.hud-goal {
  width: 285px;
  position: absolute;
  top: 104px;
  left: max(24px, var(--safe-left));
  background: #24372ff5;
  color: white;
  padding: 18px;
  border: 1px solid #ffffff20;
  border-radius: 14px;
}
.hud-goal header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.hud-goal .percent {
  font:
    750 32px ui-monospace,
    monospace;
  margin: 10px 0;
}
.hud-goal .percent small {
  font: 12px system-ui;
  color: #c6d6c8;
}
.progress {
  height: 5px;
  background: #ffffff26;
  overflow: hidden;
  border-radius: 20px;
}
.progress > span {
  display: block;
  height: 100%;
  background: #efb168;
  transition: width 0.3s;
}
.goal-small {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 12px;
  color: #e2e8db;
  font-size: 11px;
}
.goal-small .ico {
  width: 15px;
  height: 15px;
}
.hud-budget {
  position: absolute;
  top: max(20px, var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  background: #fffdf7ed;
  border-radius: 12px;
  padding: 12px 17px;
  display: flex;
  gap: 15px;
  align-items: center;
  box-shadow: 0 4px 16px #21352a12;
}
.hud-budget span {
  font-size: 11px;
  color: var(--muted);
}
.hud-budget b {
  font:
    750 23px ui-monospace,
    monospace;
}
.hud-budget em {
  font-size: 12px;
  font-style: normal;
  color: var(--muted);
}
.crosshair {
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  border: 2px solid #fff;
  border-radius: 5px;
  filter: drop-shadow(0 1px 2px #23362c);
  display: grid;
  place-items: center;
}
.crosshair:after {
  content: "";
  width: 4px;
  height: 4px;
  background: white;
  border-radius: 50%;
}
.hud-bottom {
  position: absolute;
  left: max(24px, var(--safe-left));
  right: max(24px, var(--safe-right));
  bottom: max(24px, var(--safe-bottom));
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.loadout {
  display: flex;
  gap: 8px;
  background: #fffdf7ed;
  padding: 8px;
  border: 1px solid #fff9;
  border-radius: 14px;
  max-width: 60vw;
}
.loadout-button {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 12px;
  min-width: 76px;
  min-height: 70px;
  background: transparent;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
}
.loadout-button[aria-pressed="true"] {
  background: #fbe6d2;
  border-color: #d47b41;
}
.loadout-button img {
  width: 42px;
  height: 31px;
  object-fit: contain;
}
.loadout-button kbd {
  position: absolute;
  top: 3px;
  left: 3px;
  padding: 1px 3px;
  font-size: 9px;
}
.loadout-button small {
  font-size: 10px;
  color: var(--muted);
}
.game-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.game-actions .btn {
  min-height: 58px;
}
.game-actions .place-btn {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange-dark);
  min-width: 136px;
}
.game-actions .ignite-btn {
  background: #fffdf7f5;
  min-width: 108px;
}
.game-actions .settle-btn {
  position: absolute;
  right: 0;
  bottom: 76px;
  background: #24372ff5;
  color: white;
  border-color: #24372f;
} /* MODALS / PANELS */
.scrim {
  position: fixed;
  inset: 0;
  background: #172c28ad;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, var(--safe-top)) max(24px, var(--safe-right))
    max(24px, var(--safe-bottom)) max(24px, var(--safe-left));
}
.dialog {
  background: var(--paper);
  border: 1px solid #fff8;
  border-radius: 22px;
  box-shadow: 0 28px 90px #12241d45;
  width: min(570px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dialog.wide {
  width: min(1020px, 100%);
}
.dialog-head {
  padding: 25px 28px 18px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.dialog-head .eyebrow {
  margin-bottom: 6px;
}
.dialog-head h2 {
  font-size: 25px;
}
.dialog-body {
  padding: 24px 28px;
  overflow: auto;
  min-height: 0;
  overscroll-behavior: contain;
}
.dialog-foot {
  padding: 16px 28px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: none;
  font-size: 12px;
}
.dialog-foot .btn {
  min-width: 120px;
}
.dialog p.lead {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 18px;
}
.pause-dialog {
  width: 430px;
}
.pause-dialog .dialog-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pause-dialog .btn {
  width: 100%;
}
.paused-state {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--green);
  margin-bottom: 18px;
}
.pause-dialog .pause-stats {
  padding: 14px 16px;
  background: #e7e9dc;
  border-radius: 12px;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}
.pause-dialog .textbtn {
  background: none;
  border: 0;
  min-height: 44px;
  color: var(--muted);
  font-size: 13px;
}
.confirm-copy {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}
.warning-emblem {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 14px;
  background: #f3e3d0;
  color: #a04820;
  display: grid;
  place-items: center;
}
.confirm-copy h3 {
  margin-bottom: 10px;
}
.confirm-copy p {
  font-size: 14px;
  color: var(--muted);
}
.confirm-detail {
  padding: 12px 16px;
  background: #e9eadf;
  border-radius: 10px;
  margin-top: 18px;
  font-size: 12px;
  line-height: 1.8;
}
.settings-layout {
  display: grid;
  grid-template-columns: 178px 1fr;
  gap: 28px;
  min-height: 300px;
}
.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.settings-nav button {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 12px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 13px;
}
.settings-nav button[aria-selected="true"] {
  background: var(--ink);
  color: white;
  font-weight: 700;
}
.settings-content {
  min-width: 0;
}
.settings-content h3 {
  margin-bottom: 18px;
}
.setting {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}
.setting:last-child {
  border: 0;
}
.setting small {
  display: block;
  color: var(--muted);
  margin-top: 6px;
  font-size: 12px;
}
.setting input[type="range"] {
  width: 180px;
  accent-color: var(--orange);
  min-height: 44px;
}
.setting select {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  min-height: 44px;
}
.setting input[type="checkbox"] {
  appearance: none;
  position: relative;
  width: 46px;
  height: 28px;
  border-radius: 20px;
  background: #a4ac9c;
  border: 1px solid #7e8979;
  flex: none;
  cursor: pointer;
}
.setting input[type="checkbox"]:before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px #0002;
}
.setting input:checked {
  background: var(--green);
}
.setting input:checked:before {
  left: 21px;
}
.sliderwrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.sliderwrap output {
  min-width: 40px;
  font-size: 12px;
  text-align: right;
}
.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.control-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  font-size: 12px;
  min-height: 50px;
}
.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border-radius: 12px;
  background: #e5eadb;
  color: #415541;
  font-size: 12px;
  line-height: 1.8;
  padding: 14px;
}
.notice .ico {
  width: 20px;
  height: 20px;
  flex: none;
  margin-top: 2px;
}
.notice.warning {
  background: #f5e3cc;
  color: #804322;
}
.notice.error {
  background: #f2dfd8;
  color: #8c382b;
}
.tool-panel-layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 22px;
}
.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.tool-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  min-height: 120px;
  position: relative;
}
.tool-card[aria-pressed="true"] {
  border: 2px solid var(--orange);
  background: #fff3e6;
  padding: 13px;
}
.tool-card > img {
  width: 88px;
  height: 84px;
  object-fit: contain;
}
.tool-card > span {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tool-card strong {
  font-size: 14px;
}
.tool-card small {
  font-size: 11px;
  color: var(--muted);
}
.tool-card .tick {
  position: absolute;
  top: 8px;
  right: 8px;
  color: var(--orange);
}
.tool-detail {
  background: #e6e9db;
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 12px;
}
.tool-detail h3 {
  font-size: 17px;
}
.tool-detail p {
  color: var(--muted);
}
.tool-detail .btn {
  margin-top: auto;
}
.tool-tabs {
  margin-bottom: 18px;
}
.tool-grid.prefab-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.prefab-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  min-height: 155px;
}
.prefab-tile img {
  width: 100%;
  height: 90px;
  object-fit: contain;
}
.prefab-tile strong {
  font-size: 14px;
}
.prefab-tile small {
  font-size: 11px;
  color: var(--muted);
}
.prefab-tile[aria-pressed="true"] {
  border: 2px solid var(--orange);
  background: #fff3e6;
  padding: 11px;
}
.material-cube {
  height: 66px;
  width: 66px;
  transform: rotate(-12deg);
  border-radius: 6px;
  background: var(--cube);
  box-shadow:
    inset -18px -12px #0002,
    inset 0 12px #ffffff35;
}
.material-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.material-grid .prefab-tile {
  min-height: 164px;
  justify-content: center;
}
.hint-number {
  font:
    750 11px ui-monospace,
    monospace;
  color: var(--muted);
  letter-spacing: 1px;
}
.hint-step {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.8;
}
.hint-step strong {
  display: block;
  margin-bottom: 6px;
  color: var(--orange-dark);
}
.guide-targets {
  margin-top: 0;
}
.result-layout {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 48px;
  align-items: center;
  min-height: 100%;
  max-width: 1100px;
  margin: auto;
}
.medal-display {
  position: relative;
  text-align: center;
  padding: 20px;
}
.medal-ring {
  display: grid;
  place-items: center;
  width: 220px;
  height: 220px;
  background: #ebd494;
  border: 12px solid #f5e5b7;
  border-radius: 50%;
  box-shadow:
    0 0 0 1px #d5b363,
    0 12px 0 #c4a256,
    0 28px 40px #b8a56530;
  margin: 15px auto 28px;
  color: #735a20;
  transform: rotate(-6deg);
}
.medal-ring .ico {
  width: 112px;
  height: 112px;
  stroke-width: 1.1;
}
.medal-display .eyebrow {
  color: #7c6334;
  margin-top: 16px;
}
.medal-display h2 {
  font-size: 42px;
  margin-top: 10px;
}
.result-copy {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.result-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
}
.result-metrics strong {
  font:
    750 30px ui-monospace,
    monospace;
  display: block;
  letter-spacing: -1px;
}
.result-metrics small {
  color: var(--muted);
  display: block;
  margin-top: 8px;
}
.result-checks {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 13px;
}
.result-checks > div {
  display: flex;
  align-items: center;
  gap: 10px;
}
.result-checks .ico {
  color: var(--green);
  width: 18px;
  height: 18px;
}
.result-checks .failed .ico {
  color: var(--red);
}
.result-actions {
  display: flex;
  gap: 10px;
}
.result-actions > .primary {
  flex: 1;
}
.result-save {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
}
.result-save .ico {
  width: 16px;
  height: 16px;
}
.failure-art {
  height: 260px;
  background: #e6e4d7;
  border-radius: 20px;
  position: relative;
}
.failure-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: saturate(0.65);
}
.failure-art .chip {
  position: absolute;
  left: 20px;
  bottom: 20px;
}
.update-feature {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  align-items: center;
}
.update-feature > img {
  width: 180px;
  height: 150px;
  object-fit: contain;
  background: #e6e9d8;
  border-radius: 14px;
}
.update-feature h3 {
  font-size: 23px;
  margin-bottom: 10px;
}
.update-feature p {
  font-size: 13px;
  color: var(--muted);
}
.unlock-art {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e4e8d6;
  border-radius: 14px;
  margin-bottom: 18px;
  position: relative;
}
.unlock-art img {
  height: 100%;
  width: 100%;
  object-fit: contain;
}
.unlock-art .chip {
  position: absolute;
  left: 12px;
  top: 12px;
}
.center-screen {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.center-card {
  width: min(480px, 100%);
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}
.center-card .btn {
  min-width: 180px;
}
.spinner {
  width: 46px;
  height: 46px;
  border: 4px solid #dddccc;
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
}
.loading-art {
  height: 210px;
  width: 100%;
  object-fit: contain;
}
.error-emblem {
  width: 90px;
  height: 90px;
  background: #efdfd2;
  border-radius: 24px;
  display: grid;
  place-items: center;
  color: var(--orange-dark);
}
.error-emblem .ico {
  width: 42px;
  height: 42px;
}
.rotate-illustration {
  height: 120px;
  width: 65px;
  border: 5px solid var(--ink);
  border-radius: 16px;
  position: relative;
  transform: rotate(90deg);
  margin: 25px;
}
.rotate-illustration:after {
  content: "";
  position: absolute;
  width: 20px;
  height: 4px;
  background: var(--ink);
  bottom: 5px;
  left: 17px;
  border-radius: 6px;
}
.storage-status {
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  margin-bottom: 18px;
  font-size: 12px;
  line-height: 1.8;
}
.danger-zone {
  margin-top: 18px;
  border-top: 1px solid #e6d2c7;
  padding-top: 18px;
}
.danger-zone .btn {
  color: var(--red);
  border-color: #d9b1a5;
}
.steps {
  display: flex;
  gap: 5px;
  margin: 12px 0;
}
.steps span {
  height: 5px;
  width: 32px;
  background: #d9ddce;
  border-radius: 9px;
}
.steps span.on {
  background: var(--orange);
}
.tutorial-card {
  position: absolute;
  left: 24px;
  top: 104px;
  max-width: 295px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  pointer-events: auto;
}
.tutorial-card h3 {
  margin: 10px 0;
  font-size: 18px;
}
.tutorial-card p {
  font-size: 12px;
  color: var(--muted);
}
.tutorial-card .btn {
  min-height: 44px;
  padding: 10px;
  font-size: 12px;
  margin-top: 12px;
}
.tutorial-card .quiet {
  padding-left: 0;
}
.tutorial-card .row {
  justify-content: space-between;
}
.tutorial-card .eyebrow {
  color: var(--orange-dark);
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (min-width: 1700px) {
  .shell {
    padding-left: calc((100vw - 1500px) / 2);
    padding-right: calc((100vw - 1500px) / 2);
  }
}
@media (max-width: 1050px) {
  .shell {
    padding-left: max(28px, var(--safe-left));
    padding-right: max(28px, var(--safe-right));
  }
  .topbar {
    height: 80px;
  }
  .home-layout {
    gap: 16px;
    grid-template-columns: 1fr 1.1fr;
  }
  .home-copy h1 {
    font-size: 64px;
  }
  .hero {
    min-height: 360px;
  }
  .campaign-grid {
    gap: 12px;
  }
  .mission-card .picture {
    height: 150px;
  }
  .mission-card .card-copy {
    padding: 14px;
  }
  .list-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .briefing {
    gap: 20px;
  }
  .brief-art {
    min-height: 340px;
  }
  .brief-art > img {
    height: 280px;
  }
  .brief-content .block {
    padding: 18px;
  }
  .result-layout {
    gap: 24px;
  }
  .tool-panel-layout {
    grid-template-columns: 1fr 210px;
  }
  .dialog-head {
    padding: 20px 24px 16px;
  }
  .dialog-body {
    padding: 20px 24px;
  }
  .dialog-foot {
    padding: 14px 24px 18px;
  }
}
@media (max-height: 560px) and (min-width: 600px) {
  body {
    font-size: 13px;
  }
  .shell {
    padding-left: max(24px, var(--safe-left));
    padding-right: max(24px, var(--safe-right));
  }
  .topbar {
    height: 60px;
  }
  .stamp {
    height: 32px;
    width: 32px;
    border-radius: 8px;
  }
  .brand {
    font-size: 14px;
    gap: 8px;
  }
  .brand small {
    font-size: 8px;
  }
  .topnav {
    gap: 10px;
  }
  .topnav > .muted {
    display: none;
  }
  .topnav .btn {
    min-height: 44px;
    padding: 8px 12px;
  }
  .topnav .iconbtn {
    width: 44px;
    height: 44px;
  }
  .footer {
    height: 36px;
    font-size: 10px;
  }
  .footer .footer-right {
    visibility: hidden;
  }
  .shell-content {
    padding: 18px 0 14px;
  }
  .home-layout {
    grid-template-columns: 1fr 1.05fr;
    gap: 20px;
  }
  .home-copy {
    padding: 0;
  }
  .home-copy > .eyebrow {
    font-size: 9px;
    letter-spacing: 1.5px;
  }
  .home-copy h1 {
    font-size: 48px;
    letter-spacing: -2px;
    margin: 9px 0;
  }
  .home-copy > .description {
    font-size: 12px;
    line-height: 1.6;
    margin-bottom: 12px;
  }
  .home-copy > .description br {
    display: none;
  }
  .continue {
    min-height: 60px;
    padding: 10px 14px;
  }
  .continue span {
    font-size: 16px;
    gap: 4px;
  }
  .continue small {
    font-size: 10px;
  }
  .mode-row {
    margin-top: 10px;
    gap: 8px;
  }
  .mode-tile {
    min-height: 54px;
    padding: 10px;
    gap: 8px;
  }
  .mode-tile span {
    gap: 4px;
    font-size: 12px;
  }
  .mode-tile small {
    font-size: 10px;
  }
  .mode-tile > .ico {
    width: 20px;
  }
  .home-low {
    margin-top: 4px;
    gap: 12px;
  }
  .home-low button {
    font-size: 10px;
  }
  .home-version {
    display: none;
  }
  .hero {
    min-height: 250px;
  }
  .hero-caption {
    top: 0;
    right: 0;
  }
  .hero-caption > span {
    font-size: 10px;
  }
  .hero .floating-tnt {
    width: 76px;
    bottom: 8%;
  }
  .hero:after {
    font-size: 8px;
    letter-spacing: 1.5px;
    bottom: 2px;
  }
  .hero-label {
    top: 23%;
    font-size: 8px;
  }
  .screen-heading {
    margin-bottom: 14px;
  }
  .screen-heading h1 {
    font-size: 28px;
  }
  .screen-heading .eyebrow {
    font-size: 9px;
    margin-bottom: 5px;
  }
  .screen-heading p {
    font-size: 11px;
    margin-top: 5px;
  }
  .screen-heading > .chip {
    font-size: 10px;
  }
  .chapter-tabs {
    padding-bottom: 8px;
    margin-bottom: 12px;
    gap: 6px;
  }
  .tab {
    padding: 8px 12px;
    min-height: 44px;
    font-size: 12px;
  }
  .chapter-tabs > .muted {
    font-size: 10px;
  }
  .campaign-grid {
    gap: 10px;
  }
  .mission-card .picture {
    height: 114px;
  }
  .mission-card .card-copy {
    padding: 12px;
    gap: 8px;
  }
  .mission-card h3 {
    font-size: 13px;
  }
  .mission-card p {
    font-size: 10px;
    min-height: 32px;
  }
  .mission-card .btn {
    font-size: 11px;
    padding: 10px;
    min-height: 44px;
  }
  .card-meta {
    font-size: 10px;
    gap: 6px;
  }
  .mission-card .number {
    font-size: 10px;
    top: 8px;
    left: 10px;
  }
  .medal-corner .chip {
    font-size: 9px;
    padding: 4px 5px;
  }
  .chapter-note {
    font-size: 11px;
    margin-top: 12px;
    padding: 10px 14px;
  }
  .list-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }
  .list-grid .picture {
    height: 90px;
  }
  .map-grid {
    gap: 10px;
  }
  .map-card {
    min-height: 172px;
    grid-template-columns: 43% 1fr;
  }
  .map-card > div {
    padding: 14px;
    gap: 8px;
  }
  .map-card h3 {
    font-size: 15px;
  }
  .map-card p {
    font-size: 11px;
  }
  .map-card .btn {
    min-height: 44px;
    padding: 8px 12px;
    font-size: 11px;
  }
  .briefing {
    grid-template-columns: 0.9fr 1fr;
    gap: 20px;
  }
  .brief-art {
    min-height: 236px;
    border-radius: 14px;
  }
  .brief-art > img {
    height: 200px;
  }
  .brief-art > .chip {
    top: 12px;
    left: 12px;
    font-size: 10px;
  }
  .brief-caption {
    padding: 0 14px 14px;
    font-size: 10px;
  }
  .brief-content {
    gap: 12px;
  }
  .brief-content .block {
    padding: 12px 16px;
    border-radius: 12px;
  }
  .brief-content h3 {
    font-size: 14px;
  }
  .objective-line {
    padding: 8px 0;
    gap: 8px;
  }
  .objective-line strong {
    font-size: 12px;
  }
  .objective-line small {
    font-size: 10px;
    margin-top: 3px;
  }
  .objective-line .ico {
    width: 18px;
    height: 18px;
  }
  .brief-budget {
    padding: 10px 12px;
  }
  .brief-budget strong {
    font-size: 22px;
  }
  .brief-budget > span {
    font-size: 10px;
  }
  .tool-mini {
    font-size: 10px;
    padding: 4px 7px;
  }
  .tool-mini img {
    width: 27px;
    height: 25px;
  }
  .medal-tier {
    padding: 9px 7px;
    font-size: 10px;
  }
  .medal-tier strong {
    font-size: 11px;
  }
  .medal-tier small {
    font-size: 10px;
  }
  .medal-tier svg {
    width: 16px;
    height: 16px;
  }
  .brief-start .btn {
    min-height: 44px;
    padding: 10px;
    font-size: 12px;
  }
  .game-top {
    top: max(12px, var(--safe-top));
    left: max(16px, var(--safe-left));
    right: max(16px, var(--safe-right));
  }
  .game-label {
    padding: 9px 12px;
    max-width: 260px;
    gap: 8px;
    border-radius: 10px;
  }
  .game-label strong {
    font-size: 12px;
  }
  .game-label small {
    font-size: 10px;
  }
  .game-label .ico {
    width: 18px;
    height: 18px;
  }
  .hud-buttons .btn {
    min-height: 44px;
    height: 44px;
    padding: 9px;
    width: auto;
    font-size: 11px;
  }
  .hud-buttons .iconbtn {
    width: 44px;
  }
  .hud-budget {
    top: max(12px, var(--safe-top));
    padding: 8px 12px;
    gap: 8px;
    min-height: 46px;
  }
  .hud-budget b {
    font-size: 20px;
  }
  .hud-budget span,
  .hud-budget em {
    font-size: 10px;
  }
  .hud-goal {
    top: 76px;
    left: max(16px, var(--safe-left));
    width: 202px;
    padding: 12px;
    border-radius: 10px;
  }
  .hud-goal header {
    font-size: 10px;
  }
  .hud-goal .percent {
    font-size: 24px;
    margin: 6px 0;
  }
  .hud-goal .percent small {
    font-size: 10px;
  }
  .goal-small {
    font-size: 10px;
    margin-top: 8px;
  }
  .hud-bottom {
    left: max(16px, var(--safe-left));
    right: max(16px, var(--safe-right));
    bottom: max(16px, var(--safe-bottom));
    gap: 10px;
  }
  .loadout {
    padding: 4px;
    border-radius: 10px;
    gap: 4px;
  }
  .loadout-button {
    min-height: 58px;
    min-width: 58px;
    padding: 5px 6px;
    font-size: 10px;
    gap: 2px;
  }
  .loadout-button img {
    width: 30px;
    height: 24px;
  }
  .loadout-button small {
    font-size: 9px;
  }
  .loadout-button kbd {
    display: none;
  }
  .game-actions {
    gap: 6px;
  }
  .game-actions .btn {
    min-height: 48px;
    padding: 10px;
    font-size: 11px;
  }
  .game-actions .btn .ico {
    width: 18px;
    height: 18px;
  }
  .game-actions .place-btn {
    min-width: 92px;
  }
  .game-actions .ignite-btn {
    min-width: 80px;
  }
  .game-actions .settle-btn {
    bottom: 60px;
    font-size: 11px;
    min-height: 44px;
  }
  .crosshair {
    width: 22px;
    height: 22px;
  }
  .joystick {
    position: absolute;
    bottom: 18px;
    left: 24px;
    width: 80px;
    height: 80px;
    border: 1px solid #ffffff90;
    border-radius: 50%;
    background: #ffffff18;
    pointer-events: auto;
  }
  .joystick:after {
    content: "";
    position: absolute;
    left: 23px;
    top: 23px;
    width: 32px;
    height: 32px;
    background: #fff8;
    border: 1px solid #fffa;
    border-radius: 50%;
  }
  .touch-input .loadout {
    margin-left: 108px;
    max-width: 40vw;
  }
  .touch-input .game-actions kbd {
    display: none;
  }
  .touch-input .game-actions .jump {
    display: inline-flex;
  }
  .desktop-input .game-actions .jump {
    display: none;
  }
  .touch-input .game-actions .remote-text {
    display: none;
  }
  .build-context .row {
    gap: 8px;
  }
  .scrim {
    padding: max(12px, var(--safe-top)) max(16px, var(--safe-right))
      max(12px, var(--safe-bottom)) max(16px, var(--safe-left));
  }
  .dialog {
    border-radius: 16px;
  }
  .dialog-head {
    padding: 12px 18px 10px;
  }
  .dialog-head .eyebrow {
    font-size: 9px;
    margin-bottom: 4px;
  }
  .dialog-head h2 {
    font-size: 20px;
  }
  .dialog-head .iconbtn {
    width: 44px;
    height: 44px;
    min-height: 44px;
  }
  .dialog-body {
    padding: 14px 18px;
  }
  .dialog-foot {
    padding: 10px 18px 12px;
    gap: 10px;
    font-size: 10px;
  }
  .dialog-foot .btn {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 12px;
  }
  .dialog-foot small {
    font-size: 10px;
  }
  .dialog p.lead {
    font-size: 12px;
    margin-bottom: 12px;
  }
  .dialog.wide {
    width: min(810px, 100%);
  }
  .settings-layout {
    grid-template-columns: 145px 1fr;
    gap: 20px;
    min-height: 200px;
  }
  .settings-nav button {
    min-height: 44px;
    font-size: 12px;
    padding: 10px 12px;
  }
  .settings-content h3 {
    font-size: 15px;
    margin-bottom: 8px;
  }
  .setting {
    padding: 10px 0;
    font-size: 12px;
    gap: 10px;
  }
  .setting small {
    font-size: 10px;
    margin-top: 4px;
  }
  .setting input[type="range"] {
    width: 150px;
  }
  .setting select {
    font-size: 12px;
    padding: 8px;
  }
  .tool-panel-layout {
    grid-template-columns: 1fr 180px;
    gap: 14px;
  }
  .tool-grid {
    gap: 8px;
  }
  .tool-card {
    min-height: 94px;
    padding: 10px;
    gap: 8px;
  }
  .tool-card[aria-pressed="true"] {
    padding: 9px;
  }
  .tool-card > img {
    width: 58px;
    height: 60px;
  }
  .tool-card strong {
    font-size: 12px;
  }
  .tool-card small {
    font-size: 10px;
  }
  .tool-card > span {
    gap: 6px;
  }
  .tool-detail {
    padding: 12px;
    gap: 10px;
    font-size: 10px;
  }
  .tool-detail h3 {
    font-size: 14px;
  }
  .tool-detail .btn {
    min-height: 44px;
    padding: 8px;
    font-size: 11px;
  }
  .tool-tabs {
    margin-bottom: 10px;
  }
  .notice {
    font-size: 10px;
    padding: 10px;
    gap: 8px;
  }
  .notice .ico {
    width: 16px;
    height: 16px;
  }
  .prefab-tile {
    min-height: 130px;
    gap: 5px;
    padding: 10px;
  }
  .prefab-tile img {
    height: 65px;
  }
  .prefab-tile strong {
    font-size: 12px;
  }
  .prefab-tile small {
    font-size: 10px;
  }
  .material-grid {
    gap: 8px;
  }
  .material-grid .prefab-tile {
    min-height: 137px;
  }
  .material-cube {
    width: 48px;
    height: 48px;
  }
  .hint-step {
    font-size: 11px;
    padding: 10px;
    margin-top: 10px;
  }
  .result-layout {
    gap: 24px;
    grid-template-columns: 0.75fr 1fr;
    min-height: 100%;
  }
  .medal-display {
    padding: 0;
  }
  .medal-ring {
    width: 130px;
    height: 130px;
    border-width: 8px;
    margin: 5px auto 16px;
    box-shadow:
      0 0 0 1px #d5b363,
      0 7px 0 #c4a256,
      0 16px 24px #b8a56530;
  }
  .medal-ring .ico {
    width: 68px;
    height: 68px;
  }
  .medal-display .eyebrow {
    font-size: 9px;
    margin-top: 10px;
  }
  .medal-display h2 {
    font-size: 28px;
    margin-top: 6px;
  }
  .result-copy {
    gap: 12px;
  }
  .result-copy h1 {
    font-size: 28px;
  }
  .result-copy > .muted {
    font-size: 11px;
  }
  .result-metrics {
    padding: 14px;
  }
  .result-metrics strong {
    font-size: 23px;
  }
  .result-metrics small {
    font-size: 10px;
    margin-top: 6px;
  }
  .result-checks {
    font-size: 11px;
    gap: 8px;
  }
  .result-actions .btn {
    min-height: 44px;
    padding: 10px;
    font-size: 12px;
  }
  .result-save {
    font-size: 10px;
  }
  .failure-art {
    height: 180px;
  }
  .pause-dialog {
    width: 400px;
  }
  .pause-dialog .dialog-body {
    gap: 8px;
  }
  .pause-dialog .dialog-body .btn {
    min-height: 44px;
    padding: 10px;
    font-size: 12px;
  }
  .pause-dialog .pause-stats {
    padding: 10px;
    font-size: 10px;
    margin-bottom: 0;
  }
  .paused-state {
    font-size: 11px;
    margin-bottom: 0;
  }
  .update-feature {
    grid-template-columns: 140px 1fr;
    gap: 16px;
  }
  .update-feature > img {
    width: 140px;
    height: 120px;
  }
  .update-feature h3 {
    font-size: 18px;
  }
  .update-feature p {
    font-size: 11px;
  }
  .unlock-art {
    height: 110px;
    margin-bottom: 12px;
  }
  .center-card {
    gap: 14px;
  }
  .center-card h1 {
    font-size: 28px;
  }
  .center-card p {
    font-size: 12px;
  }
  .loading-art {
    height: 110px;
  }
  .spinner {
    width: 32px;
    height: 32px;
    border-width: 3px;
  }
  .error-emblem {
    width: 60px;
    height: 60px;
    border-radius: 16px;
  }
  .error-emblem .ico {
    width: 30px;
    height: 30px;
  }
  .center-card .btn {
    min-height: 44px;
  }
  .tutorial-card {
    left: 16px;
    top: 76px;
    width: 225px;
    padding: 14px;
  }
  .tutorial-card h3 {
    font-size: 14px;
    margin: 8px 0;
  }
  .tutorial-card p {
    font-size: 10px;
  }
  .tutorial-card .btn {
    font-size: 10px;
    margin-top: 8px;
  }
  .control-grid {
    gap: 8px;
  }
  .control-item {
    font-size: 10px;
    padding: 9px;
    min-height: 44px;
  }
  .confirm-copy h3 {
    font-size: 16px;
  }
  .confirm-copy p {
    font-size: 12px;
  }
  .confirm-detail {
    font-size: 11px;
    margin-top: 12px;
  }
  .warning-emblem {
    width: 42px;
    height: 42px;
  }
  .storage-status {
    font-size: 11px;
    margin-bottom: 12px;
  }
  .danger-zone {
    margin-top: 12px;
    padding-top: 12px;
  }
}
@media (max-width: 599px) {
  .shell {
    padding: 0 max(20px, var(--safe-right)) 0 max(20px, var(--safe-left));
  }
  .topbar {
    height: 72px;
  }
  .brand {
    font-size: 13px;
  }
  .brand small {
    font-size: 7px;
  }
  .stamp {
    width: 32px;
    height: 32px;
  }
  .topnav > .muted,
  .topnav > .separator,
  .topnav > .chip {
    display: none;
  }
  .topnav {
    gap: 6px;
  }
  .topnav .btn {
    min-height: 44px;
    width: 44px;
    padding: 0;
  }
  .topnav .btn .back-label {
    display: none;
  }
  .shell-content {
    padding: 20px 0;
  }
  .home-layout {
    display: flex;
    flex-direction: column-reverse;
    gap: 0;
  }
  .hero {
    min-height: 230px;
    width: 100%;
  }
  .hero > img {
    height: 250px;
    width: 120%;
    object-fit: contain;
  }
  .hero:before {
    width: 70%;
  }
  .hero-caption {
    top: 0;
    right: 0;
  }
  .hero-caption > span {
    font-size: 10px;
  }
  .hero-label {
    font-size: 9px;
    left: 0;
    top: 20%;
  }
  .hero .floating-tnt {
    width: 75px;
    bottom: 4%;
  }
  .hero:after {
    bottom: 10px;
    font-size: 8px;
    letter-spacing: 1px;
  }
  .home-copy {
    width: 100%;
    padding: 10px 0;
  }
  .home-copy h1 {
    font-size: 56px;
    margin: 10px 0;
    letter-spacing: -3px;
  }
  .home-copy > .description {
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 18px;
  }
  .home-copy > .description br {
    display: none;
  }
  .home-copy > .eyebrow {
    font-size: 9px;
  }
  .home-low {
    margin-top: 8px;
  }
  .home-low button {
    font-size: 11px;
  }
  .home-version {
    display: none;
  }
  .mode-tile {
    padding: 12px;
    min-height: 70px;
  }
  .mode-tile span {
    font-size: 13px;
  }
  .mode-tile small {
    font-size: 10px;
  }
  .footer {
    height: 42px;
    font-size: 9px;
  }
  .footer-right {
    display: none;
  }
  .screen-heading {
    align-items: flex-start;
    margin-bottom: 18px;
  }
  .screen-heading h1 {
    font-size: 30px;
  }
  .screen-heading p {
    font-size: 12px;
  }
  .screen-heading > .chip {
    display: none;
  }
  .chapter-tabs {
    display: block;
  }
  .chapter-tabs .tabs {
    gap: 3px;
    flex-wrap: nowrap;
  }
  .chapter-tabs .tab {
    padding: 10px;
    font-size: 11px;
  }
  .chapter-tabs > .muted {
    display: block;
    margin-top: 10px;
    font-size: 11px;
  }
  .campaign-grid,
  .list-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .mission-card .picture {
    height: 110px;
  }
  .mission-card .card-copy {
    padding: 12px;
    gap: 9px;
  }
  .mission-card h3 {
    font-size: 14px;
  }
  .mission-card p {
    font-size: 11px;
    min-height: 38px;
  }
  .mission-card .btn {
    font-size: 11px;
    padding: 10px;
  }
  .card-meta {
    font-size: 10px;
    gap: 5px;
  }
  .mission-card .number {
    font-size: 10px;
    left: 10px;
    top: 10px;
  }
  .medal-corner {
    right: 5px !important;
    top: 7px !important;
  }
  .medal-corner .chip {
    font-size: 9px;
    padding: 3px 5px;
  }
  .chapter-note {
    font-size: 11px;
    padding: 12px;
  }
  .chapter-note .chip {
    display: none;
  }
  .map-grid {
    grid-template-columns: 1fr;
  }
  .map-card {
    min-height: 170px;
  }
  .map-card > div {
    padding: 16px;
  }
  .map-card h3 {
    font-size: 16px;
  }
  .map-card .btn {
    font-size: 12px;
  }
  .briefing {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .brief-art {
    min-height: 225px;
  }
  .brief-art > img {
    height: 195px;
  }
  .brief-caption {
    font-size: 10px;
    padding: 0 16px 16px;
  }
  .brief-content {
    gap: 16px;
  }
  .brief-content .block {
    padding: 18px;
  }
  .brief-start .primary {
    min-height: 52px;
  }
  .medal-tier {
    padding: 10px 8px;
  }
  .medal-tier strong {
    font-size: 12px;
  }
  .medal-tier small {
    font-size: 10px;
  }
  .scrim {
    padding: max(14px, var(--safe-top)) 12px max(14px, var(--safe-bottom));
  }
  .dialog {
    border-radius: 18px;
  }
  .dialog-head {
    padding: 16px;
  }
  .dialog-head .eyebrow {
    font-size: 9px;
  }
  .dialog-head h2 {
    font-size: 21px;
  }
  .dialog-body {
    padding: 16px;
  }
  .dialog-foot {
    padding: 12px 16px 16px;
    font-size: 11px;
  }
  .dialog-foot .btn {
    padding: 12px;
    font-size: 12px;
    min-width: 100px;
  }
  .dialog-foot small {
    font-size: 10px;
  }
  .settings-layout {
    display: block;
    min-height: 0;
  }
  .settings-nav {
    flex-direction: row;
    gap: 2px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
    overflow: auto;
  }
  .settings-nav button {
    padding: 10px;
    min-width: 66px;
    flex-direction: column;
    gap: 7px;
    font-size: 11px;
  }
  .settings-nav button .ico {
    width: 18px;
    height: 18px;
  }
  .setting {
    font-size: 13px;
    gap: 8px;
    padding: 14px 0;
  }
  .setting small {
    font-size: 10px;
  }
  .setting input[type="range"] {
    width: 110px;
  }
  .sliderwrap {
    gap: 6px;
  }
  .sliderwrap output {
    font-size: 11px;
    min-width: 33px;
  }
  .setting select {
    font-size: 12px;
    padding: 8px;
  }
  .tool-panel-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .tool-detail {
    padding: 14px;
  }
  .tool-detail p {
    font-size: 11px;
  }
  .tool-grid {
    gap: 8px;
  }
  .tool-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    min-height: 165px;
  }
  .tool-card[aria-pressed="true"] {
    padding: 11px;
  }
  .tool-card > img {
    width: 76px;
    height: 70px;
  }
  .tool-card > span {
    gap: 6px;
    align-items: center;
  }
  .tool-card strong {
    font-size: 13px;
  }
  .tool-card small {
    font-size: 10px;
  }
  .tool-tabs .tabs {
    gap: 2px;
    flex-wrap: nowrap;
  }
  .tool-tabs .tab {
    padding: 10px;
    font-size: 12px;
  }
  .tool-grid.prefab-grid {
    grid-template-columns: 1fr 1fr;
  }
  .prefab-tile img {
    height: 80px;
  }
  .prefab-tile small {
    font-size: 10px;
  }
  .material-grid {
    gap: 8px;
  }
  .material-grid .prefab-tile {
    min-height: 130px;
    padding: 8px;
  }
  .material-cube {
    width: 42px;
    height: 42px;
  }
  .prefab-tile strong {
    font-size: 12px;
  }
  .update-feature {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }
  .update-feature > img {
    width: 100%;
    height: 155px;
  }
  .update-feature h3 {
    font-size: 22px;
  }
  .result-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }
  .medal-display {
    padding: 0;
  }
  .medal-ring {
    width: 140px;
    height: 140px;
    border-width: 8px;
    margin: 8px auto 22px;
  }
  .medal-ring .ico {
    width: 76px;
    height: 76px;
  }
  .medal-display h2 {
    font-size: 30px;
  }
  .result-copy {
    gap: 16px;
    width: 100%;
  }
  .result-copy h1 {
    font-size: 28px;
  }
  .result-copy > .muted {
    font-size: 12px;
  }
  .result-metrics {
    padding: 16px;
  }
  .result-metrics strong {
    font-size: 25px;
  }
  .result-metrics small {
    font-size: 10px;
  }
  .result-checks {
    font-size: 12px;
  }
  .result-actions .btn {
    font-size: 12px;
    padding: 12px;
  }
  .failure-art {
    height: 190px;
    width: 100%;
  }
  .control-grid {
    grid-template-columns: 1fr;
  }
  .center-card h1 {
    font-size: 30px;
  }
  .center-card p {
    font-size: 13px;
  }
  .loading-art {
    height: 160px;
  }
  .confirm-copy {
    gap: 12px;
  }
  .confirm-copy h3 {
    font-size: 18px;
  }
  .confirm-copy p {
    font-size: 13px;
  }
  .warning-emblem {
    width: 42px;
    height: 42px;
  }
  .game .game-ui {
    display: none;
  }
  .game:after {
    content: "请横屏体验游戏内界面";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: var(--paper);
    font-size: 22px;
    font-weight: 750;
  }
  .game .rotate-action {
    position: absolute;
    z-index: 2;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
  }
  .pause-dialog .dialog-body {
    gap: 10px;
  }
}
.shell-content {
  overflow-x: hidden;
}
.home-layout {
  min-height: 0;
  height: 100%;
}
.hero > img {
  flex-shrink: 0;
}
.hero:after {
  right: 10px;
}
.home-low .ico {
  width: 16px;
  height: 16px;
}
button.btn:disabled {
  background: #e8e7dc !important;
  color: #687066 !important;
  border-color: #cbd1c5 !important;
  box-shadow: none !important;
  opacity: 0.85;
}
@media (max-height: 560px) and (min-width: 600px) {
  .home-copy h1 {
    font-size: 36px;
    line-height: 1.05;
    letter-spacing: -1.5px;
    margin: 8px 0;
  }
  .home-copy > .description {
    display: none;
  }
  .home-copy > .eyebrow {
    font-size: 8px;
  }
  .continue {
    min-height: 54px;
    padding: 9px 14px;
  }
  .continue span {
    font-size: 14px;
  }
  .continue small {
    font-size: 9px;
  }
  .mode-row {
    margin-top: 8px;
  }
  .mode-tile {
    min-height: 50px;
    padding: 8px 10px;
  }
  .mode-tile span {
    font-size: 11px;
    gap: 3px;
  }
  .mode-tile small {
    font-size: 9px;
  }
  .home-low {
    margin: 0;
  }
  .home-low button {
    font-size: 9px;
    min-height: 44px;
  }
  .hero {
    min-height: 220px;
  }
}
@media (max-height: 560px) and (min-width: 600px) {
  .brief-content {
    padding-bottom: 74px;
  }
  .brief-start {
    position: fixed;
    bottom: 36px;
    right: max(24px, var(--safe-right));
    width: calc(52% - 24px);
    padding: 10px 0 12px;
    background: var(--paper);
    z-index: 4;
    border-top: 1px solid var(--line);
  }
  .brief-start .btn {
    min-height: 46px;
  }
  .result-copy {
    padding-bottom: 90px;
  }
  .result-actions {
    position: fixed;
    bottom: 36px;
    right: max(24px, var(--safe-right));
    width: calc(55% - 24px);
    padding: 10px 0 12px;
    background: var(--paper);
    border-top: 1px solid var(--line);
    z-index: 4;
  }
  .result-actions .btn {
    min-height: 46px;
  }
  .result-save {
    font-size: 10px;
  }
  .game-actions .btn {
    font-size: 12px;
  }
  .hud-goal header {
    font-size: 11px;
  }
  .hud-goal .goal-small {
    font-size: 11px;
  }
  .touch-input .loadout {
    max-width: 39vw;
  }
  .flight-buttons {
    position: absolute;
    right: max(16px, var(--safe-right));
    top: 76px;
    display: flex;
    gap: 6px;
  }
  .flight-buttons .btn {
    min-height: 44px;
    font-size: 11px;
    padding: 10px;
  }
  .result-copy .result-metrics {
    padding: 12px;
  }
  .result-copy .result-checks {
    gap: 6px;
  }
  .result-copy > .muted {
    font-size: 10px;
  }
}
.flight-buttons {
  position: absolute;
  right: 24px;
  top: 104px;
  display: flex;
  gap: 8px;
  pointer-events: auto;
}
.touch-input.sandbox .loadout .loadout-button:not([aria-pressed="true"]) {
  display: none;
}
@media (max-height: 560px) and (min-width: 600px) {
  .flight-buttons {
    right: max(16px, var(--safe-right));
    top: 76px;
  }
}
@media (max-width: 599px) {
  .home-layout {
    height: auto;
  }
  .shell-content {
    overflow-x: hidden;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
body.reduced *,
body.reduced *:before,
body.reduced *:after {
  animation: none !important;
  transition: none !important;
}
html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
#game {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
#ui {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
.shell {
  width: 100%;
  pointer-events: auto;
}
.scrim,
.panel {
  pointer-events: auto;
}
[hidden] {
  display: none !important;
}
.panel:not(.home-copy) {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  max-width: 540px;
  margin: auto;
}
.panel:not(.home-copy) button {
  display: block;
  width: 100%;
  margin: 10px 0;
  min-height: 44px;
}
.panel:not(.home-copy) h1 {
  margin-bottom: 20px;
}
.upgrade-notice {
  font-size: 11px;
  line-height: 1.7;
  margin-top: 8px;
}
.upgrade-notice button {
  min-height: 44px;
}
.topnav > .muted {
  font-size: 12px;
}
.pending-save {
  pointer-events: auto;
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 8px 16px;
}
.campaign-menu {
  width: 100%;
} /* The HUD is transparent over the running PlayCanvas world. */
.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hud button {
  pointer-events: auto;
}
.game-top {
  z-index: 2;
}
.game-label {
  max-width: 330px;
}
.game-label small {
  font-size: 12px;
}
.hud-buttons {
  align-items: center;
}
.hud-buttons button {
  background: var(--surface);
}
.hud-goal {
  max-height: calc(100dvh - 245px);
  overflow: auto;
  overscroll-behavior: contain;
  pointer-events: auto;
}
.hud-goal .percent b {
  font-weight: 750;
}
.goal-small {
  line-height: 1.7;
  display: block;
}
.campaign-objectives {
  white-space: pre-line;
  line-height: 1.7;
  margin-top: 8px;
  font-size: 12px;
}
.campaign-objectives.failed {
  color: #ffd7c2;
  font-weight: 700;
}
.hud-budget {
  z-index: 3;
}
.crosshair {
  font-size: 18px;
  color: white;
  text-align: center;
  line-height: 24px;
}
.crosshair:after {
  display: none;
}
.placement-status,
.hint {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  background: #24372ff5;
  border: 1px solid #ffffff22;
  border-radius: 8px;
  text-align: center;
  max-width: 42vw;
  line-height: 1.6;
  font-size: 12px;
  padding: 6px 10px;
  pointer-events: none;
}
.placement-status {
  top: calc(48% + 32px);
}
.hint {
  top: calc(48% + 70px);
}
.hint:empty,
.bomb-status:empty,
.audio-status:empty {
  display: none;
}
.bomb-status {
  position: absolute;
  left: 50%;
  top: 80px;
  transform: translateX(-50%);
  color: white;
  background: #24372ff5;
  max-width: calc(100vw - 560px);
  text-align: center;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  line-height: 1.6;
}
.audio-status {
  position: absolute;
  left: 50%;
  top: 128px;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 11px;
  min-height: 44px;
  max-width: 35vw;
}
.toolstrip,
.sandbox-loadout {
  pointer-events: auto;
}
.toolstrip button,
.sandbox-loadout button {
  margin: 0;
}
.loadout-button img {
  width: 42px;
  height: 31px;
}
.quick-retry {
  position: absolute;
  right: max(24px, var(--safe-right));
  top: 80px;
  pointer-events: auto;
  min-height: 44px;
  font-size: 12px;
}
.game-actions .settle-btn {
  position: absolute;
  right: 0;
  bottom: 76px;
  min-width: 110px;
}
.actions .jump {
  display: none;
}
.joystick {
  display: none;
  position: absolute;
  bottom: max(24px, var(--safe-bottom));
  left: max(24px, var(--safe-left));
  width: 90px;
  height: 90px;
  pointer-events: auto;
  border-radius: 50%;
  border: 1px solid #ffffff99;
  background: #ffffff25;
  touch-action: none;
}
.joystick:after {
  content: "";
  position: absolute;
  width: 34px;
  height: 34px;
  left: 27px;
  top: 27px;
  background: #fff9;
  border: 1px solid white;
  border-radius: 50%;
}
.look-zone {
  position: absolute;
  top: 80px;
  bottom: 120px;
  right: 0;
  width: 60%;
  pointer-events: none;
  touch-action: none;
}
#ui[data-input-mode="touch"] .joystick {
  display: block;
}
#ui[data-input-mode="touch"] .look-zone {
  pointer-events: auto;
}
#ui[data-input-mode="touch"] .actions .jump {
  display: inline-flex;
}
#ui[data-input-mode="touch"] .loadout {
  margin-left: 110px;
  max-width: 40vw;
}
#ui[data-input-mode="touch"]
  .sandbox-loadout
  .loadout-button:not([aria-pressed="true"]) {
  display: none;
}
#ui[data-input-mode="touch"] .loadout kbd {
  display: none;
}
.sandbox-tools {
  position: absolute;
  left: max(24px, var(--safe-left));
  top: 104px;
  width: 220px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: auto;
}
.sandbox-command-row {
  display: flex;
  gap: 6px;
}
.sandbox-command-row button {
  padding: 9px;
  min-height: 44px;
  font-size: 12px;
}
#open-tools {
  flex: 1;
  text-align: left;
  justify-content: flex-start;
}
#open-tools span {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 10px;
  font-weight: 500;
}
#current-tool {
  font-size: 12px;
}
.sandbox-meta {
  padding: 0 6px;
  border: 1px solid #ffffff88;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #fffdf7f2;
  min-height: 44px;
  font-size: 11px;
}
.sandbox-meta span {
  flex: 1;
  white-space: nowrap;
}
#sandbox-save {
  border: 0;
  min-height: 44px;
  min-width: 60px;
  background: transparent;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
}
.prefab-controls .btn {
  width: 100%;
  min-height: 44px;
  font-size: 12px;
  padding: 9px;
}
.tool-context {
  background: #fffdf7f2;
  border-radius: 9px;
  font-size: 11px;
  padding: 9px;
  line-height: 1.6;
}
.flight-controls {
  position: absolute;
  right: max(24px, var(--safe-right));
  top: 104px;
  display: flex;
  gap: 6px;
  pointer-events: auto;
}
.flight-controls button {
  min-height: 44px;
  font-size: 12px;
}
.tutorial {
  position: absolute;
  left: max(24px, var(--safe-left));
  top: 104px;
  width: 290px;
  padding: 18px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.7;
  pointer-events: auto;
}
.tutorial .btn {
  font-size: 12px;
  margin-top: 10px;
  min-height: 44px;
}
.hud:has(.tutorial) .hud-goal {
  display: none;
}
.prefab-controls[hidden] {
  display: none;
}
.tool-context:empty {
  display: none;
}
@media (max-height: 560px) {
  .game-top {
    top: max(12px, var(--safe-top));
    left: max(16px, var(--safe-left));
    right: max(16px, var(--safe-right));
  }
  .game-label {
    max-width: 215px;
    padding: 9px 12px;
    gap: 8px;
  }
  .game-label strong {
    font-size: 12px;
  }
  .game-label small {
    font-size: 10px;
  }
  .hud-budget {
    top: max(12px, var(--safe-top));
    padding: 8px 12px;
    gap: 8px;
    min-height: 46px;
  }
  .hud-budget b {
    font-size: 21px;
  }
  .hud-budget span,
  .hud-budget em {
    font-size: 10px;
  }
  .hud-buttons .btn {
    min-height: 44px;
    font-size: 11px;
    padding: 8px;
  }
  .hud-buttons .iconbtn {
    width: 44px;
    height: 44px;
  }
  .hud-goal {
    top: 76px;
    left: max(16px, var(--safe-left));
    width: 202px;
    padding: 12px;
    max-height: calc(100dvh - 205px);
  }
  .hud-goal header {
    font-size: 10px;
  }
  .hud-goal .percent {
    font-size: 24px;
    margin: 6px 0;
  }
  .goal-small,
  .campaign-objectives {
    font-size: 10px;
    line-height: 1.6;
    margin-top: 7px;
  }
  .hud-bottom {
    left: max(16px, var(--safe-left));
    right: max(16px, var(--safe-right));
    bottom: max(16px, var(--safe-bottom));
    gap: 8px;
  }
  .loadout {
    gap: 4px;
    padding: 4px;
  }
  .loadout-button {
    min-height: 58px;
    min-width: 54px;
    font-size: 10px;
    padding: 5px;
    gap: 2px;
  }
  .loadout-button img {
    width: 30px;
    height: 24px;
  }
  .loadout-button small {
    font-size: 9px;
  }
  .actions {
    gap: 6px;
  }
  .actions .btn {
    min-height: 48px;
    font-size: 12px;
    padding: 10px;
  }
  .actions .place-btn {
    min-width: 86px;
  }
  .actions .ignite-btn {
    min-width: 68px;
  }
  .actions .btn .ico {
    width: 18px;
    height: 18px;
  }
  .actions .iconbtn {
    width: 44px;
    min-width: 44px;
  }
  .actions .settle-btn {
    min-height: 44px;
    bottom: 62px;
    min-width: 94px;
  }
  .joystick {
    bottom: max(16px, var(--safe-bottom));
    width: 80px;
    height: 80px;
  }
  .joystick:after {
    width: 30px;
    height: 30px;
    left: 24px;
    top: 24px;
  }
  .sandbox-tools {
    left: max(16px, var(--safe-left));
    top: 76px;
    width: 194px;
  }
  .sandbox-command-row button {
    font-size: 11px;
    padding: 8px;
  }
  .sandbox-command-row .ico {
    width: 18px;
    height: 18px;
  }
  .sandbox-meta {
    font-size: 10px;
    gap: 4px;
    padding: 0 4px;
  }
  #current-tool {
    font-size: 11px;
  }
  #sandbox-save {
    font-size: 9px;
    min-width: 58px;
  }
  .tool-context {
    font-size: 10px;
    padding: 7px;
  }
  .flight-controls {
    top: 76px;
    right: max(16px, var(--safe-right));
  }
  .flight-controls button {
    font-size: 11px;
    padding: 8px;
  }
  .quick-retry {
    top: 76px;
    right: max(16px, var(--safe-right));
    font-size: 11px;
  }
  .placement-status {
    font-size: 10px;
    top: calc(48% + 26px);
    max-width: 39vw;
  }
  .hint {
    font-size: 10px;
    top: calc(48% + 60px);
    max-width: 39vw;
  }
  .bomb-status {
    top: 70px;
    max-width: calc(100vw - 430px);
    font-size: 10px;
    padding: 5px 8px;
  }
  .audio-status {
    top: 107px;
    font-size: 10px;
    max-width: 34vw;
  }
  .crosshair {
    font-size: 16px;
    line-height: 19px;
  }
  .tutorial {
    top: 76px;
    left: max(16px, var(--safe-left));
    width: 220px;
    font-size: 11px;
    padding: 12px;
  }
  .tutorial .btn {
    font-size: 10px;
    margin-top: 8px;
  }
  .look-zone {
    bottom: 105px;
  }
  .prefab-controls .btn {
    font-size: 11px;
    padding: 8px;
  }
}
.tool-overlay {
  z-index: 12;
  pointer-events: auto;
}
.tool-overlay .dialog {
  max-height: 100%;
}
.tool-panel-body {
  min-width: 0;
  align-content: start;
}
.tool-panel-body > .btn {
  min-height: 60px;
}
.tool-panel-body > .tool-card {
  min-height: 120px;
}
.tool-panel-body > .prefab-card img {
  object-fit: contain;
}
.tool-tabs {
  margin-bottom: 18px;
}
.panel-live-note {
  font-size: 12px;
  line-height: 1.7;
}
.tool-panel-body [aria-pressed="true"] {
  border-color: var(--orange);
  background: #fff3e6;
  box-shadow: inset 0 0 0 1px var(--orange);
}
.campaign-guide {
  width: min(600px, 100%);
}
.campaign-guide pre {
  font: 13px/1.8 inherit;
  white-space: pre-wrap;
  background: #e7e9dc;
  border-radius: 10px;
  padding: 12px;
  margin: 14px 0;
}
.campaign-guide h3 {
  font-size: 16px;
}
.controls-tabs {
  margin: 12px 0;
}
.controls-tabs [aria-pressed="true"] {
  background: var(--ink);
  color: white;
}
.setting .btn {
  font-size: 12px;
}
.more-layout .tool-panel-body {
  min-width: 0;
}
.more-layout .btn {
  width: 100%;
}
.continue-run {
  position: absolute;
  right: 0;
  bottom: 128px;
  min-height: 44px;
}
.tutorial .eyebrow {
  margin-bottom: 10px;
}
#settings-save {
  font-size: 12px;
  line-height: 1.7;
}
.dialog-foot small {
  display: block;
}
@media (max-height: 560px) {
  .tool-panel-body > .tool-card {
    min-height: 94px;
  }
  .tool-panel-body > .btn {
    min-height: 48px;
  }
  .tool-tabs {
    margin-bottom: 10px;
  }
  .panel-live-note {
    font-size: 10px;
  }
  .campaign-guide pre {
    font-size: 11px;
    line-height: 1.7;
    padding: 10px;
    margin: 10px 0;
  }
  .campaign-guide h3 {
    font-size: 14px;
  }
  .continue-run {
    bottom: 112px;
  }
}
.medal-ring.silver {
  background: #c5d0d1;
  border-color: #e7edec;
  color: #4b6263;
  box-shadow:
    0 0 0 1px #a7b6b7,
    0 12px 0 #9eaeae,
    0 28px 40px #8a9c9c22;
}
.medal-ring.bronze {
  background: #cfa783;
  border-color: #ebd1af;
  color: #6e492e;
  box-shadow:
    0 0 0 1px #b38b63,
    0 12px 0 #a77b55,
    0 28px 40px #9c816322;
}
.result-save {
  border: 0;
  background: transparent;
  min-height: 44px;
  padding: 5px 0;
  text-align: left;
  cursor: pointer;
}
.result-actions {
  flex-wrap: wrap;
}
.settlement-banner {
  position: absolute;
  right: 0;
  bottom: 185px;
  background: var(--surface);
  border-radius: 9px;
  padding: 10px 14px;
  font-size: 12px;
  max-width: 240px;
}
#portrait-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--paper);
  text-align: center;
}
#portrait-overlay strong {
  font-size: 30px;
}
#portrait-overlay p {
  font-size: 14px;
  color: var(--muted);
}
#portrait-overlay .eyebrow {
  font-size: 10px;
}
#save-retry-status,
#audio-retry-status,
#update-save {
  font-size: 12px;
  line-height: 1.7;
  margin-top: 12px;
  color: var(--red);
}
@media (max-height: 560px) {
  .settlement-banner {
    bottom: 164px;
    font-size: 10px;
    max-width: 185px;
  }
  .result-layout {
    align-items: start;
  }
  .medal-display {
    padding-top: 10px;
  }
  .medal-display .eyebrow {
    display: none;
  }
  .medal-display h2 {
    font-size: 24px;
  }
  .medal-ring {
    width: 115px;
    height: 115px;
    margin: 15px auto 20px;
  }
  .result-actions {
    gap: 6px;
  }
  .result-actions > .btn {
    font-size: 11px;
    padding: 10px;
    flex: 1;
  }
  .result-actions > .quiet {
    min-width: 44px;
    flex: none;
  }
  .result-copy {
    padding-bottom: 85px;
  }
  .center-card details {
    font-size: 11px;
  }
}
.result-hints {
  margin: 16px 0;
  font-size: 13px;
  line-height: 1.8;
}
.result-hints summary {
  min-height: 44px;
  padding: 10px 0;
  cursor: pointer;
  font-weight: 700;
}
.result-hints ol {
  padding-left: 24px;
}
.result-hints li + li {
  margin-top: 8px;
}

/* Brand key art stays local and independent of text/localized UI. */
.home-layout.brand-home {
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.4fr);
  gap: 28px;
}
.home-copy .brand-title {
  font-size: clamp(54px, 6.4vw, 86px);
  letter-spacing: -3px;
}
.hero.brand-hero {
  height: min(560px, 68vh);
  min-height: 400px;
  border-radius: 30px;
  overflow: hidden;
  background: #f4f0e5;
  box-shadow: 0 20px 50px #50381b0c;
}
.hero.brand-hero::before,
.hero.brand-hero::after {
  display: none;
}
.hero.brand-hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  object-fit: cover;
  object-position: 53% 50%;
  transform: none;
  filter: none;
}
.brand-hero .hero-label {
  top: 18px;
  left: 20px;
  margin: 0;
  border: 0;
  padding: 7px 10px;
  border-radius: 7px;
  background: #f7f4e9ec;
  color: #35413b;
  font-size: 9px;
  letter-spacing: 1.5px;
}
.brand-hero .hero-caption {
  top: auto;
  right: 18px;
  bottom: 18px;
  padding: 11px 14px;
  border-radius: 12px;
  background: #fbf9f0ed;
  color: #2b3933;
}
@media (max-width: 599px) {
  .hero.brand-hero {
    width: 100%;
    height: 245px;
    min-height: 245px;
    border-radius: 20px;
  }
  .home-copy .brand-title {
    font-size: 52px;
    line-height: 1;
    letter-spacing: -2px;
  }
  .brand-hero .hero-label {
    left: 12px;
    top: 12px;
    font-size: 7px;
    letter-spacing: 1px;
  }
  .brand-hero .hero-caption {
    right: 12px;
    bottom: 12px;
    padding: 7px 10px;
  }
}
@media (max-height: 560px) and (min-width: 600px) {
  .home-layout.brand-home {
    grid-template-columns: 1fr 1.08fr;
    gap: 20px;
  }
  .hero.brand-hero {
    height: min(330px, calc(100dvh - 140px));
    min-height: 0;
    border-radius: 20px;
  }
  .home-copy .brand-title {
    font-size: 34px;
    line-height: 1;
    letter-spacing: -1px;
    margin: 8px 0;
  }
  .brand-hero .hero-label {
    left: 10px;
    top: 10px;
    font-size: 6px;
    letter-spacing: 0.7px;
  }
  .brand-hero .hero-caption {
    right: 10px;
    bottom: 10px;
    padding: 7px 9px;
  }
}

#portrait-overlay {
  overflow-y: auto;
}
.portrait-welcome {
  width: min(100%, 460px);
}
.portrait-welcome > h1 {
  margin: 8px 0 18px;
  font-size: 36px;
  letter-spacing: -1px;
}
.portrait-welcome > img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 20px;
  border-radius: 20px;
}
.portrait-welcome .center-card {
  margin-inline: auto;
}

@media (min-width: 600px) and (max-width: 900px) and (min-height: 561px) {
  .home-layout.brand-home {
    grid-template-columns: minmax(240px, 1fr) minmax(0, 1.1fr);
    gap: 20px;
  }
  .brand-home .home-copy {
    padding: 0;
  }
  .brand-home .brand-title {
    font-size: 48px;
    line-height: 1;
    margin: 10px 0;
    letter-spacing: -2px;
  }
  .brand-home .home-copy > .eyebrow {
    font-size: 8px;
    letter-spacing: 1px;
  }
  .brand-home .home-copy > .description {
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 16px;
  }
  .brand-home .continue {
    min-height: 64px;
    padding: 10px 14px;
  }
  .brand-home .continue span {
    font-size: 16px;
  }
  .brand-home .continue small {
    font-size: 10px;
  }
  .brand-home .mode-row {
    gap: 8px;
    margin-top: 10px;
  }
  .brand-home .mode-tile {
    gap: 8px;
    min-height: 64px;
    padding: 10px;
  }
  .brand-home .mode-tile span {
    font-size: 12px;
    gap: 4px;
  }
  .brand-home .mode-tile small {
    font-size: 9px;
  }
  .brand-home .home-low {
    gap: 8px;
    margin-top: 6px;
  }
  .brand-home .home-low button {
    font-size: 10px;
  }
  .brand-home .home-version {
    display: none;
  }
  .hero.brand-hero {
    min-height: 330px;
    height: min(440px, 68vh);
  }
}
/* Warm translucent workshop; the world and original branded art remain visible. */
:root {
  --control-scale: 1;
  --theme-emblem: url("../brand/block-demolition-keyart-v1.jpg");
}
.home-copy,
.home-layout,
.page,
.page-content {
  background: transparent;
}
.reduced-transparency {

  --scrim-blur: none;
  --glass-blur: none;
}
.services-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.services-links button {
  min-height: 44px;
  border: 1px solid #6a735f55;
  background: #fff8e7b0;
  border-radius: 12px;
  padding: 8px 12px;
}
.services-links button:disabled {
  opacity: 0.65;
}
:is(.game-foundation-services, .playscape-host-surfaces) {
  --glass-fill: rgba(30, 43, 37, 0.86);
  --ink: #fff8e9;
  --glass-blur: blur(18px);
  color: #fff8e9;
  --theme-emblem: url("../brand/block-demolition-keyart-v1.jpg");
}
.reduced-transparency :is(.game-foundation-services, .playscape-host-surfaces) {
  --glass-fill: #1e2b25;
  --glass-blur: none;
}
:is(.game-foundation-services, .playscape-host-surfaces) button,
:is(.game-foundation-services, .playscape-host-surfaces) input {
  color: inherit;
}
:is(.game-foundation-services, .playscape-host-surfaces) button {
  min-height: 44px;
}
.btn,
.mode-tile,
.setting {
  min-width: 0;
}
.setting > span:first-child {
  min-width: 0;
  flex: 1;
}
.setting small {
  overflow-wrap: break-word;
}
.setting select {
  max-width: 55%;
}
.assisted-forward {
  display: none;
  pointer-events: auto;
}
.assisted-forward-enabled .assisted-forward {
  display: block;
  position: absolute;
  bottom: 110px;
  left: 0;
  max-width: 150px;
}
.joystick {
  display: block !important;
  width: calc(84px * var(--control-scale));
  height: calc(84px * var(--control-scale));
  touch-action: none;
}
.game-actions .btn {
  min-height: calc(44px * var(--control-scale));
  padding: 10px;
  max-width: 150px;
}
.game-actions .iconbtn {
  min-width: calc(44px * var(--control-scale));
  width: auto;
}
.left-handed .joystick {
  left: auto !important;
  right: max(12px, var(--safe-right));
}
.left-handed .game-actions {
  right: auto;
  left: 0;
}
.left-handed .assisted-forward {
  left: auto;
  right: 0;
}
@media (max-width: 600px) {
  .home-layout,
  .briefing,
  .result-layout {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }
  .brand-home .home-copy {
    width: 100%;
    padding: 20px;
  }
  .home-copy h1 {
    font-size: 40px;
  }
  .brand-hero {
    min-height: 160px;
    max-height: 220px;
    order: -1;
  }
  .home-low {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .home-low button {
    min-height: 44px;
    flex: 1 1 120px;
  }
  .mode-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .mode-tile {
    min-width: 0;
  }
  .mode-tile span {
    min-width: 0;
    overflow-wrap: break-word;
  }
  .page {
    height: 100dvh;
    overflow: auto;
  }
  .page-body,
  .page-content {
    padding: 12px;
  }
  .brief-art {
    max-height: 200px;
  }
  .brief-content {
    padding: 0 0 12px;
  }
  .brief-start,
  .result-actions {
    position: static;
    width: auto;
    display: flex;
    flex-wrap: wrap;
    background: transparent;
  }
  .brief-start .btn,
  .result-actions .btn {
    flex: 1 1 120px;
  }
  .settings-layout {
    display: flex;
    flex-direction: column;
  }
  .settings-nav {
    display: flex;
    overflow-x: auto;
    flex: none;
  }
  .settings-nav button {
    flex: 0 0 auto;
    min-height: 44px;
  }
  .settings-content {
    padding: 12px;
  }
  .dialog {
    width: 100%;
    max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 16px);
  }
  .dialog-body {
    overflow: auto;
    min-height: 0;
  }
  .dialog-foot {
    flex-wrap: wrap;
    gap: 8px;
  }
  .dialog-foot > .btn {
    flex: 1;
    min-height: 44px;
  }
  .setting {
    gap: 12px;
    align-items: center;
  }
  .sliderwrap {
    width: 125px;
    flex: 0 0 125px;
  }
  .sliderwrap input {
    width: 95px;
  }
  .control-grid {
    grid-template-columns: 1fr;
  }
  .medal-row {
    gap: 4px;
  }
  .medal-tier {
    min-width: 0;
    padding: 8px;
  }
  .medal-tier small {
    font-size: 11px;
  }
  .game-top {
    top: max(8px, var(--safe-top));
    left: max(8px, var(--safe-left));
    right: max(8px, var(--safe-right));
    gap: 5px;
  }
  .game-label {
    max-width: 47%;
    padding: 8px;
  }
  .game-label strong {
    font-size: 11px;
  }
  .game-label small {
    font-size: 9px;
  }
  .hud-budget {
    position: static;
    transform: none;
    min-width: 65px;
    padding: 6px;
    gap: 3px;
    flex-wrap: wrap;
  }
  .hud-budget b {
    font-size: 20px;
  }
  .hud-budget span {
    font-size: 10px;
  }
  .hud-budget em {
    font-size: 10px;
  }
  .hud-buttons {
    margin-left: auto;
  }
  .hud-buttons .btn {
    width: 44px;
    height: 44px;
    padding: 8px;
  }
  .hud-goal {
    top: 80px;
    left: 8px;
    width: calc(100% - 16px);
    max-height: 115px;
    overflow: auto;
    padding: 8px;
    font-size: 10px;
  }
  .hud-goal .percent {
    font-size: 22px;
    margin: 2px 0;
  }
  .hud-goal header {
    font-size: 10px;
  }
  .goal-small,
  .campaign-objectives {
    font-size: 10px;
    line-height: 1.4;
    margin-top: 3px;
  }
  .tutorial {
    top: 80px;
    left: 8px;
    width: calc(100% - 16px);
    max-height: 130px;
    overflow: auto;
    padding: 10px;
    font-size: 11px;
  }
  .hud-bottom {
    left: max(8px, var(--safe-left));
    right: max(8px, var(--safe-right));
    bottom: max(8px, var(--safe-bottom));
    display: block;
    height: 170px;
    pointer-events: none;
  }
  .loadout {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 100% !important;
    display: flex;
    overflow-x: auto;
    pointer-events: auto;
    gap: 3px;
    padding: 3px;
  }
  .loadout-button {
    min-width: 54px;
    min-height: 48px;
    padding: 3px;
    font-size: 10px;
    flex: 1;
  }
  .loadout-button img {
    width: 26px;
    height: 20px;
  }
  .loadout-button small {
    font-size: 9px;
  }
  .game-actions {
    position: absolute;
    right: 0;
    bottom: 68px;
    display: grid;
    grid-template-columns: repeat(2, minmax(44px, 1fr));
    gap: 4px;
    width: calc(132px * var(--control-scale));
    pointer-events: auto;
  }
  .game-actions .btn {
    font-size: 11px;
    padding: 5px;
    min-width: 0;
    max-width: none;
  }
  .game-actions .btn .ico {
    width: 15px;
    height: 15px;
  }
  .game-actions .place-btn,
  .game-actions .ignite-btn {
    min-width: 0;
  }
  .game-actions .settle-btn {
    position: static;
    grid-column: 1/-1;
    min-width: 0;
    min-height: 44px;
  }
  .joystick {
    left: max(12px, var(--safe-left));
    bottom: calc(max(8px, var(--safe-bottom)) + 82px);
  }
  .joystick:after {
    left: calc(50% - 15px);
    top: calc(50% - 15px);
    width: 30px;
    height: 30px;
  }
  .look-zone {
    top: 200px;
    bottom: 190px;
    width: 100%;
    right: 0;
    left: 0;
  }
  .placement-status {
    top: 43%;
    font-size: 11px;
    max-width: 90%;
  }
  .hint {
    top: calc(43% + 36px);
    font-size: 11px;
    max-width: 88%;
    white-space: normal;
  }
  .bomb-status {
    top: 202px;
    max-width: 88%;
    font-size: 10px;
  }
  .audio-status {
    top: 230px;
    max-width: 85%;
    font-size: 10px;
  }
  .crosshair {
    top: 40%;
  }
  .sandbox-tools {
    top: 74px;
    left: 8px;
    width: calc(100% - 16px);
    max-height: 112px;
  }
  .sandbox-command-row {
    display: flex;
    flex-wrap: wrap;
  }
  .sandbox-command-row button {
    flex: 1;
    min-height: 44px;
    padding: 5px;
    font-size: 11px;
  }
  .tool-context {
    font-size: 10px;
  }
  .flight-controls {
    top: 190px;
    right: 8px;
  }
  .quick-retry {
    top: 190px;
    right: 8px;
  }
  .assisted-forward-enabled .assisted-forward {
    bottom: 175px;
    max-width: 125px;
    font-size: 11px;
  }
}
@media (max-height: 420px) {
  .game-label small,
  .hud-goal {
    display: none;
  }
  .loadout {
    max-width: 48%;
  }
  .joystick {
    bottom: max(12px, var(--safe-bottom));
    left: max(12px, var(--safe-left));
  }
  .hud-bottom {
    height: 100px;
    bottom: max(8px, var(--safe-bottom));
  }
  .hud-bottom .loadout {
    bottom: 0;
    left: 110px;
    right: auto;
    max-width: calc(100% - 310px) !important;
    overflow: auto;
  }
  .game-actions {
    bottom: 0;
    right: 0;
    width: 180px;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .game-actions .btn {
    min-height: 44px;
    min-width: 44px;
  }
  .tutorial {
    max-height: 120px;
    width: 230px;
  }
  .look-zone {
    top: 70px;
    bottom: 110px;
  }
  .left-handed .hud-bottom .loadout {
    left: auto;
    right: 110px;
  }
  .left-handed .game-actions {
    left: 0;
    right: auto;
  }
  .left-handed .joystick {
    right: 12px;
  }
  .bomb-status {
    top: 65px;
    max-width: 45%;
  }
  .hint {
    max-width: 45%;
    top: 55%;
  }
  .placement-status {
    top: 43%;
    max-width: 45%;
  }
  .game-top {
    top: max(8px, var(--safe-top));
  }
  .sandbox-tools {
    top: 65px;
    width: 220px;
    max-height: 120px;
  }
  .flight-controls {
    top: 65px;
  }
  .quick-retry {
    top: 65px;
  }
}
@media (forced-colors: active) {
  .panel,
  .dialog,
  :is(.game-foundation-services, .playscape-host-surfaces) {
    background: Canvas !important;
    color: CanvasText !important;
    backdrop-filter: none;
  }
}
.hud-goal,
.hud-goal .percent b,
.hud-goal header,
.hud-goal .goal-small,
.hud-goal .campaign-objectives {
  color: #24322e !important;
}
.hud-goal header span:last-child {
  color: #46584d !important;
}
.game-actions .jump {
  display: inline-flex !important;
}
@media (max-width: 600px) {
  .hud-buttons {
    flex: 0 0 46px;
    display: block;
  }
  .hud-buttons .btn:not(.iconbtn) {
    position: absolute;
    top: 74px;
    right: 4px;
    width: 115px;
    max-width: 115px;
    font-size: 11px;
    white-space: normal;
    line-height: 1.3;
    padding: 6px;
    min-height: 44px;
  }
  .hud-goal {
    top: 124px;
    max-height: 100px;
  }
  .game-label {
    max-width: 45%;
    flex: 1;
  }
  .hud-budget {
    flex: 0 0 88px;
    max-width: 88px;
  }
  .quick-retry {
    top: 76px;
    left: 8px;
    right: auto;
    font-size: 11px;
    max-width: 150px;
    min-height: 44px;
  }
  .bomb-status {
    top: 230px;
  }
  .audio-status {
    top: 255px;
  }
}

@font-face {
  font-family: DemolitionLatin;
  src: url("../assets/fonts/nunito-sans-latin.woff2") format("woff2");
  font-display: swap;
  font-weight: 100 900;
}
@font-face {
  font-family: DemolitionSymbols;
  src: url("../assets/fonts/noto-sans-symbols.woff2") format("woff2");
  font-display: swap;
  font-weight: 100 900;
}
@font-face {
  font-family: DemolitionSC;
  src: url("../assets/fonts/noto-sans-sc-ui.woff2") format("woff2");
  font-display: swap;
  font-weight: 100 900;
}
@font-face {
  font-family: DemolitionTC;
  src: url("../assets/fonts/noto-sans-tc-ui.woff2") format("woff2");
  font-display: swap;
  font-weight: 100 900;
}
@font-face {
  font-family: DemolitionJP;
  src: url("../assets/fonts/noto-sans-jp-ui.woff2") format("woff2");
  font-display: swap;
  font-weight: 100 900;
}
@font-face {
  font-family: DemolitionKR;
  src: url("../assets/fonts/noto-sans-kr-ui.woff2") format("woff2");
  font-display: swap;
  font-weight: 100 900;
}
@font-face {
  font-family: DemolitionSCNames;
  src: url("../assets/fonts/noto-sans-sc-names.woff2") format("woff2");
  font-display: swap;
  font-weight: 100 900;
}
@font-face {
  font-family: DemolitionTCNames;
  src: url("../assets/fonts/noto-sans-tc-names.woff2") format("woff2");
  font-display: swap;
  font-weight: 100 900;
}
@font-face {
  font-family: DemolitionJPNames;
  src: url("../assets/fonts/noto-sans-jp-names.woff2") format("woff2");
  font-display: swap;
  font-weight: 100 900;
}
@font-face {
  font-family: DemolitionKRNames;
  src: url("../assets/fonts/noto-sans-kr-names.woff2") format("woff2");
  font-display: swap;
  font-weight: 100 900;
}

:root {
  --game-font:
    DemolitionLatin, DemolitionSC, DemolitionSymbols, DemolitionSCNames,
    DemolitionTCNames, DemolitionJPNames, DemolitionKRNames, sans-serif;
}
:root:lang(zh-Hant) {
  --game-font:
    DemolitionLatin, DemolitionTC, DemolitionSymbols, DemolitionSCNames,
    DemolitionTCNames, DemolitionJPNames, DemolitionKRNames, sans-serif;
}
:root:lang(ja) {
  --game-font:
    DemolitionLatin, DemolitionJP, DemolitionSymbols, DemolitionSCNames,
    DemolitionTCNames, DemolitionJPNames, DemolitionKRNames, sans-serif;
}
:root:lang(ko) {
  --game-font:
    DemolitionLatin, DemolitionKR, DemolitionSymbols, DemolitionSCNames,
    DemolitionTCNames, DemolitionJPNames, DemolitionKRNames, sans-serif;
}
body,
button,
input,
select,
textarea,
h1,
h2,
h3,
.brand-title {
  font-family: var(--game-font) !important;
}
.shell {
  background:
    linear-gradient(#f4f1e8b8, #f4f1e8cc),
    url("../brand/block-demolition-keyart-v1.jpg") center/cover fixed;
}
.reduced-transparency .shell {
  background: #f4f1e8;
}
/* Explicit FPS regions keep the swapped action cluster clear of the movement pad. */
.hud-goal header {
  display: flex;
  gap: 12px;
  justify-content: space-between;
}
.hud-goal header span {
  min-width: 0;
  flex: 1;
}
@media (min-width: 601px) and (min-height: 421px) {
  .hud-bottom {
    height: 140px;
    display: block;
    pointer-events: none;
  }
  .hud-bottom .loadout {
    position: absolute;
    left: 130px;
    right: 350px;
    bottom: 0;
    width: max-content;
    max-width: calc(100% - 480px);
    margin: 0 !important;
    pointer-events: auto;
    overflow: auto;
  }
  .hud-bottom .game-actions {
    position: absolute;
    right: 0;
    left: auto;
    bottom: 0;
    width: 320px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    pointer-events: auto;
  }
  .hud-bottom .game-actions .btn {
    min-width: 0;
    max-width: none;
  }
  .hud-bottom .game-actions .settle-btn {
    position: static;
    grid-column: 1/-1;
    grid-row: 1;
    justify-self: end;
  }
  .left-handed .hud-bottom .game-actions {
    left: 0;
    right: auto;
  }
  .left-handed .hud-bottom .loadout {
    left: auto;
    right: 130px;
  }
  .assisted-forward-enabled .assisted-forward {
    bottom: 135px;
  }
  .game-label {
    max-width: calc(50% - 110px);
  }
}
@media (max-width: 600px) and (min-height: 421px) {
  .hud-bottom .loadout {
    margin: 0 !important;
    min-height: 64px;
    max-height: 68px;
  }
  .loadout-button {
    max-height: 60px;
  }
  .loadout-button img {
    max-height: 20px;
  }
  .hud-bottom .game-actions {
    width: calc(158px * var(--control-scale));
    bottom: 76px;
  }
  .hud-bottom .game-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .game-actions .settle-btn {
    grid-column: 1/-1;
    grid-row: 1;
    min-height: 44px;
  }
  .game-actions .btn {
    overflow-wrap: anywhere;
  }
  .game-actions .jump {
    padding: 2px;
  }
  .hud-goal {
    top: 145px;
    max-height: 70px;
  }
  .crosshair {
    top: 50%;
  }
  .placement-status {
    top: 54%;
  }
  .hint {
    top: 62%;
  }
  .assisted-forward-enabled .assisted-forward {
    bottom: 210px;
    max-width: 100px;
    min-height: 44px;
  }
  .joystick {
    bottom: calc(max(8px, var(--safe-bottom)) + 84px);
  }
  .quick-retry {
    display: none;
  } /* Retry remains available in the pause menu. */
}
@media (max-height: 420px) {
  .hud-bottom {
    display: block;
    pointer-events: none;
  }
  .hud-bottom .game-actions {
    position: absolute;
    bottom: 0;
    right: 0;
    left: auto;
    width: 190px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    pointer-events: auto;
  }
  .hud-bottom .game-actions .settle-btn {
    position: static;
    grid-column: 1/-1;
    grid-row: 1;
    min-height: 44px;
  }
  .left-handed .hud-bottom .game-actions {
    left: 0;
    right: auto;
  }
  .hud-bottom .loadout {
    position: absolute;
    margin: 0 !important;
    left: 120px;
    right: 200px;
    max-width: calc(100% - 320px) !important;
    max-height: 74px;
  }
  .left-handed .hud-bottom .loadout {
    left: 200px;
    right: 120px;
  }
  .assisted-forward-enabled .assisted-forward {
    bottom: 116px;
    max-width: 104px;
    font-size: 11px;
    min-height: 44px;
  }
  .game-label {
    max-width: 38%;
    font-size: 11px;
  }
  .hud-budget {
    top: 20px;
    max-width: 130px;
  }
  .quick-retry {
    display: none;
  }
  .crosshair {
    top: 50%;
  }
}
@media (max-width: 600px) {
  .game-actions .btn {
    overflow-wrap: normal;
    word-break: normal;
    font-size: 10px;
    padding: 3px;
  }
  .game-actions .btn:not(.jump) .ico {
    display: none;
  }
}
@media (max-height: 420px) {
  .hud-buttons {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
  }
  .hud-buttons .btn:not(.iconbtn) {
    position: static;
    min-height: 44px;
    max-width: 115px;
    font-size: 11px;
  }
  .game-top {
    align-items: flex-start;
  }
  .game-label {
    max-width: 36%;
  }
  .hud-budget {
    position: static;
    transform: none;
    min-width: 70px;
    padding: 6px;
    max-width: 88px;
  }
  .game-actions .btn:not(.jump) .ico {
    display: none;
  }
}
@media (max-width: 600px) and (min-height: 421px) and (max-height: 650px) {
  .bomb-status {
    top: 218px;
    max-width: calc(100% - 24px);
  }
  .placement-status,
  .hint {
    left: 12px;
    right: auto;
    transform: none;
    width: calc(100% - 144px);
    max-width: 180px;
  }
  .placement-status {
    top: 278px;
  }
  .hint {
    top: 326px;
    font-size: 10px;
  }
}
@media (max-height: 420px) {
  .bomb-status {
    top: 78px;
    left: 12px;
    transform: none;
    max-width: 38%;
    font-size: 10px;
  }
  .hint {
    top: calc(50% + 36px);
    left: 210px;
    right: 130px;
    width: auto;
    max-width: none;
    transform: none;
    font-size: 10px;
  }
}

.low-quality .scrim,
.reduced-transparency .scrim {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

@media (max-width: 600px) {
  /* Long diagnostic actions need a complete row beside translated help text. */
  .setting:has(> button) {
    flex-direction: column;
    align-items: stretch;
  }
  .setting:has(> button) > span {
    flex: auto;
  }
}

/* The localized brand title follows its text column, not the full viewport.
   Keep Start in the first desktop screen before any focus/scroll adjustment. */
.brand-home .home-copy {
  container-type: inline-size;
}
.brand-home .home-copy .brand-title {
  font-size: clamp(30px, 11cqi, 60px);
  line-height: 1.06;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}
@media (min-width: 600px) and (max-height: 800px) {
  .brand-home .home-copy {
    padding: 12px 0;
  }
  .brand-home .home-copy .brand-title {
    font-size: clamp(30px, 10cqi, 48px);
    margin: 8px 0 12px;
  }
  .brand-home .home-copy > .description {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
  }
}
/* Single native material source. Local frosting, no fullscreen readback. */
:root {
  --surface-rgb: 255, 250, 237;
  --content-alpha: 0.68;
  --chrome-alpha: 0.62;
  --glass-blur: blur(18px) saturate(115%);
  --glass-fill: rgba(var(--surface-rgb), var(--content-alpha));
  --ink: #20372e;
  --muted: #34483c;
  --line: #46584640;
  --orange: #a83c0d;
  --green: #245b44;
  --blue: #23556a;
  --material-edge: #ffffffae;
  --material-shadow: 0 14px 38px #26372c20;
  --menu-safe-top: max(76px, calc(env(safe-area-inset-top, 0px) + 60px));
}
:is(
  .panel,
  .dialog,
  .tool-panel,
  .center-card,
  .result-copy,
  .mission-card,
  .map-card,
  .campaign-guide
) {
  background: var(--glass-fill) !important;
  color: var(--ink);
  border: 1px solid var(--material-edge);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--material-shadow);
  border-radius: 24px;
}
:is(
  .game-label,
  .hud-goal,
  .tutorial,
  .sandbox-tools,
  .loadout,
  .hud-budget,
  .toolstrip,
  .sandbox-loadout,
  .bomb-status,
  .placement-status,
  .hint,
  .audio-status,
  .tool-context,
  .settlement-banner
) {
  background: rgba(var(--surface-rgb), var(--chrome-alpha)) !important;
  color: var(--ink) !important;
  border: 1px solid var(--material-edge);
  border-radius: 14px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: 0 5px 18px #26372c16;
}
:is(.dialog, .panel, .tool-panel, .campaign-guide)
  :is(
    .panel,
    .tutorial,
    .notice,
    .storage-status,
    .tool-detail,
    .paused-state
  ) {
  background: #fff8e742 !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}
.scrim {
  background: #142d2438 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  padding: var(--menu-safe-top) max(12px, env(safe-area-inset-right, 0px))
    max(12px, env(safe-area-inset-bottom, 0px))
    max(12px, env(safe-area-inset-left, 0px));
}
.shell,
.reduced-transparency .shell {
  padding: var(--menu-safe-top) max(16px, env(safe-area-inset-right, 0px))
    max(12px, env(safe-area-inset-bottom, 0px))
    max(16px, env(safe-area-inset-left, 0px));
  background:
    linear-gradient(#f4f1e81c, #f4f1e84c),
    url("../brand/block-demolition-keyart-v1.jpg") center/cover;
  min-height: 0;
  height: 100dvh;
}
.shell .topbar {
  height: auto;
  min-height: 56px;
  gap: 12px;
  border: 0;
  padding: 4px 10px;
  border-radius: 16px;
  background: rgba(var(--surface-rgb), var(--chrome-alpha));
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.brand {
  min-width: 0;
  gap: 10px;
  font-size: 1rem;
}
.brand [data-product-title] {
  overflow-wrap: anywhere;
}
.brand .stamp {
  flex: none;
}
.topnav {
  gap: 8px;
  flex: none;
}
.shell .topnav .btn {
  min-width: 48px;
  min-height: 48px;
}
.shell-content {
  padding: 16px 0;
  min-height: 0;
}
.shell .footer {
  height: auto;
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  border-radius: 12px;
  background: rgba(var(--surface-rgb), 0.86);
  color: var(--muted);
  font-size: 0.8rem;
}
.home-layout.brand-home {
  display: block;
  max-width: 500px;
  min-height: 0;
  margin: 0 auto;
}
.brand-home .home-copy {
  container-type: normal;
  padding: 20px;
  display: grid;
  gap: 14px;
  margin: 0;
  width: 100%;
}
.brand-home .brand-hero {
  display: none;
}
.demolition-title-art {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  position: relative;
  inset: auto;
  width: 100%;
  height: auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}
.home-copy .demolition-title-art h1 {
  grid-area: 1/1;
  position: static;
  inset: auto;
  width: auto;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 0;
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: normal;
  overflow-wrap: anywhere;
}
.demolition-title-art img {
  grid-area: 1/1;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 3;
  max-height: 210px;
  object-fit: contain;
  visibility: hidden;
  pointer-events: none;
}
.demolition-title-art[data-artwork-status="loaded"] img {
  visibility: visible;
}
.demolition-title-art[data-artwork-status="loaded"] h1 {
  clip-path: inset(50%);
}
.home-progress {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}
.brand-home .mode-row {
  margin: 0;
  gap: 10px;
}
.brand-home .home-low {
  margin: 0;
  display: grid;
  gap: 4px;
}
.brand-home .home-low button {
  text-align: left;
}
.home-copy .continue {
  min-height: 76px;
  margin: 0;
}
.home-copy .continue span {
  font-size: 1.15rem;
}
.home-copy .continue small {
  font-size: 0.85rem;
  white-space: normal;
}
:is(
  .btn,
  .mode-tile,
  .home-low button,
  .services-links button,
  .tab,
  .settings-nav button,
  .controls-tabs button,
  .tool-tabs button,
  select,
  input[type="number"],
  summary
) {
  min-height: 48px;
  white-space: normal;
  overflow-wrap: anywhere;
}
:is(
  .btn,
  .mode-tile,
  .tab,
  .settings-nav button,
  .controls-tabs button,
  .tool-tabs button,
  .services-links button,
  select,
  input[type="number"]
) {
  background: #fffaf0e8;
  border-color: #53674766;
  color: var(--ink);
}
:is(.btn.primary, .mode-tile.active, [aria-selected="true"], .tab.active) {
  background: #a83c0d;
  color: #fffdf5;
  border-color: #a83c0d;
}
.btn.quiet {
  background: #fffaf0bd;
}
.btn:disabled {
  opacity: 1;
  background: #dddcd1;
  color: #4b5149;
  border-style: dashed;
}
:is(
  .muted,
  .eyebrow,
  .setting small,
  .card-meta,
  .home-progress,
  .goal-small,
  .campaign-objectives,
  .hud-budget em,
  .hud-goal header,
  .hint,
  .tool-mini,
  .storage-status p,
  .result-copy small,
  .control-item,
  .paused-state
) {
  color: var(--muted);
}
:is(.hud-goal, .hud-budget, .game-label, .tool-context, .bomb-status)
  :is(span, b, em, small) {
  color: inherit;
}
:is(.notice, .chip, .result-checks > div) {
  color: #20372e;
  background: #fff4d9e6;
}
.notice.error,
.chip.red,
.result-checks .failed,
.objective-failure {
  color: #7b241b;
  background: #fff0e6ed;
}
.dialog {
  min-height: 0;
  max-height: 100%;
}
.dialog-head {
  padding: 16px;
  gap: 12px;
}
.dialog-head > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.dialog-head h2 {
  font-size: 1.35rem;
}
.dialog-head .eyebrow {
  display: none;
}
.dialog-body {
  padding: 16px;
  min-width: 0;
}
.dialog-foot {
  padding: 12px 16px;
  flex-wrap: wrap;
}
.dialog-foot > * {
  min-width: 0;
}
.dialog-foot .btn {
  flex: 1 1 140px;
}
.dialog-foot small {
  overflow-wrap: anywhere;
}
.setting {
  gap: 12px;
}
.setting select {
  max-width: 55%;
  min-width: 0;
}
.settings-content {
  min-width: 0;
}
.result-copy {
  padding: 24px;
  min-width: 0;
}
.result-layout {
  align-items: start;
}
.result-actions {
  flex-wrap: wrap;
}
.result-actions .btn {
  flex: 1 1 140px;
}
.game-actions:empty,
.tool-context:empty {
  background: none !important;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
@supports not (
  (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))
) {
  :root {
    --content-alpha: 0.94;
    --chrome-alpha: 0.94;
    --glass-blur: none;
  }
}
.reduced-transparency,
:root:has(.reduced-transparency) {
  --content-alpha: 0.96;
  --chrome-alpha: 0.96;
  --glass-blur: none;
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  :root {
    --content-alpha: 0.96;
    --chrome-alpha: 0.96;
    --glass-blur: none;
  }
}
@media (max-width: 600px) {
  .brand-home .home-copy {
    padding: 16px;
    gap: 12px;
  }
  .shell .brand .stamp {
    display: none;
  }
  .shell .brand {
    font-size: 0.85rem;
  }
  .shell .topbar {
    padding: 4px 8px;
  }
  .home-copy .demolition-title-art h1 {
    font-size: 1.65rem;
  }
  .demolition-title-art img {
    max-height: 170px;
  }
  .settings-layout {
    display: block;
  }
  .settings-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
  }
  .settings-nav button {
    flex: 1 1 110px;
    padding: 8px;
    font-size: 0.85rem;
  }
  .setting {
    flex-wrap: wrap;
  }
  .setting select {
    max-width: 100%;
    width: 100%;
  }
  .result-layout {
    display: block;
  }
  .medal-display,
  .failure-art {
    margin-bottom: 16px;
  }
  .result-copy {
    padding: 16px;
  }
  .result-metrics {
    gap: 8px;
  }
}
@media (max-height: 500px) {
  .dialog-head {
    padding: 10px 14px;
  }
  .dialog-head h2 {
    font-size: 1.1rem;
  }
  .dialog-foot {
    padding: 8px 14px;
  }
  .dialog-foot small {
    display: none;
  }
  .shell .topbar {
    min-height: 48px;
  }
  .home-layout.brand-home {
    max-width: 580px;
  }
}
@media (forced-colors: active) {
  :root {
    --glass-blur: none;
    --ink: CanvasText;
    --muted: CanvasText;
    --line: CanvasText;
  }
  :is(
    .shell,
    .panel,
    .dialog,
    .tool-panel,
    .center-card,
    .result-copy,
    .mission-card,
    .map-card,
    .campaign-guide,
    .topbar,
    .game-label,
    .hud-goal,
    .tutorial,
    .sandbox-tools,
    .loadout,
    .hud-budget,
    .toolstrip,
    .sandbox-loadout,
    .bomb-status,
    .placement-status,
    .hint,
    .audio-status,
    .tool-context,
    .settlement-banner
  ) {
    background: Canvas !important;
    color: CanvasText !important;
    border: 1px solid CanvasText;
    box-shadow: none;
  }
  .demolition-title-art img {
    display: none;
  }
  .demolition-title-art[data-artwork-status="loaded"] h1 {
    clip-path: none;
  }
  :is(button, select, input, summary) {
    forced-color-adjust: auto;
  }
  .scrim {
    background: Canvas !important;
  }
}

.iconbtn {
  min-width: 48px;
  min-height: 48px;
}

@media (max-width: 480px) {
  .brand-home .mode-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .mode-tile span {
    min-width: 0;
    flex: 1;
  }
}
