:root {
  --ink: #152238;
  --teal-top: #26b4d6;
  --teal-mid: #1684b0;
  --teal-deep: #0e5f87;
  --panel-dark: #304766;
  --panel-mid: #405c80;
  --steel-light: #d7e5f2;
  --steel-mid: #9db3ca;
  --steel-dark: #637994;
  --coin-gold: #ffd426;
  --sky-fill: #3fd2ff;
  --lime-top: #8df024;
  --lime-mid: #5dd413;
  --lime-dark: #3ca308;
  --orange-top: #ff9a2e;
  --orange-mid: #f26c16;
  --orange-dark: #bd4406;
  --accent: #47d1ff;
}

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

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  color: #ffffff;
  font-family: 'Fredoka', 'Nunito', 'Trebuchet MS', 'Arial Rounded MT Bold', system-ui, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  background:
    repeating-conic-gradient(
      from -10deg at 50% 48%,
      rgba(255, 255, 255, 0.06) 0deg 14deg,
      transparent 14deg 30deg
    ),
    radial-gradient(circle at 50% 35%, var(--teal-top) 0%, var(--teal-mid) 56%, var(--teal-deep) 100%);
}

.app {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  padding: max(6px, env(safe-area-inset-top)) 12px max(8px, env(safe-area-inset-bottom));
  gap: 5px;
}

/* Top Chunky Arcade HUD */
.hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: min(100%, 1180px);
  flex-shrink: 0;
}

.brand-lockup {
  display: flex;
  flex-direction: column;
  line-height: 0.88;
  flex-shrink: 0;
  transform: rotate(-2deg);
  filter: drop-shadow(0 3px 0 var(--ink));
}

.brand-top {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ffd426;
  -webkit-text-stroke: 4px var(--ink);
  paint-order: stroke fill;
}

.brand-bottom {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #79e5ff;
  -webkit-text-stroke: 4px var(--ink);
  paint-order: stroke fill;
}

.coins-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 112px;
  min-height: 42px;
  padding: 4px 12px 4px 8px;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--panel-mid) 0%, var(--panel-dark) 100%);
  border: 3px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink), inset 0 2px 0 rgba(255, 255, 255, 0.22);
}

.coin-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #fff9ba 0%, #ffd426 52%, #e08d00 100%);
  border: 3px solid var(--ink);
  box-shadow: inset 0 -2px 0 rgba(180, 95, 0, 0.65), 0 2px 0 rgba(21, 34, 56, 0.4);
  flex-shrink: 0;
  position: relative;
}

.coin-badge::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 2px solid rgba(255, 250, 200, 0.7);
}

.coins-value {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #ffe24a;
  -webkit-text-stroke: 3.5px var(--ink);
  paint-order: stroke fill;
  transition: transform 90ms ease;
}

.coins-value.bump {
  transform: scale(1.16);
}

.progress-wrap {
  flex: 1;
  max-width: 260px;
  min-width: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.progress-bar {
  position: relative;
  width: 100%;
  height: 24px;
  border-radius: 999px;
  background: #243752;
  border: 3px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink), inset 0 3px 0 rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(180deg, #8cf0ff 0%, var(--sky-fill) 52%, #1ca4eb 100%);
  border-radius: 999px;
  transition: width 75ms linear;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 6px;
  right: 6px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
}

.cleared-value {
  position: relative;
  z-index: 1;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
}

.map-tag {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ffe24a;
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  line-height: 1;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.hub-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 42px;
  padding: 0 10px;
  border-radius: 12px;
  border: 3px solid var(--ink);
  background: linear-gradient(180deg, #ffd84d 0%, #f09c14 60%, #bf6b06 100%);
  box-shadow: 0 4px 0 var(--ink), inset 0 2px 0 rgba(255, 255, 255, 0.48);
  color: #ffffff;
  font-family: inherit;
  cursor: pointer;
}

.hub-pill:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}

.hub-icon {
  font-size: 14px;
  line-height: 1;
}

.hub-text {
  font-size: 12px;
  font-weight: 700;
  -webkit-text-stroke: 2.8px var(--ink);
  paint-order: stroke fill;
}

.hub-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ff3b4e;
  border: 2px solid var(--ink);
  box-shadow: 0 0 8px #ff3b4e;
}

.hub-dot[hidden] {
  display: none;
}

.auto-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 42px;
  padding: 0 10px;
  border-radius: 12px;
  border: 3px solid var(--ink);
  background: linear-gradient(180deg, #4b6587 0%, #314663 100%);
  box-shadow: 0 4px 0 var(--ink), inset 0 2px 0 rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-family: inherit;
  cursor: pointer;
}

.auto-pill[hidden] {
  display: none;
}

.auto-pill[aria-pressed='true'] {
  background: linear-gradient(180deg, var(--orange-top) 0%, var(--orange-mid) 58%, var(--orange-dark) 100%);
  box-shadow: 0 4px 0 var(--ink), inset 0 3px 0 rgba(255, 255, 255, 0.42);
}

.auto-pill:not(:disabled):active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}

.auto-pill-label {
  font-size: 12px;
  font-weight: 700;
  -webkit-text-stroke: 2.8px var(--ink);
  paint-order: stroke fill;
}

.auto-pill-state {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 6px;
  background: rgba(21, 34, 56, 0.45);
  color: #ffe8a3;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 3px solid var(--ink);
  background: linear-gradient(180deg, #75c6f5 0%, #3d98d6 55%, #2a78b5 100%);
  box-shadow: 0 4px 0 var(--ink), inset 0 3px 0 rgba(255, 255, 255, 0.45);
  color: #ffffff;
  cursor: pointer;
  transition: transform 60ms ease, box-shadow 60ms ease, filter 120ms ease;
}

.icon-btn svg {
  filter: drop-shadow(0 1.5px 0 var(--ink));
}

.icon-btn:hover {
  filter: brightness(1.07);
}

.icon-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink), inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.icon-btn[aria-pressed='true'] {
  background: linear-gradient(180deg, #ffae42 0%, #f27416 60%, #c95008 100%);
}

/* Level Unlock Strip & Active Magnetic Nova Button */
.meta-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: min(100%, 1180px);
  flex-shrink: 0;
}

.level-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 9px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(48, 71, 102, 0.92) 0%, rgba(33, 50, 74, 0.94) 100%);
  border: 3px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
}

.level-badge {
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 8px;
  background: linear-gradient(180deg, #6cf2ff 0%, #1eb8e8 100%);
  border: 2px solid var(--ink);
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  -webkit-text-stroke: 2.6px var(--ink);
  paint-order: stroke fill;
}

.xp-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.xp-bar {
  position: relative;
  height: 15px;
  border-radius: 999px;
  background: #1b2c44;
  border: 2px solid var(--ink);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.xp-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(180deg, #7df7ff 0%, #24c6f0 100%);
  transition: width 90ms linear;
}

.xp-text {
  position: relative;
  z-index: 1;
  font-size: 10px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 0 var(--ink);
}

.meta-subline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.quest-text {
  font-size: 11px;
  font-weight: 700;
  color: #b4ff7a;
  text-shadow: 0 1.5px 0 var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.next-unlock {
  font-size: 11px;
  font-weight: 700;
  color: #ffe24a;
  text-shadow: 0 1.5px 0 var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.nova-btn {
  position: relative;
  flex-shrink: 0;
  min-width: 146px;
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  border: 3px solid var(--ink);
  background: linear-gradient(180deg, #435d80 0%, #2b3f5c 100%);
  box-shadow: 0 3px 0 var(--ink), inset 0 2px 0 rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-family: inherit;
  cursor: pointer;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nova-btn:disabled {
  cursor: default;
}

.nova-btn.locked {
  opacity: 0.78;
}

.nova-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(180deg, rgba(255, 198, 54, 0.55) 0%, rgba(242, 108, 22, 0.72) 100%);
  pointer-events: none;
  transition: width 90ms linear;
}

.nova-btn.ready {
  background: linear-gradient(180deg, #ffe24a 0%, #ff981a 58%, #d95204 100%);
  box-shadow: 0 3px 0 var(--ink), 0 0 18px rgba(255, 210, 48, 0.85), inset 0 2px 0 rgba(255, 255, 255, 0.5);
  animation: glowNova 0.9s ease-in-out infinite;
}

.nova-btn.ready:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--ink);
}

.nova-btn.active {
  background: linear-gradient(180deg, #ff7a18 0%, #e63946 100%);
  box-shadow: 0 3px 0 var(--ink), 0 0 16px rgba(255, 122, 24, 0.75);
}

.nova-label {
  position: relative;
  z-index: 1;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ffffff;
  -webkit-text-stroke: 2.8px var(--ink);
  paint-order: stroke fill;
  white-space: nowrap;
}

@keyframes glowNova {
  0%, 100% {
    box-shadow: 0 3px 0 var(--ink), 0 0 12px rgba(255, 210, 48, 0.6);
  }
  50% {
    box-shadow: 0 3px 0 var(--ink), 0 0 24px rgba(255, 232, 92, 0.95);
  }
}

/* Main Workshop Stage (Responsive Landscape 3:2 & Portrait 2:3) */
.stage-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tray-frame {
  position: relative;
  height: 100%;
  max-width: min(100%, 1180px);
  max-height: 100%;
  aspect-ratio: 3 / 2;
  border-radius: 22px;
  padding: 9px;
  background: linear-gradient(180deg, var(--steel-light) 0%, var(--steel-mid) 52%, var(--steel-dark) 100%);
  border: 4px solid var(--ink);
  box-shadow:
    0 8px 0 #3f5570,
    0 12px 0 var(--ink),
    0 18px 28px rgba(8, 28, 46, 0.42),
    inset 0 3px 0 rgba(255, 255, 255, 0.65);
}

@media (max-aspect-ratio: 1 / 1) {
  .tray-frame {
    width: 100%;
    height: 100%;
    max-width: 100%;
    aspect-ratio: auto;
    padding: 4px;
    border-radius: 14px;
    border-width: 3px;
    box-shadow: 0 4px 0 #3f5570, 0 7px 0 var(--ink);
  }

  #tray {
    border-radius: 10px;
    border-width: 2px;
  }

  .pause-overlay {
    inset: 4px;
    border-radius: 10px;
  }
}

@media (min-aspect-ratio: 1 / 1) {
  .tray-frame {
    width: min(100%, 1180px);
    height: 100%;
    aspect-ratio: auto;
  }
}

#tray {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  border: 3px solid #485e7a;
  background: #92acc7;
  cursor: crosshair;
  touch-action: none;
}

/* Pause Overlay */
.pause-overlay {
  position: absolute;
  inset: 10px;
  border-radius: 12px;
  background: rgba(16, 32, 54, 0.78);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 16px;
  z-index: 5;
}

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

.pause-title {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #ffe24a;
  -webkit-text-stroke: 5px var(--ink);
  paint-order: stroke fill;
}

.pause-note {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #dceeff;
}

.resume-btn {
  min-width: 164px;
  min-height: 48px;
  padding: 10px 26px;
  border-radius: 14px;
  border: 3px solid var(--ink);
  background: linear-gradient(180deg, var(--lime-top) 0%, var(--lime-mid) 58%, var(--lime-dark) 100%);
  box-shadow: 0 5px 0 var(--ink), inset 0 3px 0 rgba(255, 255, 255, 0.45);
  color: #ffffff;
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  cursor: pointer;
}

.resume-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--ink);
}

/* Save Warning */
.save-warning {
  width: min(100%, 1180px);
  margin: 0;
  padding: 5px 12px;
  border-radius: 12px;
  background: #ff4757;
  border: 3px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  flex-shrink: 0;
}

.save-warning[hidden] {
  display: none;
}

/* Mobile Collapsible Upgrades Toggle Pill (hidden on Desktop > 600px) */
.upgrades-toggle {
  display: none;
}

/* Bottom 4-Branch Parallel Upgrade Dock */
.hud-bottom {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: min(100%, 1180px);
  padding: 7px 8px 9px;
  border-radius: 18px;
  background: linear-gradient(180deg, #4b6e94 0%, #345275 100%);
  border: 4px solid var(--ink);
  box-shadow: 0 5px 0 var(--ink), inset 0 3px 0 rgba(255, 255, 255, 0.28);
  flex-shrink: 0;
}

.upgrade-card {
  position: relative;
  min-height: 76px;
  padding: 6px 8px 7px;
  border-radius: 13px;
  border: 3px solid var(--ink);
  background: linear-gradient(180deg, #3c5475 0%, #2a3e59 100%);
  box-shadow: 0 4px 0 var(--ink), inset 0 2px 0 rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-family: inherit;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 3px;
  text-align: left;
  transition: filter 120ms ease, box-shadow 120ms ease;
}

.upgrade-card:disabled {
  cursor: default;
}

.upgrade-card.locked {
  opacity: 0.78;
}

.upgrade-card.ready {
  background: linear-gradient(180deg, var(--lime-top) 0%, var(--lime-mid) 58%, var(--lime-dark) 100%);
  box-shadow: 0 4px 0 var(--ink), 0 0 18px rgba(141, 240, 36, 0.55), inset 0 3px 0 rgba(255, 255, 255, 0.45);
  animation: glowReady 1.4s ease-in-out infinite;
}

.upgrade-card.ready:hover {
  filter: brightness(1.06);
}

.upgrade-card.ready:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}

.upgrade-card.maxed {
  background: linear-gradient(180deg, #43f0de 0%, #15bfa9 60%, #0b8a7a 100%);
  box-shadow: 0 4px 0 var(--ink), inset 0 3px 0 rgba(255, 255, 255, 0.5);
}

.upgrade-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(180deg, rgba(102, 224, 255, 0.42) 0%, rgba(45, 173, 235, 0.5) 100%);
  pointer-events: none;
  transition: width 90ms linear;
}

.upgrade-card.ready .upgrade-fill {
  background: repeating-linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.16) 0 12px,
    transparent 12px 24px
  );
}

.upgrade-card.maxed .upgrade-fill,
.upgrade-card.locked .upgrade-fill {
  background: transparent;
}

.upgrade-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.upgrade-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ffffff;
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
}

.upgrade-lvl {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(21, 34, 56, 0.48);
  color: #cfeaff;
}

.upgrade-meta {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 600;
  color: #e0f0ff;
  text-shadow: 0 1.5px 0 var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upgrade-card.locked .upgrade-meta {
  color: #ffd38a;
}

.upgrade-card.ready .upgrade-meta {
  color: #f6ffcf;
}

.upgrade-price-wrap {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 9px;
  background: rgba(21, 34, 56, 0.42);
  border: 2px solid var(--ink);
  align-self: flex-start;
}

.mini-coin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #fff8b8 0%, #ffd426 55%, #d98200 100%);
  border: 2px solid var(--ink);
  flex-shrink: 0;
}

.upgrade-card.maxed .mini-coin {
  display: none;
}

.upgrade-price {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #ffe24a;
  -webkit-text-stroke: 2.6px var(--ink);
  paint-order: stroke fill;
}

@keyframes glowReady {
  0%, 100% {
    box-shadow: 0 4px 0 var(--ink), 0 0 12px rgba(141, 240, 36, 0.42), inset 0 3px 0 rgba(255, 255, 255, 0.45);
  }
  50% {
    box-shadow: 0 4px 0 var(--ink), 0 0 22px rgba(141, 240, 36, 0.8), inset 0 3px 0 rgba(255, 255, 255, 0.55);
  }
}

@media (max-width: 720px) {
  .brand-lockup {
    display: none;
  }
}

@media (max-width: 600px) {
  .app {
    padding: 0;
    gap: 0;
  }

  /* TRUE 100% EDGE-TO-EDGE FULL-SCREEN CANVAS ON MOBILE */
  .stage-wrap {
    position: fixed;
    inset: 0;
    z-index: 1;
    width: 100vw;
    height: 100dvh;
  }

  .tray-frame {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }

  #tray {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
  }

  .pause-overlay {
    inset: 0;
    border-radius: 0;
    z-index: 30;
  }

  /* FLOATING TOP HUD OVERLAY (pointer-events pass through empty gaps) */
  .hud-top {
    position: fixed;
    top: max(6px, env(safe-area-inset-top));
    left: 6px;
    right: 6px;
    width: auto;
    z-index: 12;
    flex-wrap: wrap;
    row-gap: 4px;
    column-gap: 5px;
    pointer-events: none;
  }

  .hud-top > * {
    pointer-events: auto;
  }

  .coins-pill {
    order: 1;
    min-width: 78px;
    min-height: 34px;
    padding: 2px 8px 2px 5px;
    background: rgba(25, 42, 66, 0.84);
    backdrop-filter: blur(4px);
  }

  .coin-badge {
    width: 20px;
    height: 20px;
  }

  .coins-value {
    font-size: 15px;
  }

  .top-actions {
    order: 2;
    margin-left: auto;
    gap: 4px;
  }

  .progress-wrap {
    order: 3;
    flex: 1 0 100%;
    max-width: 100%;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    pointer-events: none;
  }

  .progress-bar {
    height: 18px;
    min-width: 96px;
    background: rgba(21, 34, 56, 0.78);
  }

  .map-meta-row {
    flex-shrink: 0;
    gap: 4px;
  }

  .map-tag {
    flex-shrink: 0;
    font-size: 10.5px;
  }

  .bay-mod-pill {
    display: none;
  }

  .icon-btn,
  .auto-pill,
  .hub-pill {
    height: 34px;
  }

  .icon-btn {
    width: 34px;
  }

  .hub-pill {
    padding: 0 8px;
  }

  .hub-text {
    display: none;
  }

  .auto-pill {
    padding: 0 7px;
  }

  .meta-strip {
    position: fixed;
    top: calc(max(6px, env(safe-area-inset-top)) + 60px);
    left: 6px;
    right: 6px;
    width: auto;
    z-index: 12;
    pointer-events: none;
  }

  .level-wrap {
    background: rgba(25, 42, 66, 0.80);
    backdrop-filter: blur(4px);
    pointer-events: none;
  }

  .next-unlock {
    display: none;
  }

  .nova-btn {
    min-width: 108px;
    height: 36px;
    padding: 0 8px;
    pointer-events: auto;
  }

  .nova-label {
    font-size: 11px;
  }

  .tutorial-bar {
    position: fixed;
    top: calc(max(6px, env(safe-area-inset-top)) + 114px);
    bottom: auto;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: fit-content;
    max-width: calc(100vw - 16px);
    z-index: 14;
    padding: 3px 8px;
    gap: 5px;
    border-radius: 999px;
    border-width: 2px;
    background: rgba(15, 27, 46, 0.82);
    backdrop-filter: blur(4px);
  }

  .tutorial-text {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* FLOATING THUMB-ZONE UPGRADES BUTTON (NEVER SHRINKS MAP!) */
  .upgrades-toggle {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 22;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    height: 40px;
    padding: 0 14px;
    border-radius: 14px;
    border: 3px solid var(--ink);
    background: linear-gradient(180deg, rgba(60, 89, 125, 0.92) 0%, rgba(39, 62, 92, 0.94) 100%);
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 0 var(--ink), 0 6px 16px rgba(0, 0, 0, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.03em;
    -webkit-text-stroke: 2.5px var(--ink);
    paint-order: stroke fill;
    cursor: pointer;
  }

  .upgrades-toggle.has-ready {
    background: linear-gradient(180deg, var(--lime-top) 0%, var(--lime-mid) 58%, var(--lime-dark) 100%);
    box-shadow: 0 4px 0 var(--ink), 0 0 18px rgba(141, 240, 36, 0.85), inset 0 2px 0 rgba(255, 255, 255, 0.48);
    animation: glowReady 1.05s ease-in-out infinite;
  }

  .upgrades-toggle:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--ink);
  }

  .upgrades-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: #ff4757;
    border: 2px solid var(--ink);
    color: #ffffff;
    font-size: 11.5px;
    font-weight: 700;
    -webkit-text-stroke: 0;
  }

  .upgrades-badge[hidden] {
    display: none;
  }

  /* FLOATING BOTTOM-SHEET OVERLAY DRAWER (ZERO MAP RESIZE / ZERO SHRINK!) */
  .hud-bottom {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(max(8px, env(safe-area-inset-bottom)) + 48px);
    width: auto;
    z-index: 21;
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 7px 7px 8px;
    border-radius: 16px;
    border-width: 3px;
    background: rgba(39, 62, 92, 0.94);
    backdrop-filter: blur(8px);
    box-shadow: 0 6px 0 var(--ink), 0 12px 28px rgba(0, 0, 0, 0.52);
  }

  .hud-bottom.mobile-open {
    display: grid;
    animation: sheetRise 160ms ease-out;
  }

  @keyframes sheetRise {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .upgrade-card {
    min-height: 52px;
    padding: 4px 6px 5px;
    gap: 1px;
    border-width: 2.5px;
    border-radius: 11px;
  }

  .upgrade-name {
    font-size: 12px;
  }

  .upgrade-meta {
    font-size: 10px;
  }

  .upgrade-price-wrap {
    padding: 1px 6px;
  }

  .upgrade-price {
    font-size: 12px;
  }
}

@media (max-height: 500px) {
  .app {
    padding: 4px 8px;
    gap: 3px;
  }

  .brand-lockup {
    display: none;
  }

  .coins-pill,
  .icon-btn,
  .auto-pill,
  .hub-pill {
    min-height: 32px;
    height: 32px;
  }

  .meta-strip {
    gap: 6px;
  }

  .level-wrap {
    padding: 2px 6px;
  }

  .nova-btn {
    height: 32px;
  }

  .tray-frame {
    width: min(100%, 1180px);
    height: 100%;
    aspect-ratio: auto;
    padding: 5px;
  }

  .hud-bottom {
    padding: 4px 6px 5px;
    gap: 5px;
  }

  .upgrade-card {
    min-height: 50px;
    padding: 3px 6px;
  }
}

/* Workshop Hub & Welcome Back Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 38, 0.78);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  z-index: 30;
}

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

.modal-card {
  width: min(100%, 620px);
  max-height: min(88dvh, 660px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 20px;
  background: linear-gradient(180deg, #3b587d 0%, #263b57 100%);
  border: 4px solid var(--ink);
  box-shadow: 0 8px 0 var(--ink), 0 18px 34px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.modal-compact {
  width: min(100%, 380px);
  align-items: center;
  text-align: center;
  padding: 20px 18px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #ffe24a;
  -webkit-text-stroke: 3.6px var(--ink);
  paint-order: stroke fill;
}

.cores-pill {
  padding: 3px 10px;
  border-radius: 999px;
  background: #1a2d45;
  border: 2.5px solid #47e3ff;
  font-size: 12px;
  font-weight: 700;
  color: #7bf7eb;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 3px solid var(--ink);
  background: #ff5964;
  box-shadow: 0 3px 0 var(--ink);
  color: #ffffff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.modal-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tab-btn {
  padding: 8px 10px;
  border-radius: 12px;
  border: 3px solid var(--ink);
  background: #23364f;
  color: #bcd6f0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.tab-btn.active {
  background: linear-gradient(180deg, #54d1ff 0%, #1d97db 100%);
  color: #ffffff;
  -webkit-text-stroke: 2.6px var(--ink);
  paint-order: stroke fill;
}

.modal-body {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 2px;
}

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

.overclock-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, #1d3552 0%, #162840 100%);
  border: 3px solid #2ee2f2;
}

.overclock-title {
  font-size: 13px;
  font-weight: 700;
  color: #7bf7eb;
}

.overclock-sub {
  font-size: 11.5px;
  color: #d6ebff;
}

.overclock-btn {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 11px;
  border: 3px solid var(--ink);
  background: #3a516e;
  box-shadow: 0 3px 0 var(--ink);
  color: #cfe0f2;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: default;
}

.overclock-btn.ready {
  background: linear-gradient(180deg, #4df5e2 0%, #12b8a6 100%);
  color: #ffffff;
  -webkit-text-stroke: 2.5px var(--ink);
  paint-order: stroke fill;
  cursor: pointer;
}

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

.tech-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 3px solid var(--ink);
  background: linear-gradient(180deg, #324a69 0%, #24364f 100%);
  box-shadow: 0 3px 0 var(--ink);
  color: #ffffff;
  font-family: inherit;
  text-align: left;
  cursor: default;
}

.tech-card.ready {
  background: linear-gradient(180deg, var(--lime-top) 0%, var(--lime-mid) 60%, var(--lime-dark) 100%);
  cursor: pointer;
}

.tech-card.maxed {
  background: linear-gradient(180deg, #3be8d6 0%, #0e998b 100%);
}

.tech-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.tech-name {
  font-size: 12.5px;
  font-weight: 700;
  -webkit-text-stroke: 2.5px var(--ink);
  paint-order: stroke fill;
}

.tech-lvl {
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(21, 34, 56, 0.55);
}

.tech-desc {
  font-size: 10.5px;
  color: #e4f2ff;
}

.tech-cost {
  margin-top: 2px;
  font-size: 11.5px;
  font-weight: 700;
  color: #7bf7eb;
  text-shadow: 0 1px 0 var(--ink);
}

.relics-summary {
  margin: 0;
  font-size: 12px;
  color: #dceeff;
}

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

.relic-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  padding: 8px 6px 7px;
  border-radius: 12px;
  border: 3px solid var(--ink);
  background: #1d2e44;
  text-align: center;
  position: relative;
  color: #ffffff;
  font-family: inherit;
  cursor: default;
  transition: transform 100ms ease, filter 120ms ease;
}

.relic-cell.owned {
  cursor: pointer;
}

.relic-cell.owned:hover {
  filter: brightness(1.1);
}

.relic-cell.owned:active {
  transform: translateY(2px);
}

.relic-cell.equipped {
  box-shadow: 0 0 0 2px #ffffff, 0 0 14px rgba(255, 226, 74, 0.85);
}

.relic-cell.locked {
  opacity: 0.62;
}

.relic-cell.owned.rarity-common {
  border-color: #9ec0e0;
  background: #2b425e;
}

.relic-cell.owned.rarity-uncommon {
  border-color: #45e066;
  background: #1b4a33;
}

.relic-cell.owned.rarity-rare {
  border-color: #38b6ff;
  background: #1b426b;
}

.relic-cell.owned.rarity-epic {
  border-color: #c46bff;
  background: #3d2163;
  box-shadow: inset 0 0 12px rgba(196, 107, 255, 0.25);
}

.relic-cell.owned.rarity-legendary {
  border-color: #ffd026;
  background: linear-gradient(180deg, #694912 0%, #4a310a 100%);
  box-shadow: 0 0 12px rgba(255, 208, 38, 0.4), inset 0 0 12px rgba(255, 224, 102, 0.25);
}

.relic-cell.owned.rarity-mythic {
  border-color: #ff42a1;
  background: linear-gradient(135deg, #5c164e 0%, #2d1b69 50%, #661740 100%);
  box-shadow: 0 0 16px rgba(255, 66, 161, 0.65), inset 0 0 14px rgba(54, 245, 255, 0.3);
  animation: mythicPulse 2.2s ease-in-out infinite;
}

@keyframes mythicPulse {
  0%, 100% { border-color: #ff42a1; box-shadow: 0 0 14px rgba(255, 66, 161, 0.65); }
  50% { border-color: #36f5ff; box-shadow: 0 0 18px rgba(54, 245, 255, 0.78); }
}

.relic-stars {
  position: absolute;
  top: 4px;
  right: 5px;
  font-size: 9.5px;
  font-weight: 700;
  color: #ffe24a;
  background: rgba(15, 26, 44, 0.78);
  padding: 1px 4px;
  border-radius: 6px;
}

.relic-equip-tag {
  position: absolute;
  top: 4px;
  left: 5px;
  font-size: 8.5px;
  font-weight: 700;
  color: #152238;
  background: #8df024;
  padding: 1px 4px;
  border-radius: 5px;
}

.relic-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 0 rgba(15, 26, 44, 0.7));
}

.relic-cell.locked .relic-img {
  filter: brightness(0) opacity(0.5);
}

.relic-name {
  font-size: 10px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.15;
}

.relic-rarity {
  font-size: 9px;
  font-weight: 700;
  color: #b8d2eb;
  text-transform: uppercase;
}

.relic-stat-mini {
  font-size: 8.5px;
  color: #cfeaff;
  line-height: 1.15;
}

/* Map meta row with Bay Modifier + Crate Tray */
.map-meta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-wrap: nowrap;
  min-width: 0;
}

.bay-mod-pill {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 7px;
  border: 2px solid var(--ink);
  background: #243854;
  color: #ffe24a;
  white-space: nowrap;
}

.bay-mod-pill[hidden] {
  display: none;
}

.crate-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 7px;
  border: 2px solid var(--ink);
  background: #1d3552;
  color: #ffe24a;
  white-space: nowrap;
}

.crate-pill.has-crates {
  background: linear-gradient(180deg, #ff9d2e 0%, #e06a00 100%);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(255, 165, 38, 0.65);
}

/* Equipped Skin Showcase & Rarity Filters inside Hub */
.equipped-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 11px;
  border-radius: 13px;
  border: 3px solid var(--ink);
  background: linear-gradient(180deg, #274060 0%, #1b2f4a 100%);
}

.equipped-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.equipped-tag {
  font-size: 9.5px;
  font-weight: 700;
  color: #8df024;
  letter-spacing: 0.04em;
}

.equipped-name {
  font-size: 14px;
  font-weight: 700;
  color: #ffe24a;
}

.equipped-stats {
  font-size: 11px;
  color: #dceeff;
}

.equipped-img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(255, 226, 74, 0.45));
}

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

.filter-btn {
  padding: 3px 8px;
  border-radius: 8px;
  border: 2px solid var(--ink);
  background: #243854;
  color: #c7e0fa;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}

.filter-btn.active {
  background: #ffe24a;
  color: var(--ink);
}

/* End-of-Bay Crate Decoder Wheel Modal */
.modal-wheel {
  width: min(100%, 490px);
  align-items: stretch;
  gap: 8px;
}

.wheel-crates {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
}

.wheel-crate-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 9px;
  border: 2px solid var(--ink);
  background: #22354f;
  color: #dceeff;
  font-size: 11px;
  font-weight: 700;
  opacity: 0.7;
}

.wheel-crate-chip.current {
  opacity: 1;
  transform: scale(1.06);
  box-shadow: 0 0 12px rgba(255, 226, 74, 0.55);
}

.wheel-crate-chip img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.wheel-odds {
  font-size: 10.5px;
  color: #cfe8ff;
  text-align: center;
  background: rgba(15, 26, 44, 0.45);
  border-radius: 8px;
  padding: 4px 8px;
}

.wheel-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0 2px;
}

.wheel-pointer {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  font-size: 24px;
  line-height: 1;
  color: #ffe24a;
  text-shadow: 0 2px 0 var(--ink), 0 0 8px rgba(255, 226, 74, 0.7);
}

#wheel-canvas {
  display: block;
  width: 224px;
  height: 224px;
  border-radius: 50%;
  box-shadow: 0 6px 0 var(--ink), 0 10px 24px rgba(0, 0, 0, 0.45);
}

.wheel-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 13px;
  border: 3px solid #ffe24a;
  background: linear-gradient(180deg, #273e5c 0%, #192b42 100%);
  animation: popReveal 220ms cubic-bezier(0.2, 1.35, 0.4, 1);
}

.wheel-result[hidden] {
  display: none;
}

@keyframes popReveal {
  0% { transform: scale(0.86); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.wheel-res-img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  flex-shrink: 0;
}

.wheel-res-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wheel-res-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.wheel-res-rarity {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 6px;
  background: #152238;
  color: #ffe24a;
}

.wheel-res-badge {
  font-size: 10px;
  font-weight: 700;
  color: #8df024;
}

.wheel-res-name {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.wheel-res-stats {
  font-size: 11px;
  color: #d6ecff;
}

.wheel-equip-btn {
  flex-shrink: 0;
  padding: 7px 12px;
  border-radius: 10px;
  border: 2.5px solid var(--ink);
  background: linear-gradient(180deg, #47c2ff 0%, #1c85d9 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.wheel-equip-btn.equipped {
  background: #3d587a;
  color: #a8c4e0;
  cursor: default;
}

.wheel-pity {
  font-size: 11px;
  font-weight: 700;
  color: #ffd38a;
  text-align: center;
}

.wheel-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.offline-note {
  margin: 0;
  font-size: 13px;
  color: #dceeff;
}

.offline-amount {
  font-size: 28px;
  font-weight: 700;
  color: #ffe24a;
  -webkit-text-stroke: 4px var(--ink);
  paint-order: stroke fill;
}

.help-btn {
  font-size: 19px;
  font-weight: 700;
  -webkit-text-stroke: 2.5px var(--ink);
  paint-order: stroke fill;
}

/* Compact Non-Blocking Tutorial Coach Pill (top-center, never covers center/bottom items) */
.tutorial-bar {
  position: absolute;
  top: 10px;
  bottom: auto;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: fit-content;
  max-width: calc(100% - 24px);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(16, 28, 48, 0.78);
  backdrop-filter: blur(4px);
  border: 2px solid #ffe24a;
  box-shadow: 0 3px 0 rgba(21, 34, 56, 0.85), 0 4px 12px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.tutorial-bar[hidden] {
  display: none;
}

.tutorial-step {
  flex-shrink: 0;
  padding: 1px 6px;
  border-radius: 999px;
  background: #ffe24a;
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 700;
}

.tutorial-text {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tutorial-skip {
  pointer-events: auto;
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: rgba(61, 88, 122, 0.9);
  color: #dceeff;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}

/* How To Play Modal */
.modal-help {
  width: min(100%, 520px);
}

.help-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.help-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(21, 34, 56, 0.52);
  border: 2px solid rgba(120, 210, 255, 0.25);
}

.help-icon {
  font-size: 20px;
  line-height: 1.1;
  flex-shrink: 0;
}

.help-row strong {
  display: block;
  font-size: 13px;
  color: #ffe24a;
}

.help-row p {
  margin: 2px 0 0;
  font-size: 11.5px;
  line-height: 1.35;
  color: #dceeff;
}

.help-row kbd {
  padding: 1px 5px;
  border-radius: 5px;
  background: #152238;
  border: 1.5px solid #ffe24a;
  color: #ffe24a;
  font-family: inherit;
  font-size: 11px;
}

.help-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

@media (max-width: 600px) {
  .tutorial-bar {
    position: fixed;
    top: calc(max(6px, env(safe-area-inset-top)) + 114px);
    bottom: auto;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: fit-content;
    max-width: calc(100vw - 16px);
    z-index: 14;
    padding: 3px 8px;
    gap: 5px;
    border-radius: 999px;
    border-width: 2px;
  }

  .tutorial-text {
    font-size: 11px;
  }
}

@media (max-width: 375px) {
  .hud-top {
    column-gap: 3px;
  }

  .coins-pill {
    min-width: 68px;
    padding: 2px 6px 2px 4px;
  }

  .icon-btn {
    width: 31px;
    height: 31px;
  }

  .hub-pill,
  .auto-pill {
    height: 31px;
    padding: 0 6px;
  }

  .nova-btn {
    min-width: 96px;
  }
}

@media (max-width: 520px) {
  .tech-grid {
    grid-template-columns: 1fr;
  }

  .relics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .overclock-box {
    flex-direction: column;
    align-items: stretch;
  }
}
