/* Achilles Bastion v3.0 — 100% 1:1 Bloons TD 6 Visual UI, Wood/Brass Sidebar, Glossy Buttons & Contextual Upgrade Drawer */
:root {
  --bg: #050811;
  --wood-dark: #5c3a21;
  --wood-mid: #8b5a2b;
  --wood-light: #c1874b;
  --wood-border: #3d2310;
  --gold: #d4af37;
  --gold-bright: #fde047;
  --emerald: #22c55e;
  --sky: #38bdf8;
  --crimson: #ef4444;
  --purple: #9333ea;
  --card: #0f172a;
  --card-elev: #1e293b;
  --border-gold: rgba(212, 175, 55, 0.55);
  --border-subtle: rgba(148, 163, 184, 0.25);
  --text: #f8fafc;
  --text-muted: #cbd5e1;
  --font-display: "Fredoka", "Nunito", "Arial Rounded MT Bold", "Inter", -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

html,
body {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  user-select: none;
  -webkit-user-select: none;
}

input {
  user-select: text;
  -webkit-user-select: text;
}

button,
select,
input {
  font-family: inherit;
}

/* ============================================================================
   Full-Viewport 16:9 Bloons TD 6 Game Shell (Stage + Narrow Right Wood Sidebar)
   ============================================================================ */
.btd6-game-shell {
  display: grid;
  grid-template-columns: 1fr 178px;
  width: 100vw;
  height: 100dvh;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

@media (max-width: 720px) {
  .btd6-game-shell {
    grid-template-columns: 1fr 142px;
  }
}

.btd6-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #d8a465;
}

.btd6-stage.black-border-frame {
  box-shadow: inset 0 0 0 4px #050811, inset 0 0 0 7px #fde047;
}

.btd6-webgl-canvas,
.btd6-overlay-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.btd6-overlay-canvas {
  cursor: crosshair;
  z-index: 2;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* ============================================================================
   Floating Top-Left HUD (Mana Shield + Lives + Cash — Outlined BTD6 Typography!)
   ============================================================================ */
.btd6-hud-top-left {
  position: absolute;
  top: 8px;
  left: 14px;
  z-index: 15;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  max-width: 265px;
  pointer-events: none;
}

.btd6-stat-cluster {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.55));
}

.btd6-stat-icon {
  font-size: 23px;
}

.btd6-outlined-num {
  font-size: 21px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.02em;
  text-shadow:
    -2px -2px 0 #111827,
    2px -2px 0 #111827,
    -2px 2px 0 #111827,
    2px 2px 0 #111827,
    0 3px 6px rgba(0, 0, 0, 0.75);
}

/* Top-Center Boss Bar & Compact Read Achilles Map/Desk Pill */
.btd6-hud-top-center {
  position: absolute;
  top: 8px;
  left: 43%;
  transform: translateX(-50%);
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  max-width: min(460px, 40vw);
}

.btd6-map-intel-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(15, 23, 42, 0.84);
  border: 2px solid rgba(253, 224, 71, 0.65);
  border-radius: 999px;
  padding: 3px 10px 3px 4px;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  max-width: 100%;
}

.map-pill-btn {
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  color: #ffffff;
  border: 2px solid #bae6fd;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.intel-pill-desk {
  font-size: 10.5px;
  font-weight: 900;
  color: var(--gold-bright);
  white-space: nowrap;
}

.intel-pill-text {
  font-size: 10.5px;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 135px;
}

@media (max-width: 1340px) {
  .intel-pill-desk,
  .intel-pill-text {
    display: none;
  }
}

@media (max-width: 940px) {
  .btd6-hud-top-center {
    top: 40px;
    left: 12px;
    transform: none;
    align-items: flex-start;
    max-width: 56vw;
  }
  .btd6-wave-forecast-pill {
    display: none;
  }
  .intel-mini-link {
    display: none;
  }
  .map-pill-btn {
    font-size: 10px;
    padding: 2px 8px;
  }
  .btd6-outlined-num {
    font-size: 16px;
  }
  .btd6-stat-icon {
    font-size: 18px;
  }
  .btd6-icon-btn {
    width: 30px;
    height: 30px;
    font-size: 14px;
    border-radius: 8px;
  }
  .btd6-signin-pill {
    height: 30px;
    padding: 0 7px;
    font-size: 10px;
  }
  .round-big-num {
    font-size: 14px;
  }
}

.intel-mini-link {
  text-decoration: none;
  font-size: 12px;
}

/* Boss Skull HP Bar */
.boss-hud-bar {
  width: min(390px, 38vw);
  background: linear-gradient(180deg, #450a0a 0%, #1f0910 100%);
  border: 3px solid #f87171;
  border-radius: 12px;
  padding: 5px 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.65);
}

.boss-hud-bar.hidden {
  display: none;
}

.boss-hud-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 900;
  color: #fef2f2;
  margin-bottom: 4px;
  gap: 6px;
}

.boss-immunity-pill {
  background: rgba(250, 204, 21, 0.22);
  border: 1px solid #fde047;
  color: #fde047;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
}

.boss-hp-track {
  position: relative;
  height: 12px;
  background: #090d16;
  border: 2px solid #fca5a5;
  border-radius: 999px;
}

.boss-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #dc2626 0%, #f97316 55%, #fde047 100%);
  border-radius: 999px;
}

.skull-marker {
  position: absolute;
  top: -5px;
  transform: translateX(-50%);
  font-size: 13px;
}

/* Floating Top-Right BTD6 HUD: Round Counter + Gear Settings + Profile + Sign In */
.btd6-hud-top-right {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 7px;
}

.btd6-round-box {
  text-align: right;
  margin-right: 4px;
  pointer-events: none;
}

.round-small-label {
  font-size: 10px;
  font-weight: 900;
  color: #e2e8f0;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 3px #000;
}

.round-big-num {
  font-size: 19px;
}

.btd6-wave-forecast-pill {
  margin-top: 2px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.86);
  border: 1.5px solid rgba(56, 189, 248, 0.75);
  color: #e0f2fe;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
}

@media (max-width: 940px) {
  .btd6-wave-forecast-pill {
    font-size: 8px;
    padding: 1px 5px;
  }
}

.btd6-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 2.5px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.45);
  transition: transform 0.1s ease;
}

.btd6-icon-btn:active {
  transform: translateY(2px);
}

.blue-gear-btn {
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
}

.emerald-icon-btn {
  background: linear-gradient(180deg, #4ade80 0%, #16a34a 100%);
}

.gold-icon-btn {
  background: linear-gradient(180deg, #fde047 0%, #ca8a04 100%);
}

.btd6-signin-pill {
  height: 36px;
  padding: 0 11px;
  border-radius: 10px;
  border: 2px solid #fde047;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  color: #fde047;
  font-size: 11.5px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.5);
}

/* Collapsible Interactive Coach Card */
.btd6-coach-toast {
  position: absolute;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  width: min(420px, 88vw);
  background: rgba(15, 23, 42, 0.95);
  border: 2.5px solid #4ade80;
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.72);
}

.btd6-coach-toast.hidden {
  display: none;
}

.coach-toast-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
  color: #fde047;
}

.coach-step-badge {
  background: #22c55e;
  color: #052e16;
  font-size: 10px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 5px;
}

.coach-toast-body {
  font-size: 11px;
  color: #e2e8f0;
  line-height: 1.35;
  margin-top: 4px;
}

.mini-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-weight: 900;
  cursor: pointer;
}

/* ============================================================================
   Floating Bottom-Left Ability Medallions (Exact BTD6 Position!)
   ============================================================================ */
.btd6-abilities-bar {
  position: absolute;
  bottom: 12px;
  left: 14px;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 65%;
}

.ability-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #fde047 0%, #b45309 100%);
  border: 3px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  font-size: 20px;
  color: #ffffff;
  transition: transform 0.12s ease;
}

.ability-btn:hover:not(:disabled) {
  transform: scale(1.08);
}

.ability-btn:disabled {
  filter: grayscale(0.85);
  opacity: 0.65;
  cursor: not-allowed;
}

.ability-cd-tag {
  position: absolute;
  bottom: -5px;
  background: #0f172a;
  border: 1.5px solid #fde047;
  color: #fde047;
  font-size: 9px;
  font-weight: 900;
  padding: 0 4px;
  border-radius: 6px;
}

/* ============================================================================
   Contextual Slide-Out Vertical BTD6 Upgrade Panel (Matches sb_M01 Frame 6!)
   ============================================================================ */
.btd6-upgrade-drawer {
  position: absolute;
  top: 52px;
  bottom: 10px;
  width: 256px;
  z-index: 22;
  background: linear-gradient(180deg, #b88a58 0%, #936639 100%);
  border: 4px solid var(--wood-border);
  border-radius: 16px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.72);
  overflow-y: auto;
}

.btd6-upgrade-drawer.drawer-left {
  left: 10px;
}

.btd6-upgrade-drawer.drawer-right {
  right: 10px;
}

.btd6-upgrade-drawer.hidden {
  display: none;
}

.btd6-drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.drawer-name-banner {
  flex: 1;
  background: var(--wood-dark);
  border: 2px solid #3d2310;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 900;
  color: #ffffff;
  text-transform: uppercase;
  text-shadow: 0 2px 2px #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-close-x {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 2px solid #7f1d1d;
  background: linear-gradient(180deg, #f87171 0%, #dc2626 100%);
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
}

.btd6-drawer-pops-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 1px 2px #000;
  gap: 4px;
  flex-wrap: wrap;
}

.crosspath-chip {
  background: #1e293b;
  border: 1.5px solid #fde047;
  color: #fde047;
  padding: 1px 6px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.buff-badges-row {
  display: inline-flex;
  gap: 3px;
  flex-wrap: wrap;
}

.buff-mini-pill {
  font-size: 9.5px;
  background: #15803d;
  color: #ffffff;
  padding: 1px 5px;
  border-radius: 4px;
}

.btd6-portrait-box {
  background: radial-gradient(circle at 50% 40%, #a3e635 0%, #4d7c0f 100%);
  border: 3px solid var(--wood-dark);
  border-radius: 12px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.btd6-portrait-box img {
  width: 84px;
  height: 84px;
  object-fit: contain;
  border-radius: 10px;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.45));
}

.btd6-target-bar {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 4px;
}

.target-arrow-btn {
  width: 28px;
  height: 24px;
  border-radius: 6px;
  border: 2px solid #14532d;
  background: linear-gradient(180deg, #4ade80 0%, #16a34a 100%);
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.target-label-btn {
  flex: 1;
  height: 24px;
  border-radius: 6px;
  border: 2px solid #3d2310;
  background: #1e293b;
  color: #fde047;
  font-size: 10.5px;
  font-weight: 900;
  cursor: pointer;
  text-transform: uppercase;
}

.btd6-mini-stats {
  font-size: 10px;
  font-weight: 800;
  color: #fef3c7;
  text-align: center;
  text-shadow: 0 1px 2px #000;
}

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

.btd6-bank-row.hidden {
  display: none;
}

/* Purple Upgrade to Paragon Banner inside Drawer */
.btd6-paragon-banner {
  width: 100%;
  padding: 8px;
  border-radius: 10px;
  border: 2.5px solid #e9d5ff;
  background: linear-gradient(180deg, #a855f7 0%, #6b21a8 100%);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.75);
  text-shadow: 0 2px 3px #000;
}

.btd6-paragon-banner.hidden {
  display: none;
}

/* 3 Stacked BTD6 Upgrade Rows */
.btd6-paths-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btd6-upg-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 5px;
  background: #7c4f28;
  border: 2.5px solid #3d2310;
  border-radius: 10px;
  padding: 5px;
  align-items: stretch;
}

.upg-owned-col {
  background: #5c3a21;
  border-radius: 7px;
  padding: 5px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
}

.upg-owned-label {
  font-size: 9.5px;
  font-weight: 900;
  color: #fde68a;
  line-height: 1.15;
}

.tier-pips {
  display: flex;
  gap: 3px;
}

.tier-pip {
  flex: 1;
  height: 7px;
  border-radius: 2px;
  background: #27170c;
  border: 1px solid #111;
}

.tier-pip.filled {
  background: #4ade80;
  box-shadow: 0 0 5px #22c55e;
}

.tier-pip.filled.tier5 {
  background: #fde047;
  box-shadow: 0 0 6px #facc15;
}

.tier-pip.locked {
  background: #451a03;
}

.upg-buy-btn {
  border-radius: 8px;
  border: 2.5px solid #14532d;
  background: linear-gradient(180deg, #4ade80 0%, #16a34a 100%);
  color: #ffffff;
  padding: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  text-shadow: 0 1.5px 2px rgba(0, 0, 0, 0.8);
  box-shadow: 0 3px 0 #14532d;
}

.upg-buy-btn:disabled {
  background: linear-gradient(180deg, #64748b 0%, #475569 100%);
  border-color: #334155;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.85;
}

.upg-buy-btn.locked-plate {
  background: #4a2e16;
  border-color: #291809;
  color: #d6bc9c;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.upg-buy-name {
  font-size: 10.5px;
  font-weight: 900;
  line-height: 1.15;
}

.upg-buy-cost {
  font-size: 12px;
  font-weight: 900;
  color: #fef08a;
  margin-top: 2px;
}

.upg-buy-desc {
  font-size: 8.8px;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 2px;
  line-height: 1.15;
}

.btd6-sell-footer {
  margin-top: auto;
  padding-top: 4px;
}

.btd6-sell-btn {
  width: 100%;
  padding: 7px;
  border-radius: 9px;
  border: 2.5px solid #7f1d1d;
  background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  text-shadow: 0 1.5px 2px #000;
  box-shadow: 0 3px 0 #7f1d1d;
}

.btd6-sell-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ============================================================================
   Right-Hand Iconic BTD6 Wooden 2-Column Tower Sidebar (Matches sb_M01–sb_M10!)
   ============================================================================ */
.btd6-right-sidebar {
  background: linear-gradient(180deg, #9c6b3b 0%, #7a4f25 100%);
  border-left: 4px solid var(--wood-border);
  padding: 7px 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100dvh;
  z-index: 25;
  box-shadow: -6px 0 20px rgba(0, 0, 0, 0.55);
}

.btd6-upgrades-top-btn {
  width: 100%;
  padding: 6px;
  border-radius: 9px;
  border: 2.5px solid #14532d;
  background: linear-gradient(180deg, #65d643 0%, #229a1b 100%);
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.05em;
  cursor: pointer;
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.65);
  box-shadow: 0 3px 0 #14532d;
}

.btd6-shop-selected-banner {
  background: var(--wood-dark);
  border: 2px solid var(--wood-border);
  border-radius: 7px;
  padding: 3px 5px;
  text-align: center;
  font-size: 10px;
  font-weight: 900;
  color: #fef3c7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btd6-cat-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 3px;
}

.cat-dot {
  padding: 3px 0;
  border-radius: 6px;
  border: 1.5px solid var(--wood-border);
  background: #5c3a21;
  color: #fde68a;
  font-size: 9.5px;
  font-weight: 900;
  cursor: pointer;
}

.cat-dot.active {
  border-color: #ffffff;
  box-shadow: 0 0 0 1.5px #fde047;
  background: #b45309;
  color: #ffffff;
}

/* 2-Column Color-Coded Square Tower Portrait Grid */
.btd6-shop-grid-2col {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  padding: 2px 3px 4px 2px;
  align-content: start;
  scrollbar-width: thin;
  scrollbar-color: #d97706 #4a2e16;
}

.btd6-shop-grid-2col::-webkit-scrollbar {
  width: 5px;
}

.btd6-shop-grid-2col::-webkit-scrollbar-track {
  background: #4a2e16;
  border-radius: 99px;
}

.btd6-shop-grid-2col::-webkit-scrollbar-thumb {
  background: #f59e0b;
  border-radius: 99px;
}

.btd6-tower-tile {
  aspect-ratio: 1 / 1.12;
  border-radius: 11px;
  border: 2.5px solid rgba(255, 255, 255, 0.65);
  padding: 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  cursor: grab;
  position: relative;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.38);
  transition: transform 0.1s ease;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.btd6-tower-tile:hover:not(.disabled-tile) {
  transform: translateY(-2px);
  border-color: #fde047;
}

.btd6-tower-tile.selected-tile {
  border-color: #ffffff;
  box-shadow: 0 0 0 3px #4ade80, 0 4px 10px rgba(0, 0, 0, 0.5);
}

.btd6-tower-tile.disabled-tile {
  opacity: 0.42;
  filter: grayscale(0.7);
  cursor: not-allowed;
}

/* Authentic BTD6 Category Tile Gradients! */
.tile-cat-Hero {
  background: linear-gradient(180deg, #2dd4bf 0%, #0f766e 100%);
  border-color: #fde047;
}

.tile-cat-Primary {
  background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
}

.tile-cat-Military {
  background: linear-gradient(180deg, #86efac 0%, #16a34a 100%);
}

.tile-cat-Magic {
  background: linear-gradient(180deg, #c084fc 0%, #7e22ce 100%);
}

.tile-cat-Support {
  background: linear-gradient(180deg, #fdba74 0%, #d97706 100%);
}

.btd6-tower-tile img {
  width: 88%;
  height: 76%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.55));
}

.tile-short-name {
  display: none;
}

.tile-cost-label {
  font-size: 11px;
  font-weight: 900;
  color: #ffffff;
  text-shadow:
    -1.5px -1.5px 0 #111827,
    1.5px -1.5px 0 #111827,
    -1.5px 1.5px 0 #111827,
    1.5px 1.5px 0 #111827;
  line-height: 1;
}

.tile-cost-label.cant-afford {
  color: #fca5a5;
}

/* Bottom Powers + Giant Green Play/Fast-Forward Dock */
.btd6-sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 4px;
  border-top: 2px solid var(--wood-border);
}

.btd6-bottom-main-btns {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 6px;
}

.btd6-powers-btn {
  height: 50px;
  border-radius: 12px;
  border: 3px solid #ffffff;
  background: linear-gradient(180deg, #fde047 0%, #eab308 100%);
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 0 #a16207;
}

.btd6-play-btn {
  height: 50px;
  border-radius: 12px;
  border: 3px solid #ffffff;
  background: linear-gradient(180deg, #65d643 0%, #1ea318 100%);
  color: #ffffff;
  font-size: 26px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 #14532d;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.55);
}

.btd6-bottom-mini-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
}

.mini-dock-pill {
  padding: 3px 2px;
  border-radius: 6px;
  border: 1.5px solid var(--wood-border);
  background: var(--wood-dark);
  color: #fef3c7;
  font-size: 9px;
  font-weight: 900;
  cursor: pointer;
  text-align: center;
}

.boss-mini-pill {
  background: #7f1d1d;
  color: #fecaca;
}

/* ============================================================================
   Glossy BTD6 Buttons & Exact "UPGRADE TO PARAGON" Cash Slider Modal
   ============================================================================ */
.btd6-glossy-btn {
  padding: 8px 16px;
  border-radius: 10px;
  border: 2.5px solid #ffffff;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-shadow: 0 1.5px 2px rgba(0, 0, 0, 0.7);
}

.green-btn {
  background: linear-gradient(180deg, #65d643 0%, #1ea318 100%);
  box-shadow: 0 3px 0 #14532d;
}

.yellow-btn {
  background: linear-gradient(180deg, #facc15 0%, #d97706 100%);
  box-shadow: 0 3px 0 #92400e;
}

.blue-btn {
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  box-shadow: 0 3px 0 #075985;
}

.red-btn {
  background: linear-gradient(180deg, #f87171 0%, #dc2626 100%);
  box-shadow: 0 3px 0 #7f1d1d;
}

/* Exact BTD6 Paragon Cash Slider Modal (`sb_M01` Frame 2!) */
.btd6-paragon-modal {
  width: min(520px, 94vw);
  background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 100%);
  border: 4px solid #bfdbfe;
  border-radius: 20px;
  padding: 22px 20px 18px;
  text-align: center;
  position: relative;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
}

.paragon-emblem-badge {
  width: 64px;
  height: 64px;
  margin: -50px auto 8px;
  border-radius: 16px;
  background: radial-gradient(circle, #a855f7 0%, #4c1d95 100%);
  border: 3px solid #e9d5ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  box-shadow: 0 6px 18px rgba(76, 29, 149, 0.8);
}

.paragon-ribbon-title {
  background: linear-gradient(90deg, #7e22ce 0%, #a855f7 50%, #7e22ce 100%);
  border: 2px solid #f3e8ff;
  border-radius: 10px;
  padding: 6px 18px;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.05em;
  display: inline-block;
  margin-bottom: 10px;
  text-shadow: 0 2px 3px #000;
}

.paragon-modal-desc {
  font-size: 12.5px;
  font-weight: 700;
  color: #eff6ff;
  line-height: 1.4;
  margin-bottom: 14px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.paragon-slider-box {
  background: rgba(15, 23, 42, 0.42);
  border: 2px solid rgba(191, 219, 254, 0.5);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
}

.paragon-slider-label {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 800;
  margin-bottom: 8px;
}

.paragon-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.paragon-slider-row input[type="range"] {
  flex: 1;
  accent-color: #fde047;
  height: 8px;
}

.coin-tag {
  font-weight: 900;
  color: #fde047;
  font-size: 13px;
  min-width: 90px;
  text-align: left;
}

.paragon-cost-pill {
  display: inline-block;
  background: #7e22ce;
  border: 2px solid #e9d5ff;
  border-radius: 999px;
  padding: 5px 18px;
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 14px;
}

.paragon-modal-btns {
  display: flex;
  justify-content: center;
  gap: 16px;
}

/* ============================================================================
   Modals, Insta-Monkey Rework Grid, Map Carousel & League Tables
   ============================================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.82);
  backdrop-filter: blur(7px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

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

.modal-dialog {
  background: linear-gradient(180deg, #172554 0%, #0f172a 100%);
  border: 3px solid #60a5fa;
  border-radius: 20px;
  width: 100%;
  max-width: 980px;
  max-height: 90dvh;
  overflow-y: auto;
  padding: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid rgba(148, 163, 184, 0.25);
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.modal-title {
  font-size: 18px;
  font-weight: 900;
  color: #fde047;
  text-shadow: 0 2px 3px #000;
}

.hub-nav-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.hub-tab {
  padding: 7px 13px;
  border-radius: 10px;
  border: 2px solid #3b82f6;
  background: #1e3a8a;
  color: #dbeafe;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.hub-tab.active {
  background: linear-gradient(180deg, #fde047 0%, #eab308 100%);
  border-color: #ffffff;
  color: #0f172a;
}

.select-ctrl {
  background: #0f172a;
  border: 2px solid #60a5fa;
  border-radius: 8px;
  padding: 6px 10px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.modal-section-heading {
  font-size: 13px;
  color: #fde047;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.oracle-modal-box,
.auth-card-box {
  background: rgba(30, 41, 59, 0.85);
  border: 2px solid rgba(250, 204, 21, 0.45);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.auth-card-box {
  display: block;
}

.medal-grid,
.ct-hex-grid,
.mk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

/* Update 57 Insta-Monkey Collection 6-Column Grid (`sb_M06` / `sb_M07`!) */
.insta-collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.insta-tile-card {
  background: radial-gradient(circle at 50% 35%, #3b82f6 0%, #1d4ed8 70%, #1e3a8a 100%);
  border: 3px solid #93c5fd;
  border-radius: 14px;
  padding: 10px 8px 8px;
  text-align: center;
  position: relative;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35), 0 5px 0 #0f172a;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.insta-tile-card:hover {
  transform: translateY(-2px);
  border-color: #fde047;
}

.insta-tile-card.tier-gold {
  border-color: #fde047;
  box-shadow: inset 0 2px 0 rgba(253, 224, 71, 0.5), 0 5px 0 #713f12;
}

.insta-count-badge {
  position: absolute;
  top: -7px;
  right: -6px;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 2px solid #fde047;
  color: #fde047;
  font-size: 10px;
  font-weight: 900;
  border-radius: 999px;
  padding: 1px 7px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.65);
}

/* BTD6 Visual Map Selector Cards (`sb_M07` & `sb_M09`!) */
.btd6-town-ribbon {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, #7c4f28 0%, #5c3a21 100%);
  border: 3px solid #3d2310;
  border-radius: 14px;
  padding: 8px 12px;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.btd6-map-carousel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.btd6-map-card {
  background: linear-gradient(180deg, #9c6b3b 0%, #6e4720 100%);
  border: 3.5px solid #3d2310;
  border-radius: 16px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  box-shadow: 0 6px 0 #27170c, 0 10px 20px rgba(0, 0, 0, 0.55);
  position: relative;
}

.btd6-map-card.medal-black {
  background: linear-gradient(180deg, #1e293b 0%, #090d16 100%);
  border-color: #fde047;
  box-shadow: 0 0 0 2px #050811, 0 6px 18px rgba(250, 204, 21, 0.35);
}

.btd6-map-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9.6;
  border-radius: 10px;
  overflow: hidden;
  border: 2.5px solid #3d2310;
  background: #0f172a;
}

.btd6-map-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.btd6-map-diff-tag {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(15, 23, 42, 0.88);
  border: 1.5px solid #fde047;
  color: #fde047;
  font-size: 9.5px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
}

.btd6-map-medals-strip {
  position: absolute;
  bottom: 5px;
  right: 6px;
  display: flex;
  gap: 3px;
  background: rgba(15, 23, 42, 0.82);
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 11px;
}

/* Update 57 Insta-Monkey Split Screen (`sb_M09.jpg`: Left Map Challenge + Right Insta Store) */
.btd6-insta-split-top {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 12px;
  margin-bottom: 14px;
}

@media (max-width: 760px) {
  .btd6-insta-split-top {
    grid-template-columns: 1fr;
  }
}

.btd6-map-challenge-box {
  background: linear-gradient(180deg, #9c6b3b 0%, #6e4720 100%);
  border: 3.5px solid #3d2310;
  border-radius: 16px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  box-shadow: 0 5px 0 #27170c;
}

.btd6-insta-store-box {
  background: linear-gradient(180deg, #4c1d95 0%, #2e1065 100%);
  border: 3.5px solid #c084fc;
  border-radius: 16px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  box-shadow: 0 5px 0 #1e1b4b;
}

.insta-quest-row {
  background: linear-gradient(90deg, #581c87 0%, #3b0764 100%);
  border: 2px solid #a855f7;
  border-radius: 12px;
  padding: 6px 10px;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 10px;
}

.insta-quest-progress-bar {
  height: 7px;
  background: #1e1b4b;
  border: 1px solid #c084fc;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}

.insta-quest-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4ade80 0%, #fde047 100%);
}

/* Visual Constellation Monkey Knowledge Tech Tree (`5.jpg` from ninjakiwi.com!) */
.btd6-mk-constellation-wrap {
  background:
    radial-gradient(circle at 20% 25%, rgba(168, 85, 247, 0.28) 0%, transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(56, 189, 248, 0.24) 0%, transparent 50%),
    linear-gradient(180deg, #2e1065 0%, #1e1b4b 52%, #0f172a 100%);
  border: 3.5px solid #a855f7;
  border-radius: 18px;
  padding: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.65);
}

.mk-tree-columns {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

@media (max-width: 780px) {
  .mk-tree-columns {
    grid-template-columns: repeat(3, 1fr);
  }
}

.mk-tree-col {
  background: rgba(15, 23, 42, 0.55);
  border: 2px solid rgba(192, 132, 252, 0.4);
  border-radius: 14px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.mk-constellation-node {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #475569 0%, #1e293b 100%);
  border: 3px solid #94a3b8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  transition: transform 0.12s ease;
}

.mk-constellation-node:hover {
  transform: scale(1.08);
}

.mk-constellation-node.unlocked {
  background: radial-gradient(circle at 35% 30%, #38bdf8 0%, #1d4ed8 70%, #1e3a8a 100%);
  border-color: #fde047;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.75), 0 0 4px #fde047;
}

.mk-node-check {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #ffffff;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mk-connector-arrow {
  color: #38bdf8;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 6px #38bdf8;
}

.medal-card,
.ct-hex-card,
.mk-node-card {
  background: rgba(30, 41, 59, 0.9);
  border: 2px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  padding: 11px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 7px;
}

.medal-card.medal-black {
  border-color: #fde047;
  background: linear-gradient(135deg, #050811 0%, #1e293b 100%);
}

.mk-node-card.unlocked {
  border-color: #4ade80;
  background: rgba(22, 163, 74, 0.16);
}

.genome-bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.genome-item {
  background: rgba(30, 41, 59, 0.85);
  border: 1.5px solid rgba(148, 163, 184, 0.3);
  border-radius: 10px;
  padding: 10px;
}

.genome-bar-track {
  height: 8px;
  background: rgba(15, 23, 42, 0.8);
  border-radius: 999px;
  margin-top: 6px;
  overflow: hidden;
}

.genome-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #fde047 0%, #22c55e 100%);
}

.passport-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.passport-card {
  background: rgba(30, 41, 59, 0.85);
  border: 1.5px solid rgba(250, 204, 21, 0.4);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 11px;
  text-decoration: none;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  text-align: left;
}

.leaderboard-table th {
  color: #fde047;
  font-size: 11px;
  text-transform: uppercase;
}

.toast-banner {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.95);
  border: 2.5px solid #fde047;
  color: #ffffff;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  z-index: 250;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.75);
  pointer-events: none;
}

.toast-banner.hidden {
  display: none;
}

[hidden] {
  display: none !important;
}

/* ============================================================================
   BTD6 Placement Confirm Bar, Slide-Out Powers Tray & Duolingo Wave Hint Pill
   ============================================================================ */
.btd6-placement-confirm-bar {
  position: absolute;
  top: 46px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 28;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.94);
  border: 2.5px solid #4ade80;
  border-radius: 999px;
  padding: 5px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.72);
  white-space: nowrap;
}

.btd6-placement-confirm-bar.hidden {
  display: none;
}

.placement-confirm-title {
  font-size: 11.5px;
  font-weight: 900;
  color: #fde047;
}

.btd6-powers-drawer {
  position: absolute;
  top: 52px;
  bottom: 10px;
  right: 10px;
  width: 244px;
  z-index: 26;
  background: linear-gradient(180deg, #9c6b3b 0%, #6e4720 100%);
  border: 4px solid var(--wood-border);
  border-radius: 16px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.78);
  overflow-y: auto;
}

.btd6-powers-drawer.hidden {
  display: none;
}

.btd6-powers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  flex: 1;
}

.power-quick-tile {
  background: radial-gradient(circle at 50% 35%, #facc15 0%, #d97706 100%);
  border: 2.5px solid #fef08a;
  border-radius: 11px;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: #ffffff;
  box-shadow: 0 3px 0 #78350f;
}

.power-quick-tile:hover {
  transform: translateY(-2px);
  border-color: #ffffff;
}

.power-quick-name {
  font-size: 9.5px;
  font-weight: 900;
  text-shadow: 0 1.5px 2px #000;
}

.power-quick-cost {
  font-size: 9px;
  font-weight: 900;
  background: rgba(15, 23, 42, 0.85);
  color: #fde047;
  padding: 1px 6px;
  border-radius: 999px;
}

.btd6-wave-hint-pill {
  position: absolute;
  top: 44px;
  left: 14px;
  z-index: 15;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(9, 13, 22, 0.84);
  border: 1.5px solid rgba(56, 189, 248, 0.75);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 10.5px;
  font-weight: 800;
  color: #e0f2fe;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.55);
  max-width: calc(100% - 28px);
}

.hint-mini-btn {
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  border: 1.5px solid #bae6fd;
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.coop-mini-btn {
  background: linear-gradient(180deg, #4ade80 0%, #16a34a 100%);
  border-color: #bbf7d0;
}

@media (max-width: 720px) {
  .btd6-wave-hint-pill {
    display: none;
  }
}

@media (max-height: 500px) {
  .btd6-wave-hint-pill {
    display: none;
  }
}

/* ============================================================================
   1:1 Clean BTD6 Battlefield Stage Overrides (Matches sb_M01–sb_M06!)
   ============================================================================ */
.btd6-stage #crisisIntelBanner {
  display: none;
}

/* ============================================================================
   4-Studio Council HUD Strip: Docked Cleanly at Bottom-Center of Battlefield!
   ============================================================================ */
.sovereign-hud-strip {
  position: absolute;
  bottom: 6px;
  top: auto;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  max-width: calc(100% - 16px);
  overflow-x: auto;
  scrollbar-width: none;
  pointer-events: auto;
  z-index: 16;
  background: rgba(5, 8, 17, 0.62);
  border: 1.5px solid rgba(250, 204, 21, 0.42);
  border-radius: 999px;
  padding: 2.5px 8px;
  backdrop-filter: blur(5px);
}
.sovereign-hud-strip::-webkit-scrollbar {
  display: none;
}

#selectQuickRoundJump {
  max-width: 128px;
  text-overflow: ellipsis;
}

.macro-wire-pill {
  display: none;
}

.era-pill-badge {
  background: linear-gradient(180deg, #1e3a8a 0%, #0f172a 100%);
  border: 2px solid #fde047;
  color: #fde047;
  font-size: 10.5px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
  white-space: nowrap;
}

.era-pill-badge:hover {
  border-color: #ffffff;
  transform: translateY(-1px);
}

.streak-pill-badge {
  background: rgba(15, 23, 42, 0.88);
  border: 1.5px solid #fb923c;
  color: #ffedd5;
  font-size: 10px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
  cursor: pointer;
}

.vault-chests-inline {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.vault-chest-pill {
  background: linear-gradient(180deg, #4c1d95 0%, #2e1065 100%);
  border: 1.5px solid #c084fc;
  color: #f3e8ff;
  font-size: 10px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.1s ease, opacity 0.15s ease;
}

.vault-chest-pill:hover:not(:disabled) {
  border-color: #fde047;
  color: #fde047;
  transform: translateY(-1px);
}

.vault-chest-pill.claimed-chest,
.vault-chest-pill:disabled {
  opacity: 0.5;
  border-color: #4ade80;
  cursor: default;
}

.macro-wire-pill {
  background: rgba(5, 8, 17, 0.84);
  border: 1.5px solid rgba(56, 189, 248, 0.55);
  color: #bae6fd;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  max-width: 390px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.codex-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  max-height: 62dvh;
  overflow-y: auto;
  padding-right: 4px;
}

body.reduced-motion *,
body.reduced-motion *::before,
body.reduced-motion *::after {
  animation-duration: 0.001ms !important;
  transition-duration: 0.001ms !important;
}

@media (max-width: 720px) {
  .btd6-game-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) 228px;
    width: 100vw;
    max-width: 100vw;
    overflow: hidden;
  }
  .btd6-stage {
    min-width: 0;
    max-width: 100vw;
  }
  .btd6-right-sidebar {
    height: 228px;
    min-width: 0;
    max-width: 100vw;
    border-left: none;
    border-top: 4px solid var(--wood-border);
    padding: 4px 8px;
    gap: 4px;
    overflow: hidden;
  }
  .btd6-upgrades-top-btn,
  .btd6-shop-selected-banner {
    display: none;
  }
  .btd6-shop-grid-2col {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }
  .btd6-tower-tile {
    aspect-ratio: 1 / 0.96;
    padding: 2px;
    border-radius: 8px;
    min-width: 0;
  }
  .btd6-tower-tile img {
    width: 74%;
    height: 64%;
  }
  .tile-cost-label {
    font-size: 9.5px;
  }
  .btd6-sidebar-bottom {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding-top: 2px;
  }
  .btd6-bottom-main-btns {
    grid-template-columns: 38px 84px;
    gap: 4px;
  }
  .btd6-powers-btn,
  .btd6-play-btn {
    height: 34px;
    font-size: 17px;
  }
  .btd6-bottom-mini-row {
    flex: 1;
    margin-left: 6px;
  }
  .btd6-hud-top-left {
    top: 6px;
    left: 6px;
    max-width: none;
    flex-wrap: nowrap;
    gap: 5px;
  }
  .btd6-stat-cluster {
    gap: 2px;
  }
  .btd6-stat-icon {
    font-size: 13px;
  }
  .btd6-outlined-num {
    font-size: 12.5px;
  }
  .btd6-wave-forecast-pill {
    display: none;
  }
  .btd6-hud-top-right {
    gap: 3px;
    right: 6px;
    top: 6px;
  }
  .btd6-hud-top-right #btnToggleMute,
  .btd6-hud-top-right #btnToggleReducedMotion {
    display: none;
  }
  .btd6-round-box {
    display: block;
    margin-right: 2px;
  }
  .round-small-label {
    font-size: 7.5px;
  }
  .round-big-num {
    font-size: 11.5px;
  }
  .btd6-icon-btn {
    width: 24px;
    height: 24px;
    font-size: 11px;
    border-radius: 6px;
  }
  .btd6-signin-pill {
    height: 24px;
    padding: 0 5px;
    font-size: 9px;
  }
  .btd6-hud-top-center {
    top: 34px;
    left: 6px;
    transform: none;
    align-items: flex-start;
    max-width: 95vw;
  }
  .sovereign-hud-strip {
    top: auto;
    bottom: 6px;
    width: calc(100% - 12px);
    max-width: 96vw;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px;
    padding: 3px 6px;
    border-radius: 12px;
  }
  .era-pill-badge,
  .streak-pill-badge,
  .vault-chest-pill {
    font-size: 8.5px;
    padding: 2px 5px;
  }
  #selectQuickRoundJump {
    max-width: 102px;
  }
  .macro-wire-pill {
    display: none;
  }
}

/* Mobile Landscape (e.g. 844x390 iPhone Pro Landscape) */
@media (max-height: 500px) {
  .btd6-hud-top-left {
    top: 5px;
    left: 8px;
    gap: 6px;
    flex-wrap: nowrap;
    max-width: none;
  }
  .btd6-stat-icon {
    font-size: 15px;
  }
  .btd6-outlined-num {
    font-size: 14px;
  }
  .btd6-wave-forecast-pill {
    display: none;
  }
  .btd6-hud-top-right {
    top: 5px;
    right: 8px;
    gap: 4px;
  }
  .btd6-icon-btn {
    width: 26px;
    height: 26px;
    font-size: 12px;
    border-radius: 7px;
  }
  .btd6-signin-pill {
    height: 26px;
    padding: 0 7px;
    font-size: 9.5px;
  }
  .round-big-num {
    font-size: 13px;
  }
  .sovereign-hud-strip {
    top: auto;
    bottom: 5px;
    padding: 2px 8px;
    gap: 4px;
  }
  .era-pill-badge,
  .streak-pill-badge,
  .vault-chest-pill {
    font-size: 8.5px;
    padding: 1.5px 5px;
  }
}

/* ============================================================================
   v7.0 5-Studio Additions:
   - Global .hidden helper
   - BTD6 Drop & Lock Placement Confirm Bar (#placementConfirmBar)
   - Slide-Out BTD6 Instant Powers Drawer (#powersQuickDrawer)
   - Duolingo Wave Threat Hint + 1-Tap Counter + Among Us Co-Op Pill (#waveThreatHintBanner)
   ============================================================================ */
.hidden {
  display: none !important;
}

.btd6-placement-confirm-bar {
  position: absolute;
  bottom: 52px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 28;
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(9, 13, 22, 0.98) 100%);
  border: 2.5px solid #4ade80;
  border-radius: 999px;
  padding: 5px 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.75);
  white-space: nowrap;
}

.placement-confirm-title {
  font-size: 11.5px;
  font-weight: 900;
  color: #f8fafc;
  text-shadow: 0 1px 2px #000;
}

.btd6-powers-drawer {
  position: absolute;
  top: 50px;
  bottom: auto !important;
  height: auto !important;
  right: 10px;
  width: 230px;
  max-height: calc(100% - 104px);
  overflow-y: auto;
  z-index: 29;
  background: linear-gradient(180deg, var(--wood-mid) 0%, var(--wood-dark) 100%);
  border: 3px solid var(--wood-border);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btd6-powers-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  flex: 0 0 auto !important;
}

.btd6-power-tile {
  background: radial-gradient(circle at 50% 35%, #fef3c7 0%, #f59e0b 100%);
  border: 2px solid #78350f;
  border-radius: 10px;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  color: #0f172a;
  font-weight: 900;
  transition: transform 0.1s ease, border-color 0.12s ease;
}

.btd6-power-tile:hover {
  transform: translateY(-1px);
  border-color: #ffffff;
}

.power-tile-emoji {
  font-size: 18px;
  line-height: 1.1;
}

.power-tile-name {
  font-size: 9.5px;
  font-weight: 900;
  text-align: center;
  line-height: 1.1;
  color: #1e293b;
}

.power-tile-cost {
  font-size: 9.5px;
  font-weight: 900;
  color: #fef08a;
  background: rgba(15, 23, 42, 0.85);
  padding: 1px 6px;
  border-radius: 999px;
}

.btd6-wave-hint-pill {
  position: absolute;
  top: 8px !important;
  bottom: auto !important;
  height: auto !important;
  left: 39% !important;
  transform: translateX(-50%);
  z-index: 15;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(15, 23, 42, 0.88);
  border: 1.5px solid rgba(56, 189, 248, 0.72);
  border-radius: 999px;
  padding: 3px 9px;
  max-width: min(430px, 35vw);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  backdrop-filter: blur(5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.55);
}

#waveHintText {
  font-size: 10.5px;
  font-weight: 800;
  color: #e0f2fe;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hint-mini-btn {
  background: linear-gradient(180deg, #fde047 0%, #eab308 100%);
  border: 1.5px solid #ffffff;
  color: #0f172a;
  font-size: 9.5px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.coop-mini-btn {
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
  color: #ffffff;
}

.btd6-tower-tile.btd6-counter-highlight {
  border-color: #fde047 !important;
  box-shadow: 0 0 0 3px #fde047, 0 0 16px rgba(250, 204, 21, 0.95) !important;
  transform: scale(1.04);
}

@media (max-width: 720px) {
  .btd6-wave-hint-pill {
    top: 34px !important;
    bottom: auto !important;
    left: 6px !important;
    transform: none !important;
    padding: 2px 7px;
    gap: 4px;
    max-width: calc(100% - 12px);
  }
  #waveHintText {
    font-size: 9px;
    max-width: 52vw;
  }
  .hint-mini-btn {
    font-size: 8.5px;
    padding: 1.5px 5px;
  }
  .btd6-placement-confirm-bar {
    bottom: 80px;
    padding: 4px 9px;
    gap: 5px;
  }
  .placement-confirm-title {
    font-size: 9.5px;
  }
  .btd6-powers-drawer {
    top: 38px;
    right: 6px;
    width: 196px;
    max-height: calc(100% - 92px);
  }
}

@media (max-height: 500px) {
  .btd6-wave-hint-pill {
    top: 34px !important;
    bottom: auto !important;
    left: 8px !important;
    transform: none !important;
    padding: 2px 8px;
    max-width: 56vw;
  }
  #waveHintText {
    font-size: 9.5px;
    max-width: 34vw;
  }
}
