/* ==============================================
   RUSH RAIDERS — COZY FRONTIER FANTASY EDITION
   Warm, inviting, magical & colorful metagame UI
   ============================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* GLOBAL HIDDEN OVERRIDE */
[hidden], .overlay[hidden], .notif[hidden] { display: none !important; }

:root {
  /* ── Cozy Frontier Fantasy Palette ── */
  --bg-deep:       #1a1008;
  --bg-dark:       #22160a;
  --bg-card:       #2b1e0e;
  --bg-pane:       #321f0f;
  --surface:       rgba(255, 200, 120, 0.07);
  --surface-hover: rgba(255, 200, 120, 0.14);
  --border:        rgba(255, 190, 100, 0.20);
  --border-focus:  #e8a030;

  /* Text */
  --text:          #fdf0d5;
  --text-dim:      rgba(253, 240, 213, 0.55);

  /* Accent colors */
  --gold:          #f5c842;
  --amber:         #e8820c;
  --green:         #4caf50;
  --forest:        #2d7a3a;
  --sky:           #5bb8d4;
  --sky-light:     #a8dff0;
  --red:           #d94f3d;
  --rose:          #e86060;
  --arcane:        #a855f7;
  --arcane-light:  #d4a0ff;
  --cream:         #fdf0d5;
  --parchment:     #e8d5a3;

  /* Tile rarity */
  --rarity-grey-bg:   linear-gradient(135deg, #6b5a3e, #8c7651);
  --rarity-grey-bdr:  #bfa070;
  --rarity-green-bg:  linear-gradient(135deg, #1b4d1f, #2d7a32);
  --rarity-green-bdr: #5cce62;
  --rarity-blue-bg:   linear-gradient(135deg, #1a4060, #2a6090);
  --rarity-blue-bdr:  #5bb8d4;
  --rarity-purple-bg: linear-gradient(135deg, #3d1a60, #6a1b9a);
  --rarity-purple-bdr:#c084fc;

  /* Layout */
  --hud-h:    74px;
  --bottom-h: 64px;
  --nav-h:    72px;

  /* Typography */
  --font-h:   'Outfit', sans-serif;
  --font-ui:  'Inter', sans-serif;
}

html, body {
  height: 100%; width: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-ui);
  touch-action: none;
  -webkit-user-select: none; user-select: none;
}

/* ── Main Container ────────────────────────── */
#home-screen, #game-container {
  position: relative;
  margin: 0 auto;
  height: 100dvh;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(170deg, #1a1008 0%, #281506 45%, #1a2010 100%);
}
@media (min-width: 450px) {
  #home-screen, #game-container {
    box-shadow: 0 0 0 1px rgba(255,190,100,0.15), 0 0 120px rgba(0,0,0,0.98);
  }
}

/* ==============================================
   HUB HEADER
   ============================================== */
.hub-header {
  padding: 14px 18px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(20, 10, 0, 0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}
.hub-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #e8a030 30%, #f5c842 50%, #e8a030 70%, transparent);
  opacity: 0.6;
}
.hub-logo {
  font-family: var(--font-h);
  font-size: 22px; font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--cream);
  text-shadow: 0 0 20px rgba(232, 160, 48, 0.5);
  line-height: 1;
}
.hub-logo span { color: var(--gold); }
.hub-logo small {
  display: block;
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-top: 1px;
}
.hub-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hub-stash-chip {
  background: rgba(245, 200, 66, 0.12);
  border: 1px solid rgba(245, 200, 66, 0.35);
  border-radius: 20px;
  padding: 5px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.hub-stash-chip .chip-label {
  font-size: 8px; font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.hub-stash-chip .chip-value {
  font-family: var(--font-h);
  font-size: 15px; font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 10px rgba(245, 200, 66, 0.4);
}

/* ==============================================
   HUB TAB CONTENT & PANES
   ============================================== */
.hub-tab-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.hub-tab-pane {
  display: none;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  padding: 16px;
  gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(232,160,48,0.3) transparent;
}
.hub-tab-pane.active { display: flex; }

/* ==============================================
   HUB BOTTOM NAVIGATION BAR
   ============================================== */
.hub-nav {
  display: flex;
  background: rgba(15, 8, 0, 0.96);
  border-top: 1px solid var(--border);
  height: var(--nav-h);
  flex-shrink: 0;
  backdrop-filter: blur(20px);
  position: relative;
  z-index: 20;
}
.hub-nav::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #e8a030 25%, #f5c842 50%, #e8a030 75%, transparent);
  opacity: 0.5;
}
.hub-tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.25s ease;
  padding: 8px 4px;
  position: relative;
}
.hub-tab-btn::after {
  content: '';
  position: absolute;
  bottom: 0; left: 20%; right: 20%;
  height: 2px;
  background: var(--gold);
  border-radius: 2px 2px 0 0;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.hub-tab-btn.active::after { opacity: 1; }
.hub-tab-btn .nav-icon {
  font-size: 22px;
  transition: transform 0.25s ease;
  line-height: 1;
}
.hub-tab-btn.active .nav-icon { transform: scale(1.15); }
.hub-tab-btn .nav-label {
  font-family: var(--font-h);
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hub-tab-btn.active {
  color: var(--gold);
}
.hub-tab-btn:hover:not(.active) {
  color: var(--parchment);
  background: rgba(255,200,100,0.05);
}

/* ==============================================
   SCREEN 1 — CAMPFIRE
   ============================================== */

/* Campfire scene wrapper */
.campfire-scene {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 10px 0 0;
}

/* Avatar ring around campfire */
.campfire-avatar-ring {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 16px;
  width: 100%;
  padding-bottom: 8px;
}
.campfire-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.avatar-bubble {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: rgba(232, 160, 48, 0.15);
  border: 2px solid rgba(232, 160, 48, 0.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  position: relative;
  transition: all 0.3s ease;
}
.avatar-bubble.you {
  width: 64px; height: 64px;
  background: rgba(245, 200, 66, 0.2);
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(245, 200, 66, 0.4);
  font-size: 32px;
}
.avatar-bubble.placeholder {
  opacity: 0.5;
  border-style: dashed;
  font-size: 22px;
}
.avatar-bubble .online-dot {
  position: absolute;
  bottom: 2px; right: 2px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #4caf50;
  border: 2px solid var(--bg-dark);
}
.avatar-label {
  font-size: 9px; font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}
.avatar-label.you-label { color: var(--gold); }

/* Campfire CSS Art */
.campfire-art {
  position: relative;
  width: 100px; height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}
.campfire-logs {
  width: 70px; height: 14px;
  background: linear-gradient(135deg, #5c3a1e, #7a4e28);
  border-radius: 7px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.6);
  position: relative;
  z-index: 2;
}
.campfire-logs::before, .campfire-logs::after {
  content: '';
  position: absolute;
  width: 60px; height: 10px;
  background: linear-gradient(135deg, #4a2e14, #6a3e20);
  border-radius: 5px;
  top: -5px;
}
.campfire-logs::before { left: 5px; transform: rotate(-20deg); }
.campfire-logs::after  { left: 5px; transform: rotate(20deg);  }
.campfire-glow {
  position: absolute;
  bottom: 8px; left: 50%;
  transform: translateX(-50%);
  width: 90px; height: 30px;
  background: radial-gradient(ellipse, rgba(232,130,12,0.5) 0%, transparent 70%);
  border-radius: 50%;
  animation: fire-glow 2s ease-in-out infinite alternate;
  z-index: 1;
}
.flame {
  position: absolute;
  bottom: 12px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  z-index: 3;
}
.flame-lick {
  width: 14px;
  border-radius: 50% 50% 30% 30%;
  animation: flicker 1.2s ease-in-out infinite alternate;
}
.flame-lick:nth-child(1) { height: 32px; background: linear-gradient(to top, #f5c842, #e8820c, transparent); animation-delay: 0s; }
.flame-lick:nth-child(2) { height: 46px; background: linear-gradient(to top, #fff, #f5c842, #e8820c, transparent); animation-delay: 0.18s; }
.flame-lick:nth-child(3) { height: 28px; background: linear-gradient(to top, #f5c842, #e8820c, transparent); animation-delay: 0.36s; }
.flame-lick:nth-child(4) { height: 40px; background: linear-gradient(to top, #e8820c, #d94f3d, transparent); animation-delay: 0.1s; }
.flame-lick:nth-child(5) { height: 22px; background: linear-gradient(to top, #f5c842, #e8820c, transparent); animation-delay: 0.28s; }
.campfire-sparks {
  position: absolute;
  bottom: 30px; left: 50%;
  transform: translateX(-50%);
  width: 60px; height: 40px;
  pointer-events: none;
  z-index: 4;
}
.spark {
  position: absolute;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--gold);
  animation: spark-fly 2.2s ease-in-out infinite;
}
.spark:nth-child(1) { left: 20%; animation-delay: 0s;    bottom: 0; }
.spark:nth-child(2) { left: 50%; animation-delay: 0.5s;  bottom: 0; }
.spark:nth-child(3) { left: 75%; animation-delay: 1.1s;  bottom: 0; }
.spark:nth-child(4) { left: 35%; animation-delay: 1.7s;  bottom: 0; }

/* Campfire info panels */
.campfire-panels {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.cf-panel {
  background: rgba(40, 22, 0, 0.8);
  border: 1px solid rgba(232, 160, 48, 0.25);
  border-radius: 14px;
  padding: 12px 14px;
  position: relative;
  overflow: hidden;
}
.cf-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--amber), transparent);
}
.cf-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.cf-panel-title {
  font-family: var(--font-h);
  font-size: 13px; font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cf-timer {
  font-family: var(--font-h);
  font-size: 15px; font-weight: 900;
  color: var(--sky);
  letter-spacing: 0.04em;
  background: rgba(91,184,212,0.1);
  border: 1px solid rgba(91,184,212,0.3);
  border-radius: 8px;
  padding: 3px 8px;
}
.cf-recipe-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.cf-recipe-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,200,100,0.08);
  border: 1px solid rgba(255,200,100,0.2);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px; font-weight: 700;
  color: var(--parchment);
  transition: all 0.2s;
}
.cf-recipe-pill.filled {
  border-color: var(--forest);
  background: rgba(45,122,58,0.2);
  color: var(--green);
}
.cf-recipe-pill .pill-icon { font-size: 14px; }

.cf-status-box {
  background: rgba(232,160,48,0.08);
  border: 1px solid rgba(232,160,48,0.2);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cf-status-line {
  font-family: var(--font-h);
  font-size: 13px; font-weight: 700;
  color: var(--cream);
  display: flex;
  align-items: center;
  gap: 8px;
}
.cf-status-line.muted {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
}

/* ==============================================
   SCREEN 2 — PERSONAL CARRIAGE
   ============================================== */
.carriage-scene {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.carriage-art-banner {
  background: linear-gradient(135deg, rgba(40,25,5,0.9), rgba(25,40,15,0.9));
  border: 1px solid rgba(232,160,48,0.25);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  min-height: 130px;
}
.carriage-art-banner::after {
  content: '🌄';
  position: absolute;
  top: 10px; right: 14px;
  font-size: 28px;
  opacity: 0.18;
}
.carriage-wagon-art {
  font-size: 70px;
  line-height: 1;
  text-shadow: 0 4px 20px rgba(232,160,48,0.4);
  animation: wagon-sway 4s ease-in-out infinite;
}
.carriage-name {
  font-family: var(--font-h);
  font-size: 15px; font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.05em;
}
.carriage-subtitle {
  font-size: 11px;
  color: var(--text-dim);
}

/* Cosmetics Panel */
.cosmetics-panel {
  background: rgba(40, 22, 0, 0.8);
  border: 1px solid rgba(232, 160, 48, 0.25);
  border-radius: 14px;
  padding: 12px;
}
.cosmetics-header {
  font-family: var(--font-h);
  font-size: 12px; font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cosmetics-avatar-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.cosm-arrow-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.cosm-arrow-btn:hover { background: var(--surface-hover); color: var(--gold); }
.cosm-avatar-frame {
  width: 90px; height: 110px;
  background: linear-gradient(160deg, rgba(50,30,10,0.9), rgba(30,50,20,0.9));
  border: 2px solid rgba(232,160,48,0.4);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: 0 0 20px rgba(232,160,48,0.15);
}
.cosm-avatar-emoji { font-size: 44px; }
.cosm-avatar-label { font-size: 9px; font-weight: 700; color: var(--text-dim); }
.cosm-coming-soon {
  font-size: 9px; font-style: italic;
  color: rgba(253,240,213,0.3);
  text-align: center;
  margin-top: 6px;
}

/* Carriage Stash */
.carriage-stash-panel {
  background: rgba(40, 22, 0, 0.8);
  border: 1px solid rgba(232, 160, 48, 0.25);
  border-radius: 14px;
  padding: 12px;
  flex: 1;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.section-title-coz {
  font-family: var(--font-h);
  font-size: 12px; font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}
.section-count-badge {
  font-family: var(--font-h);
  font-size: 11px; font-weight: 700;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2px 8px;
}
.stash-grid-cozy {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}

/* ==============================================
   SCREEN 3 — STORE
   ============================================== */
.store-scene {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.store-banner {
  background: linear-gradient(135deg, rgba(40,20,0,0.9), rgba(30,15,50,0.9));
  border: 1px solid rgba(168,85,247,0.3);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.store-banner-icon { font-size: 40px; }
.store-banner-text {}
.store-banner-title {
  font-family: var(--font-h);
  font-size: 18px; font-weight: 900;
  color: var(--cream);
}
.store-banner-sub {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

.store-section-label {
  font-family: var(--font-h);
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(232,160,48,0.15);
}
.store-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(232,160,48,0.3), transparent);
}

.store-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.store-card {
  background: rgba(40, 22, 0, 0.85);
  border: 1px solid rgba(232,160,48,0.2);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.store-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(232,160,48,0.5), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}
.store-card:hover { border-color: var(--amber); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.5); }
.store-card:hover::before { opacity: 1; }
.store-card:active { transform: translateY(0); }
.store-card.premium {
  border-color: rgba(168,85,247,0.4);
  background: rgba(30,15,50,0.85);
}
.store-card.premium:hover { border-color: var(--arcane); box-shadow: 0 8px 20px rgba(168,85,247,0.3); }
.store-item-icon { font-size: 34px; line-height: 1; }
.store-item-name {
  font-family: var(--font-h);
  font-size: 12px; font-weight: 700;
  color: var(--cream);
  text-align: center;
  line-height: 1.3;
}
.store-buy-btn {
  width: 100%;
  padding: 7px 10px;
  border-radius: 20px;
  border: none;
  background: linear-gradient(135deg, #7a4500, #e8820c);
  color: var(--cream);
  font-family: var(--font-h);
  font-size: 10px; font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.store-buy-btn:hover { filter: brightness(1.15); transform: scale(1.03); }
.store-buy-btn:active { transform: scale(0.97); }
.store-buy-btn.premium-btn {
  background: linear-gradient(135deg, #4a1080, #a855f7);
  box-shadow: 0 4px 12px rgba(168,85,247,0.4);
}
.store-buy-btn:disabled {
  background: rgba(100,80,60,0.4);
  color: var(--text-dim);
  cursor: not-allowed;
  transform: none;
  filter: none;
}

/* ── 2-Column Store Grid (Cozy Frontier UI) ── */
.store-card-grid2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.store-card2 {
  background: linear-gradient(145deg, rgba(42, 24, 6, 0.92), rgba(26, 14, 2, 0.95));
  border: 1.5px solid rgba(232, 160, 48, 0.25);
  border-radius: 16px;
  padding: 14px 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4), inset 0 1px 1px rgba(255,255,255,0.08);
  transition: all 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.store-card2.rarity-grey   { border-color: rgba(180,180,180,0.35); }
.store-card2.rarity-green  { border-color: rgba(46, 213, 115, 0.45); }
.store-card2.rarity-blue   { border-color: rgba(30, 144, 255, 0.5); }
.store-card2.rarity-purple { border-color: rgba(168, 85, 247, 0.6); }

.store-card2:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(232, 160, 48, 0.2), inset 0 1px 2px rgba(255,255,255,0.15);
  border-color: var(--gold);
}
.store-card-unaffordable {
  opacity: 0.65;
  filter: saturate(0.6);
}
.store-card2-img {
  font-size: 38px;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6));
  margin-top: 2px;
  transition: transform 0.2s;
}
.store-card2:hover .store-card2-img {
  transform: scale(1.1) rotate(4deg);
}
.store-card2-name {
  font-family: var(--font-h);
  font-size: 13px;
  font-weight: 700;
  color: var(--cream);
  text-align: center;
  line-height: 1.25;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.store-buy-btn2 {
  width: 100%;
  padding: 8px 6px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #a86200, #f59e0b);
  color: #fff;
  font-family: var(--font-h);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(245,158,11,0.3);
  transition: all 0.18s;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.store-buy-btn2:hover:not(:disabled) {
  filter: brightness(1.15);
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(245,158,11,0.5);
}
.store-buy-btn2:active:not(:disabled) {
  transform: scale(0.97);
}
.store-buy-btn2:disabled {
  background: rgba(80, 60, 40, 0.45);
  color: rgba(255,255,255,0.45);
  box-shadow: none;
  cursor: not-allowed;
  text-shadow: none;
}

/* Flying Tile Match Particles */
.tile-match-particle {
  filter: drop-shadow(0 0 12px var(--gold));
  pointer-events: none;
}

/* ==============================================

   SCREEN 4 — RAID PREPARATION
   ============================================== */
.raid-prep-scene {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Top character / gear area */
.raid-gear-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.raid-avatar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.raid-avatar-frame {
  width: 70px; height: 70px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(50,30,10,0.9), rgba(30,50,20,0.9));
  border: 2px solid rgba(232,160,48,0.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  box-shadow: 0 0 15px rgba(232,160,48,0.2);
}
.raid-avatar-name {
  font-family: var(--font-h);
  font-size: 10px; font-weight: 700;
  color: var(--gold);
  text-align: center;
}
.raid-equip-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.raid-equip-slot-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.raid-equip-label {
  font-size: 9px; font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.raid-equip-slot {
  height: 48px;
  background: rgba(0,0,0,0.4);
  border: 1px dashed var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.raid-equip-slot:hover { background: var(--surface-hover); }
.raid-equip-slot.weapon-equipped {
  border-color: var(--arcane-light);
  border-style: solid;
  background: rgba(168,85,247,0.1);
  box-shadow: inset 0 0 10px rgba(168,85,247,0.15);
}
.raid-equip-slot.shield-equipped {
  border-color: var(--sky);
  border-style: solid;
  background: rgba(91,184,212,0.1);
  box-shadow: inset 0 0 10px rgba(91,184,212,0.15);
}
.raid-equip-slot-empty {
  font-size: 9px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 5px;
}
.raid-equip-slot-empty .slot-ghost { font-size: 18px; opacity: 0.4; }
.raid-equipped-content {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  width: 100%;
}
.raid-equipped-icon { font-size: 22px; }
.raid-equipped-info { flex: 1; }
.raid-equipped-name { font-family: var(--font-h); font-size: 11px; font-weight: 700; color: var(--cream); }
.raid-equipped-stat { font-size: 10px; color: var(--text-dim); }
.raid-unequip-hint { font-size: 9px; color: var(--rose); opacity: 0.7; margin-left: auto; }

/* Backpack */
.backpack-panel {
  background: rgba(40, 22, 0, 0.8);
  border: 1px solid rgba(232, 160, 48, 0.25);
  border-radius: 14px;
  padding: 12px;
}
.backpack-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.backpack-grid-12 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

/* Safe pocket highlight */
.slot.safe-pocket {
  border-color: rgba(91,184,212,0.6) !important;
  border-style: solid !important;
  box-shadow: 0 0 10px rgba(91,184,212,0.25), inset 0 0 6px rgba(91,184,212,0.1);
}
.slot.safe-pocket::after {
  content: '🔒';
  position: absolute;
  top: 2px; right: 3px;
  font-size: 8px;
  opacity: 0.6;
}

/* Go Raid Button */
.go-raid-btn-wrap {
  padding: 4px 0;
}
.go-raid-btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #7a3800, #e8820c, #f5c842, #e8820c, #7a3800);
  background-size: 200% 100%;
  color: var(--bg-deep);
  font-family: var(--font-h);
  font-size: 18px; font-weight: 900;
  letter-spacing: 0.06em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  animation: btn-shimmer 3s ease infinite;
  box-shadow: 0 8px 25px rgba(232,130,12,0.5), inset 0 1px 0 rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.go-raid-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(232,130,12,0.7), inset 0 1px 0 rgba(255,255,255,0.3);
  filter: brightness(1.1);
}
.go-raid-btn:active { transform: translateY(-1px); }
.go-raid-btn .btn-icon { font-size: 22px; }
.go-raid-btn::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  animation: btn-sweep 2.5s ease infinite;
}

/* Raid Scrollable Stash */
.raid-stash-panel {
  background: rgba(40, 22, 0, 0.8);
  border: 1px solid rgba(232, 160, 48, 0.25);
  border-radius: 14px;
  padding: 12px;
  min-height: 100px;
}
.raid-stash-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-top: 8px;
}

/* Fallen Scout Placeholder */
.fallen-scout-panel {
  background: rgba(20, 10, 30, 0.8);
  border: 1px solid rgba(168,85,247,0.25);
  border-radius: 14px;
  padding: 12px;
}
.fallen-scout-header {
  font-family: var(--font-h);
  font-size: 12px; font-weight: 800;
  color: var(--arcane-light);
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.fallen-scout-sub {
  font-size: 10px;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.scout-beacons-row {
  display: flex;
  gap: 8px;
}
.scout-beacon-card {
  flex: 1;
  background: rgba(30,15,50,0.8);
  border: 1px dashed rgba(168,85,247,0.3);
  border-radius: 10px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 0.6;
  cursor: not-allowed;
}
.scout-beacon-icon { font-size: 20px; filter: grayscale(0.5); }
.scout-beacon-label { font-size: 9px; font-weight: 700; color: var(--arcane-light); text-align: center; }
.scout-coming-soon-tag {
  font-size: 8px;
  background: rgba(168,85,247,0.15);
  border: 1px solid rgba(168,85,247,0.25);
  border-radius: 6px;
  padding: 2px 6px;
  color: var(--arcane-light);
  letter-spacing: 0.06em;
}

/* ==============================================
   SLOT ELEMENTS (Shared across all screens)
   ============================================== */
.slot {
  aspect-ratio: 1/1;
  background: rgba(255,200,100,0.04);
  border: 1px dashed rgba(255,190,100,0.2);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.slot:hover { background: rgba(255,200,100,0.1); border-color: rgba(255,190,100,0.4); }
.slot.selected {
  border: 2px solid var(--gold);
  box-shadow: 0 0 15px rgba(245,200,66,0.5);
}
.slot-icon { font-size: 22px; line-height: 1; }
.slot-name {
  font-size: 7px; font-weight: 700;
  color: var(--cream);
  text-align: center;
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 90%;
}
.slot-badge {
  position: absolute; bottom: 2px; right: 3px;
  font-family: var(--font-h); font-size: 10px; font-weight: 900;
  color: var(--gold); background: rgba(0,0,0,0.7);
  padding: 1px 4px; border-radius: 4px;
}

/* Rarity Backgrounds — Cozy Fantasy palette */
.slot[data-rarity="grey"], .tile[data-rarity="grey"] {
  background: var(--rarity-grey-bg);
  border: 1px solid var(--rarity-grey-bdr);
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.slot[data-rarity="green"], .tile[data-rarity="green"] {
  background: var(--rarity-green-bg);
  border: 1px solid var(--rarity-green-bdr);
  box-shadow: 0 0 10px rgba(76,175,80,0.3);
}
.slot[data-rarity="blue"], .tile[data-rarity="blue"] {
  background: var(--rarity-blue-bg);
  border: 1px solid var(--rarity-blue-bdr);
  box-shadow: 0 0 12px rgba(91,184,212,0.35);
}
.slot[data-rarity="purple"], .tile[data-rarity="purple"] {
  background: var(--rarity-purple-bg);
  border: 1px solid var(--rarity-purple-bdr);
  box-shadow: 0 0 16px rgba(168,85,247,0.45);
}

/* ==============================================
   IN-RAID HUD & GAMEPLAY (PRESERVED)
   ============================================== */
#hud {
  height: var(--hud-h);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(20, 10, 0, 0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(15px);
  z-index: 20;
  position: relative;
}

.hud-left { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.player-info { display: flex; flex-direction: column; gap: 4px; }
.hud-equip-row { display: flex; gap: 4px; }
.gun-equipped-hud, .shield-equipped-hud {
  font-size: 10px; font-weight: 700;
  padding: 2px 5px; border-radius: 4px;
  display: inline-block; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 85px; cursor: pointer;
}
.gun-equipped-hud {
  color: #fff; background: rgba(168,85,247,0.15); border: 1px solid var(--arcane-light);
}
.shield-equipped-hud {
  color: #fff; background: rgba(91,184,212,0.15); border: 1px solid var(--sky);
}

.bars-container { display: flex; flex-direction: column; gap: 3px; width: 120px; }
.bar-wrapper { display: flex; align-items: center; gap: 4px; }
.bar-label { font-size: 9px; font-weight: 800; width: 26px; color: var(--text-dim); }
.bar-bg { flex: 1; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; transition: width 0.3s ease; }
.shield-fill { background: linear-gradient(90deg, #2a7890, #5bb8d4); box-shadow: 0 0 6px #5bb8d4; }
.hp-fill    { background: linear-gradient(90deg, #8a2020, var(--rose));  box-shadow: 0 0 6px var(--rose); }
.bar-num { font-size: 10px; font-weight: 700; font-family: var(--font-h); width: 22px; text-align: right; }

.hud-center { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.map-toggle-btn {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 2px 8px; cursor: pointer;
  transition: all 0.2s; color: var(--text);
}
.map-toggle-btn:hover { background: rgba(255,255,255,0.2); transform: scale(1.05); }
.map-icon { font-size: 14px; }
.timer-display {
  font-family: var(--font-h);
  font-size: 22px; font-weight: 900;
  color: #fff; line-height: 1;
  text-shadow: 0 0 10px rgba(255,255,255,0.3);
}
.timer-display.warn   { color: var(--gold); }
.timer-display.danger { color: var(--rose); animation: pulse-red 1s infinite; }

.hud-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: 1; }
.worth-counter { font-size: 11px; font-weight: 800; }
.worth-label { color: var(--text-dim); font-size: 9px; }
.worth-val-text { color: var(--gold); font-family: var(--font-h); font-size: 13px; }

/* Combat Banner */
.combat-banner {
  background: rgba(20, 14, 8, 0.95);
  border: 1px solid var(--border);
  padding: 6px 12px;
  display: flex; justify-content: space-between; align-items: center;
}
.combat-badge { font-weight: 900; font-size: 12px; color: var(--rose); letter-spacing: 0.05em; }
.enemy-info { display: flex; align-items: center; gap: 8px; }
.enemy-title { font-size: 10px; font-weight: 800; color: #fff; }
.enemy-gun { border-color: var(--red); color: #ff8a80; background: rgba(217,79,61,0.1); }

/* Cooldown Bar */
.cooldown-container {
  padding: 4px 14px;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border);
}
.cooldown-text {
  font-family: var(--font-h); font-size: 11px; font-weight: 800;
  width: 70px; text-align: right; color: var(--text-dim);
}
.cooldown-bar-bg {
  flex: 1; height: 6px; background: rgba(255,255,255,0.08);
  border-radius: 3px; overflow: hidden;
}
.cooldown-bar-fill {
  height: 100%; background: var(--amber);
  transition: width 0.05s linear;
  box-shadow: 0 0 8px var(--amber);
}

/* Main Game Area */
#main-area-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  overflow: hidden;
}

#grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(7, 1fr);
  gap: 6px;
  width: 100%;
  max-width: 390px;
  aspect-ratio: 1 / 1;
  padding: 8px;
  background: rgba(15, 8, 0, 0.7);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: inset 0 0 30px rgba(0,0,0,0.6);
  position: relative;
}

/* Match-3 Tiles */
.tile {
  position: relative;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: grab;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  overflow: hidden;
  touch-action: none;
}
.tile:active { cursor: grabbing; }
.tile.dragging {
  z-index: 50;
  box-shadow: 0 10px 25px rgba(0,0,0,0.8), 0 0 15px var(--gold);
  transition: none !important;
}
.tile.drag-target {
  z-index: 40;
  box-shadow: 0 0 15px var(--sky);
  transition: none !important;
}
.tile-fall {
  animation: tile-drop-in 0.3s cubic-bezier(0.175, 0.88, 0.32, 1.275);
}

/* Flying Icon Animation */
.flying-icon {
  position: fixed;
  font-size: 26px;
  z-index: 300;
  pointer-events: none;
  transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  filter: drop-shadow(0 0 10px var(--gold));
}

/* Obstacle/useless tiles */
.tile[data-type="useless"], .tile[data-type="dirt"], .tile[data-type="rock"], .tile[data-type="floor"] {
  background: transparent !important;
  border: 1px dashed rgba(255,190,100,0.15) !important;
  color: rgba(255,200,100,0.4);
  opacity: 0.65;
}

/* Special Tiles */
.tile[data-type="move"]   { background: transparent !important; border: 2px solid #00b0ff !important; box-shadow: 0 0 10px rgba(0,176,255,0.4); }
.tile[data-type="action"] {
  background: transparent !important;
  border: 2px solid var(--gold) !important;
  box-shadow: none !important;
}
.tile[data-type="crate"]   { border-width: 2px; }
.tile[data-type="crate-red"] {
  background: radial-gradient(circle at 40% 35%, #8b1a1a 0%, #4a0808 80%) !important;
  border: 2px solid #e85555 !important;
  box-shadow: none !important;
}
.tile[data-type="crate-purple"] {
  background: radial-gradient(circle at 40% 35%, #5c1a82 0%, #2e0845 80%) !important;
  border: 2px solid #c084fc !important;
  box-shadow: none !important;
}
.tile[data-type="crate-green"] {
  background: radial-gradient(circle at 40% 35%, #1a5c1e 0%, #0a2e0c 80%) !important;
  border: 2px solid #4caf50 !important;
  box-shadow: none !important;
}
.tile[data-type="heal"], .tile[data-type="t_heal"],
.tile[data-type="util"], .tile[data-type="t_util"] {
  background: transparent !important;
  border: 2px solid var(--amber) !important;
  box-shadow: 0 0 12px rgba(232,130,12,0.4) !important;
}

/* Tile badge */
.tile-badge {
  position: absolute; bottom: 2px; right: 4px;
  font-family: var(--font-h); font-size: 11px; font-weight: 900;
  color: #fff; background: rgba(0,0,0,0.7);
  padding: 1px 4px; border-radius: 4px;
}

/* 7x7 Map View */
.map-view {
  position: absolute;
  top: 10px; left: 10px; right: 10px; bottom: 10px;
  background: rgba(15, 8, 0, 0.96);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 30;
  backdrop-filter: blur(20px);
}
.map-header { text-align: center; }
.map-title { font-family: var(--font-h); font-size: 18px; font-weight: 800; color: var(--cream); }
.map-sub { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

.map-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 6px; flex: 1;
  max-width: 380px; max-height: 380px;
  margin: 0 auto; aspect-ratio: 1/1;
}
.map-node {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 12px; cursor: default;
  position: relative; transition: all 0.2s;
}
.map-node.spawn   { border-color: var(--green);  background: rgba(76,175,80,0.08); }
.map-node.med     { border-color: var(--sky);     background: rgba(91,184,212,0.08); }
.map-node.high    { border-color: var(--arcane);  background: rgba(168,85,247,0.12); box-shadow: 0 0 10px rgba(168,85,247,0.3); }
.map-node.extract { border-color: var(--gold);    background: rgba(245,200,66,0.12); }
.map-node.current {
  border: 2px solid var(--cream);
  box-shadow: 0 0 15px var(--cream);
  animation: pulse-select 1s infinite alternate;
}
.map-node.adjacent {
  cursor: pointer;
  border-color: var(--green);
  background: rgba(76,175,80,0.2);
  transform: scale(1.05);
}
.map-node.adjacent:hover { background: var(--green); color: #000; box-shadow: 0 0 15px var(--green); }
.node-label { font-size: 9px; font-weight: 700; color: var(--text-dim); }
.node-icon  { font-size: 14px; }

.map-legend {
  display: flex; justify-content: space-around; flex-wrap: wrap; gap: 6px;
  padding-top: 8px; border-top: 1px solid var(--border);
  font-size: 10px; font-weight: 600; color: var(--text-dim);
}
.legend-item { display: flex; align-items: center; gap: 4px; }
.legend-color { width: 10px; height: 10px; border-radius: 2px; }
.legend-color.spawn   { background: var(--green); }
.legend-color.med     { background: var(--sky); }
.legend-color.high    { background: var(--arcane); }
.legend-color.extract { background: var(--gold); }
.legend-color.current { background: var(--cream); }

/* Wireframe Placeholder Art Banner */
.wireframe-banner {
  display: flex; gap: 8px;
  padding: 8px 12px 4px 12px;
  min-height: 140px;
}
.banner-left-col  { width: 145px; display: flex; flex-direction: column; gap: 6px; }
.player-banner-stats {
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 6px;
  display: flex; flex-direction: column; gap: 3px;
}
.stat-bar-row  { display: flex; align-items: center; gap: 4px; }
.stat-lbl      { font-size: 9px; font-weight: 800; width: 24px; color: var(--text-dim); }
.stat-bar-bg   { flex: 1; height: 6px; background: rgba(255,255,255,0.15); border-radius: 3px; overflow: hidden; }
.stat-bar-fill { height: 100%; border-radius: 3px; transition: width 0.3s ease; }
.stat-num      { font-size: 10px; font-weight: 700; font-family: var(--font-h); width: 22px; text-align: right; color: #fff; }
.stat-dmg-row  { font-size: 10px; font-weight: 800; color: #ff8a80; padding-top: 2px; }

.wireframe-box {
  background: rgba(255,200,100,0.08);
  border: 2px dashed rgba(255,190,100,0.3);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  text-align: center; position: relative; overflow: hidden;
}
.char-art-box {
  flex: 1; min-height: 70px;
  background: radial-gradient(circle at 50% 60%, rgba(232,130,12,0.18) 0%, transparent 70%);
  font-size: 56px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  text-shadow: 0 4px 12px rgba(0,0,0,0.7);
}
.char-art-emoji { font-size: 56px; line-height: 1; pointer-events: none; }
.area-art-box {
  flex: 1; background: rgba(100,80,50,0.15);
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.enemy-emoji {
  position: absolute;
  font-size: 52px;
  bottom: 8px; right: 10px;
  opacity: 0.88;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.8));
  pointer-events: none;
}
.banner-right-col { flex: 1; display: flex; }
.wf-label {
  font-family: var(--font-h); font-size: 14px; font-weight: 700;
  color: var(--cream); letter-spacing: 0.03em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  pointer-events: none;
}
.combat-banner-overlay {
  position: absolute; inset: 4px;
  background: rgba(20, 14, 8, 0.95);
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  gap: 4px; padding: 6px;
}

/* Bottom Action Bar */
.footer-bottom-bar {
  height: 68px;
  padding: 6px 14px;
  background: rgba(15, 8, 0, 0.96);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; z-index: 20;
}
.footer-left-move   { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 90px; }
.mov-header-row     { display: flex; align-items: center; gap: 4px; }
.footer-move-buttons { display: flex; gap: 4px; }
.footer-center-action { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }

.mov-label { font-size: 10px; font-weight: 800; color: #fff; }
.mov-icon  { color: var(--green); font-weight: 900; margin-right: 2px; }
.mov-progress-wrapper {
  width: 80px; height: 12px;
  background: rgba(255,255,255,0.1); border-radius: 6px;
  position: relative; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.15);
}
.mov-bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--forest), var(--green));
  transition: width 0.3s ease;
}
.mov-val-text {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  font-size: 9px; font-weight: 800; font-family: var(--font-h);
  display: flex; align-items: center; justify-content: center;
  color: #fff; text-shadow: 0 1px 2px #000;
}

.worth-counter { font-size: 11px; font-weight: 800; }

.btn-action-main {
  background: rgba(255,200,100,0.12);
  border: 1px solid rgba(255,190,100,0.25);
  color: var(--cream);
  font-family: var(--font-h);
  font-size: 11px; font-weight: 900;
  letter-spacing: 0.08em;
  padding: 5px 22px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-action-main:hover {
  background: rgba(232,160,48,0.25);
  border-color: var(--gold);
  transform: translateY(-1px);
}

.action-points-dots { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.action-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #7a5020;
  border: 1px solid rgba(0,0,0,0.4);
  transition: all 0.25s ease;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}
.action-dot.active {
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold), 0 0 4px #fff;
  transform: scale(1.1);
}
.action-dot.empty {
  background: #2a1a08;
  border: 1px solid rgba(255,190,100,0.15);
  box-shadow: none;
  opacity: 0.8;
}

.footer-right-backpack { display: flex; align-items: center; }
.backpack-btn {
  display: flex; align-items: center; gap: 6px;
  background: rgba(232,160,48,0.12);
  border: 1px solid var(--amber);
  padding: 8px 12px; border-radius: 10px;
  color: var(--cream); cursor: pointer; transition: all 0.2s;
}
.backpack-btn:hover { background: var(--amber); transform: translateY(-2px); color: var(--bg-deep); }
.bp-icon  { font-size: 18px; }
.bp-label { font-family: var(--font-h); font-size: 12px; font-weight: 800; }
.bp-count {
  background: rgba(0,0,0,0.5); padding: 2px 6px; border-radius: 6px;
  font-size: 11px; font-weight: 700; color: var(--gold);
}

.mov-decay-ring-wrap {
  position: relative; display: flex; align-items: center; justify-content: center;
  margin-left: 6px; width: 22px; height: 22px;
}
.mov-decay-ring { transform: rotate(-90deg); }
.mov-ring-track { stroke: rgba(255,255,255,0.15); }
.mov-ring-arc   { stroke: var(--green); transition: stroke-dashoffset 0.35s ease, stroke 0.35s ease; }
.mov-ring-label {
  position: absolute; font-size: 8px; font-weight: 800;
  font-family: var(--font-h); color: var(--green); pointer-events: none;
}

/* Area indicator */
.area-indicator { display: flex; flex-direction: column; gap: 1px; }
.area-coord { font-family: var(--font-h); font-size: 13px; font-weight: 900; color: var(--cream); }
.area-tag   { font-size: 9px; font-weight: 700; color: var(--gold); letter-spacing: 0.06em; }

/* ==============================================
   MODALS & OVERLAYS
   ============================================== */
.overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(8, 4, 0, 0.82);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 16px;
}
#ov-container { padding-top: 64px; }
#ov-container .container-card { max-width: 470px; max-height: calc(100dvh - 84px); }

.ov-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%; max-width: 410px;
  max-height: 90dvh;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.9), 0 0 0 1px rgba(255,190,100,0.1);
  overflow: hidden;
  animation: modal-scale 0.25s cubic-bezier(0.175, 0.88, 0.32, 1.275);
}

.container-modal-header {
  padding: 14px 18px;
  background: rgba(0,0,0,0.3);
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-title-wrap { display: flex; align-items: center; gap: 10px; }
.container-icon-lg { font-size: 28px; }
.ov-title { font-family: var(--font-h); font-size: 16px; font-weight: 900; color: var(--cream); }
.ov-sub   { font-size: 11px; color: var(--text-dim); }
.btn-close-modal {
  background: transparent; border: none; color: var(--text-dim);
  font-size: 20px; font-weight: 700; cursor: pointer; padding: 4px;
}
.btn-close-modal:hover { color: var(--cream); }

.dual-inventory-view {
  display: flex; flex-direction: column; gap: 12px;
  padding: 14px; overflow-y: auto; flex: 1;
}
.inv-pane {
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,190,100,0.06);
  border-radius: 12px; padding: 10px;
  display: flex; flex-direction: column; gap: 6px;
}
.inv-pane-title { font-family: var(--font-h); font-size: 11px; font-weight: 800; color: var(--text-dim); }
.bp-header-flex { display: flex; justify-content: space-between; align-items: center; }
.worth-tag      { font-size: 11px; font-weight: 700; color: var(--text-dim); }
.worth-tag span { color: var(--gold); font-family: var(--font-h); }

.modal-equip-bar { display: flex; gap: 8px; margin-bottom: 4px; }
.equip-mini { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.equip-mini-lbl { font-size: 9px; font-weight: 800; color: var(--gold); }
.equip-mini-slot { width: 100%; height: 50px; background: rgba(0,0,0,0.4); }

.inv-grid { display: grid; gap: 6px; min-height: 64px; }
.container-grid  { grid-template-columns: repeat(4, 1fr); }
.backpack-grid-12 { grid-template-columns: repeat(4, 1fr); }

.equip-slot {
  width: 100%; height: 60px;
  background: rgba(0,0,0,0.4);
}
.weapon-slot { border-color: var(--arcane-light) !important; box-shadow: inset 0 0 10px rgba(168,85,247,0.2); }
.shield-slot  { border-color: var(--sky) !important;          box-shadow: inset 0 0 10px rgba(91,184,212,0.2); }

.bp-actions-row    { display: flex; gap: 6px; justify-content: flex-end; margin-top: 4px; }
.container-action-bar { display: flex; gap: 6px; justify-content: flex-end; margin-top: 4px; }

/* Death & Win Cards */
.death-card, .win-card { padding: 30px 24px; text-align: center; align-items: center; gap: 12px; }
.ov-icon { font-size: 54px; }
.modal-buttons { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 10px; }
.stat-box { display: flex; flex-direction: column; background: var(--surface); padding: 10px 20px; border-radius: 10px; width: 100%; }
.stat-label  { font-size: 10px; font-weight: 700; color: var(--text-dim); }
.stat-val-lg { font-family: var(--font-h); font-size: 24px; font-weight: 900; color: #fff; }
.extracted-stats { display: flex; flex-direction: column; gap: 10px; width: 100%; margin: 10px 0; }

.extracted-loot-list {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
  max-height: 140px; overflow-y: auto; padding: 8px; width: 100%;
  background: rgba(0,0,0,0.3); border-radius: 10px;
}
.extracted-item-pill {
  background: var(--surface); border: 1px solid var(--border);
  padding: 4px 8px; border-radius: 6px; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; gap: 4px; color: var(--cream);
}

/* Generic Buttons */
.btn {
  width: 100%; padding: 12px;
  border: none; border-radius: 10px;
  font-family: var(--font-h);
  font-size: 14px; font-weight: 800;
  letter-spacing: 0.05em;
  cursor: pointer; transition: all 0.2s ease;
  display: flex; justify-content: center; align-items: center; gap: 6px;
  color: var(--cream);
}
.btn-green  { background: linear-gradient(135deg, var(--forest), var(--green)); color: #000; box-shadow: 0 6px 20px rgba(76,175,80,0.4); }
.btn-green:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(76,175,80,0.6); }
.btn-purple { background: linear-gradient(135deg, #3d1a60, var(--arcane)); box-shadow: 0 6px 20px rgba(168,85,247,0.4); }
.btn-cyan   { background: linear-gradient(135deg, #1a4060, var(--sky)); color: #000; box-shadow: 0 6px 20px rgba(91,184,212,0.4); }
.btn-red    { background: linear-gradient(135deg, #8a1a1a, var(--rose)); box-shadow: 0 6px 20px rgba(217,79,61,0.4); }
.btn-neutral { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-sm     { padding: 6px 10px; font-size: 11px; }

/* Equip slots in home loadout */
.equip-slots-row    { display: flex; gap: 12px; margin-top: 8px; }
.equip-slot-wrap    { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.equip-label        { font-size: 10px; font-weight: 800; color: var(--cream); }

/* Toast Notifications */
.notif {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  background: rgba(30, 15, 0, 0.96); border: 1px solid var(--amber);
  box-shadow: 0 10px 30px rgba(0,0,0,0.8), 0 0 15px rgba(232,160,48,0.4);
  padding: 10px 18px; border-radius: 50px;
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-h); font-size: 13px; font-weight: 800; color: var(--cream);
  z-index: 9999; backdrop-filter: blur(10px);
  animation: slide-down 0.3s cubic-bezier(0.175, 0.88, 0.32, 1.275);
}

/* Combat Action Modal */
#ov-combat-action .combat-action-card { max-width: 380px; }

/* ==============================================
   KEYFRAME ANIMATIONS
   ============================================== */
@keyframes flicker {
  0%   { transform: scaleX(1)    skewX(0deg) scaleY(1);    opacity: 1; }
  25%  { transform: scaleX(0.88) skewX(-3deg) scaleY(1.05); opacity: 0.9; }
  50%  { transform: scaleX(1.05) skewX(2deg)  scaleY(0.97); opacity: 1; }
  75%  { transform: scaleX(0.92) skewX(-1deg) scaleY(1.03); opacity: 0.95; }
  100% { transform: scaleX(1)    skewX(0deg)  scaleY(1);    opacity: 1; }
}
@keyframes fire-glow {
  0%   { opacity: 0.4; transform: translateX(-50%) scaleX(0.9); }
  100% { opacity: 0.7; transform: translateX(-50%) scaleX(1.1); }
}
@keyframes spark-fly {
  0%   { transform: translateY(0) translateX(0);       opacity: 1;   }
  50%  { transform: translateY(-25px) translateX(8px); opacity: 0.7; }
  100% { transform: translateY(-45px) translateX(-5px); opacity: 0; }
}
@keyframes wagon-sway {
  0%, 100% { transform: rotate(-1deg) translateY(0); }
  50%       { transform: rotate(1deg)  translateY(-3px); }
}
@keyframes btn-shimmer {
  0%   { background-position: 0%   50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0%   50%; }
}
@keyframes btn-sweep {
  0%   { left: -100%; }
  100% { left: 150%; }
}
@keyframes juicy-bounce {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.25); filter: brightness(1.5); }
  100% { transform: scale(1); }
}
.juicy-bounce { animation: juicy-bounce 0.35s cubic-bezier(0.175, 0.88, 0.32, 1.275); }
@keyframes pulse-select {
  0%   { transform: scale(1.0); box-shadow: 0 0 8px  var(--cream); }
  100% { transform: scale(1.06); box-shadow: 0 0 18px var(--cream); }
}
@keyframes pulse-banner {
  0%,10% { background: rgba(180,40,40,0.3); }
  50%    { background: rgba(180,40,40,0.5); }
}
@keyframes pulse-red {
  0%,10% { color: var(--rose); }
  50%    { color: #fff; }
}
@keyframes bounce-in {
  0%   { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}
@keyframes modal-scale {
  0%   { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}
@keyframes slide-down {
  0%   { transform: translate(-50%, -20px); opacity: 0; }
  100% { transform: translate(-50%, 0);     opacity: 1; }
}
@keyframes tile-drop-in {
  0%   { transform: translateY(-30px); opacity: 0; }
  100% { transform: translateY(0);     opacity: 1; }
}

/* ══════════════════════════════════════════════
   LOOT ROW MODAL — new container window style
   ══════════════════════════════════════════════ */
.loot-row-overlay {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(10,5,0,0.82);
  backdrop-filter: blur(4px);
}

.loot-row-card {
  width: 100%; max-width: 420px;
  background: linear-gradient(160deg, #1e1206 0%, #2a1a08 60%, #1a2010 100%);
  border: 1px solid rgba(76,175,80,0.45);
  border-radius: 20px;
  box-shadow: 0 0 40px rgba(76,175,80,0.22), 0 0 80px rgba(76,175,80,0.08);
  padding: 18px 16px 16px;
  display: flex; flex-direction: column; gap: 14px;
  animation: modal-scale 0.22s ease both;
}

.loot-row-header {
  display: flex; align-items: center; gap: 10px;
}
.loot-row-icon { font-size: 28px; }
.loot-row-title {
  font-family: var(--font-h);
  font-size: 16px; font-weight: 900;
  color: #a0ffa8;
  letter-spacing: 0.04em;
  text-shadow: 0 0 12px rgba(76,175,80,0.6);
}
.loot-row-subtitle {
  font-size: 10px; color: var(--text-dim);
  margin-top: 2px;
}

/* The green glowing loot tray */
.loot-items-tray {
  background: linear-gradient(135deg, rgba(20,60,22,0.6), rgba(10,40,12,0.8));
  border: 1px solid rgba(76,175,80,0.35);
  border-radius: 14px;
  padding: 14px 10px;
  min-height: 90px;
  display: flex; gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  justify-content: center;
  flex-wrap: wrap;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5), 0 0 16px rgba(76,175,80,0.12);
}
.loot-items-tray::-webkit-scrollbar { height: 4px; }
.loot-items-tray::-webkit-scrollbar-track { background: transparent; }
.loot-items-tray::-webkit-scrollbar-thumb { background: rgba(76,175,80,0.3); border-radius: 2px; }

/* A single loot item card in the tray */
.loot-tray-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(76,175,80,0.4);
  background: rgba(30,60,30,0.7);
  transition: transform 0.15s, box-shadow 0.15s;
  min-width: 66px;
  position: relative;
}
.loot-tray-item:active {
  transform: scale(0.92);
  box-shadow: 0 0 20px rgba(76,175,80,0.55);
}
.loot-tray-item:hover {
  background: rgba(40,80,40,0.85);
  box-shadow: 0 0 16px rgba(76,175,80,0.4);
  transform: translateY(-2px);
}
.loot-tray-emoji { font-size: 28px; }
.loot-tray-name {
  font-size: 9px; font-weight: 700; color: var(--cream);
  text-align: center; max-width: 60px;
  line-height: 1.2;
}
.loot-tray-val {
  font-size: 9px; color: var(--gold); font-weight: 700;
}
.loot-tray-count {
  position: absolute; top: 4px; right: 6px;
  font-size: 10px; font-weight: 900;
  background: rgba(0,0,0,0.6); border-radius: 4px;
  padding: 0 3px; color: #fff;
}
.loot-tray-empty {
  color: var(--text-dim); font-size: 12px; font-style: italic;
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 16px 0;
}

/* Backpack bottom sheet (only shown when full) */
.loot-bp-sheet {
  background: rgba(20,10,4,0.95);
  border: 1px solid rgba(255,200,100,0.25);
  border-radius: 14px;
  padding: 10px;
}
.loot-bp-sheet-label {
  font-size: 10px; font-weight: 800; color: var(--gold);
  margin-bottom: 8px; letter-spacing: 0.05em;
}
.loot-bp-compact-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
/* Drag-over highlight for backpack swap */
.slot.drag-over { border-color: var(--green) !important; box-shadow: 0 0 12px rgba(76,175,80,0.5); }
.slot.drag-source { opacity: 0.55; border-style: dashed; }

/* Safe Pocket slot styling */
.safe-pocket-slot {
  position: relative;
}
.safe-pocket-slot::before {
  content: '🔒';
  position: absolute; top: -6px; left: -4px;
  font-size: 10px; z-index: 2;
  filter: drop-shadow(0 0 4px rgba(91,184,212,0.8));
}
.slot.safe-pocket {
  border-color: var(--sky) !important;
  box-shadow: 0 0 8px rgba(91,184,212,0.35), inset 0 0 4px rgba(91,184,212,0.15);
}

.loot-continue-btn {
  width: 100%;
  padding: 14px 0;
  background: linear-gradient(90deg, #1f5c23, #2d8e32);
  border: none; border-radius: 12px;
  font-family: var(--font-h); font-size: 16px; font-weight: 900;
  color: #fff; letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(76,175,80,0.4);
  transition: transform 0.12s, box-shadow 0.12s;
}
.loot-continue-btn:active {
  transform: scale(0.97);
  box-shadow: 0 2px 10px rgba(76,175,80,0.25);
}

/* Action Row Modal — same visual style */
.action-row-card {
  width: 100%; max-width: 420px;
  background: linear-gradient(160deg, #0f0b1e 0%, #1a1030 60%, #0f1020 100%);
  border: 1px solid rgba(245,200,66,0.45);
  border-radius: 20px;
  box-shadow: 0 0 40px rgba(245,200,66,0.22), 0 0 80px rgba(245,200,66,0.08);
  padding: 18px 16px 16px;
  display: flex; flex-direction: column; gap: 14px;
  animation: modal-scale 0.22s ease both;
}
.action-row-header {
  display: flex; align-items: center; justify-content: space-between;
}
.action-row-title {
  font-family: var(--font-h); font-size: 16px; font-weight: 900;
  color: var(--gold); letter-spacing: 0.04em;
}
.action-items-tray {
  background: linear-gradient(135deg, rgba(30,25,5,0.7), rgba(20,16,4,0.9));
  border: 1px solid rgba(245,200,66,0.3);
  border-radius: 14px;
  padding: 14px 10px;
  min-height: 90px;
  display: flex; gap: 10px;
  overflow-x: auto; overflow-y: hidden;
  justify-content: center; flex-wrap: wrap;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}
.action-tray-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; flex-shrink: 0;
  padding: 8px 10px; border-radius: 12px;
  border: 1px solid rgba(245,200,66,0.4);
  background: rgba(40,30,5,0.7);
  transition: transform 0.15s, box-shadow 0.15s;
  min-width: 66px;
}
.action-tray-item:active { transform: scale(0.92); }
.action-tray-item:hover {
  background: rgba(55,42,8,0.9);
  box-shadow: 0 0 16px rgba(245,200,66,0.4);
  transform: translateY(-2px);
}
.action-close-btn {
  background: none; border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px; padding: 6px 14px;
  color: var(--text-dim); font-size: 12px; font-weight: 700;
  cursor: pointer; width: 100%;
  transition: border-color 0.15s;
}
.action-close-btn:hover { border-color: var(--gold); color: var(--gold); }

/* ═══════════════════════════════════════════════════════════════════════════
   HERO GACHA CARAVAN & HERO MANAGEMENT UI
   ═══════════════════════════════════════════════════════════════════════════ */

/* Caravan Main Hub */
.caravan-hub-scene {
  display: flex; flex-direction: column; gap: 16px; padding: 12px 16px 24px;
  max-width: 600px; margin: 0 auto;
}
.caravan-hero-banner {
  background: linear-gradient(135deg, rgba(43, 30, 14, 0.9), rgba(26, 16, 8, 0.95));
  border: 2px solid var(--border-focus);
  border-radius: 18px; padding: 20px;
  text-align: center; box-shadow: 0 8px 32px rgba(0,0,0,0.6), inset 0 0 24px rgba(245, 200, 66, 0.15);
  position: relative; overflow: hidden;
}
.caravan-hero-banner::after {
  content: ""; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(245, 200, 66, 0.1) 0%, transparent 60%);
  animation: caravan-glow-pulse 6s infinite alternate ease-in-out;
  pointer-events: none;
}
@keyframes caravan-glow-pulse {
  0% { transform: scale(0.9) rotate(0deg); opacity: 0.6; }
  100% { transform: scale(1.1) rotate(15deg); opacity: 1; }
}
.caravan-banner-title {
  font-family: var(--font-h); font-size: 22px; font-weight: 900; color: var(--gold);
  letter-spacing: 0.05em; text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}
.caravan-banner-sub {
  font-size: 13px; color: var(--cream); opacity: 0.85; margin-top: 4px;
}
.caravan-buttons-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.caravan-btn-card {
  background: linear-gradient(145deg, var(--bg-card), var(--bg-pane));
  border: 1.5px solid var(--border); border-radius: 16px; padding: 16px 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; cursor: pointer; transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4); text-align: center;
}
.caravan-btn-card:hover {
  transform: translateY(-3px); border-color: var(--gold);
  box-shadow: 0 8px 24px rgba(245, 200, 66, 0.25);
}
.caravan-btn-card:active { transform: scale(0.96); }
.caravan-btn-card.hero-pull-btn {
  background: linear-gradient(135deg, #4a1d64 0%, #2b1142 100%);
  border-color: var(--arcane-light);
}
.caravan-btn-card.hero-pull-btn:hover {
  box-shadow: 0 8px 28px rgba(168, 85, 247, 0.4);
}
.caravan-btn-icon { font-size: 32px; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6)); }
.caravan-btn-label { font-family: var(--font-h); font-size: 15px; font-weight: 800; color: var(--cream); }
.caravan-btn-desc { font-size: 11px; color: var(--text-dim); }

.caravan-mini-squad {
  background: rgba(34, 22, 10, 0.8); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.caravan-mini-header {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-h); font-size: 13px; font-weight: 700; color: var(--gold);
}

/* Hero Management Screen */
.heroes-screen-scene {
  display: flex; flex-direction: column; gap: 18px; padding: 12px 16px 24px;
  max-width: 650px; margin: 0 auto;
}
.heroes-section-card {
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}
.heroes-section-header {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
  border-bottom: 1px solid rgba(255, 190, 100, 0.15); padding-bottom: 10px;
}
.heroes-section-title {
  font-family: var(--font-h); font-size: 16px; font-weight: 900; color: var(--gold);
  display: flex; align-items: center; gap: 6px;
}
.party-stats-pill {
  background: rgba(0, 0, 0, 0.4); border: 1px solid var(--border-focus);
  border-radius: 20px; padding: 4px 12px; font-size: 12px; font-weight: 700;
  color: var(--cream); display: flex; gap: 10px; align-items: center;
}
.party-stat-item { display: flex; align-items: center; gap: 4px; }
.party-stat-item.atk { color: var(--gold); }
.party-stat-item.hp { color: var(--rose); }
.party-stat-item.shd { color: var(--sky); }

/* Squad Top Slots Grid */
.squad-slots-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.squad-slot-card {
  background: linear-gradient(145deg, rgba(30, 20, 10, 0.9), rgba(18, 12, 6, 0.95));
  border: 2px dashed var(--border); border-radius: 16px; padding: 14px 10px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
  cursor: pointer; position: relative; transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  min-height: 140px; justify-content: space-between;
}
.squad-slot-card:hover {
  border-style: solid; border-color: var(--sky-light); transform: translateY(-2px);
}
.squad-slot-card.selected {
  border-style: solid; border-color: var(--gold); background: linear-gradient(145deg, rgba(65, 45, 15, 0.9), rgba(35, 22, 8, 0.95));
  box-shadow: 0 0 20px rgba(245, 200, 66, 0.4), inset 0 0 12px rgba(245, 200, 66, 0.2);
  transform: scale(1.03);
}
.squad-slot-badge {
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  background: var(--bg-deep); border: 1px solid var(--border); border-radius: 10px;
  padding: 2px 8px; font-size: 10px; font-weight: 800; color: var(--gold);
}
.squad-slot-icon { font-size: 38px; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.8)); }
.squad-slot-name { font-family: var(--font-h); font-size: 14px; font-weight: 800; color: var(--cream); }
.squad-slot-lv { font-size: 11px; font-weight: 700; color: var(--amber); }
.squad-slot-stats {
  display: flex; justify-content: space-around; width: 100%; font-size: 11px; font-weight: 700;
  background: rgba(0,0,0,0.35); border-radius: 8px; padding: 4px 2px;
}
.hero-detail-btn {
  background: rgba(255, 200, 120, 0.12); border: 1px solid var(--border);
  border-radius: 8px; padding: 4px 8px; font-size: 11px; font-weight: 700; color: var(--cream);
  cursor: pointer; width: 100%; transition: all 0.15s; margin-top: 4px;
}
.hero-detail-btn:hover { background: var(--gold); color: #000; border-color: var(--gold); }

/* Roster Scrollable Grid */
.roster-grid-scroll {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px;
  max-height: 380px; overflow-y: auto; padding-right: 4px;
}
.roster-hero-card {
  background: linear-gradient(145deg, rgba(40, 28, 14, 0.85), rgba(24, 16, 8, 0.9));
  border: 1.5px solid var(--border); border-radius: 14px; padding: 12px 8px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  cursor: pointer; transition: all 0.2s ease; position: relative;
}
.roster-hero-card:hover {
  border-color: var(--gold); transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(245, 200, 66, 0.2);
}

/* Hero Details Modal specific */
.hero-details-card {
  max-width: 440px; width: 95%; background: var(--bg-deep); border: 2px solid var(--border-focus);
  border-radius: 20px; padding: 22px; display: flex; flex-direction: column; gap: 16px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.8);
}
.hero-details-top {
  display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--border); padding-bottom: 14px;
}
.hero-details-big-icon {
  font-size: 54px; background: rgba(255, 200, 120, 0.08); border: 2px solid var(--border);
  border-radius: 16px; width: 80px; height: 80px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; box-shadow: inset 0 0 16px rgba(245, 200, 66, 0.15);
}
.hero-details-stats-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.hero-stat-box {
  background: rgba(0,0,0,0.4); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 6px; text-align: center; display: flex; flex-direction: column; gap: 4px;
}
.hero-stat-lbl { font-size: 11px; color: var(--text-dim); font-weight: 700; }
.hero-stat-val { font-family: var(--font-h); font-size: 18px; font-weight: 900; }
.hero-perk-box {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(43, 30, 14, 0.3));
  border: 1px solid var(--arcane); border-radius: 14px; padding: 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.hero-perk-title {
  font-family: var(--font-h); font-size: 13px; font-weight: 800; color: var(--arcane-light);
  display: flex; align-items: center; gap: 6px;
}
.hero-perk-desc { font-size: 12px; color: var(--cream); line-height: 1.4; }
.hero-actions-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.btn-level-up {
  background: linear-gradient(135deg, #e8a030, #b86e06); border: 1px solid #ffd875;
  border-radius: 12px; padding: 12px; font-family: var(--font-h); font-size: 14px; font-weight: 800;
  color: #fff; cursor: pointer; transition: all 0.15s; text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  width: 100%; box-shadow: 0 4px 12px rgba(232, 160, 48, 0.3);
}
.btn-level-up:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(232, 160, 48, 0.5); }
.btn-level-up:active { transform: scale(0.97); }
.btn-mock-sub {
  background: rgba(255,255,255,0.06); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px; font-size: 12px; font-weight: 700; color: var(--text); cursor: pointer;
  transition: all 0.15s;
}
.btn-mock-sub:hover { border-color: var(--sky); color: var(--sky-light); background: rgba(91, 184, 212, 0.1); }

/* In-Raid 3-Hero HUD Container */
.hud-squad-box {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: none; border: none;
  padding: 0; width: auto; margin: 0;
}
.hud-hero-slot {
  display: flex; flex-direction: column; align-items: center; font-size: 11px; font-weight: 700;
  color: var(--cream); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hud-hero-icon { font-size: 24px; filter: drop-shadow(0 1px 3px rgba(0,0,0,0.8)); }

/* Floating Damage Text */
.floating-dmg-text {
  position: absolute; pointer-events: none; z-index: 100000;
  font-family: var(--font-h); font-size: 26px; font-weight: 900;
  text-shadow: 0 2px 6px rgba(0,0,0,0.9), 0 0 12px rgba(0,0,0,0.8);
  animation: float-dmg-up 1.1s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}
.floating-dmg-text.dmg { color: #ff1744; }
.floating-dmg-text.heal { color: #00e676; }
.floating-dmg-text.shd { color: #00b0ff; }
@keyframes float-dmg-up {
  0% { transform: translateY(0) scale(0.6); opacity: 1; }
  30% { transform: translateY(-24px) scale(1.25); opacity: 1; }
  100% { transform: translateY(-64px) scale(0.9); opacity: 0; }
}
