:root {
  --page: #d9d9d9;
  --shell: #781113;
  --shell-dark: #47090b;
  --ink: #fff7e8;
  --muted: #c9b7a9;
  --line: #efe58f;
  --lime: #d9fb66;
  --salt: #9cf66c;
  --blue: #7ba0ff;
  --cyan: #5fcde4;
  --gold: #d9a400;
  --purple: #7a35aa;
  --panel: rgba(20, 8, 8, 0.42);
  --pixel-font: "Press Start 2P", "Courier New", monospace;
  --micro-font: "Courier New", ui-monospace, SFMono-Regular, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: var(--pixel-font);
  letter-spacing: 0;
  image-rendering: pixelated;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.site-frame {
  width: min(1120px, calc(100% - 24px));
  min-height: calc(100vh - 24px);
  margin: 12px auto;
  padding: 26px clamp(18px, 4vw, 54px) 34px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    var(--shell);
  background-size: 28px 28px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2) inset;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 18px;
  border-bottom: 3px solid var(--line);
  padding-bottom: 15px;
}

.brand {
  justify-self: center;
  grid-column: 1 / 4;
  color: var(--ink);
  font-size: clamp(23px, 4.6vw, 42px);
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
  text-shadow: 4px 4px 0 var(--shell-dark);
}

.nav-tabs {
  grid-column: 1 / 3;
  display: flex;
  gap: clamp(12px, 3vw, 42px);
  flex-wrap: wrap;
  align-items: center;
  margin-top: 2px;
}

.nav-tabs a {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
  text-decoration: none;
  text-transform: uppercase;
}

.nav-tabs a:hover,
.nav-tabs a:focus-visible,
.nav-tabs .is-active {
  color: var(--lime);
}

.wallet-link {
  justify-self: end;
  align-self: start;
  background: #120607;
  color: var(--ink);
  padding: 10px 12px;
  font-size: 8px;
  text-decoration: none;
  text-transform: uppercase;
  border: 1px solid #2d1011;
}

.wallet-link:hover,
.wallet-link:focus-visible,
button:hover,
button:focus-visible,
.primary-button:hover,
.primary-button:focus-visible,
.ghost-button:hover,
.ghost-button:focus-visible {
  transform: translateY(-1px);
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

.egg-gate {
  width: 100vw;
  min-height: calc(100svh - 24px);
  margin: -26px calc(50% - 50vw) 0;
  overflow: hidden;
  background: #a8c0e6;
}

.egg-gate img {
  width: 100%;
  min-height: calc(100svh - 24px);
  display: block;
  object-fit: cover;
  object-position: 66% 55%;
  image-rendering: pixelated;
}

.home-story {
  max-width: 900px;
  padding: clamp(38px, 7vw, 78px) 0 clamp(30px, 5vw, 58px);
}

.home-story h1 {
  margin-bottom: 22px;
}

.home-story p {
  max-width: 820px;
  color: #fff7e8;
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.65;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  align-items: center;
  gap: clamp(24px, 5vw, 56px);
  padding: clamp(34px, 7vw, 72px) 0 44px;
}

.hero-graphic {
  min-height: 270px;
  overflow: hidden;
  background: #141414;
  border: 2px solid rgba(239, 229, 143, 0.4);
}

.hero-graphic img {
  width: 100%;
  height: 100%;
  min-height: 270px;
  display: block;
  object-fit: cover;
  object-position: 52% 56%;
  filter: saturate(0.92) contrast(1.08);
}

.hero-copy {
  max-width: 460px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--lime);
  font-size: 9px;
  line-height: 1.8;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  color: var(--line);
  font-size: clamp(21px, 4vw, 34px);
  line-height: 1.45;
}

h2 {
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}

p {
  color: var(--ink);
  font-family: "Courier New", monospace;
  font-size: 16px;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.primary-button,
.ghost-button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 0;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, outline-color 120ms ease;
}

.primary-button,
button {
  background: var(--lime);
  color: #151006;
  padding: 12px 16px;
  font-size: 9px;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  border: 1px solid rgba(239, 229, 143, 0.55);
  padding: 11px 16px;
  font-size: 9px;
}

.map-game-panel {
  margin: 0 0 34px;
  padding: 18px;
  background: rgba(78, 67, 48, 0.54);
  border: 1px solid rgba(233, 223, 184, 0.5);
  box-shadow: 0 0 0 1px rgba(95, 205, 228, 0.08) inset;
}

.map-app-panel.map-game-panel {
  padding: 8px;
}

.map-game-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.map-game-head .eyebrow,
.map-game-head h2 {
  margin: 0;
}

.map-game-head > div:first-child {
  display: grid;
  gap: 8px;
}

.map-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 10px;
}

.speed-controls,
.zoom-controls,
.unit-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.speed-controls button,
.zoom-controls button,
.unit-controls button {
  min-height: 32px;
  padding: 8px 10px;
  background: #17130e;
  color: var(--ink);
  border: 1px solid rgba(233, 223, 184, 0.38);
  font-size: 8px;
}

.unit-controls label {
  color: var(--muted);
  font-size: 7px;
  line-height: 1.4;
}

.unit-controls input,
.unit-controls select {
  width: 86px;
  min-height: 32px;
  border: 1px solid rgba(233, 223, 184, 0.38);
  border-radius: 0;
  background: #d8c18a;
  color: #17130e;
  padding: 7px 8px;
  font-size: 8px;
}

.unit-controls select {
  width: auto;
  max-width: 140px;
}

.speed-controls .is-active {
  background: var(--lime);
  color: #06110a;
}

.map-shell {
  position: relative;
  overflow: hidden;
  background: #c7ba94;
  border: 2px solid rgba(233, 223, 184, 0.55);
}

.map-resize-handle {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: 0;
  width: min(220px, 46%);
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0;
  background: rgba(21, 17, 12, 0.64);
  border: 1px solid rgba(233, 223, 184, 0.42);
  border-bottom: 0;
  color: var(--line);
  cursor: ns-resize;
  transform: translateX(-50%);
  touch-action: none;
}

.map-resize-handle span,
.map-resize-handle::before,
.map-resize-handle::after {
  content: "";
  display: block;
  width: 54px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 0 8px rgba(217, 251, 102, 0.24);
}

.map-resize-handle span {
  width: 70px;
}

.map-resize-handle::before {
  margin-bottom: 3px;
  opacity: 0.62;
}

.map-resize-handle::after {
  margin-top: 3px;
  opacity: 0.62;
}

.map-app-body.is-resizing-map {
  cursor: ns-resize;
  user-select: none;
}

.map-title-overlay {
  position: absolute;
  z-index: 4;
  top: 12px;
  left: 12px;
  width: min(33.333%, 360px);
  min-width: 280px;
  max-width: calc(100% - 236px);
  max-height: calc(100% - 24px);
  display: block;
  overflow: hidden;
  background: rgba(16, 13, 9, 0.94);
  border: 1px solid rgba(233, 223, 184, 0.58);
  box-shadow:
    0 0 0 1px rgba(23, 19, 14, 0.78) inset,
    0 10px 26px rgba(0, 0, 0, 0.24);
  pointer-events: auto;
}

.map-info-summary {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 9px;
  cursor: pointer;
  list-style: none;
}

.map-info-summary::-webkit-details-marker {
  display: none;
}

.map-info-summary strong {
  min-width: 0;
  overflow: hidden;
  color: var(--line);
  font-size: clamp(10px, 1vw, 13px);
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-info-toggle {
  width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
  color: var(--lime);
  font-size: 11px;
  line-height: 1;
}

.map-info-toggle::before {
  content: "+";
}

.map-title-overlay[open] .map-info-toggle::before {
  content: "-";
}

.map-info-content {
  display: grid;
  gap: 8px;
  max-height: calc(var(--map-shell-height, 640px) - 72px);
  overflow: auto;
  padding: 0 9px 10px;
  scrollbar-color: rgba(217, 251, 102, 0.6) rgba(16, 6, 6, 0.5);
  scrollbar-width: thin;
}

.map-info-totals {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.map-info-totals .pile-resource-chip {
  min-height: 38px;
  gap: 8px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.68);
  border-left-width: 4px;
  font-family: var(--micro-font);
  font-size: 10px;
  line-height: 1.1;
}

.map-info-totals .pile-resource-chip i {
  width: 24px;
  height: 24px;
  font-family: var(--pixel-font);
  font-size: 10px;
}

.map-info-totals .pile-resource-icon {
  height: 24px;
}

.map-info-totals .pile-resource-chip strong {
  font-size: 14px;
  line-height: 1.05;
}

.map-info-totals .pile-resource-chip em {
  font-size: 10px;
  line-height: 1.05;
}

.map-drop-meter {
  height: 46px;
}

.map-drop-meter .pile-rarity-segment strong {
  font-size: 10px;
}

.map-drop-meter .pile-rarity-segment em {
  font-family: var(--micro-font);
  font-size: 9px;
  font-weight: 700;
}

.map-info-separator {
  display: block;
  height: 1px;
  background: rgba(239, 229, 143, 0.45);
  box-shadow: 0 1px 0 rgba(23, 19, 14, 0.6);
}

.map-drop-list-details {
  display: grid;
  gap: 6px;
}

.map-drop-list-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
  color: var(--lime);
  cursor: pointer;
  font-size: 9px;
  line-height: 1;
  list-style: none;
}

.map-drop-list-details > summary::-webkit-details-marker {
  display: none;
}

.map-drop-list-details > summary::after {
  content: "+";
  color: var(--line);
}

.map-drop-list-details[open] > summary::after {
  content: "-";
}

.map-drop-list {
  display: grid;
  gap: 7px;
}

.map-drop-item {
  display: grid;
  gap: 6px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.58);
  border: 1px solid rgba(239, 229, 143, 0.28);
}

.map-drop-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.map-drop-item-head strong,
.map-drop-item-head em {
  font-style: normal;
  line-height: 1;
}

.map-drop-item-head strong {
  min-width: 0;
  overflow: hidden;
  color: #fff7e8;
  font-size: 10px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-drop-item-head em {
  flex: none;
  color: var(--line);
  font-family: var(--micro-font);
  font-size: 10px;
  font-weight: 700;
}

.map-drop-item-body {
  display: grid;
  gap: 3px;
}

.map-drop-resource-line {
  min-width: 0;
  display: grid;
  grid-template-columns: 22px minmax(64px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 5px 7px;
  background: rgba(23, 19, 14, 0.72);
  border-left: 3px solid var(--resource-color, var(--line));
  color: #fff7e8;
  font-family: var(--micro-font);
}

.map-drop-resource-line i {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: #17130e;
  background: var(--resource-color, var(--line));
  font-family: var(--pixel-font);
  font-size: 9px;
  font-style: normal;
}

.map-drop-resource-icon {
  width: auto;
  height: 20px;
  image-rendering: pixelated;
}

.map-drop-resource-line strong {
  color: #fff7e8;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.map-drop-resource-line em {
  min-width: 0;
  overflow: hidden;
  color: var(--resource-color, var(--line));
  font-size: 10px;
  font-weight: 700;
  font-style: normal;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-drop-empty {
  display: grid;
  place-items: center;
  min-height: 42px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(239, 229, 143, 0.2);
  font-size: 8px;
}

.map-selection-back {
  flex: none;
  width: 30px;
  min-height: 30px;
  padding: 0;
  background: #efe58f;
  color: #151006;
  border: 1px solid rgba(23, 19, 14, 0.72);
  box-shadow: 0 3px 0 rgba(23, 19, 14, 0.3);
  font-size: 14px;
  line-height: 1;
}

.map-selection-overlay {
  position: absolute;
  z-index: 9;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(14px, 3vw, 30px);
  background:
    linear-gradient(rgba(20, 8, 8, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 8, 8, 0.18) 1px, transparent 1px),
    rgba(13, 9, 6, 0.78);
  background-size: 22px 22px;
  backdrop-filter: blur(2px);
}

.map-selection-overlay[hidden] {
  display: none;
}

.map-selection-panel {
  width: min(720px, 100%);
  max-height: min(640px, calc(100% - 20px));
  overflow: auto;
  padding: clamp(16px, 3vw, 24px);
  background: rgba(21, 17, 12, 0.92);
  border: 2px solid rgba(233, 223, 184, 0.68);
  box-shadow:
    0 0 0 2px rgba(23, 19, 14, 0.7) inset,
    0 18px 42px rgba(0, 0, 0, 0.45);
}

.map-selection-panel h2 {
  margin: 0 0 16px;
  color: var(--line);
  font-size: clamp(16px, 2.2vw, 24px);
}

.map-selection-list {
  display: grid;
  gap: 12px;
}

.map-selection-card {
  width: 100%;
  min-height: 116px;
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 6px 16px;
  padding: 12px;
  background: #17130e;
  color: var(--ink);
  border: 1px solid rgba(233, 223, 184, 0.38);
  text-align: left;
}

.map-selection-card.is-active {
  border-color: var(--lime);
  box-shadow: 0 0 0 2px rgba(217, 251, 102, 0.2) inset;
}

.map-selection-card strong {
  align-self: end;
  color: var(--line);
  font-size: clamp(13px, 1.7vw, 18px);
  line-height: 1.35;
}

.map-selection-card em {
  align-self: start;
  color: var(--muted);
  font-size: 8px;
  font-style: normal;
  line-height: 1.7;
}

.map-selection-art {
  grid-row: 1 / 3;
  width: 100%;
  aspect-ratio: 1.22 / 1;
  display: block;
  border: 1px solid rgba(233, 223, 184, 0.32);
  background-color: #b9ad8b;
  box-shadow: 0 0 0 1px rgba(23, 19, 14, 0.6) inset;
}

.dirt-mountain-art {
  background:
    radial-gradient(circle at 82% 45%, #6f7478 0 11%, #303438 12% 18%, transparent 19%),
    linear-gradient(90deg, transparent 0 15%, rgba(255, 247, 232, 0.5) 16% 19%, transparent 20%),
    linear-gradient(90deg, #efe58f 0 16%, #a98252 17% 76%, #303438 77% 100%);
}

.ash-desert-art {
  background:
    radial-gradient(circle at 20% 28%, rgba(95, 205, 228, 0.58) 0 6%, transparent 7%),
    radial-gradient(circle at 66% 58%, rgba(217, 251, 102, 0.54) 0 5%, transparent 6%),
    linear-gradient(135deg, rgba(233, 223, 184, 0.55), transparent 38%),
    repeating-linear-gradient(45deg, #b9ad8b 0 12px, #c7ba94 12px 24px);
}

.map-tools-overlay {
  position: absolute;
  z-index: 7;
  top: 12px;
  right: 12px;
  display: grid;
  justify-items: end;
  max-width: min(520px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  pointer-events: auto;
}

.map-tools-overlay[open] {
  justify-items: stretch;
  width: min(520px, calc(100% - 24px));
  padding: 8px;
  overflow: auto;
  background: rgba(21, 17, 12, 0.86);
  border: 1px solid rgba(233, 223, 184, 0.45);
  box-shadow:
    0 0 0 1px rgba(23, 19, 14, 0.72) inset,
    0 12px 30px rgba(0, 0, 0, 0.36);
}

.map-tools-overlay summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 9px 12px;
  color: #06110a;
  background: var(--lime);
  border: 1px solid rgba(23, 19, 14, 0.62);
  box-shadow: 0 3px 0 rgba(23, 19, 14, 0.32);
  cursor: pointer;
  font-size: 8px;
  list-style: none;
}

.map-tools-overlay summary::-webkit-details-marker {
  display: none;
}

.map-tools-overlay[open] summary {
  justify-self: end;
  margin-bottom: 8px;
  background: #efe58f;
}

.map-tools-overlay .map-controls {
  display: grid;
  justify-content: stretch;
  gap: 8px;
}

.map-tools-overlay .speed-controls,
.map-tools-overlay .zoom-controls,
.map-tools-overlay .unit-controls {
  justify-content: start;
}

.map-focus-exit {
  position: absolute;
  top: 198px;
  right: 12px;
  z-index: 3;
  min-height: 34px;
  padding: 9px 12px;
  background: var(--lime);
  color: #17130e;
  border: 1px solid rgba(23, 19, 14, 0.62);
  box-shadow: 0 3px 0 rgba(23, 19, 14, 0.32);
  font-size: 8px;
}

.map-focus-exit[hidden] {
  display: none;
}

.mini-map-frame {
  position: absolute;
  top: 58px;
  right: 12px;
  z-index: 3;
  width: 184px;
  display: grid;
  gap: 5px;
  padding: 8px;
  background: rgba(21, 17, 12, 0.78);
  border: 1px solid rgba(233, 223, 184, 0.42);
  box-shadow: 0 0 0 1px rgba(23, 19, 14, 0.65) inset;
  pointer-events: none;
}

.mini-map-frame span {
  color: var(--line);
  font-size: 7px;
  line-height: 1;
}

#miniMapCanvas {
  display: block;
  width: 100%;
  height: 132px;
  background: #d8c18a;
  image-rendering: pixelated;
}

#harvestMapCanvas {
  display: block;
  width: 100%;
  height: min(72vh, 740px);
  min-height: 520px;
  background: #c7ba94;
  cursor: grab;
  image-rendering: pixelated;
  touch-action: none;
}

#harvestMapCanvas.is-dragging {
  cursor: grabbing;
}

.map-overlay-layer {
  position: absolute;
  z-index: 8;
  inset: 0;
  pointer-events: none;
}

.map-data-tab {
  position: absolute;
  z-index: 10;
  top: 12px;
  right: 214px;
  min-width: 78px;
  min-height: 36px;
  padding: 8px 10px;
  background: rgba(16, 13, 9, 0.94);
  border: 1px solid rgba(217, 251, 102, 0.76);
  box-shadow:
    0 0 0 1px rgba(23, 19, 14, 0.78) inset,
    0 8px 18px rgba(0, 0, 0, 0.24);
  color: var(--line);
  font-family: var(--pixel-font);
  font-size: 10px;
  line-height: 1;
  pointer-events: auto;
}

.map-data-tab.is-open {
  background: rgba(217, 251, 102, 0.92);
  color: #17130e;
}

.map-data-panel {
  position: absolute;
  z-index: 11;
  top: 56px;
  right: 12px;
  width: min(560px, calc(100% - 24px));
  max-height: calc(100% - 72px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(217, 251, 102, 0.08), transparent 34%),
    rgba(16, 13, 9, 0.96);
  border: 1px solid rgba(233, 223, 184, 0.62);
  box-shadow:
    0 0 0 1px rgba(23, 19, 14, 0.82) inset,
    0 14px 32px rgba(0, 0, 0, 0.34);
  color: #fff7e8;
  font-family: var(--pixel-font);
  pointer-events: auto;
}

.map-data-panel[hidden] {
  display: none;
}

.map-data-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.map-data-head h2 {
  margin: 4px 0 0;
  color: var(--line);
  font-size: 17px;
  line-height: 1;
}

.map-data-head button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(239, 229, 143, 0.48);
  color: #fff7e8;
  font-family: var(--pixel-font);
  font-size: 11px;
}

.map-data-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.map-data-stat {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 9px;
  background: rgba(0, 0, 0, 0.46);
  border: 1px solid rgba(239, 229, 143, 0.26);
  border-left: 4px solid var(--stat-color, var(--line));
}

.map-data-stat span {
  overflow: hidden;
  color: rgba(255, 247, 232, 0.72);
  font-size: 8px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-data-stat strong {
  overflow-wrap: anywhere;
  color: #fff7e8;
  font-size: 13px;
  line-height: 1.2;
}

.map-data-content {
  min-height: 0;
  display: grid;
  gap: 10px;
  overflow: auto;
  padding-right: 4px;
  scrollbar-color: rgba(217, 251, 102, 0.62) rgba(16, 6, 6, 0.5);
  scrollbar-width: thin;
}

.map-data-section {
  display: grid;
  gap: 6px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(239, 229, 143, 0.22);
}

.map-data-section h3 {
  margin: 0;
  color: var(--line);
  font-size: 11px;
  line-height: 1.2;
}

.map-data-table {
  display: grid;
  gap: 4px;
}

.map-data-row {
  display: grid;
  grid-template-columns: minmax(96px, 0.75fr) minmax(0, 1.55fr) minmax(72px, 0.65fr);
  gap: 8px;
  align-items: start;
  min-width: 0;
  padding: 7px 8px;
  background: rgba(23, 19, 14, 0.72);
  border: 1px solid rgba(239, 229, 143, 0.13);
  color: rgba(255, 247, 232, 0.88);
  font-family: var(--micro-font);
  font-size: 10px;
  line-height: 1.35;
}

.map-data-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #fff7e8;
}

.map-data-row span,
.map-data-row em {
  min-width: 0;
  overflow-wrap: anywhere;
}

.map-data-row em {
  color: #efe58f;
  font-style: normal;
  text-align: right;
}

.map-data-row.is-muted {
  color: rgba(255, 247, 232, 0.58);
}

.map-data-empty {
  padding: 10px;
  color: rgba(255, 247, 232, 0.58);
  font-family: var(--micro-font);
  font-size: 10px;
  line-height: 1.4;
}

.map-data-ledger {
  max-height: 360px;
  margin: 0;
  padding: 9px;
  overflow: auto;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(239, 229, 143, 0.16);
  color: rgba(255, 247, 232, 0.88);
  font-family: var(--micro-font);
  font-size: 10px;
  line-height: 1.45;
  scrollbar-color: rgba(217, 251, 102, 0.62) rgba(16, 6, 6, 0.5);
  scrollbar-width: thin;
  white-space: pre;
}

@media (max-width: 760px) {
  .map-data-tab {
    top: 58px;
    right: 12px;
  }

  .map-data-panel {
    top: 102px;
    width: calc(100% - 24px);
    max-height: calc(100% - 116px);
  }

  .map-data-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-data-row {
    grid-template-columns: minmax(82px, 0.8fr) minmax(0, 1.2fr);
  }

  .map-data-row em {
    grid-column: 1 / -1;
    text-align: left;
  }
}

.map-data-page-body {
  margin: 0;
  background: #f4f1e8;
  color: #191713;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

.map-data-page {
  width: min(1500px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.map-data-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid #29241c;
}

.map-data-page-header p {
  margin: 0 0 4px;
  color: #6c6048;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}

.map-data-page-header h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1;
}

.map-data-page-header span {
  display: block;
  margin-top: 8px;
  color: #4c4638;
  font-size: 15px;
}

.map-data-page-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.map-data-page-header a {
  padding: 8px 12px;
  background: #191713;
  color: #fff8df;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.data-page-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.data-page-tabs button {
  min-height: 42px;
  padding: 10px 18px;
  background: #fffaf0;
  border: 1px solid #d0c5a8;
  color: #191713;
  font: 700 15px/1 Arial, Helvetica, sans-serif;
  text-transform: uppercase;
}

.data-page-tabs button.is-active {
  background: #191713;
  border-color: #191713;
  color: #fff8df;
}

.data-tab-view[hidden] {
  display: none;
}

.data-page-panel {
  margin: 0 0 18px;
  padding: 18px;
  background: #fffaf0;
  border: 1px solid #d0c5a8;
  box-shadow: 0 2px 0 rgba(25, 23, 19, 0.08);
}

.data-page-panel h2 {
  margin: 0 0 12px;
  color: #191713;
  font-size: 24px;
  line-height: 1.15;
}

.data-plan-hero p {
  max-width: 940px;
  margin: 0;
  color: #3f3729;
  font-size: 18px;
  line-height: 1.55;
}

.data-section-intro {
  max-width: 980px;
  margin: 0 0 14px;
  color: #3f3729;
  font-size: 17px;
  line-height: 1.55;
}

.data-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.data-plan-grid article {
  min-width: 0;
  padding: 16px;
  background: #fffaf0;
  border: 1px solid #d0c5a8;
  border-top: 5px solid #8b5a34;
}

.data-plan-grid h3 {
  margin: 0 0 9px;
  color: #191713;
  font-size: 18px;
  line-height: 1.2;
}

.data-plan-grid p {
  margin: 0;
  color: #3f3729;
  font-size: 15px;
  line-height: 1.45;
}

.docs-page-body {
  margin: 0;
  background: #faf7ef;
  color: #191713;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

.docs-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.docs-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100vh;
  padding: 28px 22px;
  background:
    linear-gradient(rgba(124, 9, 9, 0.96), rgba(78, 5, 5, 0.98)),
    linear-gradient(90deg, rgba(255, 232, 123, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(255, 232, 123, 0.08) 1px, transparent 1px);
  background-size: auto, 22px 22px, 22px 22px;
  color: #fff8df;
  border-right: 1px solid #3c0707;
}

.docs-brand {
  color: #fff08a;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
}

.docs-sidebar p {
  margin: 0;
  color: #bdb094;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.docs-sidebar nav,
.docs-sidebar-links {
  display: grid;
  gap: 5px;
}

.docs-sidebar a {
  color: #efe4c4;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.docs-sidebar nav a {
  padding: 8px 10px;
  border-left: 3px solid transparent;
}

.docs-sidebar nav a:hover,
.docs-sidebar nav a:focus-visible,
.docs-sidebar nav a.is-active {
  background: rgba(255, 240, 138, 0.14);
  border-left-color: #fff08a;
  color: #fff08a;
}

.docs-sidebar-links {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 248, 223, 0.18);
}

.docs-content {
  width: min(940px, calc(100% - 48px));
  margin: 0 auto;
  padding: 48px 0 72px;
}

.docs-hero {
  margin-bottom: 34px;
  padding-bottom: 22px;
  border-bottom: 1px solid #d0c5a8;
}

.docs-hero p {
  margin: 0 0 8px;
  color: #766747;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.docs-hero h1 {
  margin: 0;
  color: #14120f;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 0.95;
}

.docs-hero span {
  display: block;
  max-width: 680px;
  margin-top: 12px;
  color: #4c4638;
  font-size: 18px;
}

.docs-section {
  scroll-margin-top: 28px;
  margin-bottom: 38px;
}

.docs-section h2 {
  margin: 0 0 12px;
  color: #14120f;
  font-size: 26px;
  line-height: 1.15;
}

.docs-section p,
.docs-section li,
.docs-section dd {
  color: #40392c;
  font-size: 17px;
}

.docs-section p {
  max-width: 780px;
  margin: 0 0 14px;
}

.docs-section ul,
.docs-section ol {
  margin: 0;
  padding-left: 24px;
}

.docs-section li {
  margin-bottom: 8px;
}

.docs-section table {
  width: 100%;
  border-collapse: collapse;
  background: #fffaf0;
  border: 1px solid #d0c5a8;
}

.docs-section th,
.docs-section td {
  padding: 12px 14px;
  border-bottom: 1px solid #ddd1b4;
  text-align: left;
  vertical-align: top;
}

.docs-section th {
  background: #efe3c2;
  color: #191713;
  font-size: 13px;
  text-transform: uppercase;
}

.docs-section td {
  color: #3f3729;
  font-size: 15px;
}

.docs-key-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.docs-key-list div {
  padding: 15px;
  background: #fffaf0;
  border: 1px solid #d0c5a8;
  border-top: 4px solid #8b5a34;
}

.docs-key-list dt {
  margin-bottom: 8px;
  color: #191713;
  font-size: 17px;
  font-weight: 900;
}

.docs-key-list dd {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
}

.data-plan-list {
  margin: 0;
  padding-left: 24px;
}

.data-plan-list li {
  margin: 0 0 8px;
}

.data-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.data-summary-grid article {
  min-width: 0;
  padding: 14px;
  background: #f0e6ca;
  border-left: 6px solid #8b5a34;
}

.data-summary-grid span {
  display: block;
  margin-bottom: 6px;
  color: #675d49;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.data-summary-grid strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 20px;
  line-height: 1.2;
}

.data-page-panel table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-page-panel th,
.data-page-panel td {
  padding: 9px 10px;
  vertical-align: top;
  border: 1px solid #d7ccb2;
  text-align: left;
}

.data-page-panel th {
  background: #2a241a;
  color: #fff8df;
  font-size: 13px;
  position: sticky;
  top: 0;
}

.data-page-panel tr:nth-child(even) td {
  background: #fbf4e1;
}

.data-page-panel td {
  overflow-wrap: anywhere;
}

.data-json-preview {
  max-height: 520px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  background: #191713;
  color: #fff8df;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .docs-shell {
    display: block;
  }

  .docs-sidebar {
    position: static;
    height: auto;
    padding: 18px;
  }

  .docs-sidebar nav {
    display: flex;
    flex-wrap: wrap;
  }

  .docs-sidebar nav a {
    border-left: 0;
    border-bottom: 3px solid transparent;
  }

  .docs-sidebar nav a:hover,
  .docs-sidebar nav a:focus-visible,
  .docs-sidebar nav a.is-active {
    border-left-color: transparent;
    border-bottom-color: #fff08a;
  }

  .docs-sidebar-links {
    display: flex;
    flex-wrap: wrap;
    margin-top: 0;
  }

  .docs-content {
    width: min(940px, calc(100% - 28px));
    padding: 28px 0 48px;
  }

  .docs-key-list {
    grid-template-columns: 1fr;
  }

  .map-data-page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .data-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .data-plan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .data-page-panel {
    overflow-x: auto;
  }
}

@media (max-width: 560px) {
  .map-data-page {
    width: calc(100% - 20px);
    padding-top: 14px;
  }

  .data-summary-grid {
    grid-template-columns: 1fr;
  }

  .data-plan-grid {
    grid-template-columns: 1fr;
  }
}

.unit-follow-bubble,
.pile-loot-card,
.dirt-project-card {
  position: absolute;
  color: var(--ink);
  font-family: var(--pixel-font);
  letter-spacing: 0;
  image-rendering: pixelated;
}

.unit-follow-bubble[hidden],
.pile-loot-card[hidden],
.dirt-project-card[hidden] {
  display: none;
}

.unit-follow-bubble {
  --bubble-lift: 62px;
  z-index: 5;
  width: min(260px, calc(100% - 20px));
  display: grid;
  gap: 7px;
  padding: 10px 12px;
  background:
    linear-gradient(135deg, rgba(217, 251, 102, 0.12), transparent 50%),
    rgba(21, 17, 12, 0.9);
  border: 1px solid rgba(217, 251, 102, 0.72);
  box-shadow:
    0 0 0 2px rgba(23, 19, 14, 0.72),
    0 10px 22px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  transform: translate(-50%, calc(-100% - var(--bubble-lift)));
}

.unit-follow-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.unit-follow-title strong {
  flex: 0 0 auto;
  color: #fff7e8;
  font-size: 10px;
  line-height: 1;
  text-shadow: 1px 1px 0 #17130e;
}

.unit-follow-perks {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  flex-wrap: wrap;
}

.unit-follow-perk-icon {
  width: auto;
  height: 14px;
  image-rendering: pixelated;
}

.unit-follow-task {
  color: var(--lime);
  font-size: 10px;
  line-height: 1.35;
  text-shadow: 1px 1px 0 #17130e;
}

.unit-follow-task.is-idle {
  color: #fbf236;
}

.unit-follow-bag,
.unit-follow-time {
  color: #efe58f;
  font-size: 8px;
  line-height: 1.45;
}

.unit-follow-time {
  color: #fff7e8;
}

.unit-follow-time .time-unit {
  color: #efe58f;
}

.pile-loot-card {
  z-index: 4;
  width: 432px;
  display: grid;
  gap: 11px;
  padding: 13px;
  background:
    linear-gradient(135deg, rgba(217, 251, 102, 0.08), transparent 48%),
    rgba(28, 22, 12, 0.94);
  border: 1px solid rgba(217, 251, 102, 0.88);
  box-shadow:
    0 0 0 2px rgba(23, 19, 14, 0.66),
    0 10px 22px rgba(0, 0, 0, 0.24);
  pointer-events: auto;
  transform: none;
}

.pile-loot-card.has-enemy-card {
  width: min(604px, calc(100vw - 16px));
  grid-template-columns: 148px minmax(0, 1fr);
  align-items: stretch;
}

.pile-loot-main {
  min-width: 0;
  display: grid;
  gap: 11px;
}

.pile-enemy-card {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 9px;
  background: rgba(16, 6, 6, 0.78);
  border: 1px solid rgba(224, 27, 27, 0.56);
  box-shadow: 0 0 0 1px rgba(23, 19, 14, 0.72) inset;
}

.pile-enemy-card[hidden] {
  display: none;
}

.pile-enemy-title {
  color: #ffb089;
  font-size: 10px;
  line-height: 1.25;
  text-align: center;
}

.pile-enemy-canvas {
  width: 92px;
  height: 92px;
  display: block;
  background: #17130e;
  border: 1px solid rgba(239, 229, 143, 0.32);
  image-rendering: pixelated;
}

.pile-enemy-card.is-dead {
  border-color: rgba(217, 251, 102, 0.48);
}

.pile-enemy-stats {
  display: grid;
  gap: 8px;
  font-family: var(--micro-font);
}

.pile-enemy-stats > span {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 7px 8px;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(239, 229, 143, 0.26);
  color: #fff7e8;
  line-height: 1.2;
  text-align: left;
}

.pile-enemy-hp {
  color: #ffb089 !important;
}

.pile-enemy-dmg {
  color: #efe58f !important;
}

.pile-enemy-stat-label {
  color: inherit;
  font-size: 11px;
  line-height: 1;
  text-shadow: 1px 1px 0 #17130e;
}

.pile-enemy-hp-track {
  position: relative;
  height: 11px;
  overflow: hidden;
  background: rgba(224, 27, 27, 0.18);
  border: 1px solid rgba(255, 176, 137, 0.5);
  box-shadow: 0 0 0 1px rgba(23, 19, 14, 0.66) inset;
}

.pile-enemy-hp-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--enemy-hp, 100%);
  background: #e01b1b;
  box-shadow: 0 0 9px rgba(224, 27, 27, 0.38);
}

.pile-enemy-stat-value {
  color: #fff7e8;
  font-size: 11px;
  font-style: normal;
  line-height: 1.1;
  text-shadow: 1px 1px 0 #17130e;
}

.pile-enemy-dmg .pile-enemy-stat-value {
  color: #efe58f;
  font-size: 12px;
}

.pile-enemy-card.is-dead .pile-enemy-hp-fill {
  background: #d9fb66;
  box-shadow: 0 0 9px rgba(217, 251, 102, 0.3);
}

.pile-enemy-card.is-dead .pile-enemy-hp-track {
  background: rgba(217, 251, 102, 0.12);
  border-color: rgba(217, 251, 102, 0.42);
}

.assign-modal.has-enemy-target .assign-panel {
  width: min(660px, calc(100vw - 24px));
}

.assign-enemy-card {
  width: min(292px, 100%);
  justify-self: center;
  grid-template-columns: 124px minmax(0, 1fr);
  align-items: center;
}

.assign-enemy-card .pile-enemy-title {
  grid-column: 1 / -1;
  font-size: 9px;
}

.assign-enemy-card .pile-enemy-canvas {
  width: 124px;
  height: 124px;
}

.loot-enemy-card {
  width: min(380px, 100%);
  justify-self: center;
  grid-template-columns: 136px minmax(0, 1fr);
  align-items: center;
}

.loot-enemy-card .pile-enemy-title {
  grid-column: 1 / -1;
  font-size: 10px;
}

.loot-enemy-card .pile-enemy-canvas {
  width: 136px;
  height: 136px;
}

.pile-loot-card.is-hovered,
.pile-loot-card.is-pinned {
  border-color: rgba(217, 251, 102, 0.88);
  box-shadow:
    0 0 0 2px rgba(23, 19, 14, 0.72),
    0 0 18px rgba(217, 251, 102, 0.18),
    0 10px 22px rgba(0, 0, 0, 0.24);
}

.pile-compact-button {
  display: none;
}

.pile-loot-card.is-compact {
  width: 128px;
  display: block;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.pile-loot-card.is-compact.has-enemy-card {
  width: 128px;
  grid-template-columns: 1fr;
}

.pile-loot-card.is-compact .pile-enemy-card,
.pile-loot-card.is-compact .pile-loot-main {
  display: none;
}

.pile-loot-card.is-compact .pile-compact-button {
  width: 100%;
  min-height: 42px;
  display: grid;
  place-items: center;
  padding: 10px 11px;
  background:
    linear-gradient(135deg, rgba(217, 251, 102, 0.16), transparent 52%),
    rgba(20, 14, 9, 0.94);
  border: 1px solid rgba(217, 251, 102, 0.88);
  box-shadow:
    0 0 0 2px rgba(23, 19, 14, 0.72),
    0 8px 16px rgba(0, 0, 0, 0.24);
  color: var(--line);
  font-size: 8px;
  line-height: 1.25;
  text-align: center;
}

.dirt-project-card {
  z-index: 6;
  width: min(284px, calc(100% - 16px));
  display: grid;
  gap: 7px;
  pointer-events: auto;
  transform: none;
}

.dirt-project-button {
  width: 100%;
  display: grid;
  gap: 7px;
  padding: 9px 10px;
  background:
    linear-gradient(135deg, rgba(217, 251, 102, 0.14), transparent 48%),
    rgba(20, 14, 9, 0.9);
  border: 1px solid rgba(239, 229, 143, 0.74);
  box-shadow:
    0 0 0 2px rgba(23, 19, 14, 0.72),
    0 8px 18px rgba(0, 0, 0, 0.25);
  color: #fff7e8;
  text-align: left;
}

.dirt-project-card.is-open .dirt-project-button {
  border-color: var(--lime);
  box-shadow:
    0 0 0 2px rgba(23, 19, 14, 0.72),
    0 0 18px rgba(217, 251, 102, 0.18),
    0 8px 18px rgba(0, 0, 0, 0.25);
}

.dirt-project-card.is-compact {
  width: 116px;
  gap: 0;
  pointer-events: none;
}

.dirt-project-card.is-compact .dirt-project-button {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.dirt-project-card.is-compact .dirt-project-top,
.dirt-project-card.is-compact .dirt-project-leaderboard {
  display: none;
}

.dirt-project-card.is-compact .dirt-project-meter {
  height: 5px;
  padding: 0;
  background: rgba(20, 14, 9, 0.16);
  border: 0;
  box-shadow:
    0 0 0 1px rgba(255, 247, 232, 0.22),
    0 2px 4px rgba(0, 0, 0, 0.2);
}

.dirt-project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dirt-project-title {
  color: var(--line);
  font-size: 9px;
  line-height: 1.25;
}

.dirt-project-amount {
  flex: none;
  color: #efe58f;
  font-size: 7px;
  font-style: normal;
  line-height: 1.35;
  text-align: right;
}

.dirt-project-meter {
  height: 13px;
  display: block;
  padding: 2px;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(239, 229, 143, 0.34);
  box-shadow: 0 0 0 1px rgba(23, 19, 14, 0.72) inset;
}

.dirt-project-fill {
  width: 0%;
  height: 100%;
  display: block;
  background:
    repeating-linear-gradient(90deg, rgba(255, 247, 232, 0.22) 0 5px, transparent 5px 10px),
    linear-gradient(90deg, #7b4b31, #efe58f);
}

.dirt-project-card.is-egg .dirt-project-fill {
  background:
    repeating-linear-gradient(90deg, rgba(255, 247, 232, 0.18) 0 5px, transparent 5px 10px),
    linear-gradient(90deg, #5fcde4, #d9fb66);
}

.dirt-project-leaderboard {
  display: grid;
  gap: 6px;
  padding: 10px;
  background: rgba(21, 17, 12, 0.93);
  border: 1px solid rgba(217, 251, 102, 0.72);
  box-shadow:
    0 0 0 2px rgba(23, 19, 14, 0.74),
    0 12px 22px rgba(0, 0, 0, 0.28);
}

.dirt-project-leaderboard[hidden] {
  display: none;
}

.dirt-project-leaderboard > strong {
  color: var(--line);
  font-size: 8px;
  line-height: 1.2;
}

.dirt-project-leaderboard span {
  min-width: 0;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  color: #fff7e8;
  font-size: 8px;
  line-height: 1.35;
}

.dirt-project-leaderboard i,
.dirt-project-leaderboard em {
  color: #efe58f;
  font-style: normal;
}

.dirt-project-leaderboard b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff7e8;
  font-weight: 400;
}

.pile-loot-title {
  color: #efe58f;
  font-size: 18px;
  line-height: 1.2;
}

.pile-behavior-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.pile-behavior-row span {
  min-width: 0;
  display: grid;
  place-items: center;
  min-height: 31px;
  padding: 6px 8px;
  background: rgba(255, 247, 232, 0.08);
  border: 1px solid rgba(239, 229, 143, 0.36);
  color: #efe58f;
  font-size: 9px;
  line-height: 1.25;
  text-align: center;
  text-shadow: 1px 1px 0 #17130e;
}

.pile-behavior-row .is-primary {
  grid-column: 1 / -1;
  min-height: 42px;
  background:
    linear-gradient(135deg, rgba(224, 27, 27, 0.2), transparent 62%),
    rgba(255, 247, 232, 0.07);
  border-color: rgba(224, 27, 27, 0.72);
  font-size: 13px;
  color: #ffb089;
}

.pile-loot-card[data-drop-pile-type="enemy"] .pile-behavior-row span {
  border-color: rgba(224, 27, 27, 0.54);
  color: #ff8a65;
}

.pile-loot-card[data-drop-pile-type="enemy"] .pile-behavior-row .is-primary {
  background:
    linear-gradient(135deg, rgba(224, 27, 27, 0.24), transparent 58%),
    rgba(255, 247, 232, 0.08);
  color: #ffb089;
}

.pile-loot-card[data-drop-pile-type="enemy"].is-enemy-dead .pile-behavior-row span {
  border-color: rgba(217, 251, 102, 0.5);
  color: var(--line);
}

.pile-loot-card[data-drop-pile-type="damage"] .pile-behavior-row span {
  border-color: rgba(224, 27, 27, 0.44);
  color: #ff9c72;
}

.pile-loot-card[data-drop-pile-type="damage"] .pile-behavior-row .is-primary {
  background:
    linear-gradient(135deg, rgba(224, 27, 27, 0.2), transparent 58%),
    rgba(255, 247, 232, 0.08);
}

.pile-loot-card[data-drop-pile-type="single"] .pile-behavior-row span {
  border-color: rgba(95, 205, 228, 0.52);
  color: #5fcde4;
}

.pile-loot-card[data-drop-pile-type="single"] .pile-behavior-row .is-primary {
  background:
    linear-gradient(135deg, rgba(95, 205, 228, 0.18), transparent 58%),
    rgba(255, 247, 232, 0.08);
}

.pile-drops-heading {
  display: block;
  margin-top: 2px;
  color: #fff7e8;
  font-size: 16px;
  line-height: 1.1;
  text-shadow: 2px 2px 0 #17130e;
}

.pile-resource-grid,
.loot-resource-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pile-resource-chip {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 7px 9px;
  background: rgba(0, 0, 0, 0.54);
  border-left: 4px solid var(--resource-color, var(--line));
  color: #fff7e8;
  font-size: 12px;
  line-height: 1;
}

.pile-resource-chip.is-empty {
  opacity: 0.38;
}

.pile-resource-chip i {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 29px;
  height: 29px;
  color: #17130e;
  background: var(--resource-color, var(--line));
  border: 1px solid rgba(255, 247, 232, 0.52);
  font-size: 13px;
  font-style: normal;
}

.pile-resource-icon {
  flex: 0 0 auto;
  width: auto;
  height: 29px;
  image-rendering: pixelated;
}

.pile-resource-chip strong {
  overflow: hidden;
  color: #fff7e8;
  font-size: 14px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pile-resource-chip em {
  color: var(--resource-color, var(--line));
  font-size: 12px;
  font-style: normal;
  line-height: 1;
}

.pile-draw-meter,
.loot-draw-meter {
  position: relative;
  height: 54px;
  overflow: hidden;
  background: rgba(16, 6, 6, 0.82);
  border: 1px solid rgba(239, 229, 143, 0.48);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.52) inset;
}

.pile-draw-fill,
.loot-draw-fill {
  position: absolute;
  inset: 0;
  display: flex;
  min-width: 100%;
  background: rgba(0, 0, 0, 0.32);
}

.pile-rarity-segment {
  position: relative;
  min-width: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  overflow: hidden;
  padding: 4px 2px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 247, 232, 0.18) 0 4px, transparent 4px 8px),
    linear-gradient(180deg, color-mix(in srgb, var(--rarity-color) 84%, #fff7e8), var(--rarity-color));
  border-right: 1px solid rgba(23, 19, 14, 0.58);
  color: #06110a;
  text-shadow: 1px 1px 0 rgba(255, 247, 232, 0.32);
}

.pile-rarity-segment:last-child {
  border-right: 0;
}

.pile-rarity-segment strong,
.pile-rarity-segment em {
  max-width: 100%;
  overflow: hidden;
  font-style: normal;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pile-rarity-segment strong {
  font-size: 8px;
}

.pile-rarity-segment em {
  font-size: 7px;
}

.loot-draw-meter {
  height: 58px;
}

.loot-draw-meter .pile-rarity-segment strong {
  font-size: 8px;
}

.loot-draw-meter .pile-rarity-segment em {
  font-size: 7px;
}

.pile-draw-text,
.loot-draw-text {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 31px;
  min-width: 138px;
  max-width: calc(100% - 14px);
  padding: 6px 12px;
  transform: translate(-50%, -50%);
  background: rgba(16, 6, 6, 0.64);
  border: 1px solid rgba(255, 247, 232, 0.24);
  color: #fff7e8;
  font-size: 13px;
  line-height: 1;
  text-align: center;
  text-shadow: 1px 1px 0 #17130e;
}

.loot-draw-text {
  font-size: 13px;
}

.pile-rarity-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.pile-rarity-card-row,
.loot-rarity-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.pile-rarity-card {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 7px 4px;
  background: rgba(16, 6, 6, 0.74);
  border: 1px solid color-mix(in srgb, var(--rarity-color, var(--line)) 72%, transparent);
  color: #fff7e8;
  text-align: center;
  box-shadow: 0 0 0 1px rgba(23, 19, 14, 0.68) inset;
}

.pile-rarity-card strong,
.pile-rarity-card em,
.pile-rarity-card b {
  max-width: 100%;
  overflow: hidden;
  font-style: normal;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pile-rarity-card strong {
  color: #fff7e8;
  font-size: 10px;
}

.pile-rarity-card em {
  color: var(--rarity-color, var(--line));
  font-family: var(--micro-font);
  font-size: 9px;
  font-weight: 700;
}

.pile-rarity-card b {
  color: #efe58f;
  font-family: var(--micro-font);
  font-size: 9px;
  font-weight: 700;
}

.pile-prize-carousel {
  min-width: 0;
  overflow: hidden;
}

.pile-prize-carousel .loot-prize-loop {
  width: 100%;
  min-width: 0;
  padding: 4px 6px 9px;
  background:
    linear-gradient(90deg, rgba(28, 22, 12, 0.96), transparent 12%, transparent 88%, rgba(28, 22, 12, 0.96)),
    rgba(6, 5, 4, 0.24);
  border: 0;
  box-shadow: 0 0 0 1px rgba(239, 229, 143, 0.16) inset;
  scroll-snap-type: none;
  scrollbar-width: none;
}

.pile-prize-carousel .loot-prize-loop::-webkit-scrollbar {
  display: none;
}

.pile-prize-carousel .loot-prize-track {
  min-height: 62px;
  align-items: stretch;
  gap: 5px;
}

.pile-prize-carousel .loot-prize-card,
.pile-prize-carousel .loot-prize-card.is-stick-nft {
  flex: 0 0 72px;
  min-height: 58px;
  grid-template-rows: 22px auto auto;
  align-content: start;
  gap: 3px;
  margin-right: 0;
  padding: 5px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--rarity-color, var(--line)) 16%, transparent), transparent 44%),
    rgba(16, 6, 6, 0.88);
  border: 1px solid color-mix(in srgb, var(--rarity-color, var(--line)) 72%, rgba(239, 229, 143, 0.28));
  border-radius: 0;
  box-shadow:
    0 0 0 1px rgba(23, 19, 14, 0.72),
    0 0 10px color-mix(in srgb, var(--rarity-color, var(--line)) 12%, transparent);
}

.pile-prize-carousel .loot-prize-card.is-centered {
  border-color: color-mix(in srgb, var(--rarity-color, var(--line)) 92%, #fff7e8);
  box-shadow:
    0 0 0 1px rgba(23, 19, 14, 0.82),
    0 0 13px color-mix(in srgb, var(--rarity-color, var(--line)) 25%, transparent);
}

.pile-prize-carousel .loot-prize-crown {
  top: -6px;
  width: 13px;
  height: 13px;
  border-width: 1px;
  font-size: 7px;
}

.pile-prize-carousel .loot-prize-art,
.pile-prize-carousel .loot-prize-card.is-stick-nft .loot-prize-art {
  min-height: 22px;
  height: 22px;
  background: rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 247, 232, 0.14);
}

.pile-prize-carousel .loot-prize-card.is-resource-package .loot-prize-art {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--resource-color, var(--line)) 18%, transparent), transparent 58%),
    rgba(0, 0, 0, 0.25);
}

.pile-prize-carousel .loot-resource-scene {
  transform: scale(0.26);
  transform-origin: center;
}

.pile-prize-carousel .loot-prize-colors {
  left: 4px;
  right: 4px;
  bottom: 3px;
  height: 5px;
  padding: 0;
  background: rgba(23, 19, 14, 0.48);
  border: 0;
  box-shadow: 0 0 6px color-mix(in srgb, var(--resource-color, var(--line)) 22%, transparent);
  --resource-color-size: 5px;
  --resource-color-gap: 1px;
  --resource-color-loop-speed: 5.5s;
}

.pile-prize-carousel .loot-stick-canvas {
  width: 48px;
  height: 36px;
}

.pile-prize-carousel .loot-mystery-icon {
  width: 26px;
  height: 26px;
  border-width: 1px;
  font-size: 14px;
  box-shadow: none;
}

.pile-prize-carousel .loot-prize-name,
.pile-prize-carousel .loot-prize-backing,
.pile-prize-carousel .loot-prize-odds {
  font-family: var(--micro-font);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.pile-prize-carousel .loot-prize-name {
  font-size: 9px;
}

.pile-prize-carousel .loot-prize-backing {
  display: none;
}

.pile-prize-carousel .loot-prize-odds {
  font-size: 8px;
}

.loot-prize-empty {
  display: grid;
  place-items: center;
  min-width: 160px;
  min-height: 58px;
  color: var(--muted);
  background: rgba(16, 6, 6, 0.72);
  border: 1px solid rgba(239, 229, 143, 0.22);
  font-size: 8px;
  line-height: 1.2;
}

.pile-rarity-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 5px 7px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid color-mix(in srgb, var(--rarity-color, var(--line)) 45%, transparent);
  color: #fff7e8;
  font-size: 8px;
  line-height: 1;
}

.pile-rarity-pill i {
  width: 8px;
  height: 8px;
  background: var(--rarity-color, var(--line));
}

.pile-rarity-pill strong,
.pile-rarity-pill em {
  font-style: normal;
}

.pile-rarity-pill em {
  color: var(--rarity-color, var(--line));
}

.pile-action-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.pile-action-row.has-send {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pile-drop-button {
  min-height: 32px;
  padding: 7px 8px;
  background: #17130e;
  color: var(--lime);
  border: 1px solid rgba(217, 251, 102, 0.64);
  font-size: 7px;
  line-height: 1.25;
  pointer-events: auto;
}

.pile-drop-button:hover,
.pile-drop-button:focus-visible {
  background: var(--lime);
  color: #06110a;
}

.pile-send-button {
  min-height: 32px;
  padding: 7px 8px;
  background: #d9fb66;
  color: #06110a;
  border: 1px solid rgba(255, 247, 232, 0.86);
  box-shadow:
    0 0 0 1px rgba(23, 19, 14, 0.55) inset,
    0 0 18px rgba(217, 251, 102, 0.28);
  font-size: 8px;
  line-height: 1.25;
  pointer-events: auto;
}

.pile-send-button:hover,
.pile-send-button:focus-visible {
  background: #fff7e8;
  color: #06110a;
}

.pile-send-button[hidden] {
  display: none;
}

.wallet-inventory-panel {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.wallet-inventory-heading {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-family: var(--micro-font);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
}

.wallet-inventory-heading span::after {
  content: " ->";
  color: var(--line);
}

.wallet-inventory-heading strong {
  color: var(--ink);
  font-family: var(--micro-font);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
}

.wallet-connect-button {
  min-height: 24px;
  padding: 5px 8px;
  background: #d9fb66;
  color: #06110a;
  border: 1px solid rgba(255, 247, 232, 0.66);
  font-family: var(--micro-font);
  font-size: 7px;
  line-height: 1;
}

.wallet-connect-button.is-connected {
  background: #54d16a;
}

.map-hud {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.inventory-token {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 8px;
  row-gap: 3px;
  padding: 9px 10px;
  background: rgba(15, 12, 8, 0.88);
  border: 1px solid rgba(233, 223, 184, 0.42);
  box-shadow: 0 -2px 0 color-mix(in srgb, var(--token-color, var(--lime)) 64%, transparent) inset;
  transform: translateZ(0);
}

.inventory-token-icon {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 18px;
  min-height: 24px;
}

.inventory-token-icon canvas {
  width: auto;
  height: 18px;
  image-rendering: pixelated;
}

.inventory-token-ticker {
  min-width: 0;
  color: var(--muted);
  font-family: var(--micro-font);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
}

.inventory-token-amount {
  min-width: 0;
  color: var(--lime);
  font-family: var(--micro-font);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-token.is-wallet-pulse,
.inventory-token.is-wallet-impact {
  border-color: color-mix(in srgb, var(--token-color, var(--lime)) 72%, rgba(255, 247, 232, 0.42));
  animation: wallet-token-pulse 820ms cubic-bezier(.16,.86,.26,1) both;
  box-shadow:
    0 -2px 0 color-mix(in srgb, var(--token-color, var(--lime)) 88%, transparent) inset,
    0 0 18px color-mix(in srgb, var(--token-color, var(--lime)) 38%, transparent);
}

.inventory-token-amount.is-rolling {
  color: #fff7e8;
  text-shadow:
    1px 1px 0 #17130e,
    0 0 10px color-mix(in srgb, var(--token-color, var(--lime)) 62%, transparent);
}

@keyframes wallet-token-pulse {
  0% {
    transform: scale(1);
  }
  24% {
    transform: scale(1.075);
  }
  54% {
    transform: scale(0.985);
  }
  100% {
    transform: scale(1);
  }
}

.map-app-body {
  --device-toolbar-height: 42px;
  overflow-x: hidden;
  overflow-y: auto;
  background: #17130e;
  padding-top: var(--device-toolbar-height);
}

.map-app-body .inventory-token-ticker,
.map-app-body .inventory-token-amount,
.map-app-body .tracked-count-control,
.map-app-body .selected-units-control,
.map-app-body .unit-stat-pill,
.map-app-body .unit-perk-row strong,
.map-app-body .map-drop-resource-line,
.map-app-body .map-drop-item-head em,
.map-app-body .pile-rarity-segment em,
.map-app-body .pile-rarity-card em,
.map-app-body .pile-rarity-card b {
  font-family: var(--micro-font);
  letter-spacing: 0;
}

.map-app-body.is-admin-preview {
  --device-toolbar-height: 0px;
  overflow: hidden;
  padding: 0;
  background: #d7ca9f;
}

.map-app-body.is-admin-preview .device-preview-toolbar,
.map-app-body.is-admin-preview .map-app-topbar,
.map-app-body.is-admin-preview .wallet-inventory-panel,
.map-app-body.is-admin-preview .my-units-panel,
.map-app-body.is-admin-preview .map-tools-overlay,
.map-app-body.is-admin-preview .map-title-overlay,
.map-app-body.is-admin-preview .map-data-tab,
.map-app-body.is-admin-preview .map-data-panel,
.map-app-body.is-admin-preview .mini-map-frame,
.map-app-body.is-admin-preview .map-focus-exit,
.map-app-body.is-admin-preview .map-resize-handle {
  display: none !important;
}

.map-app-body.is-admin-preview .map-app-frame {
  width: 100vw;
  min-height: 100vh;
  padding: 0;
  background: #d7ca9f;
  background-image: none;
  grid-template-rows: minmax(0, 1fr);
}

.map-app-body.is-admin-preview .map-app-panel.map-game-panel {
  min-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  background: #d7ca9f;
  box-shadow: none;
  grid-template-rows: minmax(0, 100vh);
}

.map-app-body.is-admin-preview .map-shell {
  min-height: 100vh;
  height: 100vh;
  border: 0;
  background: #d7ca9f;
}

.map-app-body.is-admin-preview #harvestMapCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.device-preview-toolbar {
  position: fixed;
  z-index: 40;
  top: 8px;
  left: 50%;
  display: flex;
  justify-content: center;
  transform: translateX(-50%);
  pointer-events: none;
}

.device-preview-toggle {
  pointer-events: auto;
  min-height: 28px;
  padding: 7px 11px;
  background: #d9fb66;
  color: #10130d;
  border: 1px solid rgba(233, 223, 184, 0.72);
  box-shadow:
    0 0 0 2px rgba(23, 19, 14, 0.72),
    0 8px 22px rgba(0, 0, 0, 0.42);
  font-size: 8px;
}

.device-preview-toggle[aria-pressed="true"] {
  background: #5fcde4;
}

.map-app-frame {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100vw;
  min-height: calc(115vh - var(--device-toolbar-height));
  padding: 12px;
  background:
    linear-gradient(rgba(233, 223, 184, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(233, 223, 184, 0.04) 1px, transparent 1px),
    #17130e;
  background-size: 28px 28px;
}

.map-app-frame:fullscreen {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  border: 0;
  border-radius: 0;
}

.map-app-body.is-mobile-emulator {
  overflow: auto;
  display: grid;
  justify-items: center;
  align-content: start;
  min-height: 100vh;
  padding: 48px 0 30px;
}

.map-app-body.is-mobile-emulator .map-app-frame {
  width: min(390px, calc(100vw - 24px));
  height: min(844px, calc(100vh - 78px));
  min-height: 690px;
  grid-template-rows: 10% minmax(0, 90%);
  padding: 13px 10px 12px;
  overflow: hidden;
  border: 13px solid #050505;
  border-radius: 34px;
  background:
    linear-gradient(rgba(233, 223, 184, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(233, 223, 184, 0.035) 1px, transparent 1px),
    #17130e;
  background-size: 22px 22px;
  box-shadow:
    0 0 0 2px #34312a,
    0 22px 60px rgba(0, 0, 0, 0.55);
}

.map-app-body.is-mobile-emulator .map-app-frame::before {
  content: "";
  position: absolute;
  z-index: 20;
  top: 7px;
  left: 50%;
  width: 92px;
  height: 8px;
  background: #050505;
  border-radius: 0 0 10px 10px;
  transform: translateX(-50%);
  pointer-events: none;
}

.map-app-body.is-mobile-emulator .map-app-topbar {
  grid-template-columns: 1fr;
  align-content: center;
  gap: 5px;
  min-height: 0;
  padding: 7px 0 5px;
}

.map-app-body.is-mobile-emulator .map-brand {
  font-size: 18px;
  line-height: 1.1;
}

.map-app-body.is-mobile-emulator .map-app-nav {
  justify-content: start;
  gap: 15px;
}

.map-app-body.is-mobile-emulator .map-app-nav a {
  font-size: 6px;
  line-height: 1.2;
}

.map-app-body.is-mobile-emulator .map-app-panel {
  grid-template-rows: minmax(0, 56%) minmax(0, 10%) minmax(0, 34%);
  gap: 4px;
  margin-top: 4px;
  overflow: hidden;
}

.map-app-body.is-mobile-emulator .map-resize-handle {
  display: none;
}

.map-app-body.is-mobile-emulator .map-game-panel {
  padding: 6px;
}

.map-app-body.is-mobile-emulator .map-app-panel h1 {
  font-size: 11px;
}

.map-app-body.is-mobile-emulator .map-title-overlay {
  top: 8px;
  left: 8px;
  width: min(270px, calc(100% - 132px));
  min-width: 0;
  max-width: calc(100% - 132px);
  max-height: calc(100% - 16px);
}

.map-app-body.is-mobile-emulator .map-info-summary {
  grid-template-columns: 26px minmax(0, 1fr) 12px;
  min-height: 38px;
  gap: 6px;
  padding: 6px;
}

.map-app-body.is-mobile-emulator .map-selection-back {
  width: 26px;
  min-height: 26px;
  font-size: 12px;
}

.map-app-body.is-mobile-emulator .map-info-summary strong {
  font-size: 9px;
}

.map-app-body.is-mobile-emulator .map-info-content {
  max-height: calc(var(--map-shell-height, 440px) - 54px);
  padding: 0 6px 7px;
}

.map-app-body.is-mobile-emulator .map-info-totals {
  grid-template-columns: 1fr;
}

.map-app-body.is-mobile-emulator .map-drop-meter {
  height: 32px;
}

.map-app-body.is-mobile-emulator .map-tools-overlay {
  top: 8px;
  right: 8px;
  max-width: calc(100% - 16px);
  max-height: calc(100% - 16px);
}

.map-app-body.is-mobile-emulator .map-tools-overlay[open] {
  width: calc(100% - 16px);
  padding: 7px;
}

.map-app-body.is-mobile-emulator .map-tools-overlay summary {
  min-height: 30px;
  padding: 8px 10px;
  font-size: 7px;
}

.map-app-body.is-mobile-emulator .map-tools-overlay .map-controls {
  overflow: auto;
  padding-bottom: 2px;
}

.map-app-body.is-mobile-emulator .speed-controls,
.map-app-body.is-mobile-emulator .zoom-controls,
.map-app-body.is-mobile-emulator .unit-controls {
  gap: 4px;
}

.map-app-body.is-mobile-emulator .speed-controls button,
.map-app-body.is-mobile-emulator .zoom-controls button,
.map-app-body.is-mobile-emulator .unit-controls button {
  min-height: 26px;
  padding: 5px 6px;
  font-size: 6px;
}

.map-app-body.is-mobile-emulator .unit-controls label {
  font-size: 6px;
}

.map-app-body.is-mobile-emulator .unit-controls input,
.map-app-body.is-mobile-emulator .unit-controls select {
  width: 66px;
  min-height: 26px;
  padding: 5px 6px;
  font-size: 6px;
}

.map-app-body.is-mobile-emulator .unit-controls select {
  width: auto;
  max-width: 104px;
}

.map-app-body.is-mobile-emulator .mini-map-frame {
  top: 46px;
  right: 8px;
  width: 118px;
  padding: 6px;
}

.map-app-body.is-mobile-emulator .mini-map-frame span {
  font-size: 6px;
}

.map-app-body.is-mobile-emulator #miniMapCanvas {
  height: 82px;
}

.map-app-body.is-mobile-emulator .map-focus-exit {
  top: 156px;
  right: 8px;
  font-size: 6px;
}

.map-app-body.is-mobile-emulator .map-hud {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 3px;
  min-height: 0;
  margin-top: 0;
}

.map-app-body.is-mobile-emulator .wallet-inventory-panel {
  min-height: 0;
  gap: 2px;
  margin-top: 0;
  overflow: hidden;
}

.map-app-body.is-mobile-emulator .wallet-inventory-heading {
  font-size: 8px;
  line-height: 1.1;
}

.map-app-body.is-mobile-emulator .wallet-inventory-heading strong {
  font-size: 8px;
}

.map-app-body.is-mobile-emulator .inventory-token {
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  justify-items: center;
  row-gap: 1px;
  min-height: 28px;
  padding: 3px 2px;
  column-gap: 0;
}

.map-app-body.is-mobile-emulator .inventory-token-icon {
  grid-row: auto;
  width: 12px;
  min-height: 12px;
}

.map-app-body.is-mobile-emulator .inventory-token-icon canvas {
  height: 11px;
}

.map-app-body.is-mobile-emulator .inventory-token-ticker {
  display: none;
}

.map-app-body.is-mobile-emulator .inventory-token-amount {
  max-width: 100%;
  font-size: 10px;
  text-align: center;
}

.map-app-body.is-mobile-emulator .my-units-panel {
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 4px;
  min-height: 0;
  margin-top: 0;
  overflow: hidden;
}

.map-app-body.is-mobile-emulator .my-units-head {
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  padding: 3px 5px;
}

.map-app-body.is-mobile-emulator .my-units-head .eyebrow,
.map-app-body.is-mobile-emulator .my-units-head > strong {
  display: none;
}

.map-app-body.is-mobile-emulator .tracked-count-control {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  font-size: 8px;
  line-height: 1;
}

.map-app-body.is-mobile-emulator .tracked-count-control strong {
  font-size: 9px;
}

.map-app-body.is-mobile-emulator .tracked-count-control input {
  min-width: 0;
}

.map-app-body.is-mobile-emulator .selected-units-control {
  grid-column: auto;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 4px;
  font-size: 8px;
  line-height: 1;
}

.map-app-body.is-mobile-emulator .selected-units-control button {
  min-height: 18px;
  padding: 3px 5px;
  font-size: 7px;
}

.map-app-body.is-mobile-emulator .my-units-roster {
  grid-template-columns: 1fr;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-right: 2px;
}

.map-app-body.is-mobile-emulator .unit-action-bar {
  grid-column: 1;
}

.map-app-body.is-mobile-emulator .unit-action-bar button {
  min-height: 30px;
  padding: 7px 12px;
  font-size: 8px;
}

.map-app-body.is-mobile-emulator .unit-action-bar.has-selected button:not(:disabled) {
  min-height: 34px;
  font-size: 9px;
}

.map-app-body.is-mobile-emulator .my-unit-card {
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
}

.map-app-body.is-mobile-emulator .my-unit-stage {
  width: 88px;
  height: 100px;
}

.map-app-body.is-mobile-emulator .unit-summary-line {
  font-size: 9px;
  line-height: 1.55;
}

.map-app-body.is-mobile-emulator .unit-stats-grid {
  gap: 4px;
}

.map-app-body.is-mobile-emulator .unit-stat-hp-bar {
  min-height: 22px;
  gap: 5px;
  padding: 4px 5px;
}

.map-app-body.is-mobile-emulator .unit-stat-hp-track {
  height: 7px;
}

.map-app-body.is-mobile-emulator .unit-stat-pill {
  min-height: 21px;
  padding: 3px 5px;
}

.map-app-body.is-mobile-emulator .unit-stat-label,
.map-app-body.is-mobile-emulator .unit-stat-pill span {
  font-size: 9px;
}

.map-app-body.is-mobile-emulator .unit-stat-hp-value,
.map-app-body.is-mobile-emulator .unit-stat-pill strong {
  font-size: 11px;
}

.map-app-body.is-mobile-emulator .unit-time-line {
  font-size: 12px;
}

.map-app-body.is-mobile-emulator .unit-perk-row strong {
  font-size: 8px;
}

.map-app-body.is-mobile-emulator .unit-item-slots {
  grid-template-columns: repeat(3, 17px);
  gap: 4px;
  min-height: 17px;
}

.map-app-body.is-mobile-emulator .unit-item-slot {
  width: 17px;
}

.map-app-body.is-mobile-emulator .unit-item-slot-icon {
  height: 11px;
}

.map-app-body.is-mobile-emulator .unit-collect-button,
.map-app-body.is-mobile-emulator .unit-select-cta {
  min-height: 28px;
  font-size: 8px;
}

.map-app-topbar {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 18px;
  min-width: 0;
  padding: 8px 0 12px;
  border-bottom: 2px solid rgba(233, 223, 184, 0.52);
}

.chain-runtime-badge {
  position: absolute;
  z-index: 13;
  left: 14px;
  bottom: 14px;
  max-width: min(520px, calc(100% - 28px));
  padding: 8px 10px;
  background: rgba(25, 18, 12, 0.84);
  border: 1px solid rgba(255, 247, 232, 0.42);
  color: #fff7e8;
  font-family: var(--micro-font);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.22);
  pointer-events: none;
}

.chain-runtime-badge strong,
.chain-runtime-badge span {
  display: block;
}

.chain-runtime-badge strong {
  color: #d9fb66;
  font-size: 10px;
}

.chain-runtime-badge span {
  margin-top: 4px;
  color: rgba(255, 247, 232, 0.78);
  font-size: 8px;
  line-height: 1.45;
}

.chain-runtime-badge.is-public-read-only strong {
  color: #efe58f;
}

.chain-runtime-badge.is-local strong {
  color: #5fcde4;
}

.map-brand {
  grid-column: auto;
  justify-self: start;
  font-size: clamp(18px, 3vw, 30px);
}

.map-app-nav {
  grid-column: auto;
  justify-content: end;
  margin-top: 0;
}

.map-app-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(440px, var(--map-shell-height, min(70vh, 720px))) auto auto;
  align-content: start;
  margin: 12px 0 0;
}

.map-app-panel h1 {
  margin: 0;
  color: var(--line);
  font-size: clamp(15px, 2.2vw, 24px);
  line-height: 1.3;
}

.map-app-shell {
  min-height: 0;
}

.map-app-shell #harvestMapCanvas {
  height: 100%;
  min-height: 0;
}

.my-units-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
  margin-top: 10px;
}

.my-units-head {
  min-width: 126px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 10px;
  background: rgba(15, 12, 8, 0.9);
  border: 1px solid rgba(233, 223, 184, 0.42);
}

.my-units-head .eyebrow {
  margin: 0;
}

.my-units-head strong {
  color: var(--line);
  font-size: 10px;
  line-height: 1.5;
}

.tracked-count-control {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-family: var(--micro-font);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
}

.tracked-count-control strong {
  color: var(--lime);
  font-size: 10px;
}

.tracked-count-control input {
  width: 100%;
  accent-color: var(--lime);
}

.selected-units-control {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-family: var(--micro-font);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
}

.selected-units-control strong {
  color: var(--cyan);
  font-size: 10px;
}

.selected-units-control button {
  min-height: 26px;
  padding: 6px 8px;
  background: rgba(95, 205, 228, 0.18);
  color: var(--ink);
  border: 1px solid rgba(95, 205, 228, 0.58);
  font-size: 8px;
}

.selected-units-control button:disabled {
  opacity: 0.38;
}

.my-units-roster {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 10px;
}

.my-units-empty-message {
  grid-column: 1 / -1;
  min-height: 118px;
  display: grid;
  place-items: center;
  padding: 18px;
  color: #fff7e8;
  background: rgba(16, 6, 6, 0.64);
  border: 1px solid rgba(255, 247, 232, 0.28);
  font-family: var(--micro-font);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.my-units-roster.is-drag-selecting {
  cursor: crosshair;
  user-select: none;
}

.unit-action-bar {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 12px;
  min-width: 0;
  padding-top: 2px;
}

.unit-action-bar button {
  min-width: min(420px, 100%);
  min-height: 60px;
  padding: 17px 28px;
  background: #17130e;
  color: var(--lime);
  border: 1px solid rgba(217, 251, 102, 0.62);
  box-shadow: 0 0 0 1px rgba(23, 19, 14, 0.65) inset;
  font-size: 15px;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, color 140ms ease, transform 140ms ease;
}

.unit-action-bar.has-selected button:not(:disabled) {
  min-height: 68px;
  background: #d9fb66;
  color: #06110a;
  border-color: #fff7e8;
  box-shadow:
    0 0 0 3px rgba(224, 27, 27, 0.82),
    0 0 22px rgba(217, 251, 102, 0.46);
  font-size: 18px;
  transform: translateY(-1px);
}

.unit-action-bar button:disabled {
  color: var(--muted);
  border-color: rgba(233, 223, 184, 0.28);
  opacity: 0.46;
}

.my-unit-card {
  min-width: 0;
  position: relative;
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 9px;
  padding: 9px;
  background:
    linear-gradient(135deg, rgba(233, 223, 184, 0.09), transparent 48%),
    rgba(14, 11, 8, 0.9);
  border: 1px solid var(--team-color, rgba(233, 223, 184, 0.36));
  box-shadow: 0 0 0 1px rgba(23, 19, 14, 0.65) inset;
  cursor: pointer;
  touch-action: none;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.my-units-roster.is-drag-selecting .my-unit-card {
  cursor: crosshair;
}

.my-unit-card:hover,
.my-unit-card:focus-visible,
.my-unit-card.is-focused {
  outline: 2px solid var(--team-color, var(--lime));
  outline-offset: 2px;
  transform: translateY(-1px);
}

.my-unit-card.is-focused {
  box-shadow:
    0 0 0 1px rgba(23, 19, 14, 0.65) inset,
    0 0 18px color-mix(in srgb, var(--team-color, var(--lime)) 42%, transparent);
}

.my-unit-card.is-selected {
  border-color: #5fcde4;
  box-shadow:
    0 0 0 2px rgba(95, 205, 228, 0.72) inset,
    0 0 18px rgba(95, 205, 228, 0.24);
}

.my-unit-card.is-waiting-assignment {
  background:
    linear-gradient(135deg, rgba(251, 242, 54, 0.34), transparent 54%),
    rgba(48, 43, 14, 0.92);
  border-color: #fbf236;
  box-shadow:
    0 0 0 1px rgba(23, 19, 14, 0.75) inset,
    0 0 18px rgba(251, 242, 54, 0.22);
}

.my-unit-card.is-waiting-assignment.is-selected {
  box-shadow:
    0 0 0 2px rgba(95, 205, 228, 0.72) inset,
    0 0 0 2px rgba(251, 242, 54, 0.9),
    0 0 22px rgba(251, 242, 54, 0.3);
}

.my-unit-card.is-collect-ready {
  background:
    linear-gradient(135deg, rgba(82, 255, 77, 0.18), transparent 48%),
    rgba(18, 43, 19, 0.82);
  border-color: #52ff4d;
}

.unit-card-identity {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  display: block;
  pointer-events: none;
}

.unit-card-number {
  display: inline-grid;
  place-items: center;
  min-width: 74px;
  min-height: 21px;
  padding: 0 6px;
  background: #e01b1b;
  color: #fff7e8;
  border: 1px solid rgba(242, 230, 189, 0.7);
  font-size: 8px;
  line-height: 1.2;
  text-shadow: 1px 1px 0 #17130e;
}

.unit-select-checkbox {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--cyan);
  image-rendering: pixelated;
}

.my-unit-visual {
  position: relative;
  display: grid;
  gap: 7px;
  align-content: start;
}

.my-unit-stage {
  display: block;
  width: 100px;
  height: 116px;
  background: #d8c18a;
  border: 1px solid rgba(233, 223, 184, 0.32);
  image-rendering: pixelated;
}

.my-unit-info {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 10px;
}

.my-unit-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.team-chip {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  background: var(--team-color, var(--line));
  color: #17130e;
  border: 1px solid rgba(242, 230, 189, 0.72);
  font-size: 10px;
}

.my-unit-visual .team-chip {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 1;
}

.unit-summary-line {
  display: block;
  min-width: 0;
  max-width: 100%;
  color: #dffb72;
  font-family: var(--micro-font);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(23, 19, 14, 0.92);
}

.my-unit-card.is-idle-state .unit-summary-line {
  color: #fff26a;
  -webkit-text-stroke: 0;
  text-shadow: 0 1px 0 rgba(23, 19, 14, 0.92);
}

.my-unit-card.is-waiting-assignment .unit-summary-line {
  color: #fff7e8;
}

.unit-stats-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 6px;
}

.unit-stat-hp-bar {
  min-width: 0;
  grid-column: 1 / -1;
  min-height: 24px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 4px 7px;
  background: rgba(8, 6, 4, 0.78);
  border: 1px solid rgba(82, 255, 77, 0.45);
  box-shadow: 0 0 0 1px rgba(23, 19, 14, 0.5) inset;
  font-family: var(--micro-font);
}

.unit-stat-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.unit-stat-hp-track {
  position: relative;
  height: 8px;
  overflow: hidden;
  background: rgba(82, 255, 77, 0.12);
  border: 1px solid rgba(233, 223, 184, 0.2);
}

.unit-stat-hp-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--unit-hp, 100%);
  background: #52ff4d;
  box-shadow: 0 0 8px rgba(82, 255, 77, 0.36);
}

.unit-stat-hp-value {
  color: #52ff4d;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  text-shadow: 1px 1px 0 #17130e;
}

.unit-stat-pill {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-height: 23px;
  padding: 4px 7px;
  background: rgba(8, 6, 4, 0.78);
  border: 1px solid rgba(233, 223, 184, 0.34);
  box-shadow: 0 0 0 1px rgba(23, 19, 14, 0.5) inset;
  font-family: var(--micro-font);
}

.unit-stat-pill span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.unit-stat-pill strong {
  color: #fff7e8;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  text-align: right;
  overflow-wrap: anywhere;
  text-shadow: 1px 1px 0 #17130e;
}

.unit-stat-pill.is-hp strong {
  color: #52ff4d;
}

.unit-stat-pill.is-attack strong {
  color: #fbf236;
}

.unit-stat-pill.is-speed strong {
  color: #5fcde4;
}

.unit-time-line {
  display: block;
  color: #fff7e8;
  font-family: var(--micro-font);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  text-shadow: 0 1px 0 rgba(23, 19, 14, 0.92);
}

.unit-time-line .time-value {
  color: #fff7e8;
}

.unit-time-line .time-unit {
  color: #f7e68f;
  margin-left: 1px;
}

.unit-progress {
  --trip-progress: 0%;
  position: relative;
  height: 20px;
  margin: 1px 9px;
}

.unit-progress::before,
.unit-progress::after {
  position: absolute;
  top: 50%;
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
  transform: translateY(-50%);
}

.unit-progress::before {
  content: "[";
  left: -9px;
}

.unit-progress::after {
  content: "]";
  right: -9px;
}

.unit-progress {
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(255, 247, 232, 0.76) calc(50% - 1px), rgba(255, 247, 232, 0.76) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(90deg, rgba(217, 251, 102, 0.28) var(--trip-progress), rgba(233, 223, 184, 0.18) 0);
  border-top: 1px solid rgba(233, 223, 184, 0.28);
  border-bottom: 1px solid rgba(233, 223, 184, 0.28);
}

.unit-progress-fill {
  position: absolute;
  top: 6px;
  left: 0;
  width: var(--trip-progress);
  height: 6px;
  background: var(--team-color, var(--lime));
}

.unit-progress-midpoint {
  position: absolute;
  z-index: 2;
  top: 2px;
  bottom: 2px;
  left: 50%;
  width: 2px;
  background: #fff7e8;
  box-shadow:
    0 0 0 1px rgba(23, 19, 14, 0.72),
    0 0 6px rgba(217, 251, 102, 0.42);
  transform: translateX(-50%);
}

.my-unit-card.is-collect-ready .unit-progress {
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(255, 247, 232, 0.82) calc(50% - 1px), rgba(255, 247, 232, 0.82) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(90deg, rgba(82, 255, 77, 0.46) var(--trip-progress), rgba(233, 223, 184, 0.18) 0);
}

.my-unit-card.is-collect-ready .unit-progress-fill {
  background: #52ff4d;
}

.unit-progress-marker {
  position: absolute;
  top: 50%;
  left: var(--trip-progress);
  color: #fff7e8;
  font-size: 13px;
  line-height: 1;
  text-shadow: 1px 1px 0 #17130e;
  transform: translate(-50%, -50%);
}

.unit-element-strip {
  display: grid;
  gap: 6px;
  min-height: 20px;
}

.unit-item-slots {
  display: grid;
  grid-template-columns: repeat(3, 20px);
  gap: 5px;
  min-height: 20px;
  align-items: center;
}

.unit-item-slots[hidden] {
  display: none;
}

.unit-item-slot {
  width: 20px;
  aspect-ratio: 1;
  display: inline-grid;
  grid-auto-flow: column;
  place-content: center;
  gap: 1px;
  background:
    linear-gradient(135deg, rgba(255, 247, 232, 0.42), rgba(239, 229, 143, 0.2)),
    rgba(23, 19, 14, 0.4);
  border: 1px solid rgba(255, 247, 232, 0.84);
  box-shadow:
    0 0 0 1px rgba(23, 19, 14, 0.86),
    0 0 0 1px rgba(23, 19, 14, 0.34) inset,
    0 0 8px rgba(255, 247, 232, 0.18);
}

.unit-item-slot.is-empty {
  border-style: dashed;
  opacity: 0.94;
}

.unit-item-slot.is-empty::before {
  content: "";
  width: 8px;
  aspect-ratio: 1;
  display: block;
  background: rgba(255, 247, 232, 0.46);
  box-shadow:
    6px 0 0 rgba(23, 19, 14, 0.24),
    0 6px 0 rgba(23, 19, 14, 0.24);
}

.unit-item-slot.is-filled {
  background:
    linear-gradient(135deg, rgba(217, 251, 102, 0.28), rgba(95, 205, 228, 0.15)),
    rgba(23, 19, 14, 0.82);
  border-color: rgba(217, 251, 102, 0.9);
}

.unit-item-slot.is-unequipped {
  opacity: 0.48;
  filter: grayscale(0.45);
}

.unit-item-slot-icon {
  width: auto;
  height: 13px;
  image-rendering: pixelated;
}

.unit-perk-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.unit-perk-icons {
  display: flex;
  align-items: center;
  gap: 3px;
}

.unit-element-strip canvas,
.unit-perk-icons canvas {
  width: auto;
  height: 18px;
  image-rendering: pixelated;
}

.unit-perk-row strong {
  min-width: 0;
  color: var(--ink);
  font-family: var(--micro-font);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.unit-collect-button {
  justify-self: stretch;
  min-height: 32px;
  background: #52ff4d;
  color: #06110a;
  border: 1px solid rgba(242, 230, 189, 0.78);
  box-shadow: 0 0 0 1px rgba(23, 19, 14, 0.55) inset;
  font-size: 10px;
}

.unit-select-cta {
  justify-self: stretch;
  min-height: 34px;
  background: #fbf236;
  color: #06110a;
  border: 1px solid rgba(255, 247, 232, 0.82);
  box-shadow:
    0 0 0 1px rgba(23, 19, 14, 0.72) inset,
    0 0 14px rgba(251, 242, 54, 0.32);
  font-size: 10px;
  text-shadow: none;
}

.my-unit-card.is-selected .unit-select-cta {
  background: #d9fb66;
  color: #06110a;
  border-color: #fff7e8;
  box-shadow:
    0 0 0 1px rgba(23, 19, 14, 0.55) inset,
    0 0 16px rgba(217, 251, 102, 0.38);
  font-size: 8px;
  text-shadow: none;
}

.unit-collect-button[hidden],
.unit-select-cta[hidden] {
  display: none;
}

.unit-collect-button:hover,
.unit-collect-button:focus-visible,
.unit-select-cta:hover,
.unit-select-cta:focus-visible {
  outline: 2px solid #fff7e8;
  outline-offset: 2px;
  background: #d9fb66;
}

.unit-flyaway {
  position: absolute;
  right: 34px;
  top: 10px;
  z-index: 3;
  color: #e01b1b;
  font-size: 7px;
  line-height: 1.25;
  pointer-events: none;
  animation: unit-flyaway 1900ms ease-out forwards;
  text-shadow:
    1px 0 0 #fff7e8,
    -1px 0 0 #fff7e8,
    0 1px 0 #fff7e8,
    0 -1px 0 #fff7e8,
    2px 2px 0 #17130e;
}

@keyframes unit-flyaway {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-18px);
  }
}

.gacha-modal[hidden] {
  display: none;
}

.gacha-modal {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(14px, 3vw, 30px);
  background: rgba(6, 5, 4, 0.78);
}

.gacha-panel {
  position: relative;
  width: min(920px, calc(100vw - 24px));
  max-height: calc(100vh - 28px);
  display: grid;
  gap: clamp(14px, 2vw, 22px);
  padding: clamp(18px, 3vw, 30px);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(217, 251, 102, 0.10), transparent 46%),
    rgba(23, 19, 14, 0.96);
  border: 2px solid rgba(239, 229, 143, 0.82);
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.72),
    0 18px 64px rgba(0, 0, 0, 0.58);
  transition:
    opacity 320ms ease,
    transform 320ms cubic-bezier(.16,.86,.26,1);
}

.gacha-panel .eyebrow,
.gacha-panel h2,
.gacha-status {
  margin: 0;
  text-align: center;
}

.gacha-panel .eyebrow {
  font-size: 10px;
  line-height: 1.45;
}

.gacha-panel h2 {
  color: var(--line);
  font-size: clamp(22px, 3.5vw, 36px);
  line-height: 1.22;
}

.gacha-odds-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  padding: 2px 0;
}

.gacha-odds-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 27px;
  padding: 6px 10px;
  color: #fff7e8;
  background: rgba(0, 0, 0, 0.78);
  border: 1px solid rgba(255, 247, 232, 0.12);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.72),
    0 0 12px color-mix(in srgb, var(--rarity-color, var(--line)) 10%, transparent);
  font-family: var(--micro-font);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.12;
}

.gacha-odds-pill i {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  background: var(--rarity-color, var(--line));
  box-shadow: 0 0 8px color-mix(in srgb, var(--rarity-color, var(--line)) 52%, transparent);
}

.gacha-odds-pill strong,
.gacha-odds-pill em {
  font-style: normal;
  letter-spacing: 0;
}

.gacha-odds-pill strong {
  color: #fff7e8;
}

.gacha-odds-pill em {
  color: var(--rarity-color, var(--line));
}

.gacha-window {
  position: relative;
  min-height: clamp(190px, 31vh, 270px);
  overflow: hidden;
  border-top: 2px solid rgba(239, 229, 143, 0.68);
  border-bottom: 2px solid rgba(239, 229, 143, 0.68);
  background:
    linear-gradient(90deg, rgba(23, 19, 14, 0.94), transparent 14%, transparent 86%, rgba(23, 19, 14, 0.94)),
    rgba(216, 193, 138, 0.1);
}

.gacha-marker {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: #fff7e8;
  box-shadow:
    0 0 0 1px #e01b1b,
    0 0 16px rgba(217, 251, 102, 0.6);
  transform: translateX(-50%);
}

.gacha-window.has-selection-boxes .gacha-marker {
  display: none;
}

.gacha-selection-overlay[hidden] {
  display: none;
}

.gacha-selection-overlay {
  position: absolute;
  z-index: 4;
  inset: clamp(18px, 3vh, 34px) 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 12px;
  pointer-events: none;
}

.gacha-selection-box {
  flex: 0 0 164px;
  border: 4px solid #e01b1b;
  background: rgba(224, 27, 27, 0.06);
  box-shadow:
    0 0 0 2px rgba(23, 19, 14, 0.82),
    0 0 0 1px rgba(255, 247, 232, 0.46) inset,
    0 0 20px rgba(224, 27, 27, 0.28);
}

.gacha-modal.is-ready .gacha-selection-box {
  box-shadow:
    0 0 0 2px rgba(23, 19, 14, 0.82),
    0 0 0 1px rgba(255, 247, 232, 0.5) inset,
    0 0 26px rgba(224, 27, 27, 0.46);
}

.gacha-track {
  display: flex;
  gap: 12px;
  align-items: stretch;
  min-width: max-content;
  padding: clamp(18px, 3vh, 34px) 0;
  will-change: transform;
}

.gacha-card {
  flex: 0 0 164px;
  min-height: clamp(188px, 26vh, 228px);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 9px;
  padding: 15px 13px;
  background:
    linear-gradient(180deg, rgba(255, 247, 232, 0.08), transparent 32%),
    linear-gradient(135deg, color-mix(in srgb, var(--rarity-color, var(--line)) 13%, transparent), transparent 60%),
    rgba(23, 19, 14, 0.92);
  border: 2px solid color-mix(in srgb, var(--rarity-color, var(--line)) 54%, rgba(233, 223, 184, 0.28));
  color: var(--ink);
  box-shadow:
    0 -4px 0 rgba(233, 223, 184, 0.16) inset,
    0 0 0 1px rgba(0, 0, 0, 0.6);
}

.gacha-prize-scene {
  position: relative;
  width: 118px;
  height: 88px;
  display: grid;
  place-items: center;
  overflow: visible;
  isolation: isolate;
}

.gacha-prize-art {
  width: 130px;
  height: 94px;
  display: grid;
  place-items: center;
  margin: 0;
  overflow: visible;
}

.gacha-resource-pile-image {
  width: 130px;
  height: 94px;
  display: block;
  object-fit: contain;
  image-rendering: pixelated;
  filter:
    drop-shadow(2px 3px 0 rgba(0, 0, 0, 0.42))
    drop-shadow(0 0 12px color-mix(in srgb, var(--rarity-color, var(--line)) 18%, transparent));
  user-select: none;
  -webkit-user-drag: none;
}

.gacha-bundle-scene {
  width: 118px;
  min-height: 88px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 44px));
  place-content: center;
  align-items: center;
  justify-items: center;
  gap: 9px;
  isolation: isolate;
}

.gacha-bundle-scene[data-drop-count="3"],
.gacha-bundle-scene[data-drop-count="5"],
.gacha-bundle-scene[data-drop-count="6"] {
  grid-template-columns: repeat(3, minmax(0, 34px));
  gap: 8px 6px;
}

.gacha-bundle-scene[data-drop-count="4"] {
  grid-template-columns: repeat(2, minmax(0, 40px));
  gap: 8px;
}

.gacha-drop-square {
  position: relative;
  width: 44px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--drop-rarity-color, var(--line)) 34%, transparent), transparent 58%),
    linear-gradient(180deg, transparent 0 72%, color-mix(in srgb, var(--drop-resource-color, var(--line)) 26%, transparent)),
    rgba(11, 8, 6, 0.88);
  border: 2px solid var(--drop-rarity-color, var(--line));
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.78),
    0 0 12px color-mix(in srgb, var(--drop-rarity-color, var(--line)) 22%, transparent);
}

.resource-color-loop {
  display: block;
  overflow: hidden;
  pointer-events: none;
}

.resource-color-loop-track {
  display: flex;
  width: max-content;
  gap: var(--resource-color-gap, 2px);
  animation: resource-color-loop-left var(--resource-color-loop-speed, 7s) linear infinite;
}

.resource-color-chip {
  flex: 0 0 var(--resource-color-size, 7px);
  width: var(--resource-color-size, 7px);
  height: 100%;
  background: var(--chip-color, var(--line));
  box-shadow:
    0 0 0 1px rgba(23, 19, 14, 0.65) inset,
    0 0 5px color-mix(in srgb, var(--chip-color, var(--line)) 36%, transparent);
}

.gacha-drop-colors {
  position: absolute;
  z-index: 2;
  left: 4px;
  right: 4px;
  bottom: 4px;
  height: 5px;
  --resource-color-size: 5px;
  --resource-color-gap: 1px;
  --resource-color-loop-speed: 5.8s;
}

.gacha-bundle-scene[data-drop-count="3"] .gacha-drop-square,
.gacha-bundle-scene[data-drop-count="5"] .gacha-drop-square,
.gacha-bundle-scene[data-drop-count="6"] .gacha-drop-square {
  width: 34px;
}

.gacha-bundle-scene[data-drop-count="4"] .gacha-drop-square {
  width: 40px;
}

.gacha-drop-icon {
  width: auto;
  height: 22px;
  image-rendering: pixelated;
  filter:
    drop-shadow(1px 1px 0 rgba(0, 0, 0, 0.68))
    drop-shadow(0 0 5px rgba(255, 247, 232, 0.16));
}

.gacha-bundle-scene[data-drop-count="3"] .gacha-drop-icon,
.gacha-bundle-scene[data-drop-count="5"] .gacha-drop-icon,
.gacha-bundle-scene[data-drop-count="6"] .gacha-drop-icon {
  height: 16px;
}

.gacha-card .gacha-drop-square strong {
  position: absolute;
  left: 50%;
  bottom: -7px;
  color: #fff7e8;
  font-family: var(--micro-font);
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  text-shadow:
    1px 1px 0 #17130e,
    0 0 7px color-mix(in srgb, var(--drop-rarity-color, var(--line)) 54%, transparent);
  transform: translateX(-50%);
}

@keyframes resource-color-loop-left {
  to {
    transform: translateX(-50%);
  }
}

.gacha-resource-icon {
  image-rendering: pixelated;
  filter:
    drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.58))
    drop-shadow(0 0 5px rgba(255, 247, 232, 0.18));
}

.gacha-resource-icon.is-primary {
  position: relative;
  z-index: 3;
}

.gacha-resource-icon.is-scatter {
  position: absolute;
  opacity: 0.9;
}

.gacha-card.rarity-common .gacha-resource-icon.is-primary {
  transform: scale(1);
}

.gacha-card.rarity-uncommon .gacha-resource-icon.is-primary {
  transform: scale(1.05);
}

.gacha-card.rarity-rare .gacha-resource-icon.is-primary {
  transform: scale(1.12);
}

.gacha-card.rarity-epic .gacha-resource-icon.is-primary {
  transform: scale(1.22);
}

.gacha-card.rarity-legendary .gacha-resource-icon.is-primary {
  transform: translateY(-5px) scale(1.28);
}

.gacha-resource-barrel {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 8px;
  width: 82px;
  height: 43px;
  background:
    linear-gradient(90deg, #3d241a 0 8px, transparent 8px calc(100% - 8px), #3d241a calc(100% - 8px)),
    linear-gradient(180deg, #8b5430, #5d382e);
  border: 3px solid #2a1712;
  box-shadow:
    inset 0 7px 0 rgba(255, 247, 232, 0.1),
    inset 0 -8px 0 rgba(0, 0, 0, 0.26),
    0 8px 0 rgba(0, 0, 0, 0.22);
  transform: translateX(-50%);
}

.gacha-resource-barrel::before,
.gacha-resource-barrel::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  height: 8px;
  background: #efe58f;
  border: 2px solid #2a1712;
}

.gacha-resource-barrel::before {
  top: 6px;
}

.gacha-resource-barrel::after {
  bottom: 6px;
}

.gacha-card strong {
  color: var(--rarity-color, #fff7e8);
  font-size: clamp(22px, 2.8vw, 30px);
  line-height: 1;
  text-shadow:
    2px 2px 0 #17130e,
    0 0 10px color-mix(in srgb, var(--rarity-color, var(--line)) 42%, transparent);
}

.gacha-payout-amount {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.gacha-card small {
  color: var(--muted);
  font-family: var(--micro-font);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.gacha-payout-icon {
  width: auto;
  height: 24px;
  flex: none;
  image-rendering: pixelated;
  filter:
    drop-shadow(1px 1px 0 rgba(0, 0, 0, 0.58))
    drop-shadow(0 0 5px rgba(255, 247, 232, 0.22));
}

.gacha-payout-token {
  color: #fff7e8 !important;
  text-shadow:
    1px 1px 0 #17130e,
    0 0 8px color-mix(in srgb, var(--rarity-color, var(--line)) 32%, transparent);
}

.gacha-rarity-label {
  color: #06110a;
  font-family: var(--micro-font);
  font-size: 11px;
  font-weight: 700;
  font-style: normal;
  letter-spacing: 0;
  line-height: 1;
  padding: 4px 7px;
  border: 1px solid rgba(255, 247, 232, 0.42);
  background: var(--rarity-color, rgba(255, 247, 232, 0.82));
  box-shadow: 0 0 8px color-mix(in srgb, var(--rarity-color, var(--line)) 34%, transparent);
}

.gacha-card.rarity-uncommon {
  border-color: color-mix(in srgb, var(--rarity-color, var(--line)) 76%, transparent);
}

.gacha-card.rarity-rare {
  border-color: color-mix(in srgb, var(--rarity-color, var(--line)) 82%, transparent);
  box-shadow:
    0 -4px 0 color-mix(in srgb, var(--rarity-color, var(--line)) 22%, transparent) inset,
    0 0 18px color-mix(in srgb, var(--rarity-color, var(--line)) 12%, transparent);
}

.gacha-card.rarity-epic {
  border-color: color-mix(in srgb, var(--rarity-color, var(--line)) 84%, transparent);
  background:
    linear-gradient(180deg, rgba(255, 247, 232, 0.1), transparent 34%),
    linear-gradient(135deg, color-mix(in srgb, var(--rarity-color, var(--line)) 20%, transparent), transparent 60%),
    rgba(30, 28, 20, 0.94);
  box-shadow:
    0 -4px 0 color-mix(in srgb, var(--rarity-color, var(--line)) 34%, transparent) inset,
    0 0 22px color-mix(in srgb, var(--rarity-color, var(--line)) 24%, transparent);
}

.gacha-card.rarity-epic .gacha-rarity-label {
  color: #fff7e8;
}

.gacha-card.rarity-legendary,
.gacha-card.rarity-mythic {
  border-color: color-mix(in srgb, var(--rarity-color, var(--line)) 90%, transparent);
  background:
    linear-gradient(180deg, rgba(255, 247, 232, 0.18), transparent 32%),
    linear-gradient(135deg, color-mix(in srgb, var(--rarity-color, var(--line)) 18%, transparent), transparent 55%),
    rgba(36, 27, 14, 0.98);
  box-shadow:
    0 -4px 0 color-mix(in srgb, var(--rarity-color, var(--line)) 36%, transparent) inset,
    0 0 26px color-mix(in srgb, var(--rarity-color, var(--line)) 28%, transparent);
}

.gacha-card.rarity-mythic {
  border-color: rgba(255, 82, 74, 0.96);
  background:
    linear-gradient(180deg, rgba(255, 247, 232, 0.2), transparent 32%),
    linear-gradient(135deg, rgba(224, 27, 27, 0.18), rgba(239, 229, 143, 0.14) 52%, transparent 70%),
    rgba(36, 14, 14, 0.98);
  box-shadow:
    0 -4px 0 rgba(239, 229, 143, 0.34) inset,
    0 0 30px rgba(224, 27, 27, 0.3);
}

.gacha-card.rarity-mythic .gacha-rarity-label {
  color: #fff7e8;
}

.gacha-card.is-gacha-winner {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--rarity-color, var(--lime)) 30%, transparent), transparent 54%),
    rgba(28, 28, 16, 0.96);
}

.gacha-modal.is-ready .is-gacha-winner {
  outline: 4px solid #d9fb66;
  outline-offset: -7px;
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.86),
    0 0 30px rgba(217, 251, 102, 0.42),
    0 0 54px color-mix(in srgb, var(--rarity-color, var(--lime)) 34%, transparent);
}

.gacha-modal.is-ready .is-gacha-winner .gacha-payout-amount {
  color: var(--rarity-color, #ffae42);
  transform: scale(1.12);
  text-shadow:
    2px 2px 0 #17130e,
    -1px 0 0 #fff7e8,
    1px 0 0 #fff7e8,
    0 0 18px color-mix(in srgb, var(--rarity-color, var(--line)) 72%, transparent),
    0 0 34px color-mix(in srgb, var(--rarity-color, var(--line)) 36%, transparent);
}

.gacha-status {
  min-height: 24px;
  color: var(--ink);
  font-family: var(--micro-font);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.gacha-unit-card {
  position: absolute;
  z-index: 6;
  top: 12px;
  left: 12px;
  width: 106px;
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 8px 7px;
  color: #fff7e8;
  background: rgba(11, 8, 6, 0.78);
  border: 1px solid rgba(239, 229, 143, 0.5);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.78),
    0 0 14px rgba(217, 251, 102, 0.12);
}

.gacha-unit-canvas {
  width: 74px;
  height: 82px;
  image-rendering: pixelated;
  border: 1px solid rgba(255, 247, 232, 0.28);
  background: #d8c18a;
}

.gacha-unit-card strong {
  max-width: 100%;
  color: var(--line);
  font-family: var(--micro-font);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.gacha-unit-bags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

.gacha-unit-bag {
  transition:
    opacity 120ms linear,
    transform 160ms ease;
}

.gacha-unit-bag.is-launching {
  opacity: 0;
  transform: translateY(-4px) scale(0.66);
}

.gacha-unit-bag,
.gacha-launch-bag {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(255, 247, 232, 0.15), transparent),
    #5d382e;
  border: 2px solid #2a1712;
  box-shadow:
    0 0 0 1px rgba(239, 229, 143, 0.42) inset,
    0 4px 0 rgba(0, 0, 0, 0.28);
}

.gacha-unit-bag-icon,
.gacha-launch-icon {
  width: auto;
  height: 13px;
  image-rendering: pixelated;
  filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, 0.62));
}

.gacha-launch-bag {
  position: absolute;
  z-index: 7;
  pointer-events: none;
  animation: gacha-bag-launch 840ms cubic-bezier(.18,.82,.22,1) forwards;
}

@keyframes gacha-bag-launch {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.64) rotate(-8deg);
  }
  14% {
    opacity: 1;
    transform: translate(0, -10px) scale(1) rotate(4deg);
  }
  82% {
    opacity: 1;
    transform: translate(calc(var(--bag-x) * 0.9), calc(var(--bag-y) * 0.9 - 12px)) scale(1.08) rotate(10deg);
  }
  100% {
    opacity: 1;
    transform: translate(var(--bag-x), var(--bag-y)) scale(1) rotate(0deg);
    filter: none;
  }
}

.gacha-claim-button {
  justify-self: center;
  min-width: min(360px, 100%);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: #d9fb66;
  color: #06110a;
  border: 1px solid rgba(255, 247, 232, 0.78);
  box-shadow: 0 0 0 2px rgba(23, 19, 14, 0.72);
  font-size: 13px;
  line-height: 1.2;
}

.gacha-claim-button strong {
  color: inherit;
  font-size: 1.06em;
  line-height: 1;
}

.gacha-claim-icon {
  width: auto;
  height: 19px;
  image-rendering: pixelated;
}

.gacha-claim-button:disabled {
  opacity: 0.62;
}

.gacha-claim-button.is-processing {
  background: #efe58f;
}

.gacha-claim-button.is-confirmed,
.gacha-modal.is-confirmed .gacha-panel {
  background: #52ff4d;
  color: #06110a;
}

.gacha-modal.is-confirmed .gacha-status,
.gacha-modal.is-confirmed h2 {
  color: #06110a;
}

.gacha-modal.is-reward-flying {
  background: rgba(6, 5, 4, 0.48);
}

.gacha-modal.is-reward-flying .gacha-panel {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.96);
}

.gacha-confetti {
  position: absolute;
  z-index: 3;
  width: 6px;
  height: 6px;
  pointer-events: none;
  animation: gacha-confetti 980ms ease-out forwards;
}

@keyframes gacha-confetti {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.6);
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(78px) scale(1);
  }
}

.assign-modal[hidden] {
  display: none;
}

.assign-modal {
  position: fixed;
  z-index: 83;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(14px, 3vw, 30px);
  background: rgba(6, 5, 4, 0.68);
}

.assign-panel {
  position: relative;
  width: min(560px, calc(100vw - 24px));
  display: grid;
  gap: 14px;
  padding: clamp(18px, 3vw, 28px);
  background:
    linear-gradient(135deg, rgba(217, 251, 102, 0.12), transparent 48%),
    rgba(23, 19, 14, 0.97);
  border: 2px solid rgba(239, 229, 143, 0.84);
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.74),
    0 18px 58px rgba(0, 0, 0, 0.58);
}

.assign-panel .eyebrow,
.assign-panel h2,
.assign-summary,
.assign-status {
  margin: 0;
  text-align: center;
}

.assign-panel h2 {
  color: var(--line);
  font-size: clamp(18px, 3.4vw, 28px);
  line-height: 1.35;
}

.assign-summary {
  color: #fff7e8;
  font-size: clamp(10px, 1.8vw, 14px);
  line-height: 1.65;
}

.assign-unit-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  min-height: 28px;
}

.assign-unit-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 29px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.58);
  border: 1px solid color-mix(in srgb, var(--team-color, var(--line)) 72%, rgba(255, 247, 232, 0.24));
  color: #fff7e8;
  box-shadow: 0 0 12px color-mix(in srgb, var(--team-color, var(--line)) 18%, transparent);
  font-size: 9px;
}

.assign-unit-pill i {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  color: #17130e;
  background: var(--team-color, var(--line));
  font-style: normal;
  line-height: 1;
}

.assign-unit-pill strong {
  color: #fff7e8;
  font-weight: 400;
}

.assign-status {
  min-height: 18px;
  color: var(--line);
  font-size: 9px;
  line-height: 1.45;
}

.assign-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 10px;
}

.assign-cancel-button,
.assign-confirm-button {
  min-height: 46px;
  padding: 10px 12px;
  font-size: 10px;
}

.assign-cancel-button {
  background: #17130e;
  color: #fff7e8;
  border: 1px solid rgba(255, 247, 232, 0.42);
}

.assign-confirm-button {
  background: #d9fb66;
  color: #06110a;
  border: 1px solid rgba(255, 247, 232, 0.88);
  box-shadow:
    0 0 0 1px rgba(23, 19, 14, 0.56) inset,
    0 0 18px rgba(217, 251, 102, 0.34);
  text-shadow: none;
}

.assign-confirm-button.is-processing {
  background: #efe58f;
  color: #17130e;
}

.assign-confirm-button.is-visual-only {
  background: #5fcde4;
  color: #06110a;
}

.assign-confirm-button.is-chain-ready {
  background: #d9fb66;
  color: #06110a;
  box-shadow:
    0 0 0 1px rgba(23, 19, 14, 0.68) inset,
    0 0 22px rgba(217, 251, 102, 0.44);
}

.assign-confirm-button.is-confirmed,
.assign-modal.is-confirmed .assign-confirm-button {
  background: #54d16a;
  color: #06110a;
}

.assign-modal.is-processing .assign-panel {
  animation: assign-processing-pulse 640ms steps(2, end) infinite;
}

@keyframes assign-processing-pulse {
  0%,
  100% {
    border-color: rgba(239, 229, 143, 0.84);
  }
  50% {
    border-color: rgba(217, 251, 102, 0.96);
  }
}

.loot-modal[hidden] {
  display: none;
}

.loot-modal {
  position: fixed;
  z-index: 82;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(16px, 3vw, 34px);
  background: rgba(6, 5, 4, 0.72);
}

.loot-panel {
  position: relative;
  width: min(980px, calc(100vw - 24px));
  max-height: calc(100vh - 28px);
  display: grid;
  gap: 19px;
  padding: clamp(24px, 3.4vw, 38px);
  overflow: auto;
  background:
    linear-gradient(135deg, rgba(239, 229, 143, 0.12), transparent 46%),
    rgba(23, 19, 14, 0.97);
  border: 2px solid rgba(239, 229, 143, 0.86);
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.76),
    0 18px 64px rgba(0, 0, 0, 0.58);
}

.loot-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  min-height: 40px;
  padding: 0;
  background: #e01b1b;
  color: #fff7e8;
  border: 1px solid rgba(255, 247, 232, 0.78);
  font-size: 13px;
}

.loot-panel .eyebrow,
.loot-panel h2 {
  margin: 0;
  text-align: center;
}

.loot-panel h2 {
  color: var(--line);
  font-size: clamp(23px, 3.8vw, 37px);
  line-height: 1.35;
}

.loot-body {
  display: grid;
  gap: 17px;
}

.loot-resource-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.loot-resource-grid .pile-resource-chip {
  min-height: 37px;
  padding: 7px 8px;
  font-size: 9px;
}

.loot-resource-grid .pile-resource-icon {
  height: 25px;
}

.loot-resource-grid .pile-resource-chip strong {
  font-size: 12px;
}

.loot-resource-grid .pile-resource-chip em {
  font-size: 9px;
}

.loot-draw-meter {
  height: 58px;
}

.loot-draw-text {
  font-size: 13px;
}

.loot-rarity-row {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.loot-note {
  margin: 0;
  color: var(--lime);
  font-family: var(--pixel-font);
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

.loot-prize-loop {
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 28px max(28px, 12vw) 34px;
  background:
    radial-gradient(circle at 50% 18%, rgba(217, 251, 102, 0.12), transparent 28%),
    linear-gradient(90deg, rgba(23, 19, 14, 0.96), transparent 16%, transparent 84%, rgba(23, 19, 14, 0.96)),
    rgba(6, 5, 4, 0.42);
  border-top: 1px solid rgba(239, 229, 143, 0.42);
  border-bottom: 1px solid rgba(239, 229, 143, 0.42);
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: rgba(217, 251, 102, 0.72) rgba(239, 229, 143, 0.12);
  overscroll-behavior-x: contain;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.loot-prize-loop.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

.loot-prize-loop::-webkit-scrollbar {
  height: 8px;
}

.loot-prize-loop::-webkit-scrollbar-track {
  background: rgba(239, 229, 143, 0.12);
  border: 1px solid rgba(239, 229, 143, 0.18);
}

.loot-prize-loop::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, rgba(217, 251, 102, 0.58), rgba(95, 205, 228, 0.66));
  border: 1px solid rgba(6, 5, 4, 0.78);
  border-radius: 0;
}

.loot-prize-loop::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, rgba(217, 251, 102, 0.9), rgba(95, 205, 228, 0.9));
}

.loot-prize-track {
  display: flex;
  align-items: center;
  gap: 0;
  width: max-content;
  min-height: 310px;
}

.loot-prize-card {
  position: relative;
  flex: 0 0 clamp(180px, 22vw, 250px);
  min-height: clamp(250px, 31vw, 330px);
  display: grid;
  grid-template-rows: minmax(150px, 1fr) auto auto auto;
  align-content: end;
  gap: 8px;
  padding: 13px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--rarity-color, var(--line)) 18%, transparent), transparent 42%),
    #201d1c;
  border: 2px solid color-mix(in srgb, var(--rarity-color, var(--line)) 72%, rgba(239, 229, 143, 0.3));
  border-radius: 8px;
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.78),
    0 18px 34px rgba(0, 0, 0, 0.38),
    0 0 22px color-mix(in srgb, var(--rarity-color, var(--line)) 14%, transparent);
  scroll-snap-align: center;
  transform: none;
  margin-right: -18px;
  transition:
    box-shadow 120ms linear,
    border-color 120ms linear;
  user-select: none;
  -webkit-user-select: none;
}

.loot-prize-card.is-centered {
  border-color: color-mix(in srgb, var(--rarity-color, var(--line)) 92%, #fff7e8);
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.86),
    0 20px 38px rgba(0, 0, 0, 0.42),
    0 0 28px color-mix(in srgb, var(--rarity-color, var(--line)) 24%, transparent);
}

.loot-prize-card.is-stick-nft {
  flex-basis: clamp(220px, 27vw, 310px);
  min-height: clamp(292px, 36vw, 390px);
}

.loot-prize-crown {
  position: absolute;
  z-index: 2;
  top: -13px;
  left: 50%;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: #17130e;
  color: var(--rarity-color, var(--line));
  border: 2px solid var(--rarity-color, var(--line));
  border-radius: 50%;
  font-style: normal;
  font-size: 13px;
  line-height: 1;
  transform: translateX(-50%);
}

.loot-prize-art {
  position: relative;
  min-height: 158px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 247, 232, 0.08), transparent 42%),
    color-mix(in srgb, var(--rarity-color, #67ad71) 42%, #67ad71);
  border: 1px solid rgba(255, 247, 232, 0.24);
  image-rendering: pixelated;
}

.loot-prize-card.is-resource-package .loot-prize-art {
  background:
    linear-gradient(135deg, rgba(255, 247, 232, 0.08), transparent 42%),
    linear-gradient(180deg, transparent 0 70%, color-mix(in srgb, var(--resource-color, var(--line)) 35%, transparent)),
    color-mix(in srgb, var(--rarity-color, #67ad71) 42%, #67ad71);
}

.loot-prize-colors {
  position: absolute;
  z-index: 3;
  left: 10px;
  right: 10px;
  bottom: 10px;
  height: 12px;
  padding: 1px;
  background: rgba(23, 19, 14, 0.72);
  border: 1px solid rgba(255, 247, 232, 0.26);
  box-shadow:
    0 0 0 1px rgba(23, 19, 14, 0.68),
    0 0 13px color-mix(in srgb, var(--resource-color, var(--line)) 22%, transparent);
  --resource-color-size: 10px;
  --resource-color-gap: 3px;
  --resource-color-loop-speed: 8.4s;
}

.loot-prize-card.is-stick-nft .loot-prize-art {
  min-height: 210px;
  background: #67ad71;
}

.loot-stick-canvas {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.loot-resource-scene {
  transform: scale(1.28);
}

.loot-mystery-icon {
  display: grid;
  place-items: center;
  width: 92px;
  height: 112px;
  color: var(--rarity-color, var(--line));
  background: #17130e;
  border: 3px solid currentColor;
  font-size: 46px;
  box-shadow: 0 0 18px color-mix(in srgb, var(--rarity-color, var(--line)) 24%, transparent);
}

.loot-prize-name,
.loot-prize-backing,
.loot-prize-odds {
  min-width: 0;
  font-style: normal;
  letter-spacing: 0;
  line-height: 1.25;
}

.loot-prize-name {
  color: #fff7e8;
  font-size: clamp(10px, 1.3vw, 14px);
}

.loot-prize-backing {
  color: #efe58f;
  font-size: clamp(8px, 1vw, 11px);
}

.loot-prize-odds {
  color: var(--rarity-color, var(--line));
  font-size: clamp(7px, 0.9vw, 10px);
}

.loot-table {
  display: grid;
  gap: 8px;
}

.loot-table-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-height: 45px;
  padding: 11px 13px;
  background: rgba(0, 0, 0, 0.36);
  border-left: 5px solid var(--rarity-color, var(--line));
  box-shadow: 0 0 0 1px rgba(255, 247, 232, 0.08) inset;
}

.loot-table-row strong {
  color: #fff7e8;
  font-size: 11px;
}

.loot-table-row span {
  min-width: 0;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.loot-table-row em {
  color: var(--rarity-color, var(--line));
  font-size: 9px;
  font-style: normal;
  line-height: 1;
  text-align: right;
}

.wallet-flyaway {
  position: fixed;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: min(330px, calc(100vw - 24px));
  pointer-events: none;
  padding: 10px 14px;
  color: #06110a;
  background: color-mix(in srgb, var(--token-color, var(--lime)) 78%, #fff7e8);
  border: 1px solid rgba(255, 247, 232, 0.78);
  box-shadow: 0 0 0 2px rgba(23, 19, 14, 0.72);
  font-size: 10px;
  line-height: 1.2;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  transition:
    transform 1040ms cubic-bezier(.2,.82,.2,1),
    opacity 1040ms ease;
}

.wallet-flyaway strong {
  color: inherit;
  font-size: 1.08em;
}

.wallet-flyaway .gacha-claim-icon {
  height: 19px;
}

.wallet-flyaway.is-flying {
  opacity: 0;
  transform: translate(-50%, -50%) translate(var(--fly-x), var(--fly-y)) scale(0.68);
}

.map-app-frame:fullscreen {
  padding: 10px;
}

.map-app-frame:fullscreen .map-app-topbar {
  padding-top: 0;
}

.stage-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 14px;
  border-top: 3px solid var(--line);
  border-bottom: 3px solid var(--line);
  padding: 24px 0;
}

.stage-strip article,
.map-card,
.pack-card,
.admin-panel,
.unit-card {
  background: var(--panel);
  border: 1px solid rgba(239, 229, 143, 0.32);
}

.stage-strip article {
  min-height: 118px;
  padding: 16px 12px;
}

.stage-strip span {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--lime);
  font-size: 10px;
}

.stage-strip h2 {
  margin-bottom: 0;
  color: var(--line);
  font-size: clamp(8px, 0.85vw, 11px);
  line-height: 1.65;
}

.stage-strip article.stage-infinite {
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: hidden;
  padding: 0;
  background: transparent;
  border: 0;
}

.stage-strip article.stage-infinite > span {
  display: block;
  margin-bottom: 0;
  color: var(--line);
  font-family: "Courier New", Consolas, monospace;
  font-size: 26px;
  font-weight: 700;
  line-height: 0.9;
  text-align: left;
}

.stage-mystery-window {
  --mystery-box-height: 27px;
  --mystery-gap: 7px;
  width: 100%;
  min-width: 100%;
  height: calc(var(--mystery-box-height) * 3 + var(--mystery-gap) * 2);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent 0%, #000 16%, #000 84%, transparent 100%);
  mask-image: linear-gradient(transparent 0%, #000 16%, #000 84%, transparent 100%);
}

.stage-mystery-track {
  display: grid;
  gap: var(--mystery-gap);
  width: 100%;
  animation: stageMysteryCascade 3s cubic-bezier(.4, 0, .2, 1) infinite;
  will-change: transform;
}

.stage-mystery-track b {
  width: 100%;
  height: var(--mystery-box-height);
  display: grid;
  place-items: center;
  background: rgba(16, 6, 6, 0.64);
  border: 1px solid rgba(239, 229, 143, 0.42);
  color: var(--line);
  font-size: 10px;
  line-height: 1;
  font-weight: 400;
  box-shadow: 0 0 0 1px rgba(23, 19, 14, 0.55) inset;
}

@keyframes stageMysteryCascade {
  0% {
    transform: translateY(calc((var(--mystery-box-height) + var(--mystery-gap)) * -1));
  }

  68%,
  100% {
    transform: translateY(0);
  }
}

.stage-strip p,
.coming-grid p,
.stick-preview p,
.admin-hero p,
.unit-card p,
.admin-panel p {
  margin-bottom: 0;
  color: var(--ink);
  font-size: 14px;
}

.coming-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.82fr);
  gap: 18px;
  padding: 34px 0;
}

.map-card,
.pack-card {
  padding: 20px;
}

.map-placeholder {
  position: relative;
  min-height: 260px;
  margin-bottom: 20px;
  overflow: hidden;
  background:
    linear-gradient(rgba(217, 251, 102, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(217, 251, 102, 0.12) 1px, transparent 1px),
    #090909;
  background-size: 34px 34px;
  border: 1px solid rgba(217, 251, 102, 0.45);
}

.map-placeholder::after {
  content: "MAP SOON";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--line);
  font-size: clamp(17px, 3vw, 26px);
}

.map-placeholder span {
  position: absolute;
  color: var(--salt);
  font-size: 8px;
}

.map-placeholder span:nth-child(1) { left: 8%; top: 22%; }
.map-placeholder span:nth-child(2) { left: 76%; top: 18%; }
.map-placeholder span:nth-child(3) { left: 42%; top: 76%; }
.map-placeholder span:nth-child(4) { left: 16%; top: 64%; }
.map-placeholder span:nth-child(5) { left: 84%; top: 70%; }

.pack-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 18px;
  align-items: center;
}

.pack-card img {
  width: 140px;
  aspect-ratio: 1;
  object-fit: cover;
  background: #111;
  border: 1px solid rgba(239, 229, 143, 0.5);
}

.stick-preview {
  display: grid;
  grid-template-columns: minmax(240px, 0.52fr) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  padding: 28px 0 0;
}

.stick-preview img {
  width: 100%;
  display: block;
  background: #050505;
  border: 1px solid rgba(239, 229, 143, 0.28);
}

.home-sticks {
  padding: clamp(34px, 6vw, 62px) 0 0;
}

.home-sticks > h2 {
  margin-bottom: 20px;
  color: var(--line);
  font-size: clamp(17px, 2.5vw, 25px);
}

.stick-row {
  display: flex;
  gap: 16px;
  align-items: stretch;
  overflow-x: auto;
  padding: 2px 2px 16px;
  scrollbar-color: var(--line) rgba(20, 8, 8, 0.42);
}

.home-stick {
  flex: 0 0 148px;
  margin: 0;
  padding: 14px 12px 12px;
  background: rgba(20, 8, 8, 0.42);
  border: 1px solid rgba(239, 229, 143, 0.32);
}

.home-stick-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 128px;
  margin-bottom: 12px;
  background:
    linear-gradient(rgba(217, 251, 102, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(217, 251, 102, 0.08) 1px, transparent 1px),
    #d8c18a;
  background-size: 12px 12px;
  border: 1px solid rgba(239, 229, 143, 0.42);
}

.home-stick-canvas {
  width: 92px;
  height: 92px;
  display: block;
  image-rendering: pixelated;
}

.home-stick figcaption {
  display: grid;
  gap: 8px;
}

.home-stick strong {
  color: var(--ink);
  font-size: 8px;
  line-height: 1.6;
}

.home-stick span {
  color: var(--lime);
  font-size: 7px;
  line-height: 1.7;
}

.footer-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 42px;
  padding-top: 24px;
  border-top: 3px solid var(--line);
  color: var(--blue);
  font-size: 9px;
}

.footer-bar img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  background: var(--ink);
  border-radius: 50%;
  padding: 3px;
}

.footer-dot {
  width: 24px;
  height: 24px;
  background: var(--salt);
  box-shadow: 8px 0 0 var(--line), 16px 0 0 var(--blue);
}

.admin-frame {
  width: calc(100% - 12px);
  max-width: none;
  margin: 6px auto;
  padding-inline: clamp(14px, 2vw, 30px);
  background-color: #6d1012;
}

.admin-hero {
  max-width: 820px;
  margin: 0 auto;
  padding: 48px 0 24px;
  text-align: center;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.admin-home-frame {
  min-height: calc(100vh - 12px);
}

.admin-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 980px;
  margin: 12px auto 48px;
}

.admin-tool-card {
  min-height: 260px;
  display: grid;
  align-content: end;
  gap: 12px;
  padding: 18px;
  color: var(--ink);
  text-decoration: none;
  background: #100606;
  border: 1px solid rgba(239, 229, 143, 0.34);
  box-shadow: 8px 8px 0 rgba(23, 19, 14, 0.28);
}

.admin-tool-card:hover,
.admin-tool-card:focus-visible {
  border-color: var(--line);
  transform: translate(-2px, -2px);
}

.admin-tool-card strong {
  color: var(--line);
  font-size: 18px;
  line-height: 1.35;
}

.admin-tool-card em {
  max-width: 36ch;
  color: #fff7e8;
  font-size: 9px;
  font-style: normal;
  line-height: 1.7;
}

.admin-tool-art {
  width: 100%;
  min-height: 120px;
  display: block;
  background:
    linear-gradient(135deg, transparent 49%, rgba(239, 229, 143, 0.24) 50%, transparent 51%),
    linear-gradient(45deg, rgba(95, 205, 228, 0.72) 0 24%, transparent 24% 100%),
    #a98252;
  background-size: 42px 42px, 100% 100%, 100% 100%;
  border: 1px solid rgba(239, 229, 143, 0.25);
}

.admin-pixel-art {
  background:
    linear-gradient(90deg, #17130e 0 18%, transparent 18% 100%),
    linear-gradient(#e01b1b 0 0) 52% 55% / 26% 20% no-repeat,
    linear-gradient(#fff7e8 0 0) 50% 32% / 14% 24% no-repeat,
    #d8c18a;
  image-rendering: pixelated;
}

.admin-drop-art {
  background:
    radial-gradient(circle at 30% 54%, #efe58f 0 5%, transparent 6%),
    radial-gradient(circle at 58% 42%, #f47b20 0 7%, transparent 8%),
    radial-gradient(circle at 76% 62%, #a98252 0 12%, transparent 13%),
    linear-gradient(135deg, rgba(239, 229, 143, 0.25), transparent 42%),
    repeating-linear-gradient(45deg, #100606 0 13px, #17130e 13px 26px);
  image-rendering: pixelated;
}

.admin-asset-art {
  background:
    linear-gradient(#efe58f 0 0) 24% 26% / 22px 5px no-repeat,
    linear-gradient(#8b5a34 0 0) 24% 36% / 66px 22px no-repeat,
    linear-gradient(#e01b1b 0 0) 52% 38% / 6px 22px no-repeat,
    radial-gradient(circle at 72% 62%, #8f5d37 0 13%, transparent 14%),
    linear-gradient(135deg, rgba(95, 205, 228, 0.72) 0 32%, transparent 33%),
    repeating-linear-gradient(0deg, #100606 0 12px, #17130e 12px 24px);
  image-rendering: pixelated;
}

.drop-admin {
  display: grid;
  grid-template-columns: minmax(230px, 0.28fr) minmax(0, 1fr);
  gap: clamp(12px, 1.4vw, 22px);
  margin: 10px 0 34px;
}

.drop-admin-side,
.drop-admin-main {
  min-width: 0;
}

.drop-map-list,
.drop-zone-grid,
.drop-resource-grid {
  display: grid;
  gap: 10px;
}

.drop-map-list button {
  width: 100%;
  min-height: 58px;
  display: grid;
  gap: 8px;
  padding: 10px;
  background: #100606;
  border: 1px solid rgba(239, 229, 143, 0.34);
  color: #fff7e8;
  text-align: left;
}

.drop-map-list button.is-active {
  border-color: var(--line);
  box-shadow: 0 0 0 2px rgba(217, 251, 102, 0.16) inset;
}

.drop-map-list strong {
  color: var(--line);
  font-size: 9px;
  line-height: 1.35;
}

.drop-map-list em {
  color: var(--muted);
  font-size: 7px;
  font-style: normal;
  line-height: 1.45;
}

.drop-zone-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 14px;
}

.drop-zone-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #100606;
  border: 1px solid rgba(239, 229, 143, 0.34);
}

.drop-zone-head {
  display: grid;
  gap: 6px;
}

.drop-zone-head h3 {
  margin: 0;
  color: var(--line);
  font-size: 14px;
  line-height: 1.3;
}

.drop-zone-head p,
.drop-empty-state {
  margin: 0;
  color: #fff7e8;
  font-size: 8px;
  line-height: 1.65;
}

.drop-zone-behavior {
  margin: 0;
  padding: 6px 8px;
  background: rgba(224, 27, 27, 0.12);
  border: 1px solid rgba(239, 229, 143, 0.26);
  color: #efe58f;
  font-size: 8px;
  line-height: 1.45;
}

.drop-zone-total {
  color: #efe58f;
  font-size: 8px;
  line-height: 1.45;
}

.drop-resource-chip {
  min-width: 0;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: rgba(255, 247, 232, 0.06);
  border-left: 4px solid var(--resource-color, var(--line));
}

.drop-resource-chip.is-empty {
  grid-template-columns: 1fr;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
}

.drop-resource-chip i {
  width: 18px;
  aspect-ratio: 1;
  display: block;
  border: 1px solid rgba(255, 247, 232, 0.42);
}

.drop-resource-chip strong,
.drop-resource-chip em {
  min-width: 0;
  color: #fff7e8;
  font-size: 8px;
  font-style: normal;
  line-height: 1.35;
}

.drop-resource-chip em {
  color: var(--resource-color, var(--line));
}

.asset-admin-frame {
  width: min(1600px, calc(100% - 24px));
  padding-inline: clamp(10px, 1.4vw, 22px);
}

.asset-maker {
  display: grid;
  grid-template-columns: clamp(220px, 16vw, 280px) minmax(660px, 1fr) clamp(300px, 20vw, 360px);
  gap: clamp(12px, 1.4vw, 22px);
  align-items: start;
  margin: 10px 0 34px;
}

.asset-library,
.asset-canvas-panel,
.asset-control-panel {
  min-width: 0;
  display: grid;
  gap: 16px;
  padding: 16px;
}

.asset-list {
  display: grid;
  gap: 9px;
  max-height: 72vh;
  overflow: auto;
  padding-right: 4px;
}

.asset-list-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 9px;
  background: #100606;
  color: #fff7e8;
  border: 1px solid rgba(239, 229, 143, 0.28);
  text-align: left;
}

.asset-list-item:hover,
.asset-list-item:focus-visible,
.asset-list-item.is-active {
  outline: 2px solid var(--line);
  outline-offset: 1px;
  border-color: var(--line);
}

.asset-list-preview {
  width: 58px;
  height: 48px;
  object-fit: contain;
  background: #17130e;
  border: 1px solid rgba(239, 229, 143, 0.28);
  image-rendering: pixelated;
}

.asset-list-item span {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.asset-list-item strong {
  color: var(--line);
  font-size: 8px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.asset-list-item em {
  color: var(--muted);
  font-size: 6px;
  font-style: normal;
  line-height: 1.45;
}

.asset-stage-wrap {
  min-height: clamp(680px, 72vh, 920px);
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 16px;
  background:
    linear-gradient(rgba(239, 229, 143, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(239, 229, 143, 0.06) 1px, transparent 1px),
    #100606;
  background-size: 16px 16px;
  border: 1px solid rgba(239, 229, 143, 0.28);
}

.asset-pixel-canvas {
  display: block;
  background: #100606;
  border: 2px solid rgba(239, 229, 143, 0.58);
  box-shadow: 8px 8px 0 rgba(23, 19, 14, 0.34);
  cursor: crosshair;
  image-rendering: pixelated;
  touch-action: none;
}

.asset-palette {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(32px, 1fr));
  gap: 7px;
}

.asset-palette-swatch {
  min-height: 30px;
  padding: 0;
  background: var(--swatch);
  color: #080808;
  border: 1px solid rgba(239, 229, 143, 0.34);
  font-size: 8px;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.35);
}

.asset-palette-swatch.is-transparent {
  color: #fff7e8;
  background:
    linear-gradient(45deg, rgba(255, 247, 232, 0.12) 25%, transparent 25% 75%, rgba(255, 247, 232, 0.12) 75%),
    linear-gradient(45deg, rgba(255, 247, 232, 0.12) 25%, transparent 25% 75%, rgba(255, 247, 232, 0.12) 75%),
    #100606;
  background-position: 0 0, 6px 6px, 0 0;
  background-size: 12px 12px;
  text-shadow: 1px 1px 0 #17130e;
}

.asset-palette-swatch.is-active {
  outline: 2px solid var(--line);
  outline-offset: 2px;
  border-color: #fff7e8;
}

.asset-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.asset-field-grid label,
.asset-field,
.asset-reference-field {
  min-width: 0;
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.45;
}

.asset-field-grid input,
.asset-field textarea,
.asset-reference-field input,
.asset-json {
  width: 100%;
  min-width: 0;
  padding: 10px;
  color: #fff7e8;
  background: #100606;
  border: 1px solid rgba(239, 229, 143, 0.34);
  font-family: inherit;
  font-size: 8px;
  line-height: 1.5;
}

.asset-field-grid input {
  min-height: 38px;
}

.asset-field textarea,
.asset-json {
  resize: vertical;
}

.asset-reference-field img {
  width: 100%;
  max-height: 150px;
  object-fit: contain;
  background: #100606;
  border: 1px solid rgba(239, 229, 143, 0.24);
  image-rendering: pixelated;
}

.asset-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.asset-actions button:nth-child(3),
.asset-actions button:nth-child(5),
.asset-actions button:nth-child(6),
.asset-actions button:nth-child(7),
.asset-actions button:nth-child(8) {
  font-size: 7px;
}

.asset-actions #assetGenerateBtn {
  background: #d9fb66;
  color: #06110a;
  border-color: rgba(255, 247, 232, 0.82);
}

.map-designer,
.pixel-lab,
.element-lab {
  display: grid;
  grid-template-columns: 260px minmax(320px, 1fr) 280px;
  gap: 18px;
  align-items: start;
}

.map-designer {
  grid-template-columns: minmax(210px, 0.22fr) minmax(420px, 1fr) minmax(320px, 0.55fr);
  gap: clamp(12px, 1.4vw, 22px);
  margin: 10px 0 34px;
}

.map-admin-frame {
  padding-inline: clamp(10px, 1.4vw, 22px);
}

.map-admin-hero {
  padding-block: 28px 16px;
}

.map-designer-page {
  grid-template-columns: clamp(260px, 20vw, 320px) minmax(0, 1fr);
  align-items: start;
}

.map-designer-page .map-designer-tools {
  grid-row: 1 / span 2;
}

.map-designer-page .map-designer-board,
.map-designer-page .map-designer-preview {
  grid-column: 2;
}

.map-designer-page .map-designer-preview {
  grid-row: 2;
}

.map-designer-tools,
.map-designer-board,
.map-designer-preview,
.lab-tools,
.lab-editor,
.lab-preview {
  background: var(--panel);
  border: 1px solid rgba(239, 229, 143, 0.32);
}

.map-designer-tools,
.lab-tools {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.field-label,
.tool-group h2,
.template-card span,
.stamp-button span {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

#templateSelect,
#elementSelect,
#animationSelect,
#mapBrushSize,
#mapHistorySelect,
#mapDropStateSelect,
#mapDropPileTypeSelect,
#mapDropResourceSelect {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(239, 229, 143, 0.5);
  border-radius: 0;
  background: #100606;
  color: var(--ink);
  padding: 0 10px;
  font-size: 9px;
}

.map-debug-toggle {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  background: #100606;
  border: 1px solid rgba(239, 229, 143, 0.34);
  color: #fff7e8;
  font-size: 8px;
  line-height: 1.35;
}

.map-debug-toggle input {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #e01b1b;
}

.designer-tool-head h2 {
  margin: 0;
  color: var(--line);
  font-size: 16px;
  line-height: 1.25;
}

.map-brush-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.map-brush-grid button,
.map-object-grid button {
  min-width: 0;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 8px;
  background: #100606;
  border: 1px solid rgba(239, 229, 143, 0.34);
  color: var(--ink);
  text-align: left;
}

.map-brush-grid button.is-active,
.map-object-grid button.is-active {
  border-color: var(--line);
  box-shadow: 0 0 0 2px rgba(217, 251, 102, 0.18) inset;
}

.map-brush-grid span,
.map-object-grid span {
  width: 22px;
  aspect-ratio: 1;
  display: block;
  border: 1px solid rgba(255, 247, 232, 0.48);
  box-shadow: 0 0 0 1px rgba(23, 19, 14, 0.72);
}

.map-object-grid span,
.map-brush-grid .map-select-icon {
  display: grid;
  place-items: center;
  color: #fff7e8;
  font-size: 10px;
  line-height: 1;
  text-shadow: 1px 1px 0 rgba(18, 7, 6, 0.72);
}

.map-brush-grid .map-select-icon {
  background:
    linear-gradient(90deg, transparent 46%, rgba(255, 247, 232, 0.9) 46% 54%, transparent 54%),
    linear-gradient(transparent 46%, rgba(255, 247, 232, 0.9) 46% 54%, transparent 54%),
    #20100c;
}

.map-brush-grid strong,
.map-object-grid strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #fff7e8;
  font-size: 7px;
  line-height: 1.35;
}

.map-object-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.map-object-inspector {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: rgba(16, 6, 6, 0.74);
  border: 1px solid rgba(239, 229, 143, 0.28);
}

.map-object-inspector h2 {
  margin: 0;
  color: var(--line);
  font-size: 13px;
  line-height: 1.35;
}

.object-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.object-field-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 7px;
  line-height: 1.35;
}

.object-field-grid input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 7px;
  color: #fff7e8;
  background: #100606;
  border: 1px solid rgba(239, 229, 143, 0.34);
  font-family: inherit;
  font-size: 8px;
}

.object-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#mapDesignJson {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  padding: 10px;
  background: #100606;
  border: 1px solid rgba(239, 229, 143, 0.34);
  color: #fff7e8;
  font-family: Consolas, "Courier New", monospace;
  font-size: 10px;
  line-height: 1.45;
}

.map-designer-board,
.map-designer-preview {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.map-designer-board {
  min-width: 0;
}

.map-designer-preview {
  min-width: 0;
  align-content: start;
}

.map-preview-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 8px;
  flex-wrap: wrap;
}

.map-renderer-toggle {
  display: flex;
  background: #100606;
  border: 1px solid rgba(239, 229, 143, 0.38);
}

.map-renderer-toggle button {
  min-height: 32px;
  padding: 8px 10px;
  background: transparent;
  color: #fff7e8;
  border: 0;
  border-right: 1px solid rgba(239, 229, 143, 0.26);
  font-size: 7px;
  line-height: 1.25;
}

.map-renderer-toggle button:last-child {
  border-right: 0;
}

.map-renderer-toggle button[aria-pressed="true"] {
  background: var(--line);
  color: #120706;
}

.map-preview-stage {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  background: #d7ca9f;
  border: 1px solid rgba(239, 229, 143, 0.36);
}

.map-designer-canvas,
.map-preview-canvas {
  width: 100%;
  display: block;
  background: #a98252;
  border: 1px solid rgba(239, 229, 143, 0.36);
  image-rendering: pixelated;
}

.map-designer-canvas {
  min-height: 420px;
  cursor: grab;
  touch-action: none;
}

.map-designer-canvas:active {
  cursor: grabbing;
}

.map-preview-canvas {
  min-height: 520px;
  background: #d7ca9f;
  cursor: grab;
  touch-action: none;
}

.map-preview-stage .map-preview-canvas {
  border: 0;
}

.map-game-preview-frame {
  width: 100%;
  min-height: 520px;
  height: 68vh;
  display: block;
  border: 0;
  background: #d7ca9f;
}

.map-preview-stage > [hidden] {
  display: none !important;
}

.map-preview-canvas:active {
  cursor: grabbing;
}

.map-designer-open {
  align-self: center;
  justify-self: end;
  padding: 9px 10px;
  background: var(--line);
  color: #120706;
  border: 1px solid rgba(18, 7, 6, 0.58);
  font-size: 8px;
  line-height: 1;
  text-decoration: none;
}

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

.map-designer-legend span {
  min-width: 0;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  color: #fff7e8;
  font-size: 7px;
  line-height: 1.3;
}

.map-designer-legend i {
  width: 18px;
  aspect-ratio: 1;
  display: block;
  border: 1px solid rgba(255, 247, 232, 0.42);
}

.map-designer-legend strong {
  overflow-wrap: anywhere;
  font-weight: 400;
}

.tool-group {
  display: grid;
  gap: 10px;
}

.tool-group h2 {
  margin: 0;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
}

.palette-swatch {
  width: 27px;
  min-height: 27px;
  padding: 0;
  border: 1px solid rgba(239, 229, 143, 0.34);
  background: var(--swatch);
  color: #080808;
  font-size: 8px;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.35);
}

.palette-swatch.is-active,
.element-palette-swatch.is-active,
.animation-palette-swatch.is-active,
.stamp-button.is-active,
.animation-frame-tab.is-active,
.element-card:hover,
.element-card:focus-visible,
.template-card:hover,
.template-card:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

.stamp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stamp-button,
.element-card,
.template-card {
  min-height: auto;
  display: grid;
  justify-items: center;
  gap: 8px;
  border: 1px solid rgba(239, 229, 143, 0.32);
  background: #0b0909;
  color: var(--ink);
  padding: 9px 7px;
}

.stamp-button canvas,
.element-card canvas,
.template-card canvas {
  width: auto;
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
}

.stamp-button span,
.element-card span,
.template-card span {
  color: var(--ink);
}

.tool-buttons {
  grid-template-columns: repeat(2, 1fr);
}

.tool-buttons button,
#copyBtn,
#elementCopyBtn,
#animationCopyBtn {
  width: 100%;
  padding: 10px 9px;
  min-height: 36px;
  font-size: 8px;
}

#saveBtn,
#elementSaveBtn,
#animationSaveBtn {
  background: var(--line);
  color: #151006;
}

.tool-buttons button:not(.is-active) {
  background: #130909;
  color: var(--ink);
  border: 1px solid rgba(239, 229, 143, 0.36);
}

.tool-buttons #saveBtn:not(.is-active),
.tool-buttons #elementSaveBtn:not(.is-active),
.tool-buttons #animationSaveBtn:not(.is-active) {
  background: var(--line);
  color: #151006;
  border-color: rgba(255, 247, 232, 0.35);
}

#spriteJson,
#elementJson,
#animationJson {
  width: 100%;
  resize: vertical;
  border: 1px solid rgba(239, 229, 143, 0.3);
  background: #090606;
  color: var(--lime);
  padding: 10px;
  font-family: "Courier New", monospace;
  font-size: 11px;
  line-height: 1.35;
}

.save-status,
.lab-note {
  margin: 0;
  color: var(--muted);
  font-family: var(--pixel-font);
  font-size: 8px;
  line-height: 1.65;
}

.lab-editor {
  min-width: 0;
  overflow-x: auto;
  padding: 18px;
}

.element-lab {
  margin-top: 18px;
}

.element-editor,
.element-preview {
  min-height: 100%;
}

.element-canvas {
  margin-top: 18px;
}

.editor-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.editor-head .eyebrow {
  margin-bottom: 8px;
}

.editor-head h2 {
  margin: 0;
  color: var(--line);
  font-size: 16px;
}

#spriteMeta,
#elementMeta,
#animationMeta {
  max-width: 190px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.pixel-canvas {
  display: block;
  max-width: none;
  height: auto;
  margin: 0 auto;
  border: 1px solid rgba(217, 251, 102, 0.45);
  background: #d8c18a;
  cursor: crosshair;
  image-rendering: pixelated;
  touch-action: none;
}

.lab-preview {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.preview-stage {
  min-height: 300px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(rgba(101, 20, 20, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(101, 20, 20, 0.12) 1px, transparent 1px),
    #d8c18a;
  background-size: 24px 24px;
  border: 1px solid rgba(239, 229, 143, 0.32);
}

#previewCanvas {
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
}

.element-preview-stage {
  min-height: 190px;
}

#elementPreviewCanvas {
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
}

.template-roster {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.element-roster {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.template-card,
.element-card {
  min-height: 102px;
}

.element-card {
  min-height: 82px;
}

.lineup-panel,
.generated-panel,
.animation-panel {
  margin-top: 18px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid rgba(239, 229, 143, 0.32);
}

.lineup-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.lineup-head .eyebrow,
.lineup-head h2 {
  margin: 0;
}

.generated-panel .lineup-head {
  align-items: center;
}

.generated-panel .lineup-head > div {
  display: grid;
  gap: 6px;
}

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

.animation-editor {
  display: grid;
  grid-template-columns: 260px minmax(320px, 1fr) 280px;
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

.animation-frame-editor,
.animation-live-preview {
  min-height: 100%;
}

.animation-frame-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.animation-frame-tab {
  min-height: 34px;
  padding: 9px 10px;
  background: #130909;
  color: var(--ink);
  border: 1px solid rgba(239, 229, 143, 0.36);
  font-size: 8px;
}

.animation-frame-tab.is-active {
  background: var(--line);
  color: #151006;
}

.animation-live-preview {
  display: grid;
  gap: 14px;
}

.animation-live-stage {
  min-height: 190px;
}

#animationPreviewCanvas {
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
}

.animation-sheet-scroll {
  overflow-x: auto;
  padding: 10px;
  background:
    linear-gradient(rgba(101, 20, 20, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(101, 20, 20, 0.12) 1px, transparent 1px),
    #d8c18a;
  background-size: 18px 18px;
  border: 1px solid rgba(239, 229, 143, 0.32);
}

.animation-live-sheet {
  display: block;
  max-width: none;
  height: auto;
  cursor: crosshair;
  image-rendering: pixelated;
  touch-action: none;
}

.animation-card {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 14px;
  background: rgba(8, 5, 5, 0.35);
  border: 1px solid rgba(239, 229, 143, 0.22);
}

.animation-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.animation-card-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 8px;
  min-width: 0;
}

.animation-card h3 {
  margin: 0;
  color: var(--line);
  font-size: 11px;
  line-height: 1.5;
}

.animation-card span {
  color: var(--muted);
  font-size: 7px;
  line-height: 1.5;
  text-align: right;
}

.gif-download-button,
.generated-download {
  border: 1px solid rgba(217, 251, 102, 0.72);
  background: rgba(217, 251, 102, 0.16);
  color: var(--line);
  font-family: var(--pixel-font);
  font-size: 6px;
  line-height: 1.3;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}

.gif-download-button {
  min-height: 26px;
  padding: 7px 8px;
  white-space: nowrap;
}

.generated-download {
  width: 100%;
  padding: 6px 5px;
  text-align: center;
}

.gif-download-button:hover,
.gif-download-button:focus-visible,
.generated-download:hover,
.generated-download:focus-visible {
  background: var(--line);
  color: #17130e;
  outline: 1px solid #fff7e8;
  outline-offset: 2px;
}

.animation-gif,
.animation-sheet,
.animation-frames img,
.animation-frames canvas {
  display: block;
  background: #d8c18a;
  image-rendering: pixelated;
}

.animation-gif {
  width: 150px;
  height: 150px;
  margin: 0 auto;
  border: 1px solid rgba(239, 229, 143, 0.3);
}

.animation-sheet {
  width: 100%;
  height: auto;
  border: 1px solid rgba(239, 229, 143, 0.3);
}

.animation-frames {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
  gap: 8px;
}

.animation-frames img,
.animation-frames canvas {
  width: 100%;
  height: auto;
  border: 1px solid rgba(239, 229, 143, 0.2);
}

#rerollUnitsBtn {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 10px 12px;
  font-size: 8px;
}

.generated-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 10px;
}

.generated-card {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 7px;
  margin: 0;
  padding: 9px 6px;
  background: rgba(8, 5, 5, 0.35);
  border: 1px solid rgba(239, 229, 143, 0.22);
}

.generated-card canvas,
.generated-card img {
  display: block;
  width: 75px;
  height: 75px;
  image-rendering: pixelated;
}

.generated-card figcaption {
  max-width: 100%;
  color: var(--ink);
  font-size: 6px;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.generated-perks {
  width: 100%;
  display: grid;
  gap: 3px;
}

.generated-perk-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.generated-perk-icons {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.generated-perk-icons canvas {
  display: block;
  width: auto;
  height: auto;
  image-rendering: pixelated;
}

.generated-perk-row strong {
  min-width: 0;
  color: var(--ink);
  font-size: 6px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lineup-stage {
  position: relative;
  display: flex;
  align-items: end;
  gap: clamp(8px, 2vw, 18px);
  min-height: 204px;
  overflow-x: auto;
  padding: 18px 18px 28px;
  background:
    linear-gradient(rgba(101, 20, 20, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(101, 20, 20, 0.12) 1px, transparent 1px),
    #d8c18a;
  background-size: 20px 20px;
  border: 1px solid rgba(239, 229, 143, 0.32);
}

.lineup-stage::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 48px;
  left: 18px;
  height: 2px;
  background: rgba(101, 20, 20, 0.55);
}

.lineup-unit {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: 0;
}

.lineup-unit canvas {
  display: block;
  image-rendering: pixelated;
}

.lineup-unit figcaption {
  color: #651414;
  font-size: 8px;
  line-height: 1.45;
  white-space: nowrap;
}

.unit-card {
  min-height: 300px;
  padding: 22px;
  display: grid;
  align-content: start;
  gap: 14px;
}

.unit-card h2 {
  margin: 8px 0 0;
}

.unit-card button {
  width: fit-content;
  margin-top: 8px;
}

.sprite {
  position: relative;
  width: 112px;
  height: 112px;
  margin: 0 auto 10px;
  background: #070707;
  border: 1px solid rgba(239, 229, 143, 0.24);
}

.px {
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--ink);
}

.sprite-human .p1 { left: 49px; top: 14px; }
.sprite-human .p2 { left: 35px; top: 28px; }
.sprite-human .p3 { left: 49px; top: 28px; }
.sprite-human .p4 { left: 63px; top: 28px; }
.sprite-human .p5 { left: 49px; top: 42px; }
.sprite-human .p6 { left: 35px; top: 56px; }
.sprite-human .p7 { left: 49px; top: 70px; }
.sprite-human .p8 { left: 63px; top: 70px; }

.sprite-cyborg .px { background: #8fc8ff; }
.sprite-cyborg .p1 { left: 49px; top: 14px; background: #d9fb66; }
.sprite-cyborg .p2 { left: 35px; top: 28px; }
.sprite-cyborg .p3 { left: 49px; top: 28px; }
.sprite-cyborg .p4 { left: 63px; top: 28px; background: #e33b37; }
.sprite-cyborg .p5 { left: 49px; top: 42px; }
.sprite-cyborg .p6 { left: 21px; top: 56px; background: #5960ff; }
.sprite-cyborg .p7 { left: 49px; top: 70px; }
.sprite-cyborg .p8 { left: 77px; top: 70px; }

.sprite-monkey .px { background: #6a3f30; }
.sprite-monkey .p1 { left: 49px; top: 12px; }
.sprite-monkey .p2 { left: 35px; top: 26px; }
.sprite-monkey .p3 { left: 49px; top: 26px; }
.sprite-monkey .p4 { left: 63px; top: 26px; }
.sprite-monkey .p5 { left: 49px; top: 42px; }
.sprite-monkey .p6 { left: 21px; top: 56px; background: #5d8b3e; }
.sprite-monkey .p7 { left: 49px; top: 70px; }
.sprite-monkey .p8 { left: 77px; top: 56px; background: #f2df2c; }

.sprite-alien .px { background: #59d8e9; }
.sprite-alien .p1 { left: 49px; top: 8px; background: #6872ff; }
.sprite-alien .p2 { left: 35px; top: 24px; }
.sprite-alien .p3 { left: 49px; top: 24px; }
.sprite-alien .p4 { left: 63px; top: 24px; }
.sprite-alien .p5 { left: 49px; top: 42px; }
.sprite-alien .p6 { left: 28px; top: 56px; }
.sprite-alien .p7 { left: 49px; top: 70px; }
.sprite-alien .p8 { left: 70px; top: 56px; background: #ff8b2b; }

.sprite-hexapod .px { background: #7b4c8f; }
.sprite-hexapod .p1 { left: 49px; top: 8px; }
.sprite-hexapod .p2 { left: 35px; top: 24px; }
.sprite-hexapod .p3 { left: 49px; top: 24px; }
.sprite-hexapod .p4 { left: 63px; top: 24px; }
.sprite-hexapod .p5 { left: 49px; top: 42px; }
.sprite-hexapod .p6 { left: 21px; top: 56px; background: #e33b37; }
.sprite-hexapod .p7 { left: 49px; top: 70px; background: #d9fb66; }
.sprite-hexapod .p8 { left: 77px; top: 56px; background: #ff8b2b; }

.sprite-giga-stick .px { background: #f8f8f8; }
.sprite-giga-stick .p1 { left: 49px; top: 10px; }
.sprite-giga-stick .p2 { left: 49px; top: 24px; }
.sprite-giga-stick .p3 { left: 49px; top: 38px; }
.sprite-giga-stick .p4 { left: 35px; top: 52px; background: #779cff; }
.sprite-giga-stick .p5 { left: 63px; top: 52px; background: #5d8b3e; }
.sprite-giga-stick .p6 { left: 49px; top: 66px; }
.sprite-giga-stick .p7 { left: 35px; top: 80px; }
.sprite-giga-stick .p8 { left: 63px; top: 80px; }

.unit-human { border-color: #8d898b; }
.unit-cyborg { border-color: #5d8b3e; }
.unit-monkey { border-color: #3f67aa; }
.unit-alien { border-color: var(--purple); }
.unit-hexapod { border-color: var(--gold); }
.unit-giga-stick { border-color: #9bb9ec; }

.admin-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-top: 22px;
  padding: 22px;
}

.admin-panel > div {
  flex: 1 1 260px;
}

.admin-panel label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 9px;
  line-height: 1.6;
}

.admin-panel input {
  accent-color: var(--lime);
}

.asset-maker > .admin-panel {
  display: grid;
  align-items: stretch;
  margin-top: 0;
}

.asset-maker > .asset-canvas-panel {
  min-height: 0;
}

@media (max-width: 1240px) {
  .asset-maker {
    grid-template-columns: clamp(190px, 24vw, 250px) minmax(0, 1fr);
  }

  .asset-canvas-panel {
    grid-column: 2;
    grid-row: span 2;
  }

  .asset-control-panel {
    grid-column: 1;
  }
}

@media (max-width: 860px) {
  .asset-maker > .asset-canvas-panel,
  .asset-maker > .asset-control-panel {
    grid-column: auto;
    grid-row: auto;
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .brand {
    grid-column: 1 / 3;
  }

  .nav-tabs {
    grid-column: 1 / 2;
  }

  .hero-panel,
  .map-game-head,
  .coming-grid,
  .stick-preview {
    grid-template-columns: 1fr;
  }

  .map-game-head {
    display: grid;
    align-items: start;
  }

  .map-controls {
    justify-content: start;
  }

  .map-app-topbar {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .map-app-nav {
    justify-content: start;
  }

  .map-hud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .my-units-panel {
    grid-template-columns: 1fr;
  }

  .my-units-head {
    min-width: 0;
  }

  .my-units-roster {
    grid-template-columns: 1fr;
  }

  .stage-strip,
  .admin-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .map-designer,
  .drop-admin,
  .asset-maker,
  .pixel-lab,
  .element-lab,
  .animation-editor {
    grid-template-columns: 1fr;
  }

  .map-designer-page .map-designer-tools,
  .map-designer-page .map-designer-board,
  .map-designer-page .map-designer-preview {
    grid-column: auto;
    grid-row: auto;
  }

  .animation-grid {
    grid-template-columns: 1fr;
  }

  .map-designer-tools,
  .lab-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-designer-tools > .designer-tool-head,
  .map-designer-tools > .field-label,
  .map-designer-tools > #mapBrushSize,
  .map-designer-tools > .map-debug-toggle,
  .map-designer-tools > #mapDesignJson,
  .map-designer-tools > .save-status {
    grid-column: span 2;
  }

  .lab-tools > .field-label,
  .lab-tools > #templateSelect,
  .lab-tools > #elementSelect,
  .lab-tools > #animationSelect {
    grid-column: span 2;
  }

  .hero-graphic {
    min-height: 220px;
  }

  .hero-graphic img {
    min-height: 220px;
  }
}

@media (max-width: 560px) {
  .site-frame {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 20px 14px 28px;
  }

  .topbar {
    gap: 12px;
  }

  .wallet-link {
    padding: 9px 10px;
  }

  .nav-tabs {
    gap: 12px;
  }

  .hero-panel {
    padding-top: 26px;
  }

  #harvestMapCanvas {
    min-height: 420px;
    height: 68vh;
  }

  .map-title-overlay {
    width: min(280px, calc(100% - 164px));
    min-width: 0;
    max-width: calc(100% - 164px);
  }

  .map-info-totals {
    grid-template-columns: 1fr;
  }

  .mini-map-frame {
    width: 142px;
    padding: 7px;
  }

  #miniMapCanvas {
    height: 102px;
  }

  .map-focus-exit {
    top: 146px;
  }

  .unit-follow-bubble {
    width: min(220px, calc(100% - 16px));
    gap: 6px;
    padding: 9px;
  }

  .pile-loot-card {
    width: min(300px, calc(100% - 18px));
    gap: 8px;
    padding: 10px;
  }

  .pile-resource-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pile-rarity-row {
    display: none;
  }

  .loot-resource-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .loot-prize-loop {
    padding: 22px 48px 28px;
  }

  .loot-prize-track {
    min-height: 250px;
    gap: 0;
  }

  .loot-prize-card,
  .loot-prize-card.is-stick-nft {
    flex-basis: 188px;
    min-height: 262px;
  }

  .loot-prize-card.is-stick-nft .loot-prize-art {
    min-height: 156px;
  }

  .loot-table-row {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .loot-table-row em {
    grid-column: 2;
    text-align: left;
  }

  .stage-strip,
  .admin-grid,
  .pack-card {
    grid-template-columns: 1fr;
  }

  .lab-tools {
    grid-template-columns: 1fr;
  }

  .lab-tools > .field-label,
  .lab-tools > #templateSelect,
  .lab-tools > #elementSelect,
  .lab-tools > #animationSelect {
    grid-column: auto;
  }

  .editor-head {
    display: grid;
  }

  #spriteMeta,
  #elementMeta,
  #animationMeta {
    text-align: left;
  }

  .pack-card img {
    width: 100%;
    max-width: 220px;
  }

  p {
    font-size: 14px;
  }
}

/* Second readability bump for dense map UI text. */
.map-info-summary strong {
  font-size: clamp(12px, 1.2vw, 16px);
}

.map-info-totals .pile-resource-chip strong {
  font-size: 17px;
}

.map-info-totals .pile-resource-chip em,
.map-drop-resource-line em,
.map-drop-list-details > summary,
.map-drop-item-head em {
  font-size: 12px;
}

.map-drop-meter .pile-rarity-segment strong,
.map-drop-item-head strong,
.map-drop-resource-line strong,
.inventory-token-ticker,
.tracked-count-control,
.selected-units-control,
.unit-perk-row strong,
.pile-prize-carousel .loot-prize-name,
.pile-prize-carousel .loot-prize-odds {
  font-size: 12px;
}

.map-drop-meter .pile-rarity-segment em,
.unit-stat-label,
.unit-stat-pill span {
  font-size: 11px;
}

.inventory-token-amount {
  font-size: 18px;
}

.wallet-inventory-heading,
.wallet-inventory-heading strong {
  font-size: 13px;
}

.unit-stat-hp-value,
.unit-stat-pill strong {
  font-size: 13px;
}

.unit-summary-line {
  font-size: 15px;
}

.unit-card-number {
  font-size: 10px;
}

.map-app-body.is-mobile-emulator .map-info-summary strong,
.map-app-body.is-mobile-emulator .inventory-token-amount,
.map-app-body.is-mobile-emulator .tracked-count-control,
.map-app-body.is-mobile-emulator .selected-units-control {
  font-size: 12px;
}

.map-app-body.is-mobile-emulator .wallet-inventory-heading,
.map-app-body.is-mobile-emulator .wallet-inventory-heading strong,
.map-app-body.is-mobile-emulator .tracked-count-control strong,
.map-app-body.is-mobile-emulator .unit-stat-hp-value,
.map-app-body.is-mobile-emulator .unit-stat-pill strong,
.map-app-body.is-mobile-emulator .unit-summary-line {
  font-size: 12px;
}

.map-app-body.is-mobile-emulator .unit-stat-label,
.map-app-body.is-mobile-emulator .unit-stat-pill span,
.map-app-body.is-mobile-emulator .unit-perk-row strong,
.map-app-body.is-mobile-emulator .selected-units-control button {
  font-size: 10px;
}
