/* Brotato Web — Crisp dark comic-arcade UI styling */

:root {
  --bg-deep: #121017;
  --panel: #1e1b28;
  --panel-alt: #272335;
  --border: #3a344d;
  --text: #f3f1f8;
  --muted: #a69fbe;
  --green: #51cf66;
  --red: #ff5c6c;
  --gold: #ffd43b;
  --blue: #4da6ff;
  --purple: #c468ff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body, #app {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Segoe UI', sans-serif;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.hidden {
  display: none !important;
}

/* Buttons */
.btn {
  border: 2px solid #15121c;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  color: var(--text);
  background: var(--panel-alt);
  box-shadow: 0 3px 0 #100d16;
  transition: transform 0.08s ease, filter 0.12s ease, background 0.12s ease;
}
.btn:hover:not(:disabled) {
  filter: brightness(1.12);
  transform: translateY(-1px);
}
.btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #100d16;
}
.btn:disabled, .btn.disabled, .btn-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.btn-go {
  background: linear-gradient(180deg, #47cc5d, #2b9c3f);
  color: #091d0d;
  border-color: #164f20;
}
.btn-primary {
  background: linear-gradient(180deg, #ffd43b, #e6a800);
  color: #1c1404;
  border-color: #5c4100;
}
.btn-buy {
  background: linear-gradient(180deg, #3fb950, #238636);
  color: #fff;
  width: 100%;
}
.btn-secondary {
  background: #302b40;
  border-color: #46405c;
}
.btn-lg {
  padding: 14px 32px;
  font-size: 18px;
  border-radius: 13px;
}
.btn-sm {
  padding: 7px 13px;
  font-size: 13px;
}
.full-w {
  width: 100%;
}

/* Overlays */
.overlay-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, rgba(28, 24, 39, 0.92), rgba(14, 12, 20, 0.97));
  padding: 18px;
  overflow-y: auto;
}
.modal-backdrop {
  background: rgba(10, 8, 15, 0.78);
  backdrop-filter: blur(4px);
  z-index: 35;
}

/* Main Menu */
.menu-card {
  width: min(560px, 100%);
  background: var(--panel);
  border: 3px solid var(--border);
  border-radius: 22px;
  padding: 36px 28px 28px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55);
}

.potato-hero {
  position: relative;
  width: 160px;
  height: 120px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.potato-art {
  width: 72px;
  height: 84px;
  border-radius: 50% / 48%;
  background: #e6c28b;
  border: 4px solid #241b16;
  position: relative;
  box-shadow: 0 10px 24px rgba(0,0,0,0.45);
  animation: heroBob 1.8s ease-in-out infinite;
}
@keyframes heroBob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-7px) rotate(2deg); }
}
.p-headband {
  position: absolute;
  top: 14px;
  left: -2px;
  right: -2px;
  height: 11px;
  background: #ff5252;
  border-top: 2px solid #241b16;
  border-bottom: 2px solid #241b16;
}
.p-eye {
  position: absolute;
  top: 34px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1a1621;
}
.p-eye.left { left: 16px; }
.p-eye.right { right: 16px; }
.p-mouth {
  position: absolute;
  bottom: 20px;
  left: 50%;
  width: 14px;
  height: 7px;
  transform: translateX(-50%);
  border-bottom: 3px solid #241b16;
  border-radius: 0 0 10px 10px;
}
.orbit-gun {
  position: absolute;
  font-size: 26px;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.5));
}
.orbit-gun.g1 { top: 8px; left: 8px; transform: rotate(-18deg); }
.orbit-gun.g2 { top: 8px; right: 8px; transform: rotate(22deg); }
.orbit-gun.g3 { bottom: 6px; left: 12px; transform: rotate(-10deg); }
.orbit-gun.g4 { bottom: 6px; right: 12px; transform: rotate(15deg); }

.real-hero { width: 190px; height: 132px; }
.hero-real-img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,0.55));
  animation: heroBob 1.8s ease-in-out infinite;
}
.orbit-gun-img {
  position: absolute;
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.65));
}
.orbit-gun-img.og1 { top: 6px; left: 4px; transform: rotate(-18deg); }
.orbit-gun-img.og2 { top: 6px; right: 4px; transform: rotate(18deg) scaleX(-1); }
.orbit-gun-img.og3 { bottom: 6px; left: 8px; transform: rotate(-10deg); }
.orbit-gun-img.og4 { bottom: 6px; right: 8px; transform: rotate(12deg); }

.rea-badge {
  display: inline-block;
  background: rgba(77, 166, 255, 0.14);
  border: 1px solid rgba(77, 166, 255, 0.35);
  color: #9dd1ff;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
}

.search-input {
  background: #17141f;
  border: 2px solid var(--border);
  border-radius: 9px;
  padding: 6px 11px;
  color: var(--text);
  font-size: 13px;
  width: 155px;
  outline: none;
}
.search-input:focus { border-color: var(--gold); }

.char-scroll {
  max-height: 310px;
  overflow-y: auto;
  padding-right: 4px;
}
.weapon-scroll {
  max-height: 210px;
  overflow-y: auto;
  padding-right: 4px;
}
.tile-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}
.tile-img.sm { width: 40px; height: 40px; }
.detail-avatar {
  width: 68px;
  height: 68px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
}
.cd-effects {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
  max-height: 115px;
  overflow-y: auto;
}
.eff-line { font-size: 12.5px; font-weight: 700; line-height: 1.35; }

.sc-icon-img { width: 32px; height: 32px; object-fit: contain; flex-shrink: 0; }
.ws-icon-img { width: 22px; height: 22px; object-fit: contain; flex-shrink: 0; }
.crate-img { width: 76px; height: 76px; object-fit: contain; margin-bottom: 6px; }
.up-img { width: 52px; height: 52px; object-fit: contain; }
.owned-item-img { width: 28px; height: 28px; object-fit: contain; vertical-align: middle; }

/* Dark themed custom scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #14121b; border-radius: 6px; }
::-webkit-scrollbar-thumb { background: #3e3754; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #5a5078; }

.game-logo {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(180deg, #fff5d6, #f5b942);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}
.game-subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 16px;
}
.record-badge {
  display: inline-block;
  background: #2b263b;
  border: 1px solid #4d4568;
  color: var(--gold);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 18px;
}
.menu-actions {
  margin-bottom: 16px;
}
.menu-toggles {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 18px;
}
.controls-footer {
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

/* Setup Screen */
.setup-panel {
  width: min(980px, 100%);
  background: var(--panel);
  border: 3px solid var(--border);
  border-radius: 20px;
  padding: 20px 22px;
  box-shadow: 0 22px 55px rgba(0,0,0,0.55);
}
.setup-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.setup-top h2 {
  font-size: 22px;
  font-weight: 900;
}
.setup-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 18px;
}
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 10px;
}
.tile-grid.compact {
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
}
.select-tile {
  background: var(--panel-alt);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 10px 8px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  transition: border-color 0.12s, transform 0.1s;
}
.select-tile:hover {
  border-color: #7d739e;
  transform: translateY(-2px);
}
.select-tile.selected {
  border-color: var(--gold);
  background: #332c45;
  box-shadow: 0 0 0 2px rgba(255, 212, 59, 0.25);
}
.char-swatch {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border: 2.5px solid #241b16;
}
.char-swatch.lg {
  width: 54px;
  height: 54px;
  font-size: 28px;
  flex-shrink: 0;
}
.tile-name {
  font-size: 13px;
  font-weight: 700;
}
.w-icon {
  font-size: 24px;
}
.cleared-tag {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 10px;
  background: rgba(255, 212, 59, 0.2);
  color: var(--gold);
  padding: 1px 5px;
  border-radius: 6px;
  font-weight: 800;
}
.char-detail-box {
  margin-top: 14px;
  background: #17141f;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}
.cd-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}
.cd-head h3 {
  font-size: 18px;
  margin-bottom: 2px;
}
.cd-head p {
  font-size: 13px;
  color: var(--muted);
}
.cd-passive {
  font-size: 13px;
  color: #a3f5b5;
  background: rgba(81, 207, 102, 0.08);
  border: 1px solid rgba(81, 207, 102, 0.25);
  padding: 8px 10px;
  border-radius: 8px;
  line-height: 1.45;
}
.setup-section {
  background: #17141f;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}
.sec-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 10px;
  text-transform: uppercase;
}
.weapon-preview-line {
  margin-top: 10px;
  font-size: 12.5px;
  color: #d6d2e4;
}
.danger-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.danger-pill {
  flex: 1;
  padding: 8px 4px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--panel-alt);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}
.danger-pill.selected {
  border-color: var(--red);
  background: #47202c;
  color: #ffd5da;
}
.danger-desc {
  font-size: 12.5px;
  color: var(--muted);
}

/* HUD */
#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  padding: 14px 18px;
}
.hud-top-left {
  position: absolute;
  top: 14px;
  left: 16px;
  width: 220px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.bar-wrap {
  position: relative;
  height: 24px;
  background: rgba(15, 13, 21, 0.85);
  border: 2px solid #111;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0,0,0,0.4);
}
.bar-wrap.xp-bar {
  height: 19px;
}
.bar-fill {
  height: 100%;
  transition: width 0.12s ease-out;
}
.hp-bar .bar-fill {
  background: linear-gradient(90deg, #e03131, #ff5c6c);
}
.xp-bar .bar-fill {
  background: linear-gradient(90deg, #2f9e44, #69db7c);
}
.bar-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  text-shadow: 0 1px 3px #000;
}
.hud-currency-row {
  display: flex;
  gap: 8px;
}
.hud-pill {
  background: rgba(18, 16, 26, 0.86);
  border: 2px solid #2f2a40;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 14px;
  font-weight: 900;
  color: #7bf58f;
}
.hud-pill.bag {
  color: var(--gold);
}

.hud-top-center {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  min-width: 240px;
}
#hud-wave {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 1px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.85);
  color: #e6e2f2;
}
#hud-timer {
  font-size: 38px;
  line-height: 1.05;
  font-weight: 900;
  text-shadow: 0 3px 10px rgba(0,0,0,0.85);
}
#hud-timer.urgent {
  color: var(--red);
  transform: scale(1.08);
}

#boss-bar-wrap {
  margin-top: 6px;
  width: 300px;
  background: rgba(15, 13, 21, 0.85);
  border: 2px solid #591624;
  border-radius: 9px;
  padding: 4px 8px 6px;
}
#boss-name {
  font-size: 12px;
  font-weight: 800;
  color: #ff9eaa;
  margin-bottom: 3px;
}
.boss-bar-track {
  height: 10px;
  background: #2b131b;
  border-radius: 5px;
  overflow: hidden;
}
#boss-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff3b5c, #ff8fa3);
  width: 100%;
  transition: width 0.1s;
}

.hud-top-right {
  position: absolute;
  top: 14px;
  right: 16px;
  display: flex;
  gap: 8px;
  pointer-events: auto;
}
.hud-btn {
  background: rgba(24, 21, 34, 0.86);
  border: 2px solid #3c3652;
  color: var(--text);
  border-radius: 9px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.hud-btn:hover {
  background: #332e47;
}
.hud-btn.icon-only {
  padding: 6px 10px;
  font-size: 15px;
}

/* Event Banner */
#event-banner {
  position: fixed;
  top: 26%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  pointer-events: none;
  font-size: 34px;
  font-weight: 900;
  text-shadow: 0 4px 16px rgba(0,0,0,0.95);
  white-space: nowrap;
}
#event-banner.pop {
  animation: bannerPop 1.7s ease forwards;
}
@keyframes bannerPop {
  0% { opacity: 0; transform: translate(-50%, 16px) scale(0.8); }
  15% { opacity: 1; transform: translate(-50%, 0) scale(1.06); }
  80% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -18px) scale(0.96); }
}

/* Touch Joystick */
#touch-joy {
  position: fixed;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.28);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 12;
}
#touch-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 224, 102, 0.72);
  transform: translate(-50%, -50%);
}

/* Between-Wave Layout (Shop / Level Up / Crates) */
.bw-layout {
  width: min(1200px, 100%);
  max-height: 94vh;
  display: grid;
  grid-template-columns: 1fr 270px;
  gap: 16px;
  align-items: start;
}
.bw-main {
  background: var(--panel);
  border: 3px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  max-height: 92vh;
  overflow-y: auto;
}
.bw-center-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.bw-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.bw-header-row h2 {
  font-size: 22px;
  font-weight: 900;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.sub-hint {
  font-size: 13px;
  color: var(--gold);
  margin-top: 2px;
  font-weight: 700;
}
.mat-pill {
  background: #17271c;
  border: 2px solid #2b6e3a;
  color: #7bf58f;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 900;
}

/* Stats Sidebar */
.bw-stats-panel {
  background: var(--panel);
  border: 3px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  max-height: 92vh;
  overflow-y: auto;
}
.sidebar-title {
  font-size: 15px;
  font-weight: 900;
  color: var(--gold);
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}
.stats-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(255,255,255,0.025);
}
.stat-label { color: #d5d0e3; }
.stat-val { font-weight: 800; }
.stat-pos { color: var(--green); }
.stat-neg { color: var(--red); }
.stat-zero { color: var(--muted); }

.sets-box {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.sidebar-sub {
  font-size: 12px;
  font-weight: 900;
  color: var(--blue);
  margin-bottom: 6px;
}
.set-pill {
  background: #262236;
  border: 1px solid #3c3657;
  border-radius: 8px;
  padding: 6px 8px;
  margin-bottom: 6px;
  font-size: 11.5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.set-bonus {
  color: var(--green);
  font-weight: 700;
}

/* Crate Modal */
.crate-card {
  width: min(400px, 100%);
  margin: 10px auto;
  background: var(--panel-alt);
  border: 3px solid var(--gold);
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
}
.crate-icon { font-size: 54px; margin-bottom: 6px; }
.crate-tier { font-size: 13px; font-weight: 900; margin-bottom: 4px; }
.crate-card h3 { font-size: 22px; margin-bottom: 12px; }
.crate-stats { margin-bottom: 18px; display: flex; flex-direction: column; gap: 4px; }
.crate-actions { display: flex; gap: 10px; justify-content: center; }

/* Level-Up Grid */
.upgrade-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.upgrade-card {
  background: var(--panel-alt);
  border: 3px solid var(--border);
  border-radius: 14px;
  padding: 18px 12px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform 0.1s, background 0.12s;
}
.upgrade-card:hover {
  transform: translateY(-4px);
  background: #332e46;
}
.up-tier { font-size: 12px; font-weight: 900; }
.up-icon { font-size: 38px; }
.up-title { font-size: 15px; font-weight: 900; }
.up-val { font-size: 14px; font-weight: 800; text-align: center; }

/* Shop Grid */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.shop-card {
  background: var(--panel-alt);
  border: 2.5px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 240px;
  gap: 8px;
}
.shop-card.locked {
  box-shadow: inset 0 0 0 2px rgba(255, 212, 59, 0.55);
}
.sold-card {
  align-items: center;
  justify-content: center;
  opacity: 0.35;
  font-size: 32px;
  border-style: dashed;
}
.sc-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sc-tier {
  font-size: 11px;
  font-weight: 900;
}
.lock-btn {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 3px 7px;
  cursor: pointer;
  font-size: 13px;
}
.lock-btn.active {
  background: rgba(255, 212, 59, 0.25);
  border-color: var(--gold);
}
.sc-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  font-weight: 900;
}
.sc-emoji { font-size: 20px; }
.sc-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
}
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.tag-chip {
  font-size: 10.5px;
  background: rgba(255,255,255,0.08);
  padding: 2px 6px;
  border-radius: 5px;
  color: #ddd7ed;
}
.cat-chip {
  background: rgba(77, 166, 255, 0.18);
  color: #8cc8ff;
}
.weapon-mini-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 6px;
  font-size: 11.5px;
  color: var(--muted);
}
.weapon-mini-stats strong { color: var(--text); }
.card-stat { font-size: 12.5px; font-weight: 800; }
.card-desc { font-size: 11.5px; color: var(--muted); line-height: 1.35; }

/* Inventory */
.inv-section {
  background: #17141f;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-top: 12px;
}
.inv-title {
  font-size: 13px;
  font-weight: 900;
  color: var(--muted);
  margin-bottom: 8px;
}
.weapon-slots-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.weapon-slot {
  background: var(--panel-alt);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  min-height: 82px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
}
.empty-slot {
  align-items: center;
  justify-content: center;
  border-style: dashed;
  color: #4f4866;
  font-weight: 900;
  font-size: 18px;
}
.ws-head {
  display: flex;
  gap: 5px;
  align-items: baseline;
}
.ws-tier { font-size: 11px; font-weight: 900; }
.ws-name { font-size: 12px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-dmg { font-size: 11px; color: var(--muted); }
.ws-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mini-btn {
  border: none;
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
}
.combine-btn {
  background: var(--gold);
  color: #1f1600;
}
.sell-btn {
  background: #3b2630;
  color: #ff9aa5;
}
.items-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.owned-item-chip {
  background: var(--panel-alt);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 4px 7px;
  font-size: 16px;
}
.owned-item-chip sub {
  font-size: 10px;
  font-weight: 900;
  color: var(--gold);
}

/* Pause & End Modals */
.modal-box {
  width: min(440px, 100%);
  background: var(--panel);
  border: 3px solid var(--border);
  border-radius: 20px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 22px 55px rgba(0,0,0,0.65);
}
.modal-box.victory { border-color: var(--gold); }
.modal-box.defeat { border-color: var(--red); }
.modal-box h2 { font-size: 26px; font-weight: 900; margin-bottom: 18px; }
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.sum-cell {
  background: #17141f;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sum-cell span { font-size: 12px; color: var(--muted); }
.sum-cell strong { font-size: 20px; color: var(--gold); }
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.modal-actions.vertical {
  flex-direction: column;
}

@media (max-width: 960px) {
  .setup-grid, .bw-layout {
    grid-template-columns: 1fr;
  }
  .shop-grid, .upgrade-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .weapon-slots-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
