:root {
  --bg: #05070a;
  --panel: rgba(7, 10, 16, 0.48);
  --panel-strong: rgba(12, 10, 18, 0.9);
  --line: rgba(158, 216, 255, 0.24);
  --text: #fffaf4;
  --muted: #c4c1d8;
  --green: #b5ef55;
  --cyan: #aee7ff;
  --amber: #ffc24f;
  --pink: #ff4faf;
  --red: #ff4b43;
  --ui-touch-joystick: url("assets/sprites/ui/touch-joystick.png");
  --ui-touch-left: url("assets/sprites/ui/touch-left.png?v=2");
  --ui-touch-right: url("assets/sprites/ui/touch-right.png?v=2");
  --ui-touch-aim: url("assets/sprites/ui/touch-aim.png");
  --ui-touch-jump: url("assets/sprites/ui/touch-jump.png");
  --ui-touch-shoot: url("assets/sprites/ui/touch-shoot.png");
  --ui-touch-reload: url("assets/sprites/ui/touch-reload.png");
  --ui-touch-swap: url("assets/sprites/ui/touch-swap.png");
  --ui-touch-heal: url("assets/sprites/ui/touch-heal.png");
  --ui-touch-interact: url("assets/sprites/ui/touch-interact.png");
  --ui-touch-menu: url("assets/sprites/ui/touch-menu.png");
  --ui-hud-health: url("assets/sprites/ui/batch-f-generated-chromakey-v1/hud-icons/hud-health.png");
  --ui-hud-coin: url("assets/sprites/ui/batch-f-generated-chromakey-v1/hud-icons/hud-coin.png");
  --ui-hud-medkit: url("assets/sprites/ui/batch-f-generated-chromakey-v1/hud-icons/hud-medkit.png");
  --ui-hud-keycard: url("assets/sprites/ui/batch-f-generated-chromakey-v1/hud-icons/hud-keycard.png");
  --ui-hud-part: url("assets/sprites/ui/batch-f-generated-chromakey-v1/hud-icons/hud-part.png");
  --ui-resource-ore: url("assets/sprites/ui/batch-f-generated-chromakey-v1/hud-icons/resource-ore.png");
  --ui-resource-spore: url("assets/sprites/ui/batch-f-generated-chromakey-v1/hud-icons/resource-spore.png");
  --ui-resource-cell: url("assets/sprites/ui/batch-f-generated-chromakey-v1/hud-icons/resource-cell.png");
  --ui-resource-scrap: url("assets/sprites/ui/batch-f-generated-chromakey-v1/hud-icons/resource-scrap.png");
  --ui-weapon-pistol: url("assets/sprites/ui/batch-f-generated-chromakey-v1/hud-icons/weapon-pistol-badge.png");
  --ui-weapon-smg: url("assets/sprites/ui/batch-f-generated-chromakey-v1/hud-icons/weapon-smg-badge.png");
  --ui-weapon-scatter: url("assets/sprites/ui/batch-f-generated-chromakey-v1/hud-icons/weapon-scatter-badge.png");
  --ui-weapon-bolt: url("assets/sprites/ui/batch-f-generated-chromakey-v1/hud-icons/weapon-bolt-badge.png");
  --ui-weapon-thumper: url("assets/sprites/ui/batch-f-generated-chromakey-v1/hud-icons/weapon-thumper-badge.png");
  --ui-panel-dialog: url("assets/sprites/ui/batch-f-generated-chromakey-v1/panels/panel-dialog.png");
  --ui-panel-pause: url("assets/sprites/ui/batch-f-generated-chromakey-v1/panels/panel-pause.png");
  --ui-panel-death: url("assets/sprites/ui/batch-f-generated-chromakey-v1/panels/panel-death.png");
  --ui-panel-win: url("assets/sprites/ui/batch-f-generated-chromakey-v1/panels/panel-win.png");
  --ui-panel-shop: url("assets/sprites/ui/batch-f-generated-chromakey-v1/panels/panel-shop.png");
  --ui-panel-card: url("assets/sprites/ui/batch-f-generated-chromakey-v1/panels/panel-card.png");
  --ui-overlay-start-pause-v1: url("assets/sprites/ui/start-pause-overlay-v1/start-pause-overlay-v1b-clean.webp");
  --ui-shop-terminal-v1: url("assets/sprites/ui/shop-terminal-v1/shop-terminal-with-icons-v1-alpha.webp");
  --ui-log-archive-shell-v1: url("assets/sprites/ui/log-archive-v1/log-archive-shell-v1d-alpha.webp");
  --ui-log-archive-row-v1: url("assets/sprites/ui/log-archive-v1/log-archive-row-frame-v1-alpha.webp");
  --ui-beacon-panel-wide: url("assets/sprites/ui/beacon-os-v2/alpha/overlay-panel-wide.png");
  --ui-beacon-card: url("assets/sprites/ui/beacon-os-v2/alpha/shop-card-default.png");
  --ui-beacon-button-primary: url("assets/sprites/ui/beacon-os-v2/alpha/button-primary-default.png");
  --ui-beacon-button-secondary: url("assets/sprites/ui/beacon-os-v2/alpha/button-secondary-default.png");
  --ui-beacon-button-selected: url("assets/sprites/ui/beacon-os-v2/alpha/button-selected.png");
  --ui-beacon-button-close: url("assets/sprites/ui/beacon-os-v2/alpha/button-close.png");
  --ui-beacon-divider: url("assets/sprites/ui/beacon-os-v2/alpha/overlay-divider.png");
  --touch-controls-user-opacity: 1;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  touch-action: none;
}

button {
  border: 0;
  color: inherit;
  font: inherit;
}

.game-shell {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 35% 20%, rgba(255, 109, 181, 0.19), transparent 26rem),
    radial-gradient(circle at 72% 42%, rgba(108, 242, 220, 0.09), transparent 24rem),
    linear-gradient(180deg, #06080d, #0c0711 64%, #040506);
}

#gameCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

.orientation-lock {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 194, 79, 0.18), rgba(0, 0, 0, 0.86) 64%),
    rgba(4, 6, 10, 0.94);
  color: #fffaf4;
  text-align: center;
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
  pointer-events: auto;
}

.orientation-lock strong {
  font-size: 28px;
  line-height: 1;
  text-shadow:
    3px 3px 0 #05060a,
    0 0 16px rgba(255, 194, 79, 0.34);
}

.orientation-lock span {
  color: #d8d4e7;
  font-size: 14px;
  font-weight: 800;
}

.hud {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: max(18px, env(safe-area-inset-left));
  right: max(18px, env(safe-area-inset-right));
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(140px, 1fr);
  align-items: start;
  gap: 14px;
  pointer-events: none;
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
}

.hud-left,
.hud-center,
.hud-right,
.chip,
.icon-button {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: var(--panel);
  border: 0;
  box-shadow: none;
}

.hud-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: min(390px, 100%);
  padding: 0;
  background: transparent;
}

.weapon-badge {
  position: relative;
  width: 78px;
  height: 78px;
  flex: 0 0 auto;
  background: var(--ui-weapon-pistol) center / contain no-repeat;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.72));
}

.weapon-badge::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.18);
  filter: blur(8px);
  z-index: -1;
}

.weapon-badge[data-weapon="pistol"] {
  background-image: var(--ui-weapon-pistol);
}

.weapon-badge[data-weapon="smg"] {
  background-image: var(--ui-weapon-smg);
}

.weapon-badge[data-weapon="scatter"] {
  background-image: var(--ui-weapon-scatter);
}

.weapon-badge[data-weapon="bolt"] {
  background-image: var(--ui-weapon-bolt);
}

.weapon-badge[data-weapon="grenade"] {
  background-image: var(--ui-weapon-thumper);
}

.weapon-sprite {
  display: none;
  position: absolute;
  left: 16px;
  top: 17px;
  width: 50px;
  height: 15px;
  transform: rotate(-31deg);
  transform-origin: center;
  border-radius: 9px;
  background:
    linear-gradient(90deg, #ffe5a4 0 16%, #2f353d 16% 31%, #f3a646 31% 48%, #4a3131 48% 64%, #171a20 64% 100%);
  border: 3px solid #0b0d12;
  box-shadow:
    16px 9px 0 -4px #dda052,
    -14px 16px 0 -5px #794431,
    0 0 0 2px rgba(255, 255, 255, 0.14);
}

.weapon-sprite::before {
  content: "";
  position: absolute;
  right: -15px;
  top: 2px;
  width: 18px;
  height: 8px;
  border-radius: 4px;
  background: #9fe8ff;
  border: 2px solid #11131a;
}

.hud-stack {
  min-width: 220px;
  padding-top: 8px;
}

.hud-center {
  min-width: 275px;
  padding: 8px 18px 10px;
  border-radius: 18px 8px 18px 8px;
  text-align: center;
  background: rgba(0, 0, 0, 0.42);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.08),
    0 8px 18px rgba(0, 0, 0, 0.48);
}

.hud-center strong {
  display: block;
  font-size: 15px;
  color: #fff;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow:
    2px 2px 0 #0a0b10,
    -1px 2px 0 #0a0b10,
    0 0 10px rgba(255, 96, 184, 0.5);
}

.hud-center span {
  display: block;
  margin-top: 3px;
  color: #e7e0fb;
  font-size: 12px;
  text-shadow: 1px 1px 0 #05060a;
}

.hud-right {
  justify-self: end;
  display: flex;
  gap: 8px;
  align-items: center;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.meter {
  position: relative;
  height: 11px;
  overflow: hidden;
  border-radius: 999px 8px 8px 999px;
  background: rgba(22, 13, 12, 0.86);
  border: 2px solid rgba(7, 6, 7, 0.84);
  box-shadow:
    inset 0 -2px rgba(0, 0, 0, 0.38),
    0 2px 0 rgba(255, 255, 255, 0.07);
}

.meter + .meter {
  margin-top: 5px;
}

.meter span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  transition: width 160ms ease;
}

.meter-health span {
  background:
    repeating-linear-gradient(90deg, transparent 0 8px, rgba(14, 8, 7, 0.42) 8px 11px),
    linear-gradient(90deg, #ffc64b, #ffe678 64%, #fff0a1);
}

.meter-armor span {
  background:
    repeating-linear-gradient(90deg, transparent 0 12px, rgba(5, 8, 12, 0.36) 12px 14px),
    linear-gradient(90deg, #81d4ff, #d3f7ff);
}

.ammo-line {
  display: grid;
  grid-template-columns: 96px auto;
  align-items: center;
  gap: 12px;
  min-height: 31px;
}

.ammo-line strong,
.chip strong {
  white-space: nowrap;
  color: #fff;
  font-size: 26px;
  line-height: 1;
  text-shadow:
    3px 3px 0 #05060a,
    -1px 2px 0 #05060a,
    0 0 7px rgba(255, 255, 255, 0.16);
}

.heart-row {
  display: flex;
  gap: 5px;
}

.heart-row span {
  position: relative;
  width: 27px;
  height: 27px;
  border-radius: 0;
  background: var(--ui-hud-health) center / contain no-repeat;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5));
}

.heart-row span::before,
.heart-row span::after {
  content: none;
}

.heart-row span.is-empty {
  opacity: 0.28;
  filter: grayscale(1);
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  font-size: 12px;
  color: #efe8be;
  text-shadow: 2px 2px 0 #07070a;
  text-transform: uppercase;
}

.stat-row strong {
  color: var(--text);
}

.chip,
.icon-button {
  min-height: 48px;
  border-radius: 999px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  background: rgba(0, 0, 0, 0.4);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.08),
    0 7px 15px rgba(0, 0, 0, 0.36);
}

.coin-dot,
.med-dot,
.key-dot,
.part-dot,
.resource-dot {
  width: 28px;
  height: 28px;
  border-radius: 0;
  display: inline-block;
  position: relative;
  flex: 0 0 auto;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.56));
}

.coin-dot {
  width: 30px;
  height: 30px;
  background-image: var(--ui-hud-coin);
}

.med-dot {
  width: 30px;
  height: 30px;
  background-image: var(--ui-hud-medkit);
}

.key-dot {
  width: 30px;
  height: 30px;
  background-image: var(--ui-hud-keycard);
}

.part-dot {
  width: 30px;
  height: 30px;
  background-image: var(--ui-hud-part);
}

.part-dot::before {
  content: none;
}

.resource-dot {
  width: 30px;
  height: 30px;
  background-image: var(--ui-resource-ore);
}

.resource-dot[data-resource="ore"] {
  background-image: var(--ui-resource-ore);
}

.resource-dot[data-resource="spore"] {
  background-image: var(--ui-resource-spore);
}

.resource-dot[data-resource="cell"] {
  background-image: var(--ui-resource-cell);
}

.resource-dot[data-resource="scrap"] {
  background-image: var(--ui-resource-scrap);
}

.icon-button {
  width: 58px;
  padding: 0;
  pointer-events: auto;
  cursor: pointer;
  color: #eef5ff;
  font-size: 28px;
  letter-spacing: 3px;
  background:
    var(--ui-touch-menu) center / contain no-repeat,
    rgba(3, 5, 11, 0.18);
  box-shadow:
    0 9px 18px rgba(0, 0, 0, 0.42);
  text-indent: -999px;
  overflow: hidden;
}

.touch-controls {
  position: absolute;
  inset: auto 0 0;
  z-index: 4;
  display: none;
  justify-content: space-between;
  align-items: flex-end;
  gap: 28px;
  padding:
    0 max(24px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom))
    max(24px, env(safe-area-inset-left));
  opacity: var(--touch-controls-user-opacity, 1);
  pointer-events: none;
}

.touch-left,
.touch-right {
  display: grid;
  gap: 10px;
  pointer-events: auto;
}

.touch-left {
  position: relative;
  width: 204px;
  height: 204px;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  padding: 0;
}

.touch-left::before,
.touch-right::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 0;
  background: var(--ui-touch-joystick) center / contain no-repeat;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.48));
  pointer-events: none;
}

.touch-right {
  position: relative;
  grid-template-columns: repeat(4, 58px);
  grid-template-rows: 58px 86px;
  align-items: end;
  gap: 8px;
  padding: 10px;
}

.touch-right::before {
  inset: auto 0 0 auto;
  width: 178px;
  height: 178px;
  background: var(--ui-touch-aim) center / contain no-repeat;
  opacity: 0.22;
}

.touch-btn {
  position: relative;
  z-index: 1;
  height: 58px;
  border-radius: 999px;
  border: 0;
  background: var(--touch-control-image) center / contain no-repeat;
  box-shadow: none;
  color: transparent;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  text-shadow: none;
  touch-action: none;
  user-select: none;
}

.touch-btn:active,
.touch-btn.is-held {
  transform: translateY(1px) scale(0.985);
  filter:
    brightness(1.16)
    drop-shadow(0 0 12px rgba(118, 229, 255, 0.44));
}

.touch-btn.direction {
  width: auto;
  height: auto;
  min-height: 100%;
  background: transparent;
  opacity: 0;
}

.touch-btn.mini {
  width: 58px;
  height: 58px;
  font-size: 20px;
}

.touch-btn[data-action="swap"] {
  --touch-control-image: var(--ui-touch-swap);
}

.touch-btn[data-action="reload"] {
  --touch-control-image: var(--ui-touch-reload);
}

.touch-btn[data-action="heal"] {
  --touch-control-image: var(--ui-touch-heal);
}

.touch-btn[data-action="interact"] {
  --touch-control-image: var(--ui-touch-interact);
}

.touch-btn[data-action="jump"] {
  --touch-control-image: var(--ui-touch-jump);
}

.touch-btn[data-action="shoot"] {
  --touch-control-image: var(--ui-touch-shoot);
}

.touch-btn.jump {
  grid-column: 1 / span 2;
  height: 86px;
  background-size: 86px 86px;
}

.touch-btn.fire,
.touch-btn.aim-pad {
  grid-column: 3 / span 2;
  height: 86px;
  background-size: 86px 86px;
  font-size: 40px;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 169, 65, 0.13), transparent 36%),
    radial-gradient(circle at 50% 56%, rgba(92, 224, 255, 0.1), rgba(0, 0, 0, 0.86) 70%),
    rgba(0, 0, 0, 0.54);
}

.overlay.is-visible {
  display: flex;
}

.mission-panel {
  --panel-accent: #7deaff;
  --panel-accent-2: #ffbe54;
  position: relative;
  isolation: isolate;
  width: min(640px, calc(100vw - 36px));
  min-height: 0;
  border-radius: 10px;
  border: 3px solid rgba(139, 171, 179, 0.38);
  padding: 30px 36px 28px;
  background:
    linear-gradient(90deg, rgba(255, 181, 67, 0.36) 0 7px, transparent 7px calc(100% - 7px), rgba(125, 234, 255, 0.24) calc(100% - 7px) 100%),
    radial-gradient(circle at 90% 0%, rgba(125, 234, 255, 0.18), transparent 36%),
    radial-gradient(circle at 8% 100%, rgba(255, 151, 45, 0.16), transparent 38%),
    linear-gradient(180deg, rgba(55, 51, 45, 0.98), rgba(17, 22, 28, 0.99) 44%, rgba(8, 10, 15, 0.98)),
    rgba(8, 11, 16, 0.96);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 0 0 9px rgba(5, 8, 12, 0.34),
    inset 0 -28px 56px rgba(0, 0, 0, 0.44),
    0 24px 86px rgba(0, 0, 0, 0.72),
    0 0 28px rgba(125, 234, 255, 0.08),
    0 0 0 1px rgba(0, 0, 0, 0.72);
}

.mission-panel::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 12px;
  border-radius: 6px;
  background:
    radial-gradient(circle at 18px 18px, rgba(255, 207, 102, 0.86) 0 3px, rgba(5, 7, 10, 0.94) 3px 6px, transparent 7px),
    radial-gradient(circle at calc(100% - 18px) 18px, rgba(125, 234, 255, 0.82) 0 3px, rgba(5, 7, 10, 0.94) 3px 6px, transparent 7px),
    radial-gradient(circle at 18px calc(100% - 18px), rgba(125, 234, 255, 0.7) 0 3px, rgba(5, 7, 10, 0.94) 3px 6px, transparent 7px),
    radial-gradient(circle at calc(100% - 18px) calc(100% - 18px), rgba(255, 207, 102, 0.78) 0 3px, rgba(5, 7, 10, 0.94) 3px 6px, transparent 7px),
    linear-gradient(90deg, rgba(125, 234, 255, 0.12), transparent 28%, rgba(255, 190, 84, 0.11)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.032) 0 1px, transparent 1px 40px);
  box-shadow:
    inset 0 0 0 1px rgba(118, 207, 237, 0.16),
    inset 0 0 42px rgba(125, 234, 255, 0.07);
}

.mission-panel::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: 42px;
  right: 42px;
  top: 18px;
  height: 6px;
  border-radius: 3px;
  background:
    linear-gradient(90deg, var(--panel-accent-2), var(--panel-accent) 58%, rgba(255, 255, 255, 0.02) 92%);
  box-shadow:
    0 0 18px rgba(125, 234, 255, 0.24),
    0 2px 0 rgba(0, 0, 0, 0.42);
  opacity: 0.94;
  pointer-events: none;
}

.kicker,
.mission-panel h1,
.mission-panel p,
.overlay-actions,
.sector-map-panel {
  position: relative;
  z-index: 1;
}

.overlay-subtitle {
  display: none;
}

.overlay[data-overlay-mode="pause"] .mission-panel {
  --panel-accent: #86ecff;
  --panel-accent-2: #ffcf66;
}

.overlay[data-overlay-mode="death"] .mission-panel {
  --panel-accent: #ff5449;
  --panel-accent-2: #ffb15f;
}

.overlay[data-overlay-mode="win"] .mission-panel,
.overlay[data-overlay-mode="next"] .mission-panel {
  --panel-accent: #ffe06a;
  --panel-accent-2: #8cf0ff;
}

.kicker {
  margin: 0 0 10px;
  color: #ffd05b;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.mission-panel h1 {
  margin: 0;
  font-size: clamp(38px, 5.4vw, 60px);
  line-height: 1;
  letter-spacing: 0;
  color: #fff;
  text-shadow:
    4px 4px 0 #05060a,
    0 0 16px rgba(125, 234, 255, 0.28);
}

.mission-panel p:not(.kicker) {
  max-width: 440px;
  margin: 14px 0 0;
  color: #dde1ef;
  line-height: 1.45;
}

.overlay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.overlay-action-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.overlay-action-content svg {
  width: 1.1em;
  height: 1.1em;
  flex: 0 0 auto;
}

.overlay-play-icon {
  fill: currentColor;
}

.overlay-replay-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 4.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.overlay-log-icon {
  display: none;
}

.overlay-map-icon {
  display: none;
}

.overlay-settings-icon {
  display: none;
}

.primary-action,
.ghost-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  min-width: 150px;
  border-radius: 8px;
  padding: 0 16px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.primary-action {
  color: #111318;
  border: 2px solid rgba(71, 34, 8, 0.94);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 42%),
    linear-gradient(135deg, #ffe06a, #ff9a2d);
  box-shadow:
    inset 0 2px rgba(255, 255, 255, 0.32),
    0 5px 0 #6b310f,
    0 12px 22px rgba(0, 0, 0, 0.36);
}

.ghost-action {
  color: #e8f8ff;
  border: 2px solid rgba(126, 226, 255, 0.24);
  background:
    linear-gradient(180deg, rgba(130, 232, 255, 0.1), transparent),
    rgba(7, 13, 21, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 8px 18px rgba(0, 0, 0, 0.28);
}

.primary-action:active,
.ghost-action:active {
  transform: translateY(2px);
  filter: brightness(1.08);
}

.sector-map-panel {
  display: none;
  margin-top: 18px;
  border: 2px solid rgba(126, 226, 255, 0.22);
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(129, 229, 255, 0.08), transparent 42%),
    rgba(4, 8, 14, 0.76);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 14px 34px rgba(0, 0, 0, 0.32);
}

.overlay.is-sector-map-open .sector-map-panel {
  display: block;
}

.sector-map-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: #e9fbff;
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
}

.sector-map-header strong {
  display: block;
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0.08em;
}

.sector-map-header span {
  display: block;
  margin-top: 4px;
  color: #8dbcc6;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.sector-map-close {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: rgba(128, 231, 255, 0.08);
  color: #bdf8ff;
  cursor: pointer;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.sector-map-progress {
  height: 7px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.sector-map-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffd85c, #7deaff);
  box-shadow: 0 0 16px rgba(125, 234, 255, 0.28);
}

.sector-map-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: min(44vh, 390px);
  overflow: auto;
  padding-right: 4px;
}

.sector-act {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.22);
}

.sector-act-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
}

.sector-act-title {
  color: #f8fbff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sector-act-status {
  color: #ffd05b;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.sector-level-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.sector-level-button {
  min-height: 58px;
  border-radius: 7px;
  border: 1px solid rgba(126, 226, 255, 0.16);
  padding: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent),
    rgba(9, 15, 22, 0.74);
  color: #dff9ff;
  cursor: pointer;
  text-align: left;
}

.sector-level-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  filter: grayscale(0.55);
}

.sector-level-button.is-current {
  border-color: rgba(255, 213, 93, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(255, 213, 93, 0.18),
    0 0 18px rgba(255, 213, 93, 0.12);
}

.sector-level-button.is-cleared {
  border-color: rgba(126, 226, 255, 0.28);
}

.sector-level-button span {
  display: block;
}

.sector-level-number {
  color: #ffd05b;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.sector-level-name {
  margin-top: 4px;
  color: #fffaf4;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.04;
}

.sector-level-state {
  margin-top: 5px;
  color: #8dbcc6;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.sector-level-button.is-locked .sector-level-state {
  color: #ff8d7f;
}

.sector-level-button.is-cleared .sector-level-state {
  color: #8cf0ff;
}

body[data-ui-overlay="v1"] .overlay {
  padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right))
    max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  background:
    linear-gradient(90deg, rgba(117, 229, 235, 0.04) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(0deg, rgba(117, 229, 235, 0.035) 1px, transparent 1px) 0 0 / 42px 42px,
    radial-gradient(circle at 50% 45%, rgba(49, 217, 226, 0.12), transparent 34rem),
    rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(2px);
}

body[data-ui-overlay="v1"][data-overlay-visible="true"] .hud,
body[data-ui-overlay="v1"][data-overlay-visible="true"] .touch-controls,
body[data-ui-overlay="v1"][data-overlay-visible="true"] .toast {
  opacity: 0;
  pointer-events: none;
}

body[data-ui-overlay="v1"] .mission-panel {
  container-type: inline-size;
  width: min(1180px, 96vw, calc((100vh - 20px) * 1.5));
  max-height: calc(100vh - 20px);
  aspect-ratio: 3 / 2;
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.76);
  overflow: visible;
}

body[data-ui-overlay="v1"] .mission-panel::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  border-radius: 0;
  background: var(--ui-overlay-start-pause-v1) center / 100% 100% no-repeat;
  box-shadow: none;
  pointer-events: none;
}

body[data-ui-overlay="v1"] .mission-panel::after,
body[data-ui-overlay="v1"] .kicker {
  display: none;
}

body[data-ui-overlay="v1"] .mission-panel h1,
body[data-ui-overlay="v1"] .overlay-subtitle,
body[data-ui-overlay="v1"] #overlayCopy,
body[data-ui-overlay="v1"] .overlay-actions {
  position: absolute;
  z-index: 1;
}

body[data-ui-overlay="v1"] .mission-panel h1 {
  left: 20.2%;
  right: 20.2%;
  top: 32.3%;
  margin: 0;
  color: #8bd8df;
  font-size: clamp(24px, 5cqw, 50px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  text-shadow:
    0 0 12px rgba(114, 243, 255, 0.2),
    2px 3px 0 rgba(0, 0, 0, 0.78);
}

body[data-ui-overlay="v1"] .overlay-subtitle {
  display: block;
  left: 24%;
  right: 24%;
  top: 41.2%;
  margin: 0;
  color: #83b8c0;
  font-size: clamp(11px, 1.8cqw, 20px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
  text-align: center;
}

body[data-ui-overlay="v1"] #overlayCopy {
  left: 29%;
  right: 29%;
  top: 57%;
  max-width: none;
  margin: 0;
  color: #8cb4bc;
  font-size: clamp(11px, 1.55cqw, 18px);
  line-height: 1.58;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-align: center;
}

body[data-ui-overlay="v1"] .overlay-actions {
  inset: 0;
  display: block;
  margin: 0;
  pointer-events: none;
}

body[data-ui-overlay="v1"] .primary-action,
body[data-ui-overlay="v1"] .ghost-action {
  position: absolute;
  z-index: 2;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: 0.055em;
  line-height: 1;
  text-transform: uppercase;
  clip-path: polygon(10% 0, 90% 0, 100% 24%, 100% 76%, 90% 100%, 10% 100%, 0 76%, 0 24%);
  pointer-events: auto;
}

body[data-ui-overlay="v1"] .primary-action:active,
body[data-ui-overlay="v1"] .ghost-action:active {
  transform: translateY(1px);
}

body[data-ui-overlay="v1"] .overlay-action-content {
  position: absolute;
  inset: 0;
  display: block;
}

body[data-ui-overlay="v1"] .overlay-action-label {
  position: absolute;
  top: 40%;
  display: block;
  font-size: clamp(10px, 1.6cqw, 20px);
  line-height: 1;
  transform: translate(-50%, -50%);
}

body[data-ui-overlay="v1"] .primary-action {
  left: 14%;
  bottom: 12%;
  width: 19.5%;
  height: 8.7%;
  color: #ffdc78;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.75);
}

body[data-ui-overlay="v1"] .primary-action .overlay-action-label {
  left: 55%;
}

body[data-ui-overlay="v1"] #restartButton {
  right: 13%;
  bottom: 12%;
  width: 18.6%;
  height: 8.4%;
  color: #9eeaf1;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.75);
}

body[data-ui-overlay="v1"] #restartButton .overlay-action-label {
  left: 58%;
}

body[data-ui-overlay="v1"] .overlay-play-icon {
  position: absolute;
  left: 19%;
  top: 41%;
  width: clamp(13px, 2.2cqw, 28px);
  height: clamp(13px, 2.2cqw, 28px);
  transform: translate(-50%, -50%);
  fill: currentColor;
  filter: drop-shadow(0 0 8px rgba(255, 222, 120, 0.28));
}

body[data-ui-overlay="v1"] .overlay-replay-icon {
  position: absolute;
  left: 24%;
  top: 41%;
  width: clamp(14px, 2.3cqw, 30px);
  height: clamp(14px, 2.3cqw, 30px);
  transform: translate(-50%, -50%);
  fill: none;
  stroke: currentColor;
  stroke-width: 4.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 8px rgba(114, 243, 255, 0.22));
}

body[data-ui-overlay="v1"] .overlay-log-link {
  top: 16%;
  left: 15%;
  width: auto;
  height: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #bdf8ff;
  opacity: 0.78;
  clip-path: none;
  text-shadow: 0 0 7px rgba(114, 243, 255, 0.22);
}

body[data-ui-overlay="v1"] .overlay-sector-link {
  top: 16%;
  right: 15%;
  width: auto;
  height: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ffd778;
  opacity: 0.82;
  clip-path: none;
  text-shadow: 0 0 7px rgba(255, 215, 120, 0.22);
}

body[data-ui-overlay="v1"] .overlay-settings-link {
  top: 15.8%;
  right: 14.6%;
  width: 11.4%;
  height: 4.4%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0 0.6cqw;
  border: 1px solid rgba(127, 237, 255, 0.22);
  border-radius: 0.35cqw;
  background: linear-gradient(180deg, rgba(19, 56, 66, 0.62), rgba(4, 17, 24, 0.78));
  color: #bdf8ff;
  opacity: 0.86;
  clip-path: none;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 0 1.1cqw rgba(73, 232, 245, 0.07),
    0 0.42cqw 1.1cqw rgba(0, 0, 0, 0.24);
  text-shadow: 0 0 0.45cqw rgba(114, 243, 255, 0.28);
}

body[data-ui-overlay="v1"] .overlay-settings-link[hidden],
.settings-panel[hidden] {
  display: none !important;
}

body[data-ui-overlay="v1"] .overlay-sector-link:hover {
  opacity: 0.98;
}

body[data-ui-overlay="v1"] .overlay-log-link:hover,
body[data-ui-overlay="v1"] .overlay-settings-link:hover {
  opacity: 0.95;
}

body[data-ui-overlay="v1"] .overlay-log-icon,
body[data-ui-overlay="v1"] .overlay-map-icon,
body[data-ui-overlay="v1"] .overlay-settings-icon {
  display: block;
  width: clamp(13px, 1.7cqw, 22px);
  height: clamp(18px, 2.3cqw, 30px);
  border: 2px solid currentColor;
  border-radius: 2px;
  position: relative;
  flex: 0 0 auto;
}

body[data-ui-overlay="v1"] .overlay-map-icon {
  border-radius: 50%;
}

body[data-ui-overlay="v1"] .overlay-settings-icon {
  display: none;
}

body[data-ui-overlay="v1"] .overlay-log-icon::before,
body[data-ui-overlay="v1"] .overlay-log-icon::after {
  content: "";
  position: absolute;
  left: 22%;
  right: 18%;
  height: 2px;
  background: currentColor;
}

body[data-ui-overlay="v1"] .overlay-log-icon::before {
  top: 24%;
  box-shadow: 0 7px 0 currentColor;
}

body[data-ui-overlay="v1"] .overlay-log-icon::after {
  top: 62%;
}

body[data-ui-overlay="v1"] .overlay-map-icon::before,
body[data-ui-overlay="v1"] .overlay-map-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 62%;
  height: 2px;
  background: currentColor;
  transform: translate(-50%, -50%);
}

body[data-ui-overlay="v1"] .overlay-map-icon::after {
  width: 2px;
  height: 62%;
}

body[data-ui-overlay="v1"] .overlay-log-label,
body[data-ui-overlay="v1"] .overlay-map-label,
body[data-ui-overlay="v1"] .overlay-settings-label {
  font-size: clamp(8px, 1.05cqw, 14px);
  line-height: 0.96;
  font-weight: 900;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

body[data-ui-overlay="v1"] .sector-map-panel {
  position: absolute;
  z-index: 3;
  left: 9.2%;
  right: 9.2%;
  top: 13.6%;
  bottom: 22.5%;
  display: none;
  margin: 0;
  padding: clamp(12px, 2.2cqw, 26px);
  border: 2px solid rgba(126, 226, 255, 0.24);
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(255, 208, 91, 0.12), transparent 24%, rgba(126, 226, 255, 0.1)),
    rgba(3, 8, 14, 0.86);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.045),
    inset 0 0 42px rgba(126, 226, 255, 0.07);
  overflow: hidden;
}

body[data-ui-overlay="v1"] .overlay.is-sector-map-open .sector-map-panel {
  display: flex;
  flex-direction: column;
}

body[data-ui-overlay="v1"] .overlay.is-sector-map-open .mission-panel h1,
body[data-ui-overlay="v1"] .overlay.is-sector-map-open .overlay-subtitle,
body[data-ui-overlay="v1"] .overlay.is-sector-map-open #overlayCopy,
body[data-ui-overlay="v1"] .overlay.is-sector-map-open .overlay-log-link,
body[data-ui-overlay="v1"] .overlay.is-sector-map-open .overlay-sector-link,
body[data-ui-overlay="v1"] .overlay.is-sector-map-open .overlay-settings-link {
  opacity: 0;
  pointer-events: none;
}

body[data-ui-overlay="v1"] .sector-map-list {
  flex: 1 1 auto;
  max-height: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(7px, 1.1cqw, 13px);
  overflow: hidden;
  padding-right: 0;
}

body[data-ui-overlay="v1"] .sector-act {
  border-radius: 0;
  padding: clamp(8px, 1.2cqw, 14px);
  background: rgba(0, 0, 0, 0.24);
}

body[data-ui-overlay="v1"] .sector-level-grid {
  grid-template-columns: 1fr;
  gap: clamp(5px, 0.7cqw, 8px);
}

body[data-ui-overlay="v1"] .sector-level-button {
  min-height: clamp(42px, 5.1cqw, 60px);
  border-radius: 0;
  padding: clamp(6px, 0.9cqw, 10px);
}

body[data-ui-overlay="v1"] .sector-map-header {
  margin-bottom: clamp(7px, 1cqw, 12px);
}

body[data-ui-overlay="v1"] .sector-map-progress {
  flex: 0 0 auto;
  height: clamp(4px, 0.7cqw, 7px);
  margin-bottom: clamp(8px, 1cqw, 13px);
}

body[data-ui-overlay="v1"] .sector-level-name {
  font-size: clamp(10px, 1.05cqw, 14px);
}

body[data-ui-overlay="v1"] .sector-level-state,
body[data-ui-overlay="v1"] .sector-level-number,
body[data-ui-overlay="v1"] .sector-act-status {
  font-size: clamp(7px, 0.76cqw, 10px);
}

body[data-ui-overlay="v1"] .sector-act-title {
  font-size: clamp(8px, 0.92cqw, 12px);
}

.shop-panel {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: none;
  align-items: center;
  justify-content: center;
  padding:
    max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 50% 34%, rgba(105, 233, 255, 0.14), transparent 34%),
    radial-gradient(circle at 50% 72%, rgba(255, 174, 70, 0.11), rgba(0, 0, 0, 0.84) 70%),
    repeating-linear-gradient(90deg, rgba(255, 194, 79, 0.035) 0 1px, transparent 1px 68px),
    rgba(0, 0, 0, 0.58);
}

.shop-panel.is-visible {
  display: flex;
}

.shop-window {
  position: relative;
  isolation: isolate;
  width: min(1040px, calc(100vw - 40px));
  max-height: min(720px, calc(100vh - 36px));
  overflow: hidden;
  border-radius: 10px;
  border: 3px solid rgba(143, 173, 174, 0.36);
  background:
    linear-gradient(90deg, rgba(255, 189, 74, 0.33) 0 7px, transparent 7px calc(100% - 7px), rgba(114, 240, 255, 0.23) calc(100% - 7px) 100%),
    radial-gradient(circle at 94% 0%, rgba(255, 194, 79, 0.15), transparent 34%),
    radial-gradient(circle at 7% 100%, rgba(114, 240, 255, 0.13), transparent 35%),
    linear-gradient(145deg, rgba(48, 49, 45, 0.99), rgba(13, 18, 24, 0.99) 48%, rgba(7, 9, 14, 0.99));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 0 0 10px rgba(5, 8, 12, 0.3),
    inset 0 0 46px rgba(111, 236, 255, 0.07),
    0 24px 90px rgba(0, 0, 0, 0.72),
    0 0 0 1px rgba(0, 0, 0, 0.72);
}

.shop-window::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 12px;
  border-radius: 6px;
  background:
    radial-gradient(circle at 20px 20px, rgba(255, 207, 102, 0.74) 0 3px, rgba(5, 7, 10, 0.94) 3px 6px, transparent 7px),
    radial-gradient(circle at calc(100% - 20px) 20px, rgba(125, 234, 255, 0.7) 0 3px, rgba(5, 7, 10, 0.94) 3px 6px, transparent 7px),
    radial-gradient(circle at 20px calc(100% - 20px), rgba(125, 234, 255, 0.6) 0 3px, rgba(5, 7, 10, 0.94) 3px 6px, transparent 7px),
    radial-gradient(circle at calc(100% - 20px) calc(100% - 20px), rgba(255, 207, 102, 0.64) 0 3px, rgba(5, 7, 10, 0.94) 3px 6px, transparent 7px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px 42px),
    linear-gradient(180deg, rgba(125, 234, 255, 0.07), transparent 34%, rgba(255, 194, 79, 0.055));
  box-shadow: inset 0 0 0 1px rgba(118, 207, 237, 0.14);
  pointer-events: none;
}

.shop-window::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: 34px;
  right: 34px;
  top: 18px;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, #ffc24f, #7df0ff 52%, transparent 90%);
  box-shadow:
    0 0 16px rgba(125, 234, 255, 0.24),
    0 2px 0 rgba(0, 0, 0, 0.42);
  pointer-events: none;
}

.shop-header,
.shop-funds,
.shop-options {
  position: relative;
  z-index: 1;
}

.shop-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 28px 30px 18px;
  border-bottom: 1px solid rgba(145, 225, 239, 0.18);
  background:
    linear-gradient(90deg, rgba(255, 194, 79, 0.16), transparent 34%, rgba(119, 237, 255, 0.11)),
    rgba(0, 0, 0, 0.24);
}

.shop-header h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(36px, 4.5vw, 54px);
  line-height: 1;
  text-shadow:
    4px 4px 0 #05060a,
    0 0 16px rgba(118, 239, 255, 0.28);
}

.shop-header p:not(.kicker) {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.35;
}

.shop-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 52px;
  min-height: 52px;
  border-radius: 50%;
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0;
  text-indent: 0;
  color: #dff8ff;
  background:
    radial-gradient(circle at 50% 44%, rgba(174, 239, 255, 0.18), rgba(5, 8, 13, 0.86) 68%),
    rgba(5, 8, 13, 0.86);
  box-shadow:
    inset 0 0 0 2px rgba(150, 226, 255, 0.28),
    0 9px 18px rgba(0, 0, 0, 0.42);
}

.shop-funds {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 30px 2px;
}

.shop-funds span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 8px;
  padding: 0 12px;
  color: #f7f0ff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent),
    rgba(0, 0, 0, 0.38);
  box-shadow:
    inset 0 0 0 2px rgba(255, 194, 79, 0.22),
    0 6px 16px rgba(0, 0, 0, 0.28);
}

.shop-funds b {
  color: var(--fund-color, #ffc24f);
  font-size: 18px;
}

.shop-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-height: calc(100vh - 236px);
  overflow: auto;
  padding: 18px 30px 30px;
}

.shop-card {
  position: relative;
  isolation: isolate;
  min-height: 184px;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 14px;
  border-radius: 8px;
  border: 2px solid rgba(156, 223, 239, 0.18);
  padding: 20px 20px 18px;
  background:
    linear-gradient(90deg, rgba(255, 194, 79, 0.24) 0 5px, transparent 5px),
    radial-gradient(circle at 88% 0%, rgba(125, 234, 255, 0.11), transparent 40%),
    linear-gradient(145deg, rgba(38, 45, 50, 0.9), rgba(11, 15, 21, 0.94)),
    rgba(5, 7, 10, 0.8);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 -18px 34px rgba(0, 0, 0, 0.28),
    0 12px 24px rgba(0, 0, 0, 0.34);
}

.shop-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  z-index: 0;
  border-radius: 5px;
  background:
    radial-gradient(circle at 10px 10px, rgba(255, 207, 102, 0.64) 0 2px, transparent 3px),
    radial-gradient(circle at calc(100% - 10px) 10px, rgba(125, 234, 255, 0.46) 0 2px, transparent 3px);
  border: 1px solid rgba(145, 225, 239, 0.09);
  pointer-events: none;
}

.shop-card-top,
.shop-card p,
.shop-card small,
.shop-buy {
  position: relative;
  z-index: 1;
}

.shop-card:not(.is-locked) {
  border-color: rgba(156, 223, 239, 0.28);
}

.shop-card.is-locked {
  opacity: 0.68;
}

.shop-card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.shop-card h3 {
  margin: 0;
  color: #fff;
  font-size: 20px;
  line-height: 1.12;
  text-shadow: 3px 3px 0 #05060a;
}

.shop-progress {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 7px;
  padding: 5px 9px;
  color: #101318;
  background: linear-gradient(135deg, #ffe06a, #72f0ff);
  font-size: 12px;
  font-weight: 900;
}

.shop-card p {
  margin: 10px 0 0;
  color: #d8d4e7;
  font-size: 14px;
  line-height: 1.42;
}

.shop-card small {
  display: block;
  margin-top: 12px;
  color: #ffd15b;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.shop-buy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  color: #111318;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  border: 2px solid rgba(71, 34, 8, 0.94);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 42%),
    linear-gradient(135deg, #ffe06a, #ff9a2d);
  box-shadow:
    inset 0 2px rgba(255, 255, 255, 0.28),
    0 5px 0 #6b310f;
}

.shop-buy:not(:disabled):active {
  transform: translateY(3px);
  box-shadow: inset 0 3px rgba(255, 255, 255, 0.2), 0 3px 0 #5c2c11;
}

.shop-buy:disabled {
  cursor: default;
  color: rgba(240, 247, 255, 0.72);
  border-color: rgba(94, 129, 150, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent),
    rgba(18, 25, 33, 0.9);
  box-shadow: inset 0 0 0 2px rgba(126, 165, 197, 0.16);
}

.shop-terminal-panel {
  padding:
    max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right))
    max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  background:
    linear-gradient(90deg, rgba(117, 229, 235, 0.04) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(0deg, rgba(117, 229, 235, 0.035) 1px, transparent 1px) 0 0 / 42px 42px,
    radial-gradient(circle at 50% 45%, rgba(49, 217, 226, 0.12), transparent 34rem),
    rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(2px);
}

.shop-terminal-window {
  position: relative;
  isolation: isolate;
  width: min(1536px, calc(100vw - min(4vw, 48px)), calc((100dvh - min(4vh, 36px)) * 1.5));
  aspect-ratio: 3 / 2;
  container-type: inline-size;
  background: var(--ui-shop-terminal-v1) center / 100% 100% no-repeat;
  color: rgba(223, 247, 248, 0.9);
  font-family: "Rajdhani", "Arial Narrow", Arial, sans-serif;
  filter: drop-shadow(0 2.6cqw 4.4cqw rgba(0, 0, 0, 0.58));
  pointer-events: auto;
}

.shop-terminal-header,
.shop-terminal-resource,
.shop-terminal-card,
.shop-terminal-close,
.shop-terminal-buy {
  position: absolute;
}

.shop-terminal-header {
  left: 12.05%;
  top: 9.75%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 29.6%;
  height: 6.7%;
  color: #82f4ff;
  text-shadow: 0 0.16cqw 0 rgba(0, 0, 0, 0.8), 0 0 1.1cqw rgba(74, 238, 255, 0.3);
  overflow: hidden;
}

.shop-terminal-header-title {
  font-size: 1.72cqw;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

.shop-terminal-header-subtitle {
  margin-top: 0.2cqw;
  color: rgba(177, 244, 249, 0.84);
  font-size: 0.9cqw;
  line-height: 1;
  font-weight: 700;
  white-space: nowrap;
}

.shop-terminal-close {
  z-index: 5;
  right: 7%;
  top: 7%;
  width: 7%;
  height: 10.9%;
  padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
  cursor: pointer;
}

.shop-terminal-close:focus-visible {
  outline: 0.2cqw solid rgba(130, 244, 255, 0.78);
  outline-offset: -0.2cqw;
}

.shop-terminal-funds {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
}

.shop-terminal-resource {
  top: 11.6%;
  display: grid;
  place-items: center;
  width: 5%;
  height: 3.2%;
  color: #dceff0;
  font-size: 1.22cqw;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-shadow: 0 0.16cqw 0 rgba(0, 0, 0, 0.86);
}

.shop-terminal-resource b {
  font: inherit;
}

.shop-terminal-resource-coins {
  left: 50.4%;
}

.shop-terminal-resource-parts {
  left: 64%;
}

.shop-terminal-resource-biome {
  left: 76%;
}

.shop-terminal-options {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
}

.shop-terminal-card {
  --title-left: 40%;
  --title-top: 6%;
  --title-width: 50%;
  --title-height: 13%;
  --description-left: 30%;
  --description-top: 30%;
  --description-width: 50%;
  --description-height: 12%;
  --level-right: 5.5%;
  --level-top: 56%;
  --cost-left: 15.6%;
  --cost-bottom: 11.2%;
  --buy-right: 12%;
  --buy-bottom: 9%;
  left: var(--card-left);
  top: var(--card-top);
  width: 37.5%;
  height: 30%;
  pointer-events: none;
}

.shop-terminal-card-weapon {
  --card-left: 11.45%;
  --card-top: 21.55%;
  --description-left: 30%;
}

.shop-terminal-card-armor {
  --card-left: 50.9%;
  --card-top: 21.55%;
  --description-left: 37%;
}

.shop-terminal-card-health {
  --card-left: 11.45%;
  --card-top: 53.95%;
  --description-left: 31%;
}

.shop-terminal-card-supply {
  --card-left: 50.9%;
  --card-top: 53.95%;
  --description-left: 35%;
}

.shop-terminal-card-title {
  position: absolute;
  top: var(--title-top);
  left: var(--title-left);
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--title-width);
  height: var(--title-height);
  margin: 0;
  color: #a8f8ff;
  font-size: 1.32cqw;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-shadow: 0 0.14cqw 0 rgba(0, 0, 0, 0.88);
}

.shop-terminal-card-description {
  position: absolute;
  top: var(--description-top);
  left: var(--description-left);
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--description-width);
  height: var(--description-height);
  margin: 0;
  color: rgba(194, 230, 232, 0.78);
  font-size: 0.92cqw;
  font-weight: 700;
  line-height: 1.12;
  text-align: center;
  text-wrap: balance;
  overflow: hidden;
  text-shadow: 0 0.12cqw 0 rgba(0, 0, 0, 0.72);
}

.shop-terminal-card-level {
  position: absolute;
  right: var(--level-right);
  top: var(--level-top);
  min-width: 9%;
  color: rgba(194, 239, 240, 0.9);
  font-size: 1.02cqw;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-shadow: 0 0.12cqw 0 rgba(0, 0, 0, 0.85);
}

.shop-terminal-card-cost {
  position: absolute;
  left: var(--cost-left);
  bottom: var(--cost-bottom);
  width: 19%;
  color: #fff0a5;
  font-size: 1.12cqw;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-shadow: 0 0.14cqw 0 rgba(0, 0, 0, 0.86), 0 0 0.7cqw rgba(255, 187, 58, 0.18);
}

.shop-terminal-buy {
  z-index: 2;
  right: var(--buy-right);
  bottom: var(--buy-bottom);
  display: grid;
  place-items: center;
  width: 32%;
  height: 14.3%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #fff0a5;
  font: 900 1.14cqw / 1 "Rajdhani", "Arial Narrow", Arial, sans-serif;
  letter-spacing: 0;
  text-align: center;
  text-shadow: 0 0.13cqw 0 rgba(0, 0, 0, 0.9), 0 0 0.78cqw rgba(255, 187, 57, 0.28);
  cursor: pointer;
  pointer-events: auto;
}

.shop-terminal-buy:disabled {
  cursor: default;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: rgba(194, 230, 232, 0.52);
  text-shadow: 0 0.13cqw 0 rgba(0, 0, 0, 0.9);
}

.shop-terminal-card.is-locked .shop-terminal-card-title,
.shop-terminal-card.is-locked .shop-terminal-card-description,
.shop-terminal-card.is-locked .shop-terminal-card-level,
.shop-terminal-card.is-locked .shop-terminal-card-cost {
  opacity: 0.72;
}

.log-archive-panel {
  z-index: 7;
  padding:
    max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right))
    max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  background:
    linear-gradient(90deg, rgba(117, 229, 235, 0.04) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(0deg, rgba(117, 229, 235, 0.035) 1px, transparent 1px) 0 0 / 42px 42px,
    radial-gradient(circle at 50% 45%, rgba(49, 217, 226, 0.12), transparent 34rem),
    rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(2px);
}

.archive {
  --archive-cyan: #86f7ff;
  --archive-cyan-soft: rgba(121, 236, 245, 0.76);
  --archive-cyan-dim: rgba(156, 227, 231, 0.62);
  --archive-ink: #031014;
  --archive-muted: rgba(185, 226, 229, 0.72);
  --archive-locked: rgba(119, 148, 152, 0.56);
  position: relative;
  width: min(1672px, calc(100vw - min(4vw, 48px)), calc((100dvh - min(4vh, 36px)) * 1.7779));
  aspect-ratio: 1672 / 941;
  container-type: inline-size;
  background: var(--ui-log-archive-shell-v1) center / 100% 100% no-repeat;
  color: var(--archive-cyan);
  filter: drop-shadow(0 3.3cqw 4.8cqw rgba(0, 0, 0, 0.54));
  isolation: isolate;
  font-family: "Rajdhani", "Arial Narrow", Arial, sans-serif;
  pointer-events: auto;
}

.archive-header,
.archive-close,
.archive-log-list,
.archive-empty-card,
.archive-reader,
.archive-reader-divider,
.archive-reader-kicker,
.archive-reader-meta-grid,
.archive-reader-scanline,
.archive-reader-body-card,
.archive-reader-context {
  position: absolute;
}

.archive-header {
  left: 13.7%;
  top: 10.65%;
  width: 34.2%;
  height: 6.65%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  text-shadow: 0 0.16cqw 0 rgba(0, 0, 0, 0.82), 0 0 1.15cqw rgba(75, 231, 245, 0.28);
}

.archive-title {
  font-size: 1.72cqw;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

.archive-subtitle {
  margin-top: 0.14cqw;
  color: rgba(177, 244, 249, 0.84);
  font-size: 0.88cqw;
  line-height: 1;
  font-weight: 700;
  white-space: nowrap;
}

.archive-close {
  right: 6.8%;
  top: 6.7%;
  width: 6.8%;
  height: 12.4%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.archive-close:focus-visible {
  outline: 0.16cqw solid rgba(134, 247, 255, 0.72);
  outline-offset: -0.2cqw;
}

.archive-log-list {
  left: 8.67%;
  top: 21.57%;
  width: 29.25%;
  height: 64.3%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0.18cqw 0 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(115, 231, 239, 0.52) rgba(2, 20, 24, 0.24);
  mask-image: linear-gradient(180deg, transparent 0, #000 2.2%, #000 96%, transparent 100%);
}

.archive-log-list::-webkit-scrollbar {
  width: 0.42cqw;
}

.archive-log-list::-webkit-scrollbar-track {
  background: rgba(2, 20, 24, 0.24);
}

.archive-log-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(115, 231, 239, 0.52);
}

.archive-list-item {
  position: relative;
  width: 100%;
  min-height: 6.64cqw;
  margin: 0 0 0.55cqw;
  padding: 0;
  border: 0;
  background: var(--ui-log-archive-row-v1) center / 100% 100% no-repeat;
  display: grid;
  grid-template-columns: 16.2% 1fr;
  align-items: center;
  color: var(--archive-cyan-soft);
  overflow: hidden;
  text-align: left;
  font: inherit;
  text-shadow: 0 0.12cqw 0 rgba(0, 0, 0, 0.8);
  cursor: pointer;
}

.archive-list-item:last-child {
  margin-bottom: 0;
}

.archive-list-item:focus-visible {
  outline: 0.12cqw solid rgba(134, 247, 255, 0.72);
  outline-offset: -0.22cqw;
}

.archive-list-index {
  display: grid;
  place-items: center;
  width: 100%;
  color: rgba(135, 249, 255, 0.92);
  font-size: 1.05cqw;
  font-weight: 900;
  line-height: 1;
  transform: translateX(1.6cqw);
}

.archive-list-copy {
  min-width: 0;
  padding-right: 7%;
  padding-left: 0.92cqw;
}

.archive-list-title {
  display: block;
  color: rgba(193, 252, 255, 0.92);
  font-size: 1.08cqw;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.archive-list-meta {
  display: block;
  margin: 0.52cqw 0 0;
  color: var(--archive-muted);
  font-size: 1.08cqw;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.archive-list-item.is-selected .archive-list-title {
  color: #e2feff;
}

.archive-list-item.is-locked {
  opacity: 0.62;
  cursor: default;
}

.archive-list-item.is-locked .archive-list-title,
.archive-list-item.is-locked .archive-list-meta {
  color: var(--archive-locked);
}

.archive-list-item:disabled {
  pointer-events: none;
}

.archive-lock {
  position: absolute;
  right: 5.6%;
  top: 50%;
  width: 1.1cqw;
  height: 1.1cqw;
  transform: translateY(-50%);
  opacity: 0.84;
}

.archive-lock::before,
.archive-lock::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.archive-lock::before {
  top: 0;
  width: 62%;
  height: 48%;
  border: 0.12cqw solid rgba(133, 181, 184, 0.76);
  border-bottom: 0;
  border-radius: 0.38cqw 0.38cqw 0 0;
}

.archive-lock::after {
  bottom: 0;
  width: 78%;
  height: 58%;
  border-radius: 0.16cqw;
  background: rgba(133, 181, 184, 0.76);
}

.archive-empty-card {
  left: 9.3%;
  top: 74%;
  width: 29.05%;
  height: 13.05%;
  display: none;
  justify-items: center;
  align-content: center;
  gap: 0.36cqw;
  color: rgba(151, 212, 216, 0.64);
  text-align: center;
  overflow: hidden;
}

.archive.is-empty .archive-log-list {
  display: none;
}

.archive.is-empty .archive-empty-card {
  display: grid;
}

.archive-empty-icon {
  position: relative;
  width: 2.8cqw;
  height: 3.4cqw;
  border: 0.16cqw solid rgba(122, 227, 238, 0.42);
  border-radius: 0.12cqw;
}

.archive-empty-icon::before,
.archive-empty-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  background: rgba(122, 227, 238, 0.42);
  transform: translateX(-50%);
}

.archive-empty-icon::before {
  top: 33%;
  width: 58%;
  height: 0.16cqw;
}

.archive-empty-icon::after {
  bottom: 20%;
  width: 42%;
  height: 0.16cqw;
  transform: translateX(-50%) rotate(45deg);
}

.archive-empty-title {
  color: rgba(187, 235, 238, 0.7);
  font-size: 0.86cqw;
  line-height: 1;
}

.archive-empty-copy {
  width: 70%;
  margin: 0;
  color: rgba(166, 205, 209, 0.55);
  font-size: 0.68cqw;
  line-height: 1.18;
}

.archive-reader {
  left: 42.2%;
  top: 23.2%;
  width: 47.5%;
  height: 63.3%;
  color: rgba(222, 250, 251, 0.9);
  overflow: hidden;
}

.archive-reader-kicker {
  left: 7.6%;
  top: 7.2%;
  color: rgba(134, 247, 255, 0.72);
  font-size: 0.82cqw;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.1em;
  text-shadow: 0 0 0.9cqw rgba(63, 226, 240, 0.2);
}

.archive-reader-title {
  position: absolute;
  left: 7.6%;
  top: 12.2%;
  width: 80%;
  height: 6.2%;
  margin: 0;
  color: rgba(197, 253, 255, 0.95);
  font-size: 1.36cqw;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 0.14cqw 0 rgba(0, 0, 0, 0.88);
}

.archive-reader-meta {
  position: absolute;
  left: 7.6%;
  top: 20.2%;
  width: 64%;
  margin: 0;
  color: rgba(163, 217, 221, 0.68);
  font-size: 0.9cqw;
  font-weight: 800;
  line-height: 1;
}

.archive-reader-divider {
  left: 7.6%;
  width: 82%;
  height: 0.08cqw;
  background: linear-gradient(90deg, rgba(118, 228, 237, 0.7), rgba(118, 228, 237, 0.1));
  opacity: 0.45;
}

.archive-reader-divider-a { top: 27%; }
.archive-reader-divider-b { top: 47.8%; }

.archive-reader-meta-grid {
  left: 7.6%;
  top: 31.2%;
  width: 72%;
  min-height: 8.4%;
  display: grid;
  grid-template-columns: 18% 35% 22%;
  gap: 1.1%;
  align-items: center;
}

.archive-reader-chip {
  display: grid;
  align-items: center;
  min-height: 2.28cqw;
  padding: 0 0.78cqw;
  border: 0.08cqw solid rgba(109, 230, 239, 0.34);
  border-radius: 0.22cqw;
  background: linear-gradient(180deg, rgba(18, 64, 72, 0.48), rgba(2, 20, 25, 0.42));
  color: rgba(199, 251, 255, 0.82);
  font-size: 0.86cqw;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: inset 0 0 1.1cqw rgba(87, 236, 246, 0.08);
}

.archive-reader-status {
  color: rgba(255, 209, 101, 0.92);
  border-color: rgba(255, 192, 65, 0.34);
}

.archive-reader-scanline {
  left: 7.6%;
  top: 41.8%;
  width: 72%;
  height: 1.8cqw;
  opacity: 0.58;
  background:
    linear-gradient(90deg, rgba(126, 240, 248, 0.1) 0 12%, transparent 12% 18%, rgba(126, 240, 248, 0.34) 18% 19%, transparent 19% 31%, rgba(126, 240, 248, 0.22) 31% 45%, transparent 45% 58%, rgba(126, 240, 248, 0.34) 58% 59%, transparent 59%),
    repeating-linear-gradient(90deg, rgba(126, 240, 248, 0.18) 0 0.14cqw, transparent 0.14cqw 0.72cqw);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 84%, transparent);
}

.archive-reader-body-card {
  left: 7.6%;
  top: 53.4%;
  width: 72%;
  min-height: 22%;
  padding: 1.28cqw 1.44cqw;
  border: 0.08cqw solid rgba(105, 225, 235, 0.22);
  border-radius: 0.28cqw;
  background:
    linear-gradient(rgba(85, 230, 240, 0.055) 1px, transparent 1px),
    linear-gradient(180deg, rgba(7, 40, 48, 0.7), rgba(2, 17, 22, 0.52));
  background-size: 100% 0.78cqw, 100% 100%;
  box-shadow: inset 0 0 2.2cqw rgba(30, 219, 235, 0.07), 0 0 1.8cqw rgba(0, 0, 0, 0.16);
}

.archive-reader-body {
  margin: 0;
  color: rgba(216, 242, 245, 0.88);
  font-size: 1.12cqw;
  font-weight: 800;
  line-height: 1.48;
  text-shadow: 0 0.1cqw 0 rgba(0, 0, 0, 0.7);
}

.archive-reader-context {
  left: 7.6%;
  top: 80.6%;
  width: 72%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2%;
}

.archive-reader-context-card {
  min-height: 4.6cqw;
  padding: 0.82cqw 1cqw;
  border: 0.08cqw solid rgba(105, 225, 235, 0.18);
  border-radius: 0.24cqw;
  background: linear-gradient(180deg, rgba(15, 61, 68, 0.42), rgba(3, 21, 26, 0.36));
  box-shadow: inset 0 0 1.5cqw rgba(72, 229, 240, 0.05);
}

.archive-reader-context-label {
  display: block;
  margin-bottom: 0.46cqw;
  color: rgba(134, 247, 255, 0.52);
  font-size: 0.72cqw;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.08em;
}

.archive-reader-context-value {
  display: block;
  color: rgba(222, 250, 251, 0.86);
  font-size: 1cqw;
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.archive-header-block {}
.archive-header-title {}
.archive-header-subtitle {}
.archive-close-button {}
.archive-empty-slot {}
.archive-empty-slot-icon {}
.archive-empty-slot-title {}
.archive-empty-slot-copy {}
.archive-reader-panel {}
.archive-reader-main-title {}
.archive-reader-main-meta {}
.archive-reader-divider-a {}
.archive-reader-divider-b {}
.archive-reader-main-copy {}

.settings-panel {
  z-index: 8;
  padding:
    max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background:
    linear-gradient(90deg, rgba(117, 229, 235, 0.04) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(0deg, rgba(117, 229, 235, 0.035) 1px, transparent 1px) 0 0 / 42px 42px,
    radial-gradient(circle at 50% 45%, rgba(49, 217, 226, 0.16), transparent 34rem),
    rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(2px);
}

.settings-window {
  position: relative;
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  border: 36px solid transparent;
  border-image-source: var(--ui-beacon-panel-wide);
  border-image-slice: 36 fill;
  border-image-width: 36px;
  border-image-repeat: stretch;
  padding: 26px 28px 24px;
  color: rgba(224, 251, 255, 0.92);
  font-family: "Rajdhani", "Arial Narrow", Arial, sans-serif;
  filter: drop-shadow(0 26px 54px rgba(0, 0, 0, 0.58));
  scrollbar-width: thin;
  scrollbar-color: rgba(115, 231, 239, 0.52) rgba(2, 20, 24, 0.24);
  pointer-events: auto;
}

.settings-window::-webkit-scrollbar {
  width: 8px;
}

.settings-window::-webkit-scrollbar-track {
  background: rgba(2, 20, 24, 0.24);
}

.settings-window::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(115, 231, 239, 0.52);
}

.settings-header {
  display: grid;
  gap: 5px;
  padding: 0 60px 18px 0;
  background: var(--ui-beacon-divider) left bottom / min(420px, 80%) 10px no-repeat;
}

.settings-header strong {
  color: #9df8ff;
  font-size: clamp(30px, 4.6vw, 48px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.02em;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.9),
    0 0 18px rgba(75, 231, 245, 0.24);
}

.settings-header span {
  color: rgba(177, 244, 249, 0.78);
  font-size: clamp(13px, 1.8vw, 18px);
  font-weight: 800;
  line-height: 1;
}

.settings-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 0;
  background: var(--ui-beacon-button-close) center / contain no-repeat;
  color: transparent;
  cursor: pointer;
}

.settings-close:focus-visible,
.settings-toggle:focus-visible,
.settings-reset:focus-visible,
.settings-range:focus-visible {
  outline: 2px solid rgba(141, 247, 255, 0.82);
  outline-offset: 2px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.settings-card {
  min-width: 0;
  min-height: 206px;
  border: 26px solid transparent;
  border-image-source: var(--ui-beacon-card);
  border-image-slice: 26 fill;
  border-image-width: 22px;
  border-image-repeat: stretch;
  padding: 8px 10px 12px;
}

.settings-card h2 {
  margin: 0 0 18px;
  color: #9df8ff;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.86);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  color: rgba(224, 251, 255, 0.88);
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}

.settings-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-range-row {
  margin-top: 16px;
}

.settings-row output {
  color: #fff0a5;
  font: inherit;
  flex: 0 0 auto;
}

.settings-toggle,
.settings-reset {
  display: grid;
  place-items: center;
  min-width: 86px;
  min-height: 42px;
  border: 24px solid transparent;
  border-image-source: var(--ui-beacon-button-selected);
  border-image-slice: 28 fill;
  border-image-width: 18px;
  border-image-repeat: stretch;
  padding: 0 12px;
  background: transparent;
  color: #fff0a5;
  font: 900 16px / 1 "Rajdhani", "Arial Narrow", Arial, sans-serif;
  letter-spacing: 0.04em;
  text-align: center;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.9);
  cursor: pointer;
}

.settings-toggle[data-state="off"] {
  border-image-source: var(--ui-beacon-button-secondary);
  color: rgba(194, 230, 232, 0.72);
}

.settings-range {
  width: 100%;
  height: 28px;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.settings-range::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(117, 229, 235, 0.26);
  background:
    linear-gradient(90deg, rgba(255, 215, 120, 0.88), rgba(117, 229, 235, 0.86))
      0 0 / var(--settings-range-fill, 75%) 100% no-repeat,
    rgba(2, 20, 24, 0.68);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.48);
}

.settings-range::-webkit-slider-thumb {
  appearance: none;
  width: 24px;
  height: 24px;
  margin-top: -8px;
  border-radius: 50%;
  border: 2px solid rgba(255, 240, 165, 0.94);
  background:
    radial-gradient(circle at 50% 45%, #e5fbff 0 18%, #7df0ff 19% 42%, #07171d 43% 100%);
  box-shadow:
    0 0 14px rgba(117, 229, 235, 0.34),
    0 6px 12px rgba(0, 0, 0, 0.42);
}

.settings-range::-moz-range-track {
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(117, 229, 235, 0.26);
  background: rgba(2, 20, 24, 0.68);
}

.settings-range::-moz-range-progress {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 215, 120, 0.88), rgba(117, 229, 235, 0.86));
}

.settings-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 240, 165, 0.94);
  background: #7df0ff;
}

.settings-reset {
  margin: 22px 0 0 auto;
  border-image-source: var(--ui-beacon-button-primary);
}

.toast {
  position: absolute;
  left: 50%;
  bottom: calc(118px + env(safe-area-inset-bottom));
  z-index: 6;
  max-width: min(520px, calc(100vw - 36px));
  min-height: 38px;
  transform: translateX(-50%) translateY(16px);
  opacity: 0;
  border-radius: 18px 8px 18px 8px;
  border: 2px solid rgba(120, 181, 232, 0.24);
  padding: 10px 14px;
  background: rgba(13, 17, 24, 0.86);
  color: var(--text);
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  text-shadow: 2px 2px 0 #05060a;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  pointer-events: none;
}

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

.shop-panel.is-visible ~ .toast {
  opacity: 0;
  transform: translateX(-50%) translateY(16px);
}

@media (hover: none), (pointer: coarse), (max-width: 960px), (max-height: 520px) {
  .touch-controls {
    display: flex;
  }

  #gameCanvas {
    cursor: default;
  }
}

@media (pointer: coarse) and (max-width: 1100px), (max-width: 1100px) and (max-height: 820px) {
  .hud {
    grid-template-columns: minmax(300px, 1fr) minmax(180px, 240px) auto;
    gap: 8px;
  }

  .hud-center {
    min-width: 0;
    max-width: 240px;
    padding: 7px 12px 9px;
  }

  .hud-center strong,
  .hud-center span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hud-right {
    gap: 6px;
  }

  .part-chip,
  .resource-chip {
    display: none;
  }

  .chip {
    min-height: 44px;
    padding: 0 10px;
  }

  .coin-dot,
  .med-dot,
  .key-dot {
    width: 28px;
    height: 28px;
  }

  .icon-button {
    width: 52px;
    min-height: 44px;
  }
}

@media (max-width: 740px) {
  .sector-map-list {
    grid-template-columns: 1fr;
  }

  body[data-ui-overlay="v1"] .sector-map-panel {
    left: 6.5%;
    right: 6.5%;
    top: 11.5%;
    bottom: 19%;
  }

  body[data-ui-overlay="v1"] .sector-map-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: auto;
  }

  .hud {
    grid-template-columns: 1fr auto;
    gap: 8px;
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
  }

  .hud-center {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: start;
    min-width: 0;
    max-width: calc(100vw - 24px);
    padding: 8px 10px;
    text-align: left;
  }

  .hud-left {
    width: min(72vw, 310px);
    padding: 0;
    gap: 8px;
  }

  .weapon-badge {
    width: 56px;
    height: 56px;
  }

  .hud-stack {
    min-width: 220px;
    padding-top: 3px;
  }

  .ammo-line {
    grid-template-columns: 76px auto;
    gap: 8px;
    min-height: 26px;
  }

  .ammo-line strong,
  .chip strong {
    font-size: 20px;
  }

  .heart-row {
    gap: 2px;
  }

  .heart-row span {
    width: 20px;
    height: 20px;
  }

  .hud-right {
    gap: 6px;
  }

  .hud-right .chip:nth-child(2) {
    display: none;
  }

  .chip {
    min-height: 38px;
    padding: 0 8px;
  }

  .coin-dot {
    width: 24px;
    height: 24px;
  }

  .med-dot {
    width: 24px;
    height: 24px;
  }

  .key-dot {
    width: 24px;
    height: 24px;
  }

  .part-dot {
    width: 24px;
    height: 24px;
  }

  .resource-dot {
    width: 24px;
    height: 24px;
  }

  .icon-button {
    width: 42px;
    min-height: 38px;
    font-size: 22px;
  }

  .shop-panel {
    padding:
      max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right))
      max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }

  .shop-window {
    max-height: calc(100vh - 20px);
  }

  .shop-header {
    padding: 14px 14px 10px;
  }

  .shop-header h2 {
    font-size: 28px;
  }

  .shop-header p:not(.kicker) {
    font-size: 13px;
  }

  .shop-funds {
    padding: 10px 14px 0;
  }

  .shop-funds span {
    min-height: 30px;
    padding: 0 9px;
    font-size: 13px;
  }

  .shop-options {
    grid-template-columns: 1fr;
    max-height: calc(100vh - 178px);
    gap: 10px;
    padding: 12px 14px 14px;
  }

  .shop-card {
    min-height: 144px;
    padding: 12px;
  }

  .shop-card h3 {
    font-size: 16px;
  }

  .shop-card p {
    font-size: 13px;
  }

  .settings-window {
    border-width: 26px;
    border-image-width: 26px;
    padding: 18px 16px 16px;
  }

  .settings-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 16px;
  }

  .settings-card {
    min-height: 156px;
  }

  .settings-close {
    top: 12px;
    right: 12px;
    width: 46px;
    height: 46px;
  }

  .settings-reset {
    width: 100%;
  }

  .touch-left {
    width: 158px;
    height: 158px;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    padding: 0;
  }

  .touch-right {
    grid-template-columns: repeat(4, 42px);
    grid-template-rows: 42px 64px;
    gap: 6px;
    padding: 6px;
  }

  .touch-controls {
    gap: 8px;
    padding:
      0 max(8px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
  }

  .touch-btn.direction {
    width: auto;
    height: auto;
    min-height: 100%;
  }

  .touch-btn.mini {
    width: 42px;
    height: 42px;
    font-size: 17px;
  }

  .touch-btn.jump,
  .touch-btn.fire,
  .touch-btn.aim-pad {
    height: 64px;
    background-size: 64px 64px;
  }
}

@media (max-width: 520px) {
  .hud-left {
    width: min(62vw, 250px);
    gap: 6px;
  }

  .hud-stack {
    min-width: 188px;
  }

  .weapon-badge {
    width: 48px;
    height: 48px;
  }

  .part-chip,
  .resource-chip {
    display: none;
  }
}

@media (max-width: 420px) {
  .key-chip {
    display: none;
  }

  .hud-left {
    width: min(64vw, 230px);
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  .settings-window {
    width: min(920px, calc(100vw - 22px));
    max-height: calc(100dvh - 18px);
    border-width: 24px;
    border-image-width: 24px;
    padding: 12px 16px 14px;
  }

  .settings-header {
    gap: 2px;
    padding: 0 52px 10px 0;
    background-size: min(420px, 62%) 7px;
  }

  .settings-header strong {
    font-size: clamp(26px, 5.2vw, 38px);
  }

  .settings-header span {
    font-size: clamp(12px, 2vw, 15px);
  }

  .settings-close {
    top: 10px;
    right: 12px;
    width: 42px;
    height: 42px;
  }

  .settings-grid {
    gap: 10px;
    margin-top: 12px;
  }

  .settings-card {
    min-height: 128px;
    border-width: 18px;
    border-image-width: 18px;
    padding: 4px 6px 8px;
  }

  .settings-card h2 {
    margin-bottom: 8px;
    font-size: 17px;
  }

  .settings-row {
    min-height: 30px;
    gap: 8px;
    font-size: 13px;
  }

  .settings-range-row {
    margin-top: 8px;
  }

  .settings-toggle,
  .settings-reset {
    min-width: 64px;
    min-height: 32px;
    border-width: 18px;
    border-image-width: 14px;
    padding: 0 8px;
    font-size: 13px;
  }

  .settings-range {
    height: 22px;
  }

  .settings-range::-webkit-slider-runnable-track {
    height: 8px;
  }

  .settings-range::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    margin-top: -7px;
  }

  .settings-reset {
    min-width: 92px;
    min-height: 28px;
    margin-top: 8px;
    border-width: 16px;
    border-image-width: 12px;
  }

  .hud {
    top: max(6px, env(safe-area-inset-top));
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    grid-template-columns: minmax(340px, 0.9fr) minmax(190px, 260px) auto;
    gap: 8px;
  }

  .hud-left {
    width: min(330px, 39vw);
    gap: 8px;
  }

  .weapon-badge {
    width: 58px;
    height: 58px;
  }

  .hud-stack {
    min-width: 228px;
    padding-top: 2px;
  }

  .ammo-line {
    min-height: 25px;
    grid-template-columns: 78px auto;
    gap: 8px;
  }

  .ammo-line strong,
  .chip strong {
    font-size: 20px;
  }

  .heart-row {
    gap: 2px;
  }

  .heart-row span {
    width: 20px;
    height: 20px;
  }

  .meter {
    height: 9px;
  }

  .stat-row {
    margin-top: 2px;
    font-size: 10px;
  }

  .hud-center {
    display: block;
    min-width: 0;
    max-width: 260px;
    padding: 5px 10px 7px;
    border-radius: 14px 6px 14px 6px;
  }

  .hud-center strong,
  .hud-center span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hud-center strong {
    font-size: 12px;
  }

  .hud-center span {
    font-size: 10px;
  }

  .hud-right {
    gap: 5px;
  }

  .part-chip,
  .resource-chip {
    display: none;
  }

  .chip {
    min-height: 36px;
    padding: 0 8px;
  }

  .coin-dot {
    width: 24px;
    height: 24px;
  }

  .med-dot {
    width: 24px;
    height: 24px;
  }

  .key-dot {
    width: 24px;
    height: 24px;
  }

  .icon-button {
    width: 44px;
    min-height: 36px;
    font-size: 21px;
    letter-spacing: 2px;
  }

  .touch-controls {
    gap: 10px;
    padding:
      0 max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left));
  }

  .touch-left {
    width: 148px;
    height: 148px;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    padding: 0;
  }

  .touch-btn.direction {
    width: auto;
    height: auto;
    min-height: 100%;
  }

  .touch-right {
    grid-template-columns: repeat(4, 38px);
    grid-template-rows: 38px 58px;
    gap: 5px;
    padding: 6px;
  }

  .touch-right::before {
    width: 126px;
    height: 126px;
  }

  .touch-btn.mini {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }

  .touch-btn.jump,
  .touch-btn.fire,
  .touch-btn.aim-pad {
    height: 58px;
    background-size: 58px 58px;
  }

  .touch-btn.fire,
  .touch-btn.aim-pad {
    font-size: 34px;
  }

  .toast {
    bottom: calc(92px + env(safe-area-inset-bottom));
  }
}

@media (orientation: portrait) and (pointer: coarse) {
  .orientation-lock {
    display: flex;
  }

  #gameCanvas,
  .hud,
  .touch-controls {
    opacity: 0.22;
    filter: blur(1px);
  }
}

@media (hover: none), (pointer: coarse), (max-width: 960px), (max-height: 520px) {
  .touch-controls {
    inset: 0;
    display: block;
    gap: 0;
    padding: 0;
    pointer-events: none;
  }

  .touch-left,
  .touch-right {
    display: block;
    gap: 0;
    padding: 0;
    pointer-events: none;
  }

  .touch-left::before,
  .touch-right::before {
    content: none;
  }

  .touch-left {
    position: absolute;
    left: max(34px, calc(env(safe-area-inset-left) + 4.2vw));
    bottom: max(22px, calc(env(safe-area-inset-bottom) + 4.6vh));
    width: clamp(206px, 19.8vw, 286px);
    height: clamp(154px, 14.8vw, 214px);
  }

  .touch-left .touch-btn.direction {
    position: absolute;
    bottom: 0;
    width: clamp(70px, 7vw, 100px);
    height: clamp(70px, 7vw, 100px);
    min-height: 0;
    opacity: 0.92;
    border: 0;
    border-radius: 999px;
    background: var(--touch-control-image) center / contain no-repeat;
    box-shadow: none;
    color: transparent;
    font-size: 0;
    line-height: 1;
    text-shadow: none;
    text-indent: 0;
    filter: drop-shadow(0 13px 24px rgba(0, 0, 0, 0.42));
    pointer-events: auto;
  }

  .touch-left .touch-btn[data-action="left"] {
    --touch-control-image: var(--ui-touch-left);
    left: 0;
  }

  .touch-left .touch-btn[data-action="right"] {
    --touch-control-image: var(--ui-touch-right);
    right: 0;
  }

  .touch-left .touch-btn.direction:active,
  .touch-left .touch-btn.direction.is-held {
    transform: translateY(1px) scale(0.985);
  }

  .touch-left .touch-btn.left-shoot {
    position: absolute;
    left: clamp(36px, 3.8vw, 58px);
    bottom: clamp(74px, 7.4vw, 110px);
    width: clamp(66px, 6.6vw, 94px);
    height: clamp(66px, 6.6vw, 94px);
    grid-column: auto;
    background: var(--ui-touch-shoot) center / contain no-repeat;
    opacity: 0.9;
    color: transparent;
    font-size: 0;
    filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.44));
    pointer-events: auto;
  }

  .touch-right {
    position: absolute;
    right: max(20px, calc(env(safe-area-inset-right) + 2.5vw));
    bottom: max(14px, calc(env(safe-area-inset-bottom) + 2.6vh));
    width: clamp(226px, 20.5vw, 260px);
    height: clamp(186px, 17vw, 222px);
  }

  .touch-right .touch-btn {
    position: absolute;
    pointer-events: auto;
  }

  .touch-right .touch-btn.aim-pad {
    right: 0;
    bottom: 0;
    width: clamp(108px, 10vw, 134px);
    height: clamp(108px, 10vw, 134px);
    grid-column: auto;
    border-radius: 999px;
    background: var(--ui-touch-aim) center / contain no-repeat;
    opacity: 0.78;
    color: transparent;
    font-size: 0;
    filter:
      drop-shadow(0 16px 24px rgba(0, 0, 0, 0.45))
      drop-shadow(0 0 18px rgba(99, 177, 232, 0.16));
  }

  .touch-right .touch-btn.right-shoot {
    right: clamp(4px, 0.8vw, 10px);
    bottom: clamp(126px, 11.8vw, 148px);
    width: clamp(58px, 5.4vw, 72px);
    height: clamp(58px, 5.4vw, 72px);
    grid-column: auto;
    background: var(--ui-touch-shoot) center / contain no-repeat;
    opacity: 0.9;
    color: transparent;
    font-size: 0;
    filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.44));
  }

  .touch-right .touch-btn.jump {
    right: clamp(76px, 7.1vw, 92px);
    bottom: clamp(126px, 11.8vw, 148px);
    width: clamp(58px, 5.4vw, 72px);
    height: clamp(58px, 5.4vw, 72px);
    grid-column: auto;
    background: var(--ui-touch-jump) center / contain no-repeat;
    filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.44));
  }

  .touch-right .touch-btn[data-action="reload"] {
    right: clamp(128px, 11.4vw, 146px);
    bottom: clamp(10px, 1.8vw, 22px);
    width: clamp(44px, 4.1vw, 54px);
    height: clamp(44px, 4.1vw, 54px);
    background-size: contain;
    opacity: 0.9;
  }

  .touch-right .touch-btn[data-action="swap"],
  .touch-right .touch-btn[data-action="heal"],
  .touch-right .touch-btn[data-action="interact"] {
    width: clamp(34px, 3.4vw, 44px);
    height: clamp(34px, 3.4vw, 44px);
    background-size: contain;
    opacity: 0.82;
    filter: drop-shadow(0 9px 18px rgba(0, 0, 0, 0.36));
  }

  .touch-right .touch-btn[data-action="swap"] {
    right: clamp(158px, 14.3vw, 182px);
    bottom: clamp(110px, 10.2vw, 130px);
  }

  .touch-right .touch-btn[data-action="heal"] {
    right: clamp(166px, 15.1vw, 190px);
    bottom: clamp(66px, 6.2vw, 78px);
  }

  .touch-right .touch-btn[data-action="interact"] {
    right: clamp(190px, 17vw, 216px);
    bottom: clamp(18px, 2.4vw, 30px);
  }
}

@media (hover: none) and (max-height: 520px), (pointer: coarse) and (max-height: 520px), (max-height: 460px) {
  .touch-left {
    left: max(26px, calc(env(safe-area-inset-left) + 3.6vw));
    bottom: max(18px, calc(env(safe-area-inset-bottom) + 4vh));
    width: clamp(176px, 17.6vw, 238px);
    height: clamp(126px, 12.4vw, 164px);
  }

  .touch-left .touch-btn.direction {
    width: clamp(62px, 6.2vw, 82px);
    height: clamp(62px, 6.2vw, 82px);
    font-size: clamp(46px, 4.6vw, 64px);
  }

  .touch-left .touch-btn.left-shoot {
    left: clamp(28px, 3vw, 42px);
    bottom: clamp(62px, 6.2vw, 82px);
    width: clamp(54px, 5.4vw, 76px);
    height: clamp(54px, 5.4vw, 76px);
  }

  .touch-right {
    right: max(12px, calc(env(safe-area-inset-right) + 1.8vw));
    bottom: max(8px, calc(env(safe-area-inset-bottom) + 1.9vh));
    width: clamp(198px, 19.4vw, 226px);
    height: clamp(162px, 15.8vw, 188px);
  }

  .touch-right .touch-btn.aim-pad {
    width: clamp(92px, 9vw, 108px);
    height: clamp(92px, 9vw, 108px);
  }

  .touch-right .touch-btn.right-shoot {
    right: clamp(4px, 0.7vw, 8px);
    bottom: clamp(106px, 10.2vw, 120px);
    width: clamp(46px, 4.6vw, 56px);
    height: clamp(46px, 4.6vw, 56px);
  }

  .touch-right .touch-btn.jump {
    right: clamp(60px, 5.8vw, 70px);
    bottom: clamp(106px, 10.2vw, 120px);
    width: clamp(46px, 4.6vw, 56px);
    height: clamp(46px, 4.6vw, 56px);
  }

  .touch-right .touch-btn[data-action="reload"] {
    right: clamp(108px, 10.4vw, 120px);
    bottom: clamp(8px, 1.3vw, 16px);
    width: clamp(38px, 3.7vw, 44px);
    height: clamp(38px, 3.7vw, 44px);
  }

  .touch-right .touch-btn[data-action="swap"],
  .touch-right .touch-btn[data-action="heal"],
  .touch-right .touch-btn[data-action="interact"] {
    width: clamp(30px, 3vw, 36px);
    height: clamp(30px, 3vw, 36px);
  }

  .touch-right .touch-btn[data-action="swap"] {
    right: clamp(126px, 12.3vw, 142px);
    bottom: clamp(86px, 8.3vw, 98px);
  }

  .touch-right .touch-btn[data-action="heal"] {
    right: clamp(132px, 12.9vw, 148px);
    bottom: clamp(52px, 5vw, 60px);
  }

  .touch-right .touch-btn[data-action="interact"] {
    right: clamp(154px, 14.8vw, 172px);
    bottom: clamp(12px, 1.8vw, 22px);
  }
}
