/* Snack Squad: Polished 2D Casual Defense Game UI Theme */
:root {
  --ink: #3e221c;
  --ink-soft: #6b4539;
  --outline: #3d211a;
  --paper: #fff8e8;
  --paper-warm: #f7e4c3;
  --wood-light: #f3d7b0;
  --wood-mid: #dfba8b;
  --wood-dark: #b88758;
  --coral: #ff6b6b;
  --gold: #ffbe3b;
  --mint: #5cd679;
  --purple: #9b6dff;
}

html, body {
  background: #1e1412;
  color: var(--ink);
  font-family: "Jua", "BM JUA", "NanumSquareRound", "Pretendard", "Malgun Gothic", "Segoe UI", sans-serif;
  letter-spacing: -0.2px;
}

button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px #ffe169, 0 5px 0 var(--outline);
}

#viewport {
  background: radial-gradient(ellipse at 50% 20%, #4b3830 0%, #1c1311 80%);
}

#game {
  border: 5px solid var(--outline);
  border-radius: 26px;
  box-shadow:
    0 14px 0 #24130f,
    0 28px 70px rgba(0, 0, 0, 0.65),
    inset 0 0 0 3px #ffe9bf;
  background: #fff2d8;
}

.vignette {
  box-shadow: inset 0 0 55px rgba(61, 33, 26, 0.18);
}

/* ==================== TOP HUD ==================== */
#hud {
  top: 16px;
  left: 22px;
  right: 22px;
}

.hud-panel {
  border: 3.5px solid var(--outline);
  background: linear-gradient(180deg, #fffef9 0%, #fcebc9 100%);
  border-radius: 20px;
  box-shadow:
    0 6px 0 var(--outline),
    0 10px 18px rgba(45, 22, 15, 0.25),
    inset 0 3px 0 #ffffff;
  color: var(--ink);
}

.health-panel {
  width: 346px;
  height: 74px;
  padding: 8px 16px 10px;
  gap: 12px;
}

.heart-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(180deg, #ff7b89 0%, #e63950 100%);
  border: 3px solid var(--outline);
  box-shadow: 0 3px 0 var(--outline), inset 0 2px 0 #ffb8c0;
  color: #fff;
  font-size: 31px;
  text-shadow: 0 2px 0 #8f1d2c;
  flex-shrink: 0;
}

.health-copy b {
  font-size: 18px;
  font-weight: 900;
  color: var(--ink);
}

.health-copy strong {
  font-size: 22px;
  font-weight: 900;
  color: #c92a3e;
  text-shadow: 0 1px 0 #fff;
}

.health-copy strong span {
  font-size: 14px;
  color: #876355;
}

.meter {
  height: 15px;
  border: 2.5px solid var(--outline);
  border-radius: 99px;
  background: #3b201b;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
  padding: 1px;
}

.meter i {
  background: linear-gradient(180deg, #ff9ca8 0%, #ff4d63 45%, #d92b44 100%);
  border-radius: 99px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.55);
}

.wave-panel {
  width: 380px;
  padding: 8px 20px 11px;
  background: linear-gradient(180deg, #fffdf6 0%, #fae3b4 100%);
}

.wave-text .tiny {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 2.5px;
  font-weight: 900;
  color: #b56527;
  margin-bottom: 2px;
}

.wave-text strong {
  font-size: 24px;
  font-weight: 900;
  color: var(--ink);
  text-shadow: 0 1px 0 #fff;
}

.wave-text strong b {
  font-size: 28px;
  color: #d95b26;
}

.wave-text small {
  font-size: 16px;
  color: #825c4a;
  font-weight: 800;
}

.wave-text > span:last-child {
  font-size: 12px;
  font-weight: 900;
  color: #fff;
  background: #593529;
  padding: 3px 10px;
  border-radius: 99px;
}

.wave-meter {
  height: 10px;
  border: 2px solid var(--outline);
  background: #3b201b;
  border-radius: 99px;
  margin-top: 6px;
  padding: 1px;
}

.wave-meter i {
  background: linear-gradient(90deg, #74dc65, #ffd24c);
  border-radius: 99px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.6);
}

.hud-right {
  gap: 8px;
}

.gold-panel {
  height: 58px;
  min-width: 155px;
  padding: 6px 16px;
  background: linear-gradient(180deg, #fffdf4 0%, #fde4a6 100%);
}

.gold-panel strong {
  font-size: 29px;
  font-weight: 900;
  color: var(--ink);
  text-shadow: 0 2px 0 #fff;
}

.coin-icon {
  width: 34px;
  height: 34px;
  border: 2.5px solid var(--outline);
  background: linear-gradient(135deg, #fff59e 0%, #ffc830 55%, #e68a12 100%);
  color: var(--outline);
  box-shadow: 0 2px 0 var(--outline), inset 0 2px 0 #fffbe0;
  font-size: 18px;
  font-weight: 900;
}

.coin-icon.small {
  width: 26px;
  height: 26px;
  font-size: 14px;
  border-width: 2px;
}

.square-btn {
  width: 52px;
  height: 56px;
  border: 3px solid var(--outline);
  border-radius: 16px;
  background: linear-gradient(180deg, #fffef8 0%, #f7dcb0 100%);
  box-shadow:
    0 5px 0 var(--outline),
    0 8px 14px rgba(45, 22, 15, 0.22),
    inset 0 3px 0 #ffffff;
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
  transition: transform 0.1s, filter 0.1s, box-shadow 0.1s;
}

.square-btn:hover {
  background: linear-gradient(180deg, #ffffff 0%, #ffe6b8 100%);
  transform: translateY(-2px);
  box-shadow: 0 7px 0 var(--outline), inset 0 3px 0 #ffffff;
}

.square-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--outline), inset 0 2px 0 #ffffff;
}

#sound, #bgm-toggle {
  width: 50px;
}

.chapter-label {
  top: 102px;
  left: 24px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: var(--ink);
  background: linear-gradient(180deg, #fffdf5, #f7e2bc);
  border: 2.5px solid var(--outline);
  box-shadow: 0 4px 0 var(--outline);
  padding: 6px 13px;
  border-radius: 99px;
}

.chapter-label i {
  width: 9px;
  height: 9px;
  background: #48bf65;
  border: 1.5px solid var(--outline);
}

.chapter-label span {
  color: #b85b28;
  font-weight: 900;
  margin-left: 6px;
}

#build-status {
  top: 102px;
  right: 24px;
  background: linear-gradient(180deg, #fffdf5, #f5dec0);
  border: 2.5px solid var(--outline);
  box-shadow: 0 4px 0 var(--outline);
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 13px;
  color: #6b3fa0;
  font-weight: 900;
}

#relic-list i {
  filter: drop-shadow(0 1px 0 var(--outline));
}

/* ==================== SIDE TACTICAL PANELS ==================== */
#command-panel {
  top: 148px;
  left: 24px;
  width: 214px;
  padding: 12px;
  background: linear-gradient(180deg, #fffaf0 0%, #f2d9b3 100%);
  border: 3px solid var(--outline);
  box-shadow:
    0 6px 0 var(--outline),
    0 12px 22px rgba(45, 22, 15, 0.25),
    inset 0 3px 0 #ffffff;
  border-radius: 20px;
}

.command-title {
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.command-title b {
  font-size: 22px;
  font-weight: 900;
  color: #2c8a4b;
  text-shadow: 0 1px 0 #fff;
}

.energy-meter {
  height: 10px;
  border: 2px solid var(--outline);
  background: #381f1a;
  border-radius: 99px;
  margin: 5px 0 10px;
  padding: 1px;
}

.energy-meter i {
  background: linear-gradient(90deg, #4cd98c, #ffd449);
  border-radius: 99px;
}

#command-panel button {
  border: 2.5px solid var(--outline);
  border-radius: 13px;
  padding: 8px 10px;
  margin-top: 8px;
  color: var(--ink);
  box-shadow: 0 4px 0 var(--outline), inset 0 2px 0 rgba(255, 255, 255, 0.8);
  transition: transform 0.1s, filter 0.1s;
}

#command-panel button:first-of-type {
  background: linear-gradient(180deg, #ffe0cc 0%, #ffad89 100%);
}

#command-panel button:nth-of-type(2) {
  background: linear-gradient(180deg, #dcffd1 0%, #96e089 100%);
}

#command-panel button:hover:enabled {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

#command-panel button:active:enabled {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--outline);
}

#command-panel button > i {
  color: var(--ink);
  font-size: 28px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

#command-panel button > span {
  font-size: 14px;
  font-weight: 900;
  color: var(--ink);
}

#command-panel button small {
  color: #5c382c;
  font-weight: 700;
  font-size: 10px;
}

#command-panel kbd {
  background: var(--outline);
  color: #fff6dc;
  border: none;
  border-radius: 6px;
  padding: 3px 6px;
  font-weight: 900;
  font-size: 10px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}

#command-panel button.active,
#command-panel button.armed {
  background: linear-gradient(180deg, #fff099 0%, #ffbb33 100%);
  border-color: var(--outline);
  color: var(--ink);
  box-shadow: 0 0 16px #ffcf4d, 0 4px 0 var(--outline);
}

#command-panel .energy-help {
  color: #704c3e;
  font-weight: 800;
  font-size: 9.5px;
  margin-top: 9px;
}

#bounty-panel {
  top: 148px;
  right: 24px;
  width: 230px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #fff8e4 0%, #f5d39b 100%);
  border: 3px solid var(--outline);
  box-shadow:
    0 6px 0 var(--outline),
    0 12px 22px rgba(45, 22, 15, 0.25),
    inset 0 3px 0 #ffffff;
  border-radius: 20px;
}

#bounty-panel > div:first-child > span {
  display: inline-block;
  background: #593325;
  color: #ffdf85;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 9px;
  letter-spacing: 1px;
  font-weight: 900;
}

#bounty-title {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  margin-top: 5px;
  text-shadow: 0 1px 0 #fff;
}

#bounty-copy {
  color: #633e31;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.55;
  margin: 7px 0 9px;
}

#bounty-start {
  background: linear-gradient(180deg, #ffe074 0%, #ff9f2e 100%);
  border: 2.5px solid var(--outline);
  color: var(--ink);
  border-radius: 11px;
  padding: 8px;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 4px 0 var(--outline), inset 0 2px 0 #fff7c2;
}

#bounty-start:hover:enabled {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

#bounty-start:active:enabled {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--outline);
}

#bounty-start:disabled {
  background: #dec6a4;
  color: #7d6252;
  border-color: #6e5244;
  box-shadow: none;
}

#bounty-meter {
  height: 6px;
  background: #3b201b;
  border: 1.5px solid var(--outline);
  margin-top: 8px;
  border-radius: 99px;
}

#bounty-meter i {
  background: linear-gradient(90deg, #ff6b57, #ffd24c);
}

/* ==================== BOSS HUD & BANNERS ==================== */
#boss-hud {
  top: 104px;
  left: 470px;
  width: 660px;
  padding: 10px 18px;
  background: linear-gradient(180deg, #522335 0%, #331421 100%);
  border: 3.5px solid var(--outline);
  box-shadow: 0 6px 0 var(--outline), inset 0 2px 0 rgba(255, 255, 255, 0.25);
  border-radius: 18px;
}

#boss-name {
  font-size: 18px;
  font-weight: 900;
  color: #ffe39f;
  text-shadow: 0 2px 0 #1f0a13;
}

#boss-phase {
  font-size: 11px;
  background: #ff4f6d;
  color: #fff;
  padding: 2px 9px;
  border-radius: 99px;
  border: 1.5px solid #1f0a13;
  font-weight: 900;
}

.boss-meter {
  height: 13px;
  border: 2px solid #1f0a13;
  background: #1a0910;
  border-radius: 99px;
  padding: 1px;
}

.boss-meter i {
  background: linear-gradient(90deg, #ff4268, #ffb347);
  border-radius: 99px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45);
}

#boss-pattern {
  color: #ffdbcf;
  font-weight: 800;
  font-size: 11.5px;
  margin-top: 6px;
}

#storm {
  right: 26px;
  top: 548px;
  width: 92px;
  height: 92px;
  background: radial-gradient(circle at 35% 28%, #fff9b3 0%, #ffbe3b 52%, #e07419 100%);
  border: 4px solid var(--outline);
  box-shadow:
    0 7px 0 var(--outline),
    0 12px 24px rgba(45, 22, 15, 0.4),
    inset 0 0 0 3px #fff6cc;
}

.storm-symbol {
  color: #fff;
  text-shadow:
    0 3px 0 var(--outline),
    -2px -2px 0 var(--outline),
    2px -2px 0 var(--outline),
    -2px 2px 0 var(--outline),
    2px 2px 0 var(--outline);
}

#storm small {
  background: var(--outline);
  border: 2px solid #ffe49c;
  color: #fff6d6;
  border-radius: 8px;
  font-weight: 900;
}

.storm-cool {
  color: #fff;
  text-shadow: 0 2px 4px #000;
}

.wave-banner {
  background: linear-gradient(180deg, #4a2720 0%, #2e1612 100%);
  border: 3.5px solid #ffd269;
  color: #fff3c4;
  box-shadow: 0 7px 0 var(--outline), 0 14px 30px rgba(0, 0, 0, 0.45);
  border-radius: 99px;
  padding: 12px 42px;
  font-size: 24px;
  text-shadow: 0 2px 0 #000;
}

.combo {
  filter: drop-shadow(0 5px 0 var(--outline));
}

.combo span {
  color: #fff8dc;
  text-shadow:
    -2px -2px 0 var(--outline),
    2px 2px 0 var(--outline),
    -2px 2px 0 var(--outline),
    2px -2px 0 var(--outline);
}

.combo strong {
  color: #ffd54a;
  -webkit-text-stroke: 3px var(--outline);
}

#legend-announcement {
  background: linear-gradient(90deg, transparent, #3b1d2ee8 15%, #4d233bf2 85%, transparent);
  border-top: 3px solid #ffd86b;
  border-bottom: 3px solid #ffd86b;
}

#legend-announcement small {
  color: #ffd86b;
  font-size: 11px;
}

#legend-announcement strong {
  color: #fff8de;
  text-shadow: 0 3px 0 var(--outline), 0 0 20px #ffae33;
}

/* ==================== TOWER PEDESTAL TAGS ==================== */
.tower-tag {
  background: rgba(56, 30, 24, 0.92);
  border: 2.5px solid #ffe094;
  border-radius: 14px;
  padding: 4px 12px 5px;
  box-shadow: 0 4px 0 rgba(35, 16, 12, 0.7);
  bottom: 2px;
}

.tower-tag b {
  background: transparent;
  border: none;
  padding: 0 2px;
  color: #fff8e6 !important;
  text-shadow: 0 1.5px 0 #1f0e0a;
  font-size: 13.5px;
  font-weight: 900;
}

.tower-tag span {
  color: #ffd24c;
  text-shadow: 0 1px 0 #1f0e0a;
  font-size: 12px;
}

.tower-tag em {
  color: #f0cfa8;
  font-weight: 700;
}

.tower-feed {
  height: 6px;
  width: 90px;
  background: #24110d;
  border: 1.5px solid #a87f5d;
  border-radius: 99px;
  margin-top: 2px;
}

.tower-feed i {
  background: linear-gradient(90deg, #5ce080, #ffd84d);
}

.tower-target:hover {
  background: rgba(255, 244, 184, 0.18);
  border-color: rgba(255, 219, 102, 0.7);
}

.tower-target.selected {
  border: 3px solid #ffd447;
  background: rgba(255, 228, 130, 0.25);
  box-shadow: 0 0 25px rgba(255, 212, 71, 0.55);
}

/* ==================== BOTTOM COMMAND DECK (WORKBENCH) ==================== */
#workbench {
  background:
    linear-gradient(180deg, #f5dbb6 0%, #e3bc8b 84%, #cfa16d 100%);
  border-top: 5px solid var(--outline);
  box-shadow:
    inset 0 4px 0 #fff6df,
    0 -8px 24px rgba(38, 18, 12, 0.28);
}

.bench-top {
  height: 44px;
  background: rgba(82, 45, 32, 0.12);
  border-bottom: 2px solid rgba(67, 38, 32, 0.18);
  color: var(--ink);
}

.bench-brand {
  color: var(--ink);
  letter-spacing: 0.8px;
  font-weight: 900;
  font-size: 12px;
}

.bench-brand b {
  color: #d64535;
}

.bench-brand i {
  color: #704938;
  font-size: 9.5px;
  font-weight: 800;
}

.bench-title {
  color: var(--ink);
  font-size: 21px;
  font-weight: 900;
  text-shadow: 0 1.5px 0 rgba(255, 255, 255, 0.8);
}

.bench-title span {
  color: #d96b27;
}

.bench-guide {
  color: #5c3a2d;
  font-weight: 800;
  font-size: 11px;
}

#recipes-open {
  top: 6px;
  background: linear-gradient(180deg, #b589ff 0%, #7f4fe0 100%);
  color: #fff;
  border: 2.5px solid var(--outline);
  border-radius: 11px;
  padding: 6px 13px;
  font-size: 12.5px;
  font-weight: 900;
  box-shadow: 0 3px 0 var(--outline), inset 0 2px 0 rgba(255, 255, 255, 0.45);
  text-shadow: 0 1px 0 #311761;
}

#recipes-open b {
  background: #391c6b;
  color: #ffe270;
  padding: 1px 7px;
  border-radius: 99px;
  margin-left: 6px;
  font-size: 10.5px;
}

#recipes-open:hover {
  background: linear-gradient(180deg, #c49fff 0%, #8f60f0 100%);
  transform: translateY(-1px);
}

#bag-pages {
  top: 7px;
  color: var(--ink);
  font-weight: 900;
  font-size: 12px;
}

#bag-pages button {
  width: 28px;
  height: 28px;
  background: linear-gradient(180deg, #fffdf6, #f2d5a7);
  border: 2px solid var(--outline);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 900;
  box-shadow: 0 2px 0 var(--outline);
}

#bag-pages button:hover:enabled {
  background: #fff;
}

#auto-supply {
  top: 6px;
  background: linear-gradient(180deg, #86e677 0%, #44b549 100%);
  border: 2.5px solid var(--outline);
  border-radius: 11px;
  color: #fff;
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 900;
  box-shadow: 0 3px 0 var(--outline), inset 0 2px 0 rgba(255, 255, 255, 0.45);
  text-shadow: 0 1px 0 #1d5720;
}

#auto-supply[aria-pressed="false"] {
  background: linear-gradient(180deg, #e0cbb0 0%, #b89c7d 100%);
  border-color: var(--outline);
  color: #4a3126;
  text-shadow: none;
}

#sell {
  background: linear-gradient(180deg, #ffd4b8 0%, #f0976b 100%);
  border: 2px solid var(--outline);
  color: var(--ink);
  font-weight: 900;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 8px;
  box-shadow: 0 2px 0 var(--outline);
}

#sell:disabled {
  background: #d9bfa0;
  color: #7d6250;
  box-shadow: none;
}

/* Gear tray */
.gear-panel {
  top: 50px;
  background: linear-gradient(180deg, #cfa576 0%, #b88b5b 100%);
  border: 3px solid var(--outline);
  border-radius: 16px;
  box-shadow:
    inset 0 3px 6px rgba(45, 22, 15, 0.35),
    0 2px 0 rgba(255, 255, 255, 0.5);
  padding: 8px 10px;
}

.gear-panel > button {
  color: #fff9eb;
  font-size: 14px;
  font-weight: 900;
  text-shadow: 0 1.5px 0 var(--outline);
}

.gear-panel > button span {
  background: var(--outline);
  color: #ffde82;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10.5px;
}

.gear-slot {
  background: linear-gradient(180deg, #fffdf5 0%, #f7deb2 100%);
  border: 2.5px solid var(--outline);
  border-radius: 12px;
  box-shadow: 0 3px 0 var(--outline), inset 0 2px 0 #fff;
  color: #8c6548;
  font-weight: 900;
}

.gear-slot svg {
  filter: none;
}

.gear-caption {
  color: #fff3db;
  font-weight: 800;
  font-size: 9.5px;
  text-shadow: 0 1px 0 rgba(45, 22, 15, 0.6);
}

/* Hero Inventory Cards */
#inventory {
  top: 49px;
}

.inv-slot {
  background: linear-gradient(180deg, #fffef9 0%, #ffefd1 72%, #f0cf9e 100%);
  border: 3px solid var(--outline);
  box-shadow:
    0 5px 0 var(--outline),
    0 8px 14px rgba(45, 22, 15, 0.22),
    inset 0 2px 0 #ffffff;
  color: var(--ink);
  border-radius: 18px;
  transition: transform 0.12s, box-shadow 0.12s;
}

.inv-slot:after {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1.5px solid rgba(255, 255, 255, 0.65);
  border-radius: 12px;
  pointer-events: none;
}

.inv-slot:hover {
  background: linear-gradient(180deg, #ffffff 0%, #fff4dc 72%, #f7daaa 100%);
  border-color: var(--outline);
  transform: translateY(-4px);
  box-shadow:
    0 9px 0 var(--outline),
    0 12px 20px rgba(45, 22, 15, 0.3),
    inset 0 2px 0 #ffffff;
}

.inv-slot .level {
  bottom: 22px;
  font-size: 13px;
  font-weight: 900;
  background: var(--outline);
  color: #fff9e6;
  padding: 1px 9px;
  border-radius: 99px;
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.5);
}

.inv-slot .stars {
  bottom: 4px;
  color: #ffad1f;
  font-size: 13px;
  text-shadow: 0 1.5px 0 var(--outline);
}

.inv-slot .slot-key {
  background: rgba(61, 33, 26, 0.12);
  color: #5e3b2e;
  font-weight: 900;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 5px;
  right: 6px;
  top: 6px;
}

.inv-slot .kind-dot {
  width: 11px;
  height: 11px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
  border: 2px solid var(--outline);
}

.inv-slot.empty {
  background: rgba(145, 98, 60, 0.28);
  border: 2.5px dashed #7a4f34;
  box-shadow: inset 0 3px 7px rgba(45, 22, 15, 0.32);
}

.inv-slot.empty:after,
.inv-slot.empty .level {
  display: none;
}

.inv-slot.empty .plus {
  color: rgba(74, 42, 28, 0.45);
  font-size: 38px;
  font-weight: 900;
}

.inv-slot.fusion-card {
  background: linear-gradient(180deg, #faf0ff 0%, #e2c7ff 70%, #c69df5 100%);
  border-color: var(--outline);
  box-shadow:
    0 5px 0 var(--outline),
    0 0 14px rgba(155, 109, 255, 0.45),
    inset 0 2px 0 #ffffff;
}

.inv-slot.pair {
  border-color: var(--outline);
  box-shadow:
    0 0 0 2.5px #ffbe3b,
    0 5px 0 var(--outline),
    inset 0 2px 0 #ffffff;
}

.inv-slot.selected,
.inv-slot.drop-match {
  border-color: var(--outline);
  box-shadow:
    0 0 0 4px #ffcf40,
    0 7px 0 var(--outline),
    0 0 25px rgba(255, 196, 45, 0.65);
  transform: translateY(-5px);
}

.inv-slot.selected:before {
  background: #ff594f;
  color: #fff;
  border: 2px solid var(--outline);
  border-radius: 8px;
  font-weight: 900;
  top: -21px;
  box-shadow: 0 2px 0 var(--outline);
}

/* Summon & Merge All Action Buttons */
#buy {
  background: linear-gradient(180deg, #ffe268 0%, #ffad33 52%, #f07e19 100%);
  border: 3.5px solid var(--outline);
  color: #fff;
  border-radius: 18px;
  box-shadow:
    0 6px 0 var(--outline),
    0 10px 18px rgba(45, 22, 15, 0.3),
    inset 0 4px 0 #fff7c4,
    inset 0 -3px 0 #c95c0e;
}

#buy > span {
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  text-shadow:
    0 2px 0 var(--outline),
    -1.5px -1.5px 0 var(--outline),
    1.5px -1.5px 0 var(--outline),
    -1.5px 1.5px 0 var(--outline),
    1.5px 1.5px 0 var(--outline);
}

#buy strong {
  color: #fff8dc;
  text-shadow:
    0 2px 0 var(--outline),
    -1.5px -1.5px 0 var(--outline),
    1.5px -1.5px 0 var(--outline),
    -1.5px 1.5px 0 var(--outline),
    1.5px 1.5px 0 var(--outline);
}

#buy > small {
  background: var(--outline);
  color: #ffe380;
  border: none;
  border-radius: 6px;
  font-weight: 900;
  width: 22px;
  height: 20px;
  line-height: 18px;
}

#merge-all {
  background: linear-gradient(180deg, #98f086 0%, #4ac959 55%, #2fa642 100%);
  border: 3px solid var(--outline);
  border-radius: 14px;
  box-shadow:
    0 5px 0 var(--outline),
    inset 0 3px 0 #dcffd4,
    inset 0 -2px 0 #1f7d2f;
  color: #fff;
  font-size: 19px;
  font-weight: 900;
  text-shadow:
    0 2px 0 var(--outline),
    -1.5px -1.5px 0 var(--outline),
    1.5px -1.5px 0 var(--outline),
    -1.5px 1.5px 0 var(--outline),
    1.5px 1.5px 0 var(--outline);
}

#merge-all small {
  background: var(--outline);
  color: #b7ffab;
  border: none;
  border-radius: 6px;
  font-weight: 900;
  width: 22px;
  height: 20px;
  line-height: 18px;
}

.bench-footer {
  background: #47281e;
  color: #f0d5b4;
  font-weight: 800;
  font-size: 11px;
}

.bench-footer > span:first-child,
.bench-footer b {
  color: #ffe38f;
  font-weight: 900;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: #6bf07c;
  box-shadow: 0 0 8px #6bf07c;
}

/* ==================== TOAST, TOOLTIP & MODALS ==================== */
#aim-hint {
  background: linear-gradient(180deg, #4f281f 0%, #331812 100%);
  border: 3.5px solid #ffd56b;
  color: #fff6d6;
  box-shadow: 0 8px 0 var(--outline), 0 16px 35px rgba(0, 0, 0, 0.5);
}

#aim-hint small {
  color: #f5c98c;
  font-weight: 700;
}

#toast {
  background: linear-gradient(180deg, #4a261e 0%, #2e1611 100%);
  border: 3px solid #ffd56b;
  border-radius: 99px;
  color: #fff7dc;
  padding: 12px 28px;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 6px 0 var(--outline), 0 12px 28px rgba(0, 0, 0, 0.45);
}

#tooltip {
  background: linear-gradient(180deg, #fffdf6 0%, #f7e1b8 100%);
  border: 3px solid var(--outline);
  border-radius: 16px;
  box-shadow: 0 6px 0 var(--outline), 0 12px 26px rgba(45, 22, 15, 0.35);
}

#tooltip strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
}

#tooltip p {
  color: #5c3a2e;
  font-weight: 700;
  font-size: 12px;
}

#tooltip small {
  color: #8c583a;
  font-weight: 900;
  font-size: 11px;
}

.overlay {
  background: rgba(28, 14, 10, 0.62);
  backdrop-filter: blur(6px);
}

#modal {
  background: linear-gradient(180deg, #fffdf6 0%, #f7e4c1 100%);
  border: 4px solid var(--outline);
  color: var(--ink);
  box-shadow:
    0 12px 0 var(--outline),
    0 28px 70px rgba(0, 0, 0, 0.55),
    inset 0 4px 0 #ffffff;
  border-radius: 30px;
}

#modal:before {
  border: 2px dashed #cfb088;
  border-radius: 22px;
}

.eyebrow, .modal-topline {
  display: inline-block;
  background: var(--outline);
  color: #ffe07d;
  padding: 4px 14px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 2px;
}

#modal h2 {
  color: var(--ink);
  font-size: 34px;
  font-weight: 900;
  text-shadow: 0 2px 0 #fff;
}

.modal-desc {
  color: #633e31;
  font-weight: 700;
  font-size: 14px;
}

.modal-desc b {
  color: #d15328;
  font-weight: 900;
}

.primary {
  background: linear-gradient(180deg, #ffe268 0%, #ffad33 52%, #f07e19 100%);
  border: 3.5px solid var(--outline);
  color: #fff;
  box-shadow:
    0 6px 0 var(--outline),
    0 10px 20px rgba(45, 22, 15, 0.28),
    inset 0 4px 0 #fff7c4,
    inset 0 -3px 0 #c95c0e;
  border-radius: 18px;
  font-weight: 900;
  text-shadow:
    0 2px 0 var(--outline),
    -1.5px -1.5px 0 var(--outline),
    1.5px -1.5px 0 var(--outline),
    -1.5px 1.5px 0 var(--outline),
    1.5px 1.5px 0 var(--outline);
}

.primary:hover:enabled {
  filter: brightness(1.06);
  transform: translateY(-2px);
  box-shadow:
    0 8px 0 var(--outline),
    0 14px 24px rgba(45, 22, 15, 0.34),
    inset 0 4px 0 #fff7c4;
}

.primary:active:enabled {
  transform: translateY(3px);
  box-shadow: 0 3px 0 var(--outline), inset 0 2px 0 #fff7c4;
}

.secondary {
  background: linear-gradient(180deg, #fffdf7 0%, #f2d8b0 100%);
  border: 3px solid var(--outline);
  color: var(--ink);
  border-radius: 15px;
  font-weight: 900;
  box-shadow: 0 4px 0 var(--outline), inset 0 2px 0 #ffffff;
}

.secondary:hover:enabled {
  background: linear-gradient(180deg, #ffffff 0%, #ffe6bf 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--outline), inset 0 2px 0 #ffffff;
}

.secondary:active:enabled {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--outline);
}

#overlay[data-mode="upgrade"] #modal {
  width: 850px;
  padding: 26px 36px 30px;
}

.upgrade-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.upgrade-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 312px;
  background: linear-gradient(180deg, #fffef9 0%, #f8e5be 74%, #edd09d 100%);
  border: 3.5px solid var(--outline);
  border-radius: 24px;
  box-shadow:
    0 8px 0 var(--outline),
    0 14px 28px rgba(45, 22, 15, 0.28),
    inset 0 3px 0 #ffffff;
  padding: 12px 12px 14px;
  text-align: center;
  transition: transform 0.14s cubic-bezier(0.2, 0.9, 0.3, 1.2), box-shadow 0.14s, filter 0.14s;
  overflow: hidden;
}

.upgrade-card.relic-card {
  background: linear-gradient(180deg, #fffaf4 0%, #f3ddff 70%, #dab9f8 100%);
}

.upgrade-card:hover {
  border-color: var(--outline);
  background: linear-gradient(180deg, #ffffff 0%, #ffedc4 100%);
  transform: translateY(-7px) scale(1.015);
  box-shadow:
    0 0 0 4px var(--accent),
    0 13px 0 var(--outline),
    0 22px 36px rgba(45, 22, 15, 0.38),
    inset 0 3px 0 #ffffff;
}

.upgrade-card.relic-card:hover {
  background: linear-gradient(180deg, #ffffff 0%, #f5e2ff 100%);
}

.upgrade-card:active {
  transform: translateY(2px);
  box-shadow: 0 3px 0 var(--outline);
}

.upgrade-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 99px;
  background: var(--outline);
  color: var(--accent, #ffe07d);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.65);
}

.upgrade-art {
  position: relative;
  width: 100%;
  height: 142px;
  border-radius: 16px;
  overflow: hidden;
  border: 2.5px solid var(--outline);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.2), 0 2px 0 rgba(255, 255, 255, 0.75);
  background: #3d211a;
  flex-shrink: 0;
}

.upgrade-art .card-art-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.upgrade-art .upgrade-char {
  position: absolute;
  right: 2px;
  bottom: -4px;
  width: 122px;
  height: 122px;
  pointer-events: none;
  filter: drop-shadow(-2px 3px 0 rgba(61, 33, 26, 0.45)) drop-shadow(0 0 10px rgba(255, 250, 210, 0.45));
  transition: transform 0.16s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.upgrade-card:hover .upgrade-char {
  transform: scale(1.08) rotate(-3deg) translateY(-3px);
}

.upgrade-body {
  padding: 10px 6px 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.upgrade-card strong {
  color: var(--ink);
  font-size: 21px;
  font-weight: 900;
  margin: 0 0 6px;
  text-shadow: 0 1.5px 0 #ffffff;
}

.upgrade-card .upgrade-body span {
  color: #5c382b;
  font-weight: 800;
  font-size: 12.5px;
  line-height: 1.5;
  margin: 0;
}

.upgrade-pick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px 14px;
  border-radius: 13px;
  border: 2.5px solid var(--outline);
  background: linear-gradient(180deg, #ffe578 0%, #ffad32 100%);
  box-shadow: 0 3px 0 var(--outline), inset 0 2px 0 #fff7c2;
  color: var(--ink);
  font-style: normal;
  font-size: 14px;
  font-weight: 900;
}

.upgrade-card.relic-card .upgrade-pick {
  background: linear-gradient(180deg, #9cf288 0%, #46bf55 100%);
  color: #fff;
  text-shadow: 0 1.5px 0 var(--outline);
  box-shadow: 0 3px 0 var(--outline), inset 0 2px 0 #dcffd4;
}

.gear-option {
  background: linear-gradient(180deg, #fffef8 0%, #f6e2be 100%);
  border: 3px solid var(--outline);
  border-radius: 16px;
  color: var(--ink);
  box-shadow: 0 4px 0 var(--outline), inset 0 2px 0 #fff;
}

.gear-option.active {
  background: linear-gradient(180deg, #eaffde 0%, #bce89e 100%);
  border-color: var(--outline);
  box-shadow: 0 0 0 2.5px #57bf49, 0 4px 0 var(--outline);
}

.gear-option span {
  color: #633e31;
  font-weight: 700;
}

.gear-option em {
  background: var(--outline);
  color: #ffe285;
  padding: 4px 10px;
  border-radius: 99px;
  font-weight: 900;
}

/* Recipe Codex Modal */
#modal.recipe-modal {
  scrollbar-color: #8c5c3e #fff5e5;
}

.archive-count {
  border-left: 2px dashed #b8916a;
}

.archive-count b {
  color: #d65527;
  font-weight: 900;
}

.archive-count small,
.archive-count span {
  color: #704938;
  font-weight: 800;
}

.recipe-guide {
  color: #5c3a2d;
  font-weight: 700;
}

.recipe-guide b {
  color: var(--ink);
  font-weight: 900;
}

.recipe-guide strong {
  background: var(--outline);
  color: #ffe07d;
  padding: 2px 12px;
  border-radius: 99px;
}

.recipe-card {
  background: linear-gradient(180deg, #fffef8 0%, #f5dfb8 100%);
  border: 3px solid var(--outline);
  border-radius: 18px;
  box-shadow: 0 5px 0 var(--outline), inset 0 2px 0 #ffffff;
}

.recipe-card.legendary {
  background: linear-gradient(180deg, #fff6e6 0%, #f5d0b5 60%, #e8b598 100%);
  border-color: var(--outline);
  box-shadow: 0 5px 0 var(--outline), 0 0 0 2px #ffae33, inset 0 2px 0 #ffffff;
}

.recipe-card.craft-ready {
  box-shadow: 0 0 0 3px #5ce06b, 0 6px 0 var(--outline);
}

.recipe-info small {
  color: #8c5032;
  font-weight: 900;
  font-size: 9.5px;
}

.recipe-info h3 {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.recipe-info p {
  color: #59382b;
  font-weight: 700;
  font-size: 10.5px;
}

.recipe-parts {
  color: var(--ink);
  font-weight: 900;
  font-size: 10.5px;
  background: rgba(61, 33, 26, 0.08);
  border-radius: 7px;
  padding: 4px 8px;
  margin-bottom: 4px;
}

.recipe-card button {
  background: linear-gradient(180deg, #98f086 0%, #46bf55 100%);
  border: 2.5px solid var(--outline);
  border-radius: 10px;
  color: #fff;
  font-weight: 900;
  box-shadow: 0 3px 0 var(--outline), inset 0 2px 0 #dcffd4;
  text-shadow: 0 1.5px 0 var(--outline);
}

.recipe-card button:enabled:hover {
  background: linear-gradient(180deg, #aef79e 0%, #55d464 100%);
  transform: translateY(-1px);
}

.recipe-card button:disabled {
  background: #d9c3a5;
  color: #6e5241;
  border-color: #7d5d4b;
  box-shadow: none;
  text-shadow: none;
}

.recipe-bottom > span {
  color: #633e31;
  font-weight: 800;
  font-size: 11px;
}

/* ==================== CUSTOM 2D SVG ICONOGRAPHY ==================== */
.ui-svg-icon {
  width: 20px;
  height: 20px;
  vertical-align: -4px;
  display: inline-block;
  flex-shrink: 0;
}

.heart-icon .ui-svg-icon {
  width: 36px;
  height: 36px;
  vertical-align: 0;
}

.coin-icon {
  background: none;
  border: none;
  box-shadow: none;
  width: 38px;
  height: 38px;
}

.coin-icon.small {
  width: 28px;
  height: 28px;
  border: none;
}

.coin-icon .ui-svg-icon {
  width: 100%;
  height: 100%;
  vertical-align: 0;
  filter: drop-shadow(0 2px 0 var(--outline));
}

.square-btn .ui-svg-icon {
  width: 29px;
  height: 29px;
  vertical-align: 0;
}

#core-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

#core-count .ui-svg-icon {
  width: 20px;
  height: 20px;
  vertical-align: 0;
}

#relic-list i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid var(--outline);
  border-radius: 8px;
  box-shadow: 0 2px 0 var(--outline);
  filter: none;
}

#relic-list i .ui-svg-icon {
  width: 20px;
  height: 20px;
  vertical-align: 0;
}

.command-title > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.command-title .ui-svg-icon {
  width: 17px;
  height: 17px;
  vertical-align: 0;
}

#command-panel button > i {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

#command-panel button > i .ui-svg-icon {
  width: 36px;
  height: 36px;
  vertical-align: 0;
}

#bounty-panel > div:first-child > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

#bounty-panel > div:first-child > span .ui-svg-icon {
  width: 14px;
  height: 14px;
  vertical-align: 0;
}

#bounty-start {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

#bounty-start .ui-svg-icon {
  width: 18px;
  height: 18px;
  vertical-align: 0;
}

.storm-symbol {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  transform: none;
}

.storm-symbol .ui-svg-icon {
  width: 58px;
  height: 58px;
  vertical-align: 0;
  filter: drop-shadow(0 3px 0 var(--outline));
}

.bench-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.bench-title span {
  margin: 0;
  display: inline-flex;
}

.bench-title .ui-svg-icon {
  width: 22px;
  height: 22px;
  vertical-align: 0;
}

#recipes-open,
#auto-supply,
#sell {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

#recipes-open .ui-svg-icon,
#auto-supply .ui-svg-icon,
#sell .ui-svg-icon {
  width: 17px;
  height: 17px;
  vertical-align: 0;
}

.gear-panel > button {
  display: flex;
  align-items: center;
  gap: 5px;
}

.gear-panel > button span {
  margin-left: auto;
}

.gear-panel > button .ui-svg-icon {
  width: 18px;
  height: 18px;
  vertical-align: 0;
}

.gear-slot .ui-svg-icon {
  width: 38px;
  height: 38px;
  vertical-align: 0;
}

.inv-slot.empty .plus {
  display: grid;
  place-items: center;
  height: 100%;
  line-height: 1;
  opacity: 0.55;
}

.inv-slot.empty .plus .ui-svg-icon {
  width: 34px;
  height: 34px;
  vertical-align: 0;
}

#buy > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

#buy > span .ui-svg-icon {
  width: 26px;
  height: 26px;
  vertical-align: 0;
  filter: drop-shadow(0 2px 0 var(--outline));
}

#merge-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

#merge-all .ui-svg-icon {
  width: 22px;
  height: 22px;
  vertical-align: 0;
  filter: drop-shadow(0 2px 0 var(--outline));
}

.upgrade-pick .ui-svg-icon,
.gear-option em .ui-svg-icon,
.recipe-info small .ui-svg-icon,
.recipe-parts .ui-svg-icon,
.recipe-guide strong .ui-svg-icon {
  width: 16px;
  height: 16px;
  vertical-align: -3px;
}

.modal-buttons button,
.recipe-card button,
.recipe-bottom .primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.modal-buttons button .ui-svg-icon,
.recipe-card button .ui-svg-icon,
.recipe-bottom .primary .ui-svg-icon {
  width: 19px;
  height: 19px;
  vertical-align: 0;
}

/* ==================== 15-RECIPE CODEX, SYNERGY & LANE BUFF HUD ==================== */
#modal.recipe-modal {
  width: 1460px;
  max-height: 850px;
  padding: 20px 30px 22px;
}

.recipe-grid.recipe-grid-15 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 10px 0 12px;
}

.recipe-grid-15 .recipe-card {
  padding: 8px 10px;
  border-radius: 14px;
  gap: 4px;
}

.recipe-grid-15 .recipe-art {
  width: 68px;
  height: 68px;
}

.recipe-grid-15 .recipe-art canvas {
  width: 68px;
  height: 68px;
}

.recipe-grid-15 .recipe-info small {
  font-size: 8.5px;
}

.recipe-grid-15 .recipe-info h3 {
  font-size: 14px;
  margin: 1px 0;
}

.recipe-grid-15 .recipe-info p {
  font-size: 9.5px;
  line-height: 1.25;
}

.recipe-grid-15 .recipe-parts {
  font-size: 9.5px;
  padding: 3px 6px;
  margin-bottom: 2px;
}

.recipe-grid-15 .recipe-card button {
  padding: 5px 6px;
  font-size: 11px;
  min-height: 28px;
}

#synergy-list {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.synergy-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 99px;
  border: 2px solid var(--outline);
  background: var(--syn-color, #ffe066);
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 900;
  box-shadow: 0 2px 0 var(--outline), inset 0 1.5px 0 rgba(255, 255, 255, 0.7);
}

.synergy-chip .ui-svg-icon {
  width: 14px;
  height: 14px;
  vertical-align: 0;
}

.tower-tag .lane-buff-pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 99px;
  border: 1.5px solid var(--outline);
  background: var(--lane-color, #ffe066);
  color: #2d160f;
  text-shadow: none;
  font-style: normal;
  font-size: 8.5px;
  font-weight: 900;
  margin-bottom: 1px;
  line-height: 1.25;
}

.gear-options {
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}

.gear-option.locked-gear-option {
  opacity: 0.78;
  background: linear-gradient(180deg, #f3e9fb 0%, #dcc5f2 100%);
}

