/* BTD 2D - Master Stylesheet with Optimized Mobile Landscape Paneling */
:root {
  --font-title: 'Fredoka', sans-serif;
  --font-body: 'Nunito', sans-serif;

  /* Playful Blocky Colors */
  --bg-lobby: #2a3b5c;
  --bg-game: #1e2230;
  
  --panel-light: #ffffff;
  --panel-dark: #f0f2f5;
  --border-color: #313338;
  
  --primary-blue: #0088ff;
  --primary-blue-dark: #0055bb;
  --primary-green: #2ecc71;
  --primary-green-dark: #27ae60;
  --primary-red: #e74c3c;
  --primary-red-dark: #c0392b;
  --primary-yellow: #f1c40f;
  --primary-yellow-dark: #f39c12;
  --primary-orange: #e67e22;

  --text-dark: #2c3e50;
  --text-light: #ffffff;
  --text-muted: #7f8c8d;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
}

/* --- CRITICAL MOBILE VIEWPORT & PAN SAFETY OVERRIDES --- */
html, body {
  width: 100%;
  height: 100dvh;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden !important; /* Prevents double scrolling/bouncing of the outer page */
  touch-action: none;          /* Disables default browser double-tap zoom and swipe navigation */
  overscroll-behavior: none;   /* Disables pull-to-refresh page reload triggers */
  user-select: none;           /* Prevents text selection highlight during rapid tapping */
  -webkit-user-select: none;
  -webkit-text-size-adjust: 100%;
  background: #1a2230;
}

/* Ensure only explicitly scrollable elements are allowed to scroll vertically */
#lobby-panels, 
#game-sidebar, 
#equipped-agents-list,
#quests-box,
#leaderboard-box {
  touch-action: pan-y !important; /* Re-enable precise vertical finger scrolling only on panels */
  -webkit-overflow-scrolling: touch;
}

body {
  background-color: #0b4cb4;
  background-image: url('assets/ui/menu/background.webp');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  color: var(--text-dark);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Global utility */
.hidden {
  display: none !important;
}

/* --- LOADING SCREEN --- */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  width: 100dvw;
  height: 100dvh;
  background: #111827 url('assets/ui/background.webp') no-repeat center center / cover;
  z-index: 9999999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

#loading-screen::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 15, 26, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 1;
}

#loading-screen.fade-out {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.05);
}

.loading-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 520px;
  width: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#loading-logo-img {
  width: 100%;
  max-width: 340px;
  height: auto;
  margin-bottom: 18px;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.6));
  animation: logoPulse 2.2s infinite ease-in-out;
  user-select: none;
  pointer-events: none;
}

@keyframes logoPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.6)); }
  50% { transform: scale(1.03); filter: drop-shadow(0 12px 26px rgba(0, 136, 255, 0.45)); }
}

.loading-bar-container {
  position: relative;
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.55));
}

.loading-bar-bg {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
  pointer-events: none;
}

.loading-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  user-select: none;
  pointer-events: none;
  clip-path: inset(0 100% 0 0);
  -webkit-clip-path: inset(0 100% 0 0);
  transition: clip-path 0.15s ease-out, -webkit-clip-path 0.15s ease-out;
}

#loading-percent {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
  letter-spacing: 1px;
  z-index: 3;
  user-select: none;
}

#loading-status {
  font-family: var(--font-title);
  font-size: 1rem;
  color: #f1c40f;
  text-shadow: 1.5px 1.5px 0 #000, -1px -1px 0 #000;
  font-weight: 800;
  letter-spacing: 0.5px;
}

/* Mobile & landscape adaptation */
@media (max-height: 480px) and (orientation: landscape) {
  #loading-logo-img {
    max-width: 210px;
    margin-bottom: 8px;
  }
  .loading-bar-container {
    max-width: 360px;
    margin-bottom: 6px;
  }
  #loading-percent {
    font-size: 0.95rem;
  }
  #loading-status {
    font-size: 0.82rem;
  }
}

/* Portrait Orientation Warning Overlay */
#orientation-warning {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  width: 100dvw;
  height: 100dvh;
  background-color: #1a2230;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.03) 2px, transparent 2px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 2px, transparent 2px);
  background-size: 30px 30px;
  z-index: 999999; /* Cover absolutely everything */
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  padding: 20px;
}

/* Enforce Aspect-Ratio checks to filter out false-positive mobile viewport changes */
@media (max-aspect-ratio: 115/100) and (pointer: coarse) {
  #orientation-warning {
    display: flex !important;
  }
}

.warning-content {
  background: rgba(0, 0, 0, 0.4);
  border: 3px solid var(--primary-yellow);
  border-radius: 20px;
  padding: 30px;
  max-width: 400px;
  box-shadow: 0 10px 0 rgba(0, 0, 0, 0.5), 0 0 20px rgba(241, 196, 15, 0.2);
  animation: warningPulse 2s infinite ease-in-out;
}

.warning-icon {
  font-size: 4rem;
  margin-bottom: 15px;
  display: inline-block;
  animation: warningRotate 2.5s infinite linear;
}

#orientation-warning h2 {
  font-family: var(--font-title);
  font-size: 1.8rem;
  color: var(--primary-yellow);
  text-shadow: 2px 2px 0 #000;
  margin-bottom: 10px;
}

#orientation-warning p {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: #ecf0f1;
}

@keyframes warningRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes warningPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

/* App container: Proportioned strictly to 16:9 matching refrence.png */
#app-container {
  width: min(96vw, calc(92vh * (16 / 9)));
  height: min(92vh, calc(96vw * (9 / 16)));
  max-width: 1920px;
  max-height: 1080px;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible !important;
  position: relative;
  display: flex;
  flex-direction: column;
}

#lobby-view {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 8px 14px 14px 14px;
  gap: 8px;
  box-sizing: border-box;
  overflow: visible !important;
}

#lobby-content {
  display: flex;
  flex: 1;
  min-height: 0;
  gap: 14px;
  overflow: visible;
}

/* --- APP CONTAINER ALWAYS SCALED VIA AUTOSCALEGAME --- */
#app-container {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  width: 2122px !important;
  height: 1188px !important;
  transform: translate(-50%, -50%) scale(var(--app-scale, 1)) !important;
  transform-origin: center center !important;
  overflow: visible !important;
  pointer-events: auto !important;
}

#lobby-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  border: none;
  padding: 0 6px;
  box-shadow: none;
  flex-wrap: nowrap;
  gap: 16px;
  min-height: 82px;
  box-sizing: border-box;
}

/* Header Left: Prominent 3D BTD2D Logo */
.header-left-cluster {
  display: flex;
  align-items: center;
  width: 240px;
}

.header-logo-badge {
  height: 78px;
  width: auto;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.55));
  user-select: none;
}

.btn-img-back {
  width: 52px;
  height: 52px;
  background: url('assets/ui/menu/sprite_07.webp') no-repeat center center / contain;
  border: none;
  cursor: pointer;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
  transition: transform 0.1s ease;
  flex-shrink: 0;
}
.btn-img-back:hover { transform: scale(1.05); }

/* Center: Chunky Profile Container */
.hud-profile-container {
  position: relative;
  width: 250px;
  height: 56px;
  background: url('assets/ui/menu/sprite_08.webp') no-repeat center center / 100% 100%;
  display: flex;
  align-items: center;
  padding-left: 62px;
  filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.4));
}

.profile-avatar-wrapper {
  position: absolute;
  left: 6px;
  top: 4px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-base-img, .avatar-user-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.profile-name-cluster {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: visible !important;
  max-width: none !important;
}

.profile-name-text {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 1px 1.5px 2px rgba(0, 0, 0, 0.7);
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

/* Header Right: Prominent Stats */
.player-meta-box {
  display: flex;
  gap: 14px;
  align-items: flex-end;
}

.hud-label {
  font-family: var(--font-title);
  font-size: 0.76rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.8px;
  text-shadow: 1.5px 1.5px 0 #002e75;
  margin-bottom: 4px;
}

.hud-level-wrapper, .hud-xp-wrapper, .hud-coins-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hud-level-badge {
  width: 58px;
  height: 58px;
  background: url('assets/ui/menu/sprite_11.webp') no-repeat center center / contain;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 2px 2px 0 #000;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.hud-xp-track {
  position: relative;
  width: 180px;
  height: 38px;
  background: url('assets/ui/menu/sprite_14.webp') no-repeat center center / 100% 100%;
  display: flex;
  align-items: center;
  padding: 4px 8px;
  box-sizing: border-box;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}

.hud-xp-fill-img {
  height: 100%;
  background: url('assets/ui/menu/sprite_10.webp') no-repeat left center / cover;
  border-radius: 12px;
  transition: width 0.3s ease;
}

.hud-xp-counter {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-title);
  font-size: 0.88rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 1.5px 1.5px 0 #000;
  white-space: nowrap;
}

.hud-coins-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-coins-pill {
  width: 155px;
  height: 48px;
  background: url('assets/ui/menu/sprite_26.webp') no-repeat center center / 100% 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 22px;
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 2px 2px 0 #000;
  box-sizing: border-box;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.btn-img-plus {
  width: 48px;
  height: 48px;
  background: url('assets/ui/menu/sprite_27.webp') no-repeat center center / contain;
  border: none;
  cursor: pointer;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
  transition: transform 0.1s ease;
}
.btn-img-plus:hover { transform: scale(1.08); }
.btn-img-plus:active { transform: scale(0.92); }
.btn-img-plus:hover { transform: scale(1.08); }
.btn-img-plus:active { transform: scale(0.92); }
.btn-img-plus:hover { transform: scale(1.08); }
.btn-img-plus:active { transform: scale(0.92); }

.blocky-title {
  font-family: var(--font-title);
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--primary-blue);
  text-shadow: 2px 2px 0 var(--border-color);
  -webkit-text-stroke: 1.5px var(--border-color);
  letter-spacing: 1px;
}

.current-map-badge, .tagline {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-muted);
  display: block;
}

.player-meta-box {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.meta-item .label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
}

.badge {
  background: var(--primary-blue);
  color: #fff;
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: 8px;
  border: 2px solid var(--border-color);
  box-shadow: 0 2px 0 var(--border-color);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-origin: center center;
}

/* ─── CLEAN ZOOM & POP KEYFRAMES (PRESERVES SPRITE ARTWORK) ─── */
@keyframes levelUpPulse {
  0% { scale: 1; }
  35% { scale: 1.25; }
  70% { scale: 1.10; }
  100% { scale: 1; }
}

.level-badge-animate {
  animation: levelUpPulse 0.85s cubic-bezier(0.34, 1.56, 0.64, 1) forwards !important;
  z-index: 100 !important;
}

@keyframes coinRainbowPulse {
  0% { scale: 1; }
  35% { scale: 1.22; }
  70% { scale: 1.08; }
  100% { scale: 1; }
}

.coin-badge-animate {
  animation: coinRainbowPulse 0.85s cubic-bezier(0.34, 1.56, 0.64, 1) forwards !important;
  z-index: 100 !important;
}

/* XP Bar */
.xp-item {
  width: 130px;
  min-width: 110px;
}

.xp-bar-container {
  width: 100%;
  height: 20px;
  background: #cbd5e1;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  border: 2px solid var(--border-color);
}

.xp-bar-fill {
  height: 100%;
  background: var(--primary-green);
  width: 0%;
  transition: width 0.3s ease;
}

.xp-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.75rem;
  font-weight: 900;
  color: #000;
}

/* Lobby Main Content split */
#lobby-content {
  display: flex;
  flex: 1;
  min-height: 0;
  gap: 14px;
  overflow: visible !important;
}

/* Sidebar Navigation: Grouped cleanly matching refrence.png */
#lobby-tabs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: auto;
  min-width: 220px;
  flex-shrink: 0;
  justify-content: flex-start;
  position: relative;
  z-index: 15;
  overflow: visible;
}

.tab-btn {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 56px;
  background: url('assets/ui/menu/sprite_01.webp') no-repeat center center / 100% 100%;
  border: none;
  cursor: pointer;
  padding: 0 16px;
  gap: 12px;
  box-sizing: border-box;
  box-shadow: none;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
  transition: transform 0.1s ease;
  transform-origin: left center !important;
  z-index: 20;
}
.tab-btn:hover {
  transform: translateX(4px);
}
.tab-btn:active {
  transform: scale(0.98);
}

.tab-btn.active {
  background: url('assets/ui/menu/sprite_02.webp') no-repeat center center / 100% 100%;
}

.tab-btn-coins {
  background: url('assets/ui/menu/sprite_03.webp') no-repeat center center / 100% 100% !important;
}

.tab-icon {
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex-shrink: 0;
}

.tab-label {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 900;
  color: #0b3472;
  text-shadow: none;
  flex: 1;
  text-align: left;
}
.tab-btn.active .tab-label {
  color: #ffffff;
  text-shadow: 1.5px 1.5px 0 #00368a;
}
.tab-btn-coins .tab-label {
  color: #5d3400 !important;
}

/* Tab Panels Container: Frame matching refrence.png */
#lobby-panels {
  flex: 1;
  min-height: 0;
  height: 100%;
  background: #003380;
  border: 5px solid #00d2ff;
  border-radius: 20px;
  padding: 0 !important;
  box-shadow: 0 0 0 3px #001f54, inset 0 0 20px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Base Panel Rules */
.lobby-panel {
  display: none;
  flex-direction: column;
  width: 100%;
  height: 100% !important;
  flex: 1 1 auto;
  min-height: 0;
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
}
.lobby-panel.active {
  display: flex;
}

/* Panel Maps: Expands to 100% of frame */
#panel-maps {
  padding: 0 !important;
  overflow: hidden !important;
  width: 100% !important;
  height: 100% !important;
  flex: 1 1 auto !important;
  display: none;
}
#panel-maps.active {
  display: flex !important;
  flex-direction: column !important;
}

.lobby-panel h2 {
  font-family: var(--font-title);
  font-size: 1.6rem;
  color: var(--text-dark);
  border-bottom: 2px dashed #ddd;
  padding-bottom: 8px;
}

/* Custom rounded buttons (Roblox style) */
.btn {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 800;
  padding: 10px 16px;
  border-radius: 10px;
  border: 3px solid var(--border-color);
  cursor: pointer;
  transition: all 0.1s ease;
  text-transform: uppercase;
}

.btn:active {
  transform: translateY(3px) !important;
  box-shadow: 0 1px 0 var(--border-color) !important;
}

.btn-deploy {
  background: var(--primary-green);
  color: #fff;
  font-size: 1.4rem;
  padding: 16px;
  margin-top: auto;
  box-shadow: 0 6px 0 var(--primary-green-dark), 0 6px 0 var(--border-color);
}
.btn-deploy:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 var(--primary-green-dark), 0 8px 0 var(--border-color);
}

/* Maps Selection Grid */
.map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 15px;
}

.map-card {
  background: #f7f9fb;
  border: 3px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
  box-shadow: 0 4px 0 var(--border-color);
}

.map-preview-canvas {
  width: 100px !important;
  height: 75px !important;
  display: block;
  border-radius: 6px;
}

.map-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--border-color);
}

.map-card.active {
  background: #e8f5e9;
  border-color: var(--primary-green);
  box-shadow: 0 4px 0 var(--primary-green);
}

.map-info {
  text-align: center;
}
.map-info .name {
  display: block;
  font-weight: 800;
  font-size: 0.95rem;
}
.map-info .difficulty {
  font-size: 0.7rem;
  font-weight: 900;
  padding: 2px 5px;
  border-radius: 4px;
}
.easy { color: var(--primary-green); }
.medium { color: var(--primary-orange); }
.hard { color: var(--primary-red); }

/* WIZARD FLOW CONTAINERS */
.wizard-step-content {
  display: flex;
  flex-direction: column;
  gap: 15px;
  animation: wizardFadeIn 0.3s ease-out;
  background: #ffffff !important;
  border-radius: 14px !important;
  padding: 16px 20px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  height: 100% !important;
  overflow-y: auto !important;
}
.wizard-step-content.hidden {
  display: none !important;
}

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

/* ─── STUNNING DIFFICULTIES CARDS (ROBLOX TDS INSPIRED) ─── */
.difficulty-wizard-deck {
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 12px;
  margin: 10px 0;
  padding: 4px 4px 10px 4px;
  scrollbar-width: thin;
}

.difficulty-wizard-deck::-webkit-scrollbar {
  height: 8px;
}
.difficulty-wizard-deck::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
}

.diff-wizard-card {
  background: #ffffff;
  border: 3px solid var(--border-color);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  padding: 0;
  box-shadow: 0 4px 0 var(--border-color);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  text-align: left;
  
  flex: 1 0 150px;
  max-width: 220px;
}

.diff-wizard-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 0 var(--border-color);
}

.diff-wizard-card.active {
  border-color: var(--primary-blue);
  box-shadow: 0 4px 0 var(--primary-blue), 0 0 15px rgba(0, 136, 255, 0.4);
  transform: scale(1.03);
}

.diff-card-header {
  padding: 10px 8px;
  text-align: center;
  color: white;
  font-family: var(--font-title);
  border-bottom: 2.5px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.diff-title {
  font-size: 1.2rem;
  font-weight: 900;
  text-shadow: 1.5px 1.5px 0 rgba(0,0,0,0.5);
  letter-spacing: 0.5px;
}

.diff-sub {
  font-size: 0.65rem;
  opacity: 0.9;
  font-family: var(--font-body);
  font-weight: 800;
  margin-top: 1px;
}

.diff-bg-easy { background: linear-gradient(135deg, #2ecc71, #27ae60); }
.diff-bg-casual { background: linear-gradient(135deg, #7f8c8d, #34495e); }
.diff-bg-intermediate { background: linear-gradient(135deg, #2196f3, #0b7dda); }
.diff-bg-molten { background: linear-gradient(135deg, #e67e22, #d35400); }
.diff-bg-fallen { background: linear-gradient(135deg, #9b59b6, #8e44ad); }

.diff-card-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  flex: 1;
  background: #fdfefe;
}

.diff-boss-preview {
  background: #f1f2f6;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  width: 80px;
  height: 80px;
  margin-bottom: 4px;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
}

.diff-metric {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  font-size: 0.75rem;
  font-weight: 900;
  color: var(--text-dark);
}

.diff-metric-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

.diff-metric-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.text-boss { color: #e74c3c; font-size: 0.72rem; font-weight: 900; }
.text-coins { color: #b8860b; }

/* Navigation buttons */
.wizard-nav-buttons {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-top: 15px;
}

.btn-wizard-back {
  background: #7f8c8d;
  color: white;
  box-shadow: 0 4px 0 #5c6266, 0 4px 0 var(--border-color);
}
.btn-wizard-back:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #5c6266, 0 6px 0 var(--border-color);
}

.btn-wizard-next {
  background: var(--primary-blue);
  color: white;
  font-size: 1.1rem;
  padding: 12px 24px;
  box-shadow: 0 4px 0 var(--primary-blue-dark), 0 4px 0 var(--border-color);
  border: 3px solid var(--border-color);
  border-radius: 10px;
  font-family: var(--font-title);
  font-weight: 800;
  cursor: pointer;
  transition: all 0.1s ease;
  text-transform: uppercase;
}
.btn-wizard-next:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--primary-blue-dark), 0 6px 0 var(--border-color);
}
.btn-wizard-next:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--primary-blue-dark), 0 2px 0 var(--border-color);
}

/* Agent Shop Cards */
.shop-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
  gap: 16px !important;
}

.shop-card {
  background: #f8fafc;
  border: 3px solid var(--border-color);
  border-radius: 12px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  box-shadow: 0 4px 0 var(--border-color);
  position: relative;
}

.shop-card .name {
  display: block;
  font-weight: 800;
  font-size: 1.1rem;
}
.cost-text {
  font-size: 0.85rem;
  color: var(--primary-orange);
  font-weight: 900;
}

.btn-shop-action {
  width: 100%;
  font-size: 0.85rem;
  background: var(--primary-blue);
  color: #fff;
  box-shadow: 0 3px 0 var(--primary-blue-dark), 0 3px 0 var(--border-color);
}
.shop-card.purchased .btn-shop-action {
  background: #bdc3c7;
  color: #7f8c8d;
  box-shadow: none;
  border-color: #bdc3c7;
  cursor: default;
}

/* ═══════════════════════════════════════════════════════════════
   LOADOUT MANAGEMENT PANEL - GLOSSY 1:1 THEME
═══════════════════════════════════════════════════════════════ */
.loadout-main-panel {
  padding: 18px !important;
  flex-direction: column !important;
  gap: 14px !important;
  box-sizing: border-box !important;
  overflow-y: auto !important;
  display: none;
}

/* Only display when the Loadout tab is active */
.loadout-main-panel.active {
  display: flex !important;
}

.loadout-stat-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 900;
  color: #334155;
  margin: 2px 0 6px 0;
  white-space: nowrap;
}

.stat-sep {
  color: #cbd5e1;
}

/* Header Banner */
.loadout-header-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, #093c85 0%, #05214e 100%);
  border: 3.5px solid #00d2ff;
  border-radius: 16px;
  padding: 12px 20px;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.25), 0 4px 12px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.loadout-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.loadout-header-icon-disc {
  width: 48px;
  height: 48px;
  background: linear-gradient(180deg, #0088ff 0%, #004eb7 100%);
  border: 2.5px solid #00d2ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

.loadout-header-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.loadout-header-text {
  display: flex;
  flex-direction: column;
}

.loadout-header-title {
  font-family: var(--font-title);
  font-size: 1.65rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 2px 2px 0 #001f54, 0 0 12px rgba(0, 210, 255, 0.6);
  letter-spacing: 0.8px;
}

.loadout-header-subtitle {
  font-size: 0.88rem;
  font-weight: 700;
  color: #d0e6ff;
  margin: 2px 0 0 0;
}

.loadout-counter-pill {
  background: #041a3d;
  border: 2px solid #00d2ff;
  border-radius: 20px;
  padding: 6px 18px;
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 900;
  color: #00ffe0;
  letter-spacing: 0.8px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
}

/* Card Grid */
.loadout-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)) !important;
  gap: 16px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.loadout-card-v2 {
  background: linear-gradient(180deg, #ffffff 0%, #e8f4fc 100%) !important;
  border: 3px solid #00d2ff !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 0 #0088cc, 0 6px 14px rgba(0, 0, 0, 0.15) !important;
  padding: 12px 10px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: space-between !important;
  min-height: 250px !important;
  box-sizing: border-box !important;
  cursor: pointer !important;
  transition: transform 0.12s ease, filter 0.12s ease, border-color 0.12s ease !important;
  position: relative !important;
}

.loadout-card-v2:hover {
  transform: translateY(-4px) !important;
  filter: brightness(1.05) !important;
}

/* Equipped State Highlight */
.loadout-card-v2.is-equipped {
  border: 3.5px solid #2ecc71 !important;
  box-shadow: 0 4px 0 #27ae60, 0 0 16px rgba(46, 204, 113, 0.4) !important;
  background: linear-gradient(180deg, #ffffff 0%, #eafbee 100%) !important;
}

.loadout-card-top-tag {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  height: 22px;
}

.tag-equipped-badge {
  background: #27ae60;
  color: #ffffff;
  font-family: var(--font-title);
  font-size: 0.68rem;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.tag-ready-badge {
  background: #cbd5e1;
  color: #475569;
  font-family: var(--font-title);
  font-size: 0.65rem;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 6px;
}

.loadout-disc-avatar {
  width: 74px;
  height: 74px;
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #cce9ff 60%, #9cd3ff 100%);
  border: 2.5px solid #00d2ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.12), 0 3px 6px rgba(0, 0, 0, 0.15);
  margin: 4px 0;
}

.loadout-card-v2.is-equipped .loadout-disc-avatar {
  border-color: #2ecc71;
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #d4f8dc 60%, #a3f0b4 100%);
}

.loadout-disc-avatar canvas {
  width: 55px !important;
  height: 55px !important;
}

.loadout-info-cluster {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 4px 0;
}

.loadout-agent-name {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 900;
  color: #0b2e68;
  letter-spacing: 0.5px;
}

/* Skin Selector */
.loadout-skin-container {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 0.72rem;
  font-weight: 900;
  color: #64748b;
}

/* Action Buttons */
.btn-loadout-equip {
  width: 100% !important;
  height: 36px !important;
  background: linear-gradient(180deg, #0088ff 0%, #0055bb 100%) !important;
  border: 2px solid #00368a !important;
  border-radius: 12px !important;
  font-family: var(--font-title) !important;
  font-size: 0.95rem !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  box-shadow: 0 3.5px 0 #002b66 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.btn-loadout-unequip {
  width: 100% !important;
  height: 36px !important;
  background: linear-gradient(180deg, #e74c3c 0%, #c0392b 100%) !important;
  border: 2px solid #962d22 !important;
  border-radius: 12px !important;
  font-family: var(--font-title) !important;
  font-size: 0.95rem !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  box-shadow: 0 3.5px 0 #782117 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* GAME / MATCH VIEW */
#game-view {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}

#game-wrapper {
  position: relative;
  flex: 1 1 auto;
  background-color: #1a2230;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

/* 4:3 Aspect Ratio Frame: Anchors Commander dialogue directly over the map */
#canvas-container {
  position: relative;
  height: 100%;
  max-height: 100%;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game-canvas {
  background-color: #1e2230;
  border: 3px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35);
  display: block;
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: 4 / 3;
}

/* CHROMEBOOK & DESKTOP SIDEBAR FIX: Prevent entire sidebar from scrolling; make only agent list scrollable */
#game-sidebar {
  width: 320px;
  background-color: var(--panel-light);
  border-left: 4px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 16px;
  overflow: hidden !important; /* Disabled sidebar-wide scroll so HUD/stats stay pinned */
  flex-shrink: 0;
}

#game-sidebar header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px dashed #e2e8f0;
  padding-bottom: 12px;
  flex-shrink: 0;
}

.btn-exit {
  background: var(--primary-red);
  color: white;
  font-size: 0.75rem;
  padding: 6px 12px;
  box-shadow: 0 3px 0 var(--primary-red-dark), 0 3px 0 var(--border-color);
}

/* HUD Statistics */
#game-hud {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  flex-shrink: 0;
}

.hud-box {
  background: #fff;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 2px 0 var(--border-color);
}

.hud-box .label {
  font-size: 0.65rem;
  font-weight: 900;
  color: var(--text-muted);
}
.hud-box .value {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 900;
}

.red-val { color: var(--primary-red); }
.green-val { color: var(--primary-green); }
.yellow-val { color: var(--primary-yellow-dark); }

#game-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.control-row {
  display: flex;
  gap: 8px;
}

.control-row .btn {
  flex: 1;
  height: 52px;
  min-height: 52px;
  max-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.1;
  padding: 4px 8px;
  box-sizing: border-box;
}

.btn-primary {
  background: var(--primary-green);
  color: #fff;
  box-shadow: 0 4px 0 var(--primary-green-dark), 0 4px 0 var(--border-color);
}

.btn-secondary {
  background: #fff;
  color: var(--text-dark);
  box-shadow: 0 4px 0 var(--border-color);
}

/* Placement Shop Container */
#placement-shop {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

#placement-shop h3 {
  font-family: var(--font-title);
  font-size: 0.9rem;
  color: var(--text-dark);
  margin-bottom: 6px;
  flex-shrink: 0;
}

/* SCROLLABLE AGENT ENTRIES ONLY - JITTER & HORIZONTAL SCROLL PROOF */
#placement-shop {
  overflow-x: hidden !important;
}

#equipped-agents-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: scroll !important; /* Permanent track prevents scrollbar pop-in jitter */
  overflow-x: hidden !important; /* Completely disallows horizontal scrolling */
  scrollbar-gutter: stable;      /* Prevents layout shift when content height changes */
  flex: 1;
  min-height: 0;
  padding-bottom: 20px;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
  touch-action: pan-y !important;
}

.placement-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 3px solid var(--border-color);
  border-radius: 10px;
  padding: 6px 12px;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.1s ease, border-color 0.1s ease;
  box-shadow: 0 3px 0 var(--border-color);
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

.placement-btn:hover {
  background: #f8fafc;
}

.placement-btn.active {
  background: #e3f2fd;
  border-color: var(--primary-blue);
  box-shadow: 0 3px 0 var(--primary-blue);
}

.placement-btn .icon {
  font-size: 1.5rem;
  background: #f0f0f0;
  border: 2px solid var(--border-color);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.placement-btn .icon canvas {
  width: 40px !important;
  height: 40px !important;
}

.placement-btn .info {
  display: flex;
  flex-direction: column;
}

.placement-btn .name {
  font-weight: 800;
  font-size: 0.95rem;
}
.placement-btn .cost {
  font-size: 0.8rem;
  color: var(--primary-green-dark);
  font-weight: 900;
}

/* Detached Upgrade Menu */
#selection-panel {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 280px;
  z-index: 1500;
  background: #fff8e1;
  border: 3px solid var(--primary-yellow-dark);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 4px 0 var(--primary-yellow-dark);
}

.selection-panel-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#selection-info .unit-name {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 900;
  color: var(--primary-orange);
  text-transform: uppercase;
  margin-bottom: 2px;
}

#selection-info .unit-stats {
  font-size: 0.75rem;
  color: var(--text-dark);
  font-weight: 800;
}

.targeting-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  padding: 4px 8px;
}

.targeting-container label {
  font-size: 0.75rem;
  font-weight: 900;
}

.styled-select {
  border: none;
  font-size: 0.8rem;
  font-weight: 900;
  color: var(--primary-blue-dark);
  cursor: pointer;
  outline: none;
  background: transparent;
}

.selection-actions {
  display: flex;
  gap: 8px;
}

.selection-actions .btn {
  flex: 1;
}

#btn-upgrade {
  background: var(--primary-green);
  color: white;
  box-shadow: 0 3px 0 var(--primary-green-dark), 0 3px 0 var(--border-color);
}

#btn-sell {
  background: var(--primary-red);
  color: white;
  box-shadow: 0 3px 0 var(--primary-red-dark), 0 3px 0 var(--border-color);
}

/* Game Over Overlay Screen */
#game-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  cursor: pointer;
}

#overlay-title {
  font-family: var(--font-title);
  font-size: 3rem;
  color: #fff;
  text-shadow: 3px 3px 0 var(--border-color);
  -webkit-text-stroke: 2px var(--border-color);
  margin-bottom: 10px;
}

#overlay-subtitle {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary-yellow);
  text-shadow: 1px 1px 0 #000;
  letter-spacing: 1px;
}

/* CRATE OPENING OVERLAY SYSTEM */
#crate-opening-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.crate-opening-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  width: 600px;
  height: 400px;
}

#crate-opening-canvas {
  display: block;
}

#crate-reveal-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #ffffff;
  border: 4px solid var(--border-color);
  border-radius: 20px;
  width: 280px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  text-align: center;
  box-shadow: 0 10px 0 var(--border-color), 0 20px 30px rgba(0, 0, 0, 0.5);
  animation: revealCardDrop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes revealCardDrop {
  0% { transform: translate(-50%, -120%) scale(0.6); opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(1.0); opacity: 1; }
}

#crate-reveal-rarity {
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 900;
  padding: 2px 16px;
  border-radius: 8px;
  border: 2px solid var(--border-color);
  box-shadow: 0 2px 0 var(--border-color);
  text-transform: uppercase;
}

.rarity-common { background: #bdc3c7; color: #333; }
.rarity-rare { background: var(--primary-blue); color: #fff; }
.rarity-epic { background: #9b59b6; color: #fff; }
.rarity-legendary { background: var(--primary-yellow); color: #000; }

#crate-reveal-agent-canvas {
  background: #f7f9fb;
  border: 3px solid var(--border-color);
  border-radius: 50%;
  width: 100px;
  height: 100px;
  box-shadow: inset 0 3px 6px rgba(0,0,0,0.15);
}

#crate-reveal-name {
  font-family: var(--font-title);
  font-size: 1.5rem;
  color: var(--text-dark);
}

#crate-reveal-unlocked {
  font-size: 0.85rem;
  font-weight: 900;
  color: var(--primary-green-dark);
}

#btn-close-reveal {
  width: 100%;
  font-size: 1.1rem;
  box-shadow: 0 4px 0 var(--primary-blue-dark), 0 4px 0 var(--border-color);
}

/* Icons styling helper */
.tab-icon { width: 22px; height: 22px; vertical-align: middle; margin-right: 8px; }
.header-icon { width: 24px; height: 24px; vertical-align: middle; margin-right: 4px; }
.title-icon { width: 26px; height: 26px; vertical-align: middle; margin-right: 6px; }
.hud-icon { width: 24px; height: 24px; vertical-align: middle; margin-right: 6px; }
.quest-icon { width: 20px; height: 20px; vertical-align: middle; margin-right: 6px; }
.crate-icon { width: 48px; height: 48px; display: block; margin: 0 auto 6px; }

/* Animated Like Prompt & Pointer */
@keyframes bounceDownArrow {
  0% { transform: translateY(0); }
  100% { transform: translateY(6px); }
}

@keyframes pulseLikePrompt {
  0%, 100% { box-shadow: 0 0 10px rgba(241, 196, 15, 0.2); }
  50% { box-shadow: 0 0 20px rgba(241, 196, 15, 0.5); }
}

@keyframes floatLikeCallout {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Animated Summary Card styles */
.summary-card-anim {
  animation: summaryPopup 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes summaryPopup {
  0% {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.85);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

#btn-toggle-sidebar {
  display: none;
}

@keyframes pulseTutorialHighlight {
  0% {
    border-color: #f1c40f !important;
    box-shadow: 0 0 10px #f1c40f, inset 0 0 5px rgba(241, 196, 15, 0.5) !important;
  }
  50% {
    border-color: #f39c12 !important;
    box-shadow: 0 0 25px #f1c40f, inset 0 0 12px rgba(241, 196, 15, 0.8) !important;
  }
  100% {
    border-color: #f1c40f !important;
    box-shadow: 0 0 10px #f1c40f, inset 0 0 5px rgba(241, 196, 15, 0.5) !important;
  }
}

.tut-highlight {
  animation: pulseTutorialHighlight 1.4s infinite !important;
  border: 3px solid #f1c40f !important;
  position: relative;
  z-index: 2000 !important;
}

/* Force highly visible, solid custom scrollbars across both PC & mobile engines */
#game-sidebar::-webkit-scrollbar,
#lobby-panels::-webkit-scrollbar,
.lobby-panel::-webkit-scrollbar,
#panel-shop::-webkit-scrollbar {
  width: 12px !important;
  height: 12px !important;
  display: block !important;
}

#game-sidebar::-webkit-scrollbar-thumb,
#lobby-panels::-webkit-scrollbar-thumb,
.lobby-panel::-webkit-scrollbar-thumb,
#panel-shop::-webkit-scrollbar-thumb {
  background: #475569 !important;
  border-radius: 8px !important;
  border: 3.5px solid #ffffff !important;
}

#game-sidebar::-webkit-scrollbar-track,
#lobby-panels::-webkit-scrollbar-track,
.lobby-panel::-webkit-scrollbar-track,
#panel-shop::-webkit-scrollbar-track {
  background: #f1f5f9 !important;
  border-radius: 8px !important;
}

/* ─── "THE COMMANDER" TUTORIAL DIALOGUE & CINEMATIC EFFECTS ─── */
#tutorial-dim-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1200;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

#tutorial-dim-overlay svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#commander-dialog-wrapper {
  position: absolute;
  bottom: 12px;
  left: 12px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  z-index: 2200; /* Stays brightly illuminated above dim overlay */
  pointer-events: auto;
  font-family: var(--font-body);
  max-width: 380px;
  width: calc(100% - 24px);
}

/* Big juicy Commander message pop animation */
@keyframes commanderBigPop {
  0% {
    transform: scale(0.65) translateY(25px);
    opacity: 0;
  }
  50% {
    transform: scale(1.12) translateY(-6px);
    opacity: 1;
  }
  75% {
    transform: scale(0.96) translateY(2px);
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.commander-pop-anim {
  animation: commanderBigPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both !important;
}

/* ─── GLIDING HAND GUIDE & TAP RIPPLE ─── */
#tutorial-hand-guide {
  position: fixed;
  z-index: 100000 !important; /* Guaranteed to display on top of unit entry and highlighted cards */
  pointer-events: none;
  transform: translate(-30%, -10%);
  will-change: left, top, transform;
}

#tut-hand-img {
  width: 54px;
  height: auto;
  display: block;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.7));
  transform-origin: 18px 8px; /* Taps directly at the tip of the pointer finger */
}

/* Continuous in-place zoom in/out pulse */
@keyframes tutHandTapPulse {
  0%, 100% {
    transform: scale(1.22);
  }
  50% {
    transform: scale(0.78);
  }
}

.hand-pulsing #tut-hand-img {
  animation: tutHandTapPulse 0.85s infinite ease-in-out !important;
}

@keyframes tutRippleExpand {
  0% {
    transform: scale(0.3);
    opacity: 1;
  }
  100% {
    transform: scale(3.2);
    opacity: 0;
  }
}

.hand-pulsing #tut-hand-ripple {
  animation: tutRippleExpand 0.85s infinite ease-out !important;
}

#tut-hand-ripple {
  position: absolute;
  top: 8px;
  left: 18px;
  width: 30px;
  height: 30px;
  margin-top: -15px;
  margin-left: -15px;
  border-radius: 50%;
  border: 3.5px solid #f1c40f;
  background: rgba(241, 196, 15, 0.4);
  box-shadow: 0 0 14px #f1c40f;
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s ease-out, opacity 0.35s ease-out;
}

.tut-highlight {
  position: relative !important;
  z-index: 1800 !important; /* Shines cleanly through the dark shadow */
  animation: pulseTutorialHighlight 1.4s infinite !important;
  border-color: #f1c40f !important;
  box-shadow: 0 0 25px #f1c40f, inset 0 0 10px rgba(241, 196, 15, 0.6) !important;
}

.commander-avatar-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #2c3e50;
  border: 3px solid var(--border-color);
  border-radius: 12px;
  padding: 4px;
  box-shadow: 0 4px 0 var(--border-color);
  flex-shrink: 0;
}

#commander-face-canvas {
  background: #ffdbac;
  border-radius: 8px;
  width: 60px;
  height: 60px;
}

.commander-name-tag {
  font-family: var(--font-title);
  font-size: 0.65rem;
  font-weight: 900;
  color: white;
  background: #e74c3c;
  padding: 1px 6px;
  border-radius: 4px;
  margin-top: 4px;
  letter-spacing: 0.5px;
}

.commander-speech-balloon {
  background: #ffffff;
  border: 3px solid var(--border-color);
  border-radius: 12px 12px 12px 0px;
  padding: 10px 12px;
  box-shadow: 0 4px 0 var(--border-color);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.commander-speech-balloon::before {
  content: '';
  position: absolute;
  bottom: -3px;
  left: -12px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 12px 12px 0;
  border-color: transparent var(--border-color) transparent transparent;
}

.commander-speech-balloon::after {
  content: '';
  position: absolute;
  bottom: 0px;
  left: -7px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 9px 9px 0;
  border-color: transparent #ffffff transparent transparent;
}

#commander-dialog-text {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.35;
}

#btn-commander-action {
  align-self: flex-end;
  font-size: 0.72rem;
  padding: 4px 10px;
  background: var(--primary-yellow);
  color: black;
  box-shadow: 0 2px 0 var(--primary-yellow-dark), 0 2px 0 var(--border-color);
  border-width: 2px;
  margin: 0;
}

/* ─── TUTORIAL ARROW PHYSICAL ANIMATIONS ─── */
@keyframes tutArrowBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes tutArrowBounceLeft {
  0%, 100% { transform: translateX(0) rotate(90deg); }
  50% { transform: translateX(-10px) rotate(90deg); }
}
@keyframes tutArrowBounceRight {
  0%, 100% { transform: translateX(0) rotate(-90deg); }
  50% { transform: translateX(10px) rotate(-90deg); }
}

/* --- CUSTOM DROPDOWN STYLING --- */
.custom-dropdown,
.custom-skin-dropdown {
  position: relative;
  display: inline-block;
  min-width: 105px;
  font-size: 0.8rem;
  font-weight: 900;
  color: var(--primary-blue-dark);
  cursor: pointer;
  user-select: none;
}

.dropdown-selected,
.skin-dropdown-selected {
  background: #fff;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  padding: 4px 8px;
  text-align: center;
  transition: border-color 0.1s;
}

.dropdown-selected:hover,
.skin-dropdown-selected:hover {
  border-color: var(--primary-blue);
}

.dropdown-options,
.skin-dropdown-options {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  box-shadow: 0 -4px 10px rgba(0,0,0,0.15);
  z-index: 1000;
  margin-bottom: 4px;
  overflow: hidden;
}

.dropdown-option,
.skin-option {
  padding: 6px 12px;
  border-bottom: 1.5px dashed #eee;
  color: var(--text-dark);
  text-align: center;
  transition: background 0.1s, color 0.1s;
}

.dropdown-option:last-child,
.skin-option:last-child {
  border-bottom: none;
}

.dropdown-option:hover,
.skin-option:hover {
  background: #e3f2fd;
}

.dropdown-option.active,
.skin-option.active {
  background: var(--primary-blue) !important;
  color: #fff !important;
}

/* ═══════════════════════════════════════════════════════════════
   COMPREHENSIVE RESPONSIVE AND COLLAPSIBLE MOBILE LAYOUTS
═══════════════════════════════════════════════════════════════ */

@media (pointer: coarse) {
  .btn,
  .placement-btn,
  .tab-btn,
  .map-card,
  .shop-card,
  .loadout-card {
    min-height: 44px;
    touch-action: manipulation;
  }
  canvas {
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
  }
}

/* ═══════════════════════════════════════════════════════════════
   UNIVERSAL NON-BREAKING VIEWPORT - SCALED DOWN TO ANY SIZE
═══════════════════════════════════════════════════════════════ */
#app-container {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  width: 2122px !important;
  height: 1188px !important;
  transform: translate(-50%, -50%) scale(var(--app-scale, 1)) !important;
  transform-origin: center center !important;
  overflow: visible !important;
  pointer-events: auto !important;
}

#app-container.in-game-match {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  width: 2122px !important;
  height: 1188px !important;
  transform: translate(-50%, -50%) scale(var(--app-scale, 1)) !important;
  transform-origin: center center !important;
}

#btn-wizard-next-maps {
  font-size: 1.15rem !important;
  padding: 10px 16px !important;
  margin-top: 10px !important;
}

/* ─── COIN PLUS BUTTON ─── */
.btn-coin-plus {
  width: 26px;
  height: 26px;
  background: var(--primary-green);
  color: #fff;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--primary-green-dark);
  transition: transform 0.1s ease;
  line-height: 1;
}

.btn-coin-plus:hover {
  transform: scale(1.1);
  background: #27ae60;
}

.btn-coin-plus:active {
  transform: translateY(2px);
}

/* ─── CRATES PANEL (LOCKED & UNLOCKED) ─── */
#panel-crates {
  padding: 0 !important;
  overflow: hidden !important;
  position: relative !important;
}

#crates-unlocked-view {
  width: 100%;
  height: 100%;
  padding: 20px 24px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

#crates-unlocked-view.hidden {
  display: none !important;
}

.crates-unlocked-deck {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
  max-width: 1080px;
  margin: 10px auto 0 auto;
}

.crate-shop-card {
  background: linear-gradient(180deg, #ffffff 0%, #e8f4fc 100%);
  border: 3.5px solid #00d2ff;
  border-radius: 18px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  box-shadow: 0 6px 0 #0088cc, 0 8px 18px rgba(0, 0, 0, 0.25);
  min-height: 380px;
  box-sizing: border-box;
  transition: transform 0.12s ease;
}

.crate-shop-card:hover {
  transform: translateY(-4px);
}

.crate-shop-card.card-elite {
  border-color: #9b59b6;
  box-shadow: 0 6px 0 #7d3c98, 0 8px 18px rgba(0, 0, 0, 0.25);
}

.crate-shop-card.card-deluxe {
  border-color: #f1c40f;
  box-shadow: 0 6px 0 #d4ac0d, 0 8px 18px rgba(241, 196, 15, 0.35);
}

.crate-img-preview {
  width: 110px;
  height: 110px;
  object-fit: contain;
  margin: 8px 0;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.35));
}

.crate-card-title {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 900;
  color: #0b2e68;
}

.crate-card-desc {
  font-size: 0.85rem;
  font-weight: 800;
  color: #64748b;
  line-height: 1.35;
  margin: 6px 0 12px 0;
}

.crate-rarity-pill {
  font-family: var(--font-title);
  font-size: 0.72rem;
  font-weight: 900;
  padding: 3px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.pill-basic { background: #cbd5e1; color: #1e293b; }
.pill-elite { background: #9b59b6; color: #fff; }
.pill-deluxe { background: #f1c40f; color: #422a00; }

.crates-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
}

.crates-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
  pointer-events: none;
  z-index: 1;
}

.crates-content {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-right: 140px;
  box-sizing: border-box;
}

.crates-info-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  width: 520px;
}

.crates-lock-badge {
  font-size: 3.2rem;
  filter: drop-shadow(0 4px 12px rgba(241, 196, 15, 0.7));
  display: inline-block;
}

.crates-locked-title {
  font-family: var(--font-title) !important;
  font-size: 3rem !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  letter-spacing: 1px !important;
  text-shadow: 2px 2px 0 #001f54, 0 0 14px rgba(0, 210, 255, 0.6) !important;
  margin: 0 !important;
  border: none !important;
  padding: 0 !important;
  text-transform: uppercase;
}

.cyan-highlight {
  color: #00d2ff !important;
  text-shadow: 2px 2px 0 #001f54 !important;
}

.crates-locked-pill {
  font-family: var(--font-title);
  font-size: 1.65rem;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 1.5px 1.5px 0 #001f54;
}

.crates-locked-subtexts {
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 800;
  color: #9cbddb;
  line-height: 1.4;
  margin: 6px 0 16px 0;
  text-shadow: 1px 1px 2px #001538;
}

.btn-crates-shop {
  height: 74px;
  min-width: 340px;
  background: url('assets/ui/menu/sprite_05.webp') no-repeat center center / 100% 100% !important;
  border: none !important;
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 26px;
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 2px 2px 0 #00368a;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn-crates-shop:hover {
  transform: scale(1.04);
  filter: brightness(1.1);
}

.btn-crates-shop:active {
  transform: scale(0.96);
}

.btn-shop-cart-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}
/* ─── COINS TAB & PANEL STYLING (1:1 MOCKUP ACCURATE) ─── */
.tab-btn-coins {
  background: url('assets/ui/menu/sprite_03.webp') no-repeat center center / 100% 100% !important;
}

/* Give Free Coins the same blue selection sprite as normal tabs when active */
.tab-btn-coins.active {
  background: url('assets/ui/menu/sprite_02.webp') no-repeat center center / 100% 100% !important;
  box-shadow: none !important;
}

.tab-btn-coins.active .tab-label {
  color: #ffffff !important;
  text-shadow: 1.5px 1.5px 0 #00368a !important;
}

.coins-ad-panel {
  padding: 0 !important;
  overflow: hidden !important;
  position: relative !important;
  width: 100% !important;
  height: 100% !important;
  display: none;
}

.coins-ad-panel.active {
  display: flex !important;
}

.coins-ad-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.coins-ad-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 1;
  pointer-events: none;
}

.coins-ad-content {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 24px 34px 28px 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Headers Cluster */
.coins-ad-headers {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  max-width: 650px;
}

.coins-ad-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.coins-title-watch {
  height: 84px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.6));
}

.coins-title-play-badge {
  height: 48px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.coins-title-get-coins {
  height: 72px;
  width: auto;
  object-fit: contain;
  margin-top: -6px;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.6));
}

.coins-ad-subtext {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 2px 2px 0 #00225e, -1px -1px 0 #00225e, 1px -1px 0 #00225e, -1px 1px 0 #00225e;
  line-height: 1.35;
  margin-top: 6px;
}

.highlight-coins {
  color: #f1c40f;
  text-shadow: 2px 2px 0 #5d3400;
}

/* Bottom Action Row */
.coins-ad-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* Green Watch Ad Pill Button */
.btn-ad-green-pill {
  width: 370px !important;
  height: 78px !important;
  background: url('assets/ui/ads/sprite_05.webp') no-repeat center center / 100% 100% !important;
  border: none !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 16px !important;
  padding: 0 20px !important;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.4)) !important;
  transition: transform 0.12s ease, filter 0.12s ease !important;
}

.btn-ad-green-pill:hover {
  transform: scale(1.04) !important;
  filter: brightness(1.08) drop-shadow(0 8px 16px rgba(0, 255, 128, 0.45)) !important;
}

.btn-ad-green-pill:active {
  transform: scale(0.96) !important;
}

.btn-ad-green-pill.disabled,
.btn-ad-green-pill:disabled {
  opacity: 0.65 !important;
  filter: grayscale(0.5) !important;
  cursor: not-allowed !important;
}

.btn-ad-play-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.35));
}

.btn-ad-text-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.btn-ad-heading {
  font-family: var(--font-title);
  font-size: 1.55rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 2px 2px 0 #005a18;
  line-height: 1.1;
  letter-spacing: 0.5px;
}

.btn-ad-reward {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 900;
  color: #f1c40f;
  text-shadow: 1.5px 1.5px 0 #5d3400;
  letter-spacing: 0.5px;
}

/* Purple Daily Limit Pill Badge */
.ad-daily-limit-badge {
  width: 220px;
  height: 64px;
  background: url('assets/ui/ads/sprite_06.webp') no-repeat center center / 100% 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 16px;
  box-sizing: border-box;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.35));
}

.ad-limit-clapper-icon {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.ad-limit-text-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.ad-limit-label {
  font-family: var(--font-title);
  font-size: 0.82rem;
  font-weight: 900;
  color: #e2c0ff;
  letter-spacing: 0.6px;
  text-shadow: 1px 1px 0 #3a0066;
}

.ad-limit-count {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 2px 2px 0 #3a0066;
  letter-spacing: 0.8px;
}

/* ─── NEW POLISHED LOBBY SPLASH: ARTWORK + CURVED PODIUM ─── */
.splash-container-v2 {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  overflow: hidden;
  display: flex;
  flex-direction: column !important;
  box-sizing: border-box !important;
}

.splash-container-v2.hidden {
  display: none !important;
}
/* Full Artwork: Shows soldiers down to their weapons and belts */
.splash-art-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('assets/ui/menu/troops.webp') no-repeat center 20% / cover !important;
  z-index: 1;
}

/* The Curved Blue Podium: Sits across the bottom 38% */
.splash-curved-podium {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.splash-curve-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.splash-podium-content {
  position: relative;
  z-index: 3;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 16px;
  box-sizing: border-box;
}

/* 3D Title Banner: Anchored on the crest of the curve */
.splash-title-img {
  max-width: 440px;
  width: 60%;
  height: auto;
  margin-top: -32px;
  margin-bottom: 2px;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.85));
}

.splash-subtext {
  color: #ffffff;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.9rem;
  max-width: 520px;
  text-align: center;
  line-height: 1.35;
  margin-bottom: 14px;
  text-shadow: 1.5px 1.5px 3px #000;
}

/* Large Action Buttons */
.splash-action-row {
  display: flex;
  gap: 20px;
  width: 100%;
  max-width: 600px;
  justify-content: center;
  padding: 0 16px;
  box-sizing: border-box;
}

.btn-splash-solo {
  flex: 0 0 auto;
  max-width: none;
  height: 74px;
  background: url('assets/ui/menu/sprite_04.webp') no-repeat center center / 100% 100% !important;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: var(--font-title);
  font-size: 1.45rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 2px 2px 0 #005a18;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
  transition: transform 0.1s ease;
}

.btn-splash-coop {
  flex: 0 0 auto;
  max-width: none;
  height: 74px;
  background: url('assets/ui/menu/sprite_05.webp') no-repeat center center / 100% 100% !important;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: var(--font-title);
  font-size: 1.45rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 2px 2px 0 #00368a;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
  transition: transform 0.1s ease;
}

.btn-splash-solo:hover, .btn-splash-coop:hover { transform: scale(1.03); }
.btn-splash-solo:active, .btn-splash-coop:active { transform: scale(0.97); }

.splash-btn-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

/* ═══════════════════════════════════════════════════════════════
   AGENT SHOP UI - 1:1 REPLICATION IN PURE GLOSSY CSS
═══════════════════════════════════════════════════════════════ */

/* 1. Top Header Banner Strip */
.shop-header-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, #093c85 0%, #05214e 100%);
  border: 3.5px solid #00d2ff;
  border-radius: 16px;
  padding: 10px 18px;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.25), 0 4px 12px rgba(0, 0, 0, 0.4);
  margin-bottom: 12px;
  flex-shrink: 0;
}

.shop-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shop-header-icon-disc {
  width: 44px;
  height: 44px;
  background: linear-gradient(180deg, #0088ff 0%, #004eb7 100%);
  border: 2px solid #00d2ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

.shop-header-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.shop-header-text {
  display: flex;
  flex-direction: column;
}

.shop-header-title {
  font-family: var(--font-title) !important;
  font-size: 1.65rem !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  text-shadow: 2px 2px 0 #001f54, 0 0 12px rgba(0, 210, 255, 0.6) !important;
  margin: 0 !important;
  border: none !important;
  padding: 0 !important;
  letter-spacing: 0.8px !important;
  text-transform: uppercase;
}

/* Force silver unlocked pill without yellow sprite override */
.btn-unlocked-pill,
button.btn-unlocked-pill,
.shop-wide-card .btn-unlocked-pill,
.shop-vert-card .btn-unlocked-pill {
  width: 100% !important;
  height: 32px !important;
  background-image: none !important;
  background: linear-gradient(180deg, #d5e0ea 0%, #8da2b5 100%) !important;
  border: 2px solid #5b7185 !important;
  border-radius: 12px !important;
  font-family: var(--font-title) !important;
  font-size: 0.85rem !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  text-shadow: 1px 1px 0 #3a4b59 !important;
  box-shadow: 0 3px 0 #475a6b !important;
  cursor: default !important;
  opacity: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.shop-header-subtitle {
  font-size: 0.85rem;
  font-weight: 700;
  color: #d0e6ff;
  margin: 1px 0 0 0;
}

.shop-header-tagline {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 900;
  color: #00ffe0;
  font-style: italic;
  letter-spacing: 0.8px;
  text-shadow: 1px 1px 2px #001f54;
}

/* 2. Category Wrapper & Strips */
.shop-category-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.cat-banner-strip {
  width: 100%;
  height: 42px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.cat-banner-green {
  background: linear-gradient(90deg, #1b6338 0%, #b2e8d0 20%, #d8f5e7 75%, #185a30 100%);
  border: 2px solid #27ae60;
}

.cat-banner-blue {
  background: linear-gradient(90deg, #093c85 0%, #bfe0ff 20%, #e0f0ff 75%, #083472 100%);
  border: 2px solid #0088ff;
}

.cat-banner-orange {
  background: linear-gradient(90deg, #b33900 0%, #ffd8b8 20%, #ffece0 75%, #942d00 100%);
  border: 2px solid #e67e22;
}

.cat-banner-purple {
  background: linear-gradient(90deg, #5b1a85 0%, #e7ccf7 20%, #f4e8fc 75%, #471169 100%);
  border: 2px solid #9b59b6;
}

.cat-pill-badge {
  height: 100%;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px 0 12px;
  box-shadow: inset 0 2px 2px rgba(255, 255, 255, 0.4), 0 2px 4px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.cat-pill-green {
  background: linear-gradient(180deg, #2ecc71 0%, #219653 100%);
  border: 2px solid #145a32;
}

.cat-pill-blue {
  background: linear-gradient(180deg, #0088ff 0%, #0055bb 100%);
  border: 2px solid #00368a;
}

.cat-pill-orange {
  background: linear-gradient(180deg, #e67e22 0%, #d35400 100%);
  border: 2px solid #963b00;
}

.cat-pill-purple {
  background: linear-gradient(180deg, #9b59b6 0%, #8e44ad 100%);
  border: 2px solid #5b2c6f;
}

.cat-star-icon {
  font-size: 1.2rem;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3));
}

.cat-icon-small {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.cat-title-text {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 1.5px 1.5px 0 rgba(0, 0, 0, 0.5);
  letter-spacing: 0.5px;
}

.cat-middle-desc {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 800;
  margin-left: 12px;
  flex: 1;
}

.text-green-dark { color: #0d4a25; }
.text-blue-dark { color: #0b3472; }

.cat-slanted-badge {
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 24px 0 20px;
  clip-path: polygon(14px 0%, 100% 0%, 100% 100%, 0% 100%);
  font-family: var(--font-title);
  font-size: 0.82rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.6px;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.cat-slanted-green {
  background: linear-gradient(180deg, #1b6338 0%, #104223 100%);
  border-left: 2px solid #2ecc71;
}

.cat-slanted-blue {
  background: linear-gradient(180deg, #093c85 0%, #05214e 100%);
  border-left: 2px solid #00d2ff;
}

.cat-slanted-orange {
  background: linear-gradient(180deg, #b33900 0%, #631e00 100%);
  border-left: 2px solid #ff7b00;
}

.cat-slanted-purple {
  background: linear-gradient(180deg, #5b1a85 0%, #300747 100%);
  border-left: 2px solid #d279ee;
}

.text-orange-dark { color: #7a2800; }
.text-purple-dark { color: #4a154b; }

/* 3. Starter Section: 4 Wide Horizontal Cards */
.starter-wide-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
}

.shop-wide-card {
  background: linear-gradient(180deg, #ffffff 0%, #e8f4fc 100%) !important;
  border: 3px solid #00d2ff !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 0 #0088cc, 0 6px 12px rgba(0, 0, 0, 0.12) !important;
  padding: 10px 12px !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 12px;
  box-sizing: border-box;
}

.wide-card-left {
  flex-shrink: 0;
}

.troop-disc-avatar {
  width: 66px;
  height: 66px;
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #cce9ff 60%, #9cd3ff 100%);
  border: 2.5px solid #00d2ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.12), 0 3px 6px rgba(0, 0, 0, 0.15);
}

.troop-disc-avatar .agent-preview-canvas {
  width: 50px !important;
  height: 50px !important;
}

.wide-card-right {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.wide-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wide-troop-name {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 900;
  color: #0b2e68;
}

.wide-tag-starter {
  background: #27ae60;
  color: #ffffff;
  font-family: var(--font-title);
  font-size: 0.65rem;
  font-weight: 900;
  padding: 1px 7px;
  border-radius: 5px;
  letter-spacing: 0.5px;
}

.wide-stat-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 900;
  color: #334155;
  white-space: nowrap;
}

.stat-unit {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.stat-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.stat-divider {
  color: #cbd5e1;
}

.wide-desc-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.25;
}

.ability-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
}

.desc-blue { color: #0284c7; }
.desc-green { color: #16a34a; }
.desc-orange { color: #ea580c; }
.desc-red { color: #dc2626; }
.desc-cyan { color: #0891b2; }
.desc-gold { color: #b45309; }

/* 4. Intermediate Section: 7 Vertical Portrait Cards */
.intermediate-vertical-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  width: 100%;
}

.shop-vert-card {
  background: linear-gradient(180deg, #ffffff 0%, #eaf5fc 100%) !important;
  border: 3px solid #00d2ff !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 0 #0088cc, 0 6px 12px rgba(0, 0, 0, 0.12) !important;
  padding: 10px 8px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: space-between !important;
  height: 258px !important;
  box-sizing: border-box;
  text-align: center;
}

.card-glow-green {
  border-color: #2ecc71 !important;
  box-shadow: 0 4px 0 #27ae60, 0 0 12px rgba(46, 204, 113, 0.35) !important;
}

.shop-vert-card .agent-preview-canvas {
  width: 50px !important;
  height: 50px !important;
}

.vert-name {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 900;
  color: #0b2e68;
  margin-top: 2px;
}

.coin-icon-mini {
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 3px;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.25));
}

.vert-stats {
  font-size: 0.64rem;
  font-weight: 900;
  color: #64748b;
  margin: 1px 0;
  white-space: nowrap;
}

.vert-desc {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 800;
  text-align: left;
  line-height: 1.2;
  flex: 1;
  margin: 3px 0;
}

.vert-ability-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
  margin-top: 1px;
}

/* 5. Buttons */
.btn-unlocked-pill {
  width: 100% !important;
  height: 32px !important;
  background: linear-gradient(180deg, #e2e8f0 0%, #94a3b8 100%) !important;
  border: 2px solid #64748b !important;
  border-radius: 12px !important;
  font-family: var(--font-title) !important;
  font-size: 0.85rem !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.4) !important;
  box-shadow: 0 3px 0 #475569 !important;
  cursor: default !important;
  opacity: 0.9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-shop-action {
  width: 100% !important;
  height: 34px !important;
  background: linear-gradient(180deg, #f1c40f 0%, #f39c12 100%) !important;
  border: 2.5px solid #d68910 !important;
  border-radius: 12px !important;
  box-shadow: 0 3.5px 0 #b7790b, 0 3px 6px rgba(0,0,0,0.15) !important;
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 900;
  color: #5d3400;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-shop-action:hover { scale: 1.03; filter: brightness(1.08); }
.btn-shop-action:active { scale: 0.97; }

/* ═══════════════════════════════════════════════════════════════
   LIVE VISUAL UI EDITOR & REFERENCE OVERLAY STYLES
═══════════════════════════════════════════════════════════════ */
#ui-editor-ref-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  z-index: 99990;
  opacity: 0;
  display: none;
}

#btn-toggle-editor {
  position: fixed;
  top: 8px;
  right: 8px;
  z-index: 1000000;
  background: #111827;
  color: #00ffe0;
  border: 2px solid #00ffe0;
  border-radius: 8px;
  padding: 6px 12px;
  font-family: var(--font-title);
  font-size: 0.8rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  transition: transform 0.1s ease;
}
#btn-toggle-editor:hover { transform: scale(1.05); }

#ui-editor-dock {
  position: fixed;
  top: 48px;
  right: 8px;
  width: 320px;
  max-height: 88vh;
  overflow-y: auto;
  background: rgba(10, 20, 38, 0.96);
  border: 3px solid #00d2ff;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  z-index: 1000000;
  color: #ffffff;
  font-family: var(--font-body);
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
}

.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px dashed #00d2ff;
  padding-bottom: 6px;
}
.editor-header h3 {
  margin: 0;
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: #00ffe0;
}
.editor-header span {
  font-size: 0.7rem;
  color: #94a3b8;
  font-weight: 800;
}

.editor-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0, 210, 255, 0.25);
  border-radius: 8px;
  padding: 8px;
}
.editor-section-title {
  font-family: var(--font-title);
  font-size: 0.78rem;
  font-weight: 900;
  color: #f1c40f;
  margin-bottom: 2px;
}

.editor-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.72rem;
  font-weight: 800;
}
.editor-field label {
  display: flex;
  justify-content: space-between;
  color: #cbd5e1;
}
.editor-field label span {
  color: #00ffe0;
  font-weight: 900;
}
.editor-field input[type="range"] {
  width: 100%;
  accent-color: #00ffe0;
  cursor: pointer;
  margin: 2px 0;
}

.editor-select {
  width: 100%;
  background: #1e293b;
  color: #ffffff;
  border: 2px solid #00d2ff;
  border-radius: 6px;
  padding: 6px;
  font-family: var(--font-title);
  font-size: 0.82rem;
  font-weight: 900;
  outline: none;
}

.editor-btn-row {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.btn-editor-action {
  flex: 1;
  padding: 8px 6px;
  border-radius: 6px;
  border: none;
  font-family: var(--font-title);
  font-size: 0.8rem;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.1s;
}
.btn-editor-copy {
  background: #2ecc71;
  color: #ffffff;
}
.btn-editor-reset {
  background: #e74c3c;
  color: #ffffff;
}
.btn-editor-action:hover { transform: scale(1.02); }
.btn-editor-action:active { transform: scale(0.98); }

/* Highlight for element selected in editor */
.ui-editor-hover-target {
  outline: 2px dashed #f1c40f !important;
  cursor: pointer !important;
}
.ui-editor-selected-target {
  outline: 3px solid #00ffe0 !important;
  box-shadow: 0 0 15px #00ffe0 !important;
}

/* ─── TACTILE BUTTON HOVER & ACTIVE ZOOM ─── */
.btn,
.tab-btn,
.btn-splash-solo,
.btn-splash-coop,
.btn-img-plus,
.btn-img-back,
.map-card,
.diff-wizard-card,
.shop-card {
  transition: scale 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.16s ease !important;
}

.btn:hover,
.tab-btn:hover,
.btn-splash-solo:hover,
.btn-splash-coop:hover,
.map-card:hover,
.diff-wizard-card:hover,
.shop-card:hover {
  scale: 1.05 !important;
  filter: brightness(1.12) drop-shadow(0 4px 10px rgba(0, 210, 255, 0.35)) !important;
  cursor: pointer !important;
}

.btn-img-plus:hover,
.btn-img-back:hover {
  scale: 1.15 !important;
  filter: brightness(1.2) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4)) !important;
  cursor: pointer !important;
}

/* Button pressed (tactile click feel) */
.btn:active,
.tab-btn:active,
.btn-splash-solo:active,
.btn-splash-coop:active,
.btn-img-plus:active,
.btn-img-back:active,
.map-card:active {
  scale: 0.95 !important;
  filter: brightness(0.92) !important;
}

/* ═══════════════════════════════════════════════════════════════
   CO-OP MULTIPLAYER LOBBY (CUSTOM ASSETS IN assets/ui/coop/)
═══════════════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════════
   CO-OP MULTIPLAYER LOBBY (COMPLETE SELF-CONTAINED SYSTEM)
═══════════════════════════════════════════════════════════════ */
.coop-main-panel {
  width: 100% !important;
  height: 100% !important;
  background: #00225e !important;
  border-radius: 18px !important;
  padding: 14px 18px !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

/* Allow .hidden to actually hide the phase! */
.coop-phase-view {
  width: 100% !important;
  height: 100% !important;
  display: flex;
  flex-direction: column !important;
  gap: 10px !important;
  min-height: 0 !important;
  background: transparent !important;
}

.coop-phase-view.hidden {
  display: none !important;
}

/* 1. Top Title Row */
.coop-panel-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  flex-shrink: 0;
}

.coop-title-cluster {
  display: flex;
  align-items: center;
  gap: 12px;
}

.coop-header-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
}

.coop-header-title-img {
  height: 38px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.coop-btn-change-mode {
  height: 40px;
  background: url('assets/ui/coop/sprite_05.webp') no-repeat center center / 100% 100%;
  border: none;
  cursor: pointer;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 1.5px 1.5px 0 #00368a;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.35));
  transition: scale 0.12s ease;
}
.coop-btn-change-mode:hover { scale: 1.05; }
.coop-btn-change-mode:active { scale: 0.95; }

.coop-gear-icon {
  font-size: 1.1rem;
}

/* 2. Controls Row: Name, Host, Room Code, Join */
.coop-controls-row {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  width: 100%;
  flex-shrink: 0;
}

.coop-field-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1.2;
}

.coop-field-label {
  font-family: var(--font-title);
  font-size: 0.85rem;
  font-weight: 900;
  color: #c9e4ff;
  letter-spacing: 0.8px;
  text-shadow: 1px 1px 2px #001f54;
}

.coop-input-pill {
  position: relative;
  display: flex;
  align-items: center;
  background: #00225e;
  border: 3px solid #00d2ff;
  border-radius: 12px;
  height: 52px;
  padding: 0 12px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
  box-sizing: border-box;
}

.coop-pencil-icon,
.coop-code-icon {
  font-size: 1.15rem;
  margin-right: 8px;
  user-select: none;
}

.coop-input-pill input {
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 900;
  color: #ffffff;
  width: 100%;
}
.coop-input-pill input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.btn-coop-pill-host {
  height: 56px;
  min-width: 220px;
  background: url('assets/ui/coop/sprite_04.png') no-repeat center center / 100% 100%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-title);
  font-size: 1.3rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 2px 2px 0 #005a18;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.35));
  padding: 0 22px;
  transition: scale 0.12s ease;
  flex-shrink: 0;
}
.btn-coop-pill-host:hover { scale: 1.05; }
.btn-coop-pill-host:active { scale: 0.95; }

.btn-coop-host-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.btn-coop-pill-join {
  height: 56px;
  min-width: 130px;
  background: url('assets/ui/coop/sprite_05.webp') no-repeat center center / 100% 100%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-title);
  font-size: 1.3rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 2px 2px 0 #00368a;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.35));
  padding: 0 18px;
  transition: scale 0.12s ease;
  flex-shrink: 0;
}
.btn-coop-pill-join:hover { scale: 1.05; }
.btn-coop-pill-join:active { scale: 0.95; }

.btn-coop-join-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

/* 3. Lower Container: ACTIVE PUBLIC SQUADS Card */
.coop-browser-card {
  flex: 1;
  min-height: 0;
  width: 100%;
  background: #00225e;
  border: 4px solid #00d2ff;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
}

.coop-browser-header {
  height: 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  border-bottom: 2px solid #00d2ff;
  background: rgba(0, 78, 183, 0.4);
}

.coop-browser-title-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 1.5px 1.5px 0 #000;
}

.coop-browser-header-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.btn-coop-refresh {
  height: 34px;
  background: url('assets/ui/coop/sprite_05.webp') no-repeat center center / 100% 100%;
  border: none;
  cursor: pointer;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-title);
  font-size: 0.85rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 1px 1px 0 #000;
  transition: scale 0.12s ease;
}
.btn-coop-refresh:hover { scale: 1.05; }
.btn-coop-refresh:active { scale: 0.95; }

.btn-coop-refresh-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.coop-browser-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.coop-empty-showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 24px;
  box-sizing: border-box;
}

.coop-empty-soldiers-img {
  width: 180px;
  height: auto;
  object-fit: contain;
  margin-bottom: 8px;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.6));
}

.coop-empty-heading {
  font-family: var(--font-title);
  font-size: 1.7rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 2px 2px 0 #000;
  margin: 0;
}

.coop-empty-caption {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 800;
  color: #70b8ff;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  margin-top: 4px;
}

.coop-rooms-deck {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}

.coop-room-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 40, 110, 0.6);
  border: 2px solid #00d2ff;
  border-radius: 12px;
  padding: 10px 14px;
}

.coop-room-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.coop-room-code {
  font-family: var(--font-title);
  font-size: 1.15rem;
  color: #00ffe0;
  font-weight: 900;
}

.coop-room-host {
  color: #ffffff;
  font-weight: 800;
  font-size: 1rem;
}

.coop-room-status {
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 4px;
}

.coop-room-meta {
  font-size: 0.8rem;
  color: #8ac2ff;
  font-weight: 800;
  margin-top: 2px;
  display: block;
}

/* ─── 4. PHASE B: ACTIVE SQUAD ROOM (HOST & MEMBERS) ─── */
.coop-room-header-strip {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  background: rgba(0, 60, 160, 0.45) !important;
  border: 3px solid #00d2ff !important;
  border-radius: 14px !important;
  padding: 10px 18px !important;
  flex-shrink: 0 !important;
}

.coop-room-badge-cluster {
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
}

.coop-code-display {
  font-family: var(--font-title) !important;
  font-size: 1.45rem !important;
  font-weight: 900 !important;
  color: #00ffe0 !important;
  letter-spacing: 1px !important;
  text-shadow: 2px 2px 0 #000 !important;
}

.btn-coop-copy-code {
  background: #0088ff !important;
  border: 2px solid #00ffe0 !important;
  border-radius: 8px !important;
  color: #fff !important;
  font-family: var(--font-title) !important;
  font-size: 0.85rem !important;
  font-weight: 900 !important;
  padding: 6px 12px !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  box-shadow: 0 3px 0 #004eb7 !important;
}
.btn-coop-copy-code:hover { filter: brightness(1.1) !important; }

.copy-icon-img {
  width: 18px !important;
  height: 18px !important;
}

.coop-privacy-toggle {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-family: var(--font-title) !important;
  font-size: 0.9rem !important;
  font-weight: 900 !important;
  color: #c9e4ff !important;
}

.coop-room-right-cluster {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
}

.coop-status-tag {
  font-family: var(--font-title) !important;
  font-size: 1rem !important;
  font-weight: 900 !important;
  text-shadow: 1px 1px 0 #000 !important;
}

.btn-coop-leave-room {
  background: #e74c3c !important;
  border: 2px solid #c0392b !important;
  border-radius: 8px !important;
  color: #ffffff !important;
  font-family: var(--font-title) !important;
  font-size: 0.85rem !important;
  font-weight: 900 !important;
  padding: 6px 14px !important;
  cursor: pointer !important;
  box-shadow: 0 3px 0 #962d22 !important;
}
.btn-coop-leave-room:hover { filter: brightness(1.1) !important; }

/* ─── 8 Player Slot Deck ─── */
.coop-roster-section {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  flex-shrink: 0 !important;
}

.coop-section-label {
  font-family: var(--font-title) !important;
  font-size: 1rem !important;
  font-weight: 900 !important;
  color: #00ffe0 !important;
  letter-spacing: 0.8px !important;
  text-shadow: 1px 1px 2px #000 !important;
}

.coop-slots-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 10px !important;
  width: 100% !important;
}

.coop-slot-card {
  height: 58px !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
  padding: 0 12px !important;
  box-sizing: border-box !important;
  gap: 10px !important;
}

.slot-occupied {
  background: #00368a !important;
  border: 2.5px solid #00d2ff !important;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5) !important;
}

.slot-self {
  border-color: #f1c40f !important;
  background: #004099 !important;
  box-shadow: 0 0 10px rgba(241, 196, 15, 0.35) !important;
}

.slot-avatar-wrapper {
  position: relative !important;
  width: 36px !important;
  height: 36px !important;
  flex-shrink: 0 !important;
}

.slot-avatar-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

.slot-id-pill {
  position: absolute !important;
  bottom: -4px !important;
  right: -4px !important;
  background: #0a1020 !important;
  color: #00ffe0 !important;
  font-size: 0.65rem !important;
  font-weight: 900 !important;
  padding: 1px 4px !important;
  border-radius: 4px !important;
  border: 1px solid #00d2ff !important;
}

.slot-info-col {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  overflow: hidden !important;
}

.slot-name {
  font-family: var(--font-title) !important;
  font-size: 1rem !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  text-shadow: 1px 1px 2px #000 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.slot-role-badge {
  font-size: 0.72rem !important;
  font-weight: 900 !important;
  margin-top: 1px !important;
}
.role-host { color: #f1c40f !important; }
.role-member { color: #2ecc71 !important; }

/* Clean, high-contrast Empty Slot */
.slot-empty {
  background: rgba(0, 20, 50, 0.5) !important;
  border: 2px dashed #0088ff !important;
  justify-content: center !important;
  color: #5599ff !important;
  gap: 6px !important;
}

.slot-empty-icon {
  font-size: 1.2rem !important;
  font-weight: 900 !important;
  color: #00d2ff !important;
}

.slot-empty-text {
  font-family: var(--font-title) !important;
  font-size: 0.85rem !important;
  font-weight: 900 !important;
  color: #66aaff !important;
  letter-spacing: 0.5px !important;
}

/* ─── Co-op Map Row ─── */
.coop-map-section {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

.coop-map-row {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
  gap: 12px !important;
  width: 100% !important;
  flex: 1 1 auto !important;
}

.coop-map-row.hidden {
  display: none !important;
}

/* ─── CLIENT SINGLE LIVE MAP CARD ─── */
.coop-single-live-card {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 32px !important;
  background: linear-gradient(135deg, rgba(0, 50, 130, 0.75), rgba(0, 20, 60, 0.85)) !important;
  border: 3.5px solid #00d2ff !important;
  border-radius: 16px !important;
  box-shadow: 0 0 25px rgba(0, 210, 255, 0.3), inset 0 0 16px rgba(0, 0, 0, 0.6) !important;
  padding: 16px 32px !important;
  width: 100% !important;
  max-width: 640px !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
}

.coop-single-live-card.hidden {
  display: none !important;
}

.live-card-badge {
  position: absolute !important;
  top: -12px !important;
  left: 24px !important;
  background: #f1c40f !important;
  color: #0b1a30 !important;
  font-family: var(--font-title) !important;
  font-size: 0.82rem !important;
  font-weight: 900 !important;
  letter-spacing: 0.8px !important;
  padding: 2px 14px !important;
  border-radius: 8px !important;
  border: 2px solid #ffffff !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5) !important;
}

#coop-live-preview-canvas {
  width: 160px !important;
  height: 120px !important;
  border-radius: 10px !important;
  border: 3px solid #00ffe0 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5) !important;
  background: #111 !important;
}

.live-card-details {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  text-align: left !important;
}

.live-map-title {
  font-family: var(--font-title) !important;
  font-size: 2rem !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  text-shadow: 2px 2px 0 #000 !important;
  letter-spacing: 0.8px !important;
}

.live-map-sub {
  font-family: var(--font-title) !important;
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.5px !important;
}

.coop-map-card {
  display: none !important;
}

/* ─── CLIENT SINGLE LIVE MAP CARD ─── */
.coop-single-live-card {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 32px !important;
  background: linear-gradient(135deg, rgba(0, 50, 130, 0.75), rgba(0, 20, 60, 0.85)) !important;
  border: 3.5px solid #00d2ff !important;
  border-radius: 16px !important;
  box-shadow: 0 0 25px rgba(0, 210, 255, 0.3), inset 0 0 16px rgba(0, 0, 0, 0.6) !important;
  padding: 16px 32px !important;
  width: 100% !important;
  max-width: 640px !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
}

.coop-single-live-card.hidden {
  display: none !important;
}

.live-card-badge {
  position: absolute !important;
  top: -12px !important;
  left: 24px !important;
  background: #f1c40f !important;
  color: #0b1a30 !important;
  font-family: var(--font-title) !important;
  font-size: 0.82rem !important;
  font-weight: 900 !important;
  letter-spacing: 0.8px !important;
  padding: 2px 14px !important;
  border-radius: 8px !important;
  border: 2px solid #ffffff !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5) !important;
}

#coop-live-preview-canvas {
  width: 160px !important;
  height: 120px !important;
  border-radius: 10px !important;
  border: 3px solid #00ffe0 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5) !important;
  background: #111 !important;
}

.live-card-details {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  text-align: left !important;
}

.live-map-title {
  font-family: var(--font-title) !important;
  font-size: 2rem !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  text-shadow: 2px 2px 0 #000 !important;
  letter-spacing: 0.8px !important;
}

.live-map-sub {
  font-family: var(--font-title) !important;
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.5px !important;
}

.coop-map-card {
  background: #ffffff !important;
  border: 2.5px solid #cbd5e1 !important;
  border-radius: 12px !important;
  padding: 8px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: space-between !important;
  cursor: pointer !important;
}

.coop-map-card.active {
  border: 3.5px solid #2ecc71 !important;
  box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.4) !important;
  background: #f0fdf4 !important;
}

.coop-map-card .map-preview-canvas {
  width: 120px !important;
  height: 90px !important;
  border-radius: 8px !important;
  display: block !important;
  background: #f1f5f9 !important;
}

/* ─── CLIENT LIVE SYNCED DECK (MAP + DIFFICULTY CARDS) ─── */
.coop-client-live-deck {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 18px !important;
  width: 100% !important;
  max-width: 820px !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
}

.coop-client-live-deck.hidden {
  display: none !important;
}

.coop-client-live-deck .coop-single-live-card {
  flex: 1 1 0 !important;
  max-width: 390px !important;
  margin: 0 !important;
  padding: 12px 18px !important;
  gap: 16px !important;
}

/* ─── CLIENT LIVE SYNCED DECK (MAP + DIFFICULTY CARDS) ─── */
.coop-client-live-deck {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 18px !important;
  width: 100% !important;
  max-width: 820px !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
}

.coop-client-live-deck.hidden {
  display: none !important;
}

.coop-client-live-deck .coop-single-live-card {
  flex: 1 1 0 !important;
  max-width: 390px !important;
  margin: 0 !important;
  padding: 12px 18px !important;
  gap: 16px !important;
}

/* ─── Bottom Launch Bar ─── */
.coop-bottom-action-bar {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  height: 64px !important;
  flex-shrink: 0 !important;
  margin-top: 4px !important;
}

.btn-coop-launch {
  height: 100% !important;
  width: 420px !important;
  background: url('assets/ui/solo/sprite_06.png') no-repeat center center / 100% 100% !important;
  border: none !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
  font-family: var(--font-title) !important;
  font-size: 1.6rem !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  text-shadow: 2px 2px 0 #005a18 !important;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4)) !important;
  transition: transform 0.12s ease !important;
}
.btn-coop-launch:hover { transform: scale(1.03) !important; }
.btn-coop-launch:active { transform: scale(0.97) !important; }
.btn-coop-launch.hidden {
  display: none !important;
}

.btn-launch-swords {
  width: 32px !important;
  height: 32px !important;
  object-fit: contain !important;
}

.coop-waiting-pill {
  background: rgba(0, 30, 80, 0.8) !important;
  border: 2px solid #00d2ff !important;
  border-radius: 14px !important;
  padding: 14px 32px !important;
  color: #00ffe0 !important;
  font-family: var(--font-title) !important;
  font-size: 1.15rem !important;
  font-weight: 900 !important;
  letter-spacing: 0.5px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}
.coop-waiting-pill.hidden {
  display: none !important;
}
/* ═══════════════════════════════════════════════════════════════
   SOLO MENU REDESIGN (ASSETS IN assets/ui/solo/) - PROPORTIONAL
═══════════════════════════════════════════════════════════════ */
.solo-menu-view {
  background: #ffffff !important;
  border-radius: 18px !important;
  padding: 16px 24px 14px 24px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  gap: 12px !important;
  overflow: hidden !important;
  position: relative !important;
}

/* 1. Header Bar */
.solo-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  flex-shrink: 0;
}

.solo-top-right-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-solo-back-action {
  height: 44px !important;
  min-width: 110px !important;
  background: url('assets/ui/solo/selectdifficulty/sprite_03.png') no-repeat center center / 100% 100% !important;
  border: none !important;
  cursor: pointer !important;
  padding: 0 18px !important;
  font-family: var(--font-title) !important;
  font-size: 1rem !important;
  font-weight: 900 !important;
  color: #2c3e50 !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15)) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: transform 0.12s ease, filter 0.12s ease !important;
}

.btn-solo-back-action:hover {
  transform: scale(1.05) !important;
  filter: brightness(1.08) !important;
}

.btn-solo-back-action:active {
  transform: scale(0.95) !important;
}

.solo-pill-badge {
  height: 52px;
  min-width: 165px;
  background: url('assets/ui/solo/sprite_07.png') no-repeat left center / 100% 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 22px 0 16px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
}

.solo-user-img-icon {
  width: 32px !important;
  height: 32px !important;
  object-fit: contain !important;
  flex-shrink: 0 !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35)) !important;
}

.solo-pill-title {
  font-family: var(--font-title);
  font-size: 1.85rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 2px 2px 0 #00368a;
  letter-spacing: 1px;
}

.solo-tagline-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 900;
  color: #2b7ae4;
  letter-spacing: 0.5px;
}

.solo-tagline-icon {
  font-size: 1.3rem;
}

/* 2. Hero Banner Card (Big, cinematic 250px height) */
.solo-hero-card {
  position: relative;
  width: 100%;
  height: 250px;
  border-radius: 16px;
  overflow: hidden;
  border: 3.5px solid #00d2ff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
  display: flex;
  flex-shrink: 0;
}

.solo-hero-artwork {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center right;
  z-index: 1;
}

.solo-hero-overlay {
  position: relative;
  z-index: 2;
  width: 48%;
  height: 100%;
  background: linear-gradient(90deg, #0b3472 0%, #0b4cb4 68%, rgba(11, 76, 180, 0) 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 32px;
  box-sizing: border-box;
}

.solo-hero-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.solo-hero-swords {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

.solo-hero-title {
  font-family: var(--font-title);
  font-size: 2.1rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 2.5px 2.5px 0 #00225e;
  letter-spacing: 1px;
}

.solo-hero-desc {
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 800;
  color: #e3f2fd;
  line-height: 1.4;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.75);
  max-width: 440px;
  margin: 0;
}

/* 3. Difficulty / Battleground Section with Divider Line */
.solo-selection-section {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.solo-section-tab-bar {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  margin-bottom: 10px;
}

.solo-section-tab {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 20px;
  background: url('assets/ui/solo/sprite_05.png') no-repeat center center / 100% 100%;
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 1.5px 1.5px 0 #00368a;
  position: relative;
  z-index: 2;
  letter-spacing: 0.5px;
}

.solo-section-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2.5px;
  background: #d8eaff;
  z-index: 1;
}

/* Map Cards Row: Large 180px cards filling width */
.solo-map-row {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
  gap: 14px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.solo-map-row .map-card {
  background: #ffffff !important;
  border: 2.5px solid #cbd5e1 !important;
  border-radius: 14px !important;
  padding: 10px 8px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: space-between !important;
  box-shadow: 0 4px 0 #e2e8f0 !important;
  transition: scale 0.14s ease, border-color 0.14s ease !important;
  height: 180px !important;
  cursor: pointer !important;
}

.solo-map-row .map-card:hover {
  scale: 1.04 !important;
  border-color: #00d2ff !important;
}

.solo-map-row .map-card.active {
  border: 3.5px solid #2ecc71 !important;
  box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.4), 0 4px 0 #27ae60 !important;
  background: #f0fdf4 !important;
}

.solo-map-row .map-preview-canvas {
  width: 120px !important;
  height: 90px !important;
  border-radius: 8px !important;
}

.solo-map-row .map-info .name {
  font-family: var(--font-title) !important;
  font-size: 1.08rem !important;
  font-weight: 900 !important;
  color: #0b2e68 !important;
  margin-top: 4px !important;
}

.solo-map-row .map-info .difficulty {
  font-size: 0.8rem !important;
  font-weight: 900 !important;
  display: inline-block !important;
  margin-top: 2px !important;
}

.locked-badge {
  background: #ff4757 !important;
  color: #ffffff !important;
  border-radius: 6px !important;
  padding: 2px 6px !important;
  font-size: 0.72rem !important;
}

/* 4. Bottom Action Footer */
.solo-footer-action {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: 6px;
  flex-shrink: 0;
}

.solo-corner-deco-left {
  width: 64px;
  height: auto;
  object-fit: contain;
  user-select: none;
}

.solo-corner-deco-right {
  width: 64px;
  height: auto;
  object-fit: contain;
  user-select: none;
}

/* Big Green PLAY Button */
.btn-solo-green-play {
  height: 78px !important;
  min-width: 440px !important;
  background: url('assets/ui/solo/sprite_06.png') no-repeat center center / 100% 100% !important;
  border: none !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 14px !important;
  font-family: var(--font-title) !important;
  font-size: 1.85rem !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  text-shadow: 2.5px 2.5px 0 #005a18 !important;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35)) !important;
  padding: 0 32px !important;
  transition: scale 0.12s ease !important;
  margin: 0 auto !important;
}

.btn-solo-green-play:hover {
  scale: 1.05 !important;
}

.btn-solo-green-play:active {
  scale: 0.95 !important;
}

.btn-solo-play-swords {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

/* ═══════════════════════════════════════════════════════════════
   CHOOSE DIFFICULTY MENU (USING sprite_01 to sprite_09 FRAMES)
═══════════════════════════════════════════════════════════════ */
.diff-menu-view {
  background: #ffffff !important;
  border-radius: 18px !important;
  padding: 18px 22px 20px 22px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  gap: 16px !important;
  overflow: hidden !important;
  position: relative !important;
}

/* 1. Top Banner Strip using sprite_01.png */
.diff-banner-strip {
  width: 100% !important;
  height: 74px !important;
  background: url('assets/ui/solo/selectdifficulty/sprite_01.webp') no-repeat center center / 100% 100% !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 0 16px 0 10px !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.18));
}

/* Slanted Title Badge using sprite_02.png */
.diff-badge-container {
  height: 54px !important;
  min-width: 290px !important;
  background: url('assets/ui/solo/selectdifficulty/sprite_02.webp') no-repeat left center / 100% 100% !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 0 28px 0 10px !important;
  box-sizing: border-box !important;
}

.diff-map-icon {
  width: 42px !important;
  height: 42px !important;
  object-fit: contain !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.diff-badge-title {
  font-family: var(--font-title) !important;
  font-size: 1.6rem !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  text-shadow: 2px 2px 0 #00368a !important;
  letter-spacing: 0.8px !important;
}

.diff-nav-buttons {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

/* <- BACK Button using sprite_03.png */
.btn-diff-back {
  height: 44px !important;
  min-width: 100px !important;
  background: url('assets/ui/solo/selectdifficulty/sprite_03.png') no-repeat center center / 100% 100% !important;
  border: none !important;
  cursor: pointer !important;
  padding: 0 18px !important;
  font-family: var(--font-title) !important;
  font-size: 0.95rem !important;
  font-weight: 900 !important;
  color: #2c3e50 !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15)) !important;
  transition: scale 0.12s ease !important;
}
.btn-diff-back:hover { scale: 1.05 !important; }
.btn-diff-back:active { scale: 0.95 !important; }

/* PREPARATION -> Button using sprite_04.png */
.btn-diff-prep {
  height: 44px !important;
  min-width: 145px !important;
  background: url('assets/ui/solo/selectdifficulty/sprite_04.webp') no-repeat center center / 100% 100% !important;
  border: none !important;
  cursor: pointer !important;
  padding: 0 20px !important;
  font-family: var(--font-title) !important;
  font-size: 0.95rem !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  text-shadow: 1px 1.5px 0 #00368a !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25)) !important;
  transition: scale 0.12s ease !important;
}
.btn-diff-prep:hover { scale: 1.05 !important; }
.btn-diff-prep:active { scale: 0.95 !important; }

/* 2. 5-Card Deck Grid: Custom Sprite Frames */
.difficulty-wizard-deck {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
  gap: 16px !important;
  width: 100% !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: visible !important;
  margin: 0 !important;
}

.diff-wizard-card {
  background-size: 100% 100% !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  border: none !important;
  border-radius: 16px !important;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  padding: 0 !important;
  cursor: pointer !important;
  height: 100% !important;
  max-width: none !important;
  transition: scale 0.14s ease, filter 0.14s ease !important;
}

/* Custom Sprite Frames (sprite_05 to sprite_09) */
.diff-card-easy {
  background-image: url('assets/ui/solo/selectdifficulty/sprite_05.png') !important;
}
.diff-card-casual {
  background-image: url('assets/ui/solo/selectdifficulty/sprite_06.png') !important;
}
.diff-card-intermediate {
  background-image: url('assets/ui/solo/selectdifficulty/sprite_07.webp') !important;
}
.diff-card-molten {
  background-image: url('assets/ui/solo/selectdifficulty/sprite_08.webp') !important;
}
.diff-card-fallen {
  background-image: url('assets/ui/solo/selectdifficulty/sprite_09.png') !important;
}

.diff-wizard-card:hover {
  scale: 1.03 !important;
  filter: brightness(1.05) !important;
}

/* Active Glow outline matching mockup */
.diff-wizard-card.active {
  filter: drop-shadow(0 0 10px #00ffe0) drop-shadow(0 0 3px #00ffe0) !important;
  scale: 1.03 !important;
}

/* Card Header: Transparent so frame's colored header shows through */
.diff-card-header {
  height: 70px !important;
  background: transparent !important;
  border: none !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding-top: 4px !important;
  flex-shrink: 0 !important;
}

.diff-title {
  font-family: var(--font-title) !important;
  font-size: 1.55rem !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.45) !important;
  letter-spacing: 0.8px !important;
}

.diff-sub {
  font-family: var(--font-body) !important;
  font-size: 0.78rem !important;
  font-weight: 800 !important;
  color: #ffffff !important;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.35) !important;
  margin-top: 1px !important;
}

/* Card Body: Transparent so frame's white body shows through */
.diff-card-body {
  background: transparent !important;
  padding: 10px 14px 14px 14px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: space-around !important;
  flex: 1 !important;
}

/* Boss preview centered inside the custom frame */
.diff-boss-preview {
  background: rgba(240, 244, 248, 0.6) !important;
  border: 2px solid #e2e8f0 !important;
  border-radius: 12px !important;
  width: 95px !important;
  height: 95px !important;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05) !important;
}

.diff-metrics-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  width: 100% !important;
  margin-top: 2px !important;
}

.diff-metric {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
  font-size: 0.98rem !important;
  font-weight: 900 !important;
  color: var(--text-dark) !important;
}

.diff-metric-icon {
  width: 24px !important;
  height: 24px !important;
  object-fit: contain !important;
  flex-shrink: 0 !important;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.12));
}

.diff-metric-text {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-family: var(--font-body) !important;
  font-weight: 900 !important;
}

/* Text Colors */
.text-boss-easy { color: #27ae60 !important; }
.text-boss-casual { color: #576574 !important; }
.text-boss-intermediate { color: #0984e3 !important; }
.text-boss-molten { color: #d35400 !important; }
.text-boss-fallen { color: #8e44ad !important; }
.text-coins { color: #b8860b !important; }

/* ═══════════════════════════════════════════════════════════════
   TACTICAL SQUAD PREPARATION (1:1 PIXEL-PERFECT MOCKUP)
═══════════════════════════════════════════════════════════════ */
.prep-menu-view {
  background: #003380 !important;
  padding: 14px 18px !important;
  border-radius: 18px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
}

/* 1. Top Banner Strip */
.prep-top-banner {
  width: 100% !important;
  height: 60px !important;
  background: url('assets/ui/solo/selectdifficulty/sprite_01.webp') no-repeat center center / 100% 100% !important;
  display: flex !important;
  align-items: center !important;
  padding: 0 16px !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
}

.prep-badge-container {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

.prep-swords-icon {
  width: 38px !important;
  height: 38px !important;
  object-fit: contain !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.prep-badge-title {
  font-family: var(--font-title) !important;
  font-size: 1.55rem !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  text-shadow: 2px 2px 0 #00368a, 0 0 10px rgba(0, 210, 255, 0.5) !important;
  letter-spacing: 0.8px !important;
}

/* 2. Hero Card with Cinematic Artwork & Hardcore Pill */
.prep-hero-card {
  position: relative !important;
  width: 100% !important;
  height: 140px !important;
  border-radius: 14px !important;
  border: 3.5px solid #00d2ff !important;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35) !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: flex-end !important;
  justify-content: center !important;
  padding-bottom: 12px !important;
  box-sizing: border-box !important;
}

.prep-hero-artwork {
  position: absolute !important;
  inset: 0 !important;
  transform: translate(-629px, -300px) scale(0.66) !important;
  transform-origin: center center !important;
  width: 2500px !important;
  max-width: none !important;
  flex: 0 0 auto !important;
  height: 654px !important;
  object-fit: cover !important;
  z-index: 1 !important;
}

/* ─── FREE COINS 2122x1188 CALIBRATION ─── */
.coins-title-watch {
  transform: translate(46px, 89px) scale(1.93) !important;
  transform-origin: left center !important;
}

.coins-title-play-badge {
  transform: translate(291px, 89px) scale(2.5) !important;
  transform-origin: left center !important;
}

.coins-title-get-coins {
  transform: translate(-13px, 156px) scale(2.18) !important;
  transform-origin: left center !important;
}

.coins-ad-subtext {
  transform: translate(156px, 181px) scale(1.48) !important;
  transform-origin: left top !important;
  width: 304px !important;
  max-width: none !important;
  flex: 0 0 auto !important;
}

#btn-tab-watch-ad-coins {
  transform: translate(249px, -80px) scale(2.05) !important;
  transform-origin: center center !important;
  height: 111px !important;
}

.btn-ad-play-icon {
  transform: translate(-30px, -4px) scale(1.54) !important;
}

.btn-ad-heading {
  transform: translate(0px, -4px) scale(1.38) !important;
}

.ad-daily-limit-badge {
  transform: translate(-122px, -4px) scale(2.3) !important;
  transform-origin: center center !important;
}

.prep-hardcore-pill {
  position: relative !important;
  z-index: 3 !important;
  background: rgba(10, 25, 50, 0.75) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
  border: 2px solid rgba(255, 255, 255, 0.35) !important;
  border-radius: 20px !important;
  padding: 6px 20px !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5) !important;
}

.prep-hc-checkbox {
  width: 18px !important;
  height: 18px !important;
  cursor: pointer !important;
  accent-color: #f1c40f !important;
}

.prep-hc-label {
  font-family: var(--font-title) !important;
  font-size: 0.95rem !important;
  font-weight: 900 !important;
  color: #ecf0f1 !important;
  letter-spacing: 0.6px !important;
  text-shadow: 1.5px 1.5px 2px #000 !important;
  cursor: pointer !important;
  user-select: none !important;
}

.prep-hc-flame {
  font-size: 1.1rem !important;
}

/* 3. Action Row (Back + Deploy) */
.prep-action-row {
  display: flex !important;
  gap: 16px !important;
  width: 100% !important;
  height: 64px !important;
  flex-shrink: 0 !important;
}

.btn-prep-back {
  flex: 0 0 260px !important;
  height: 100% !important;
  background: #606770 !important;
  border: 3.5px solid #2f3542 !important;
  border-radius: 14px !important;
  color: #ffffff !important;
  font-family: var(--font-title) !important;
  font-size: 1.1rem !important;
  font-weight: 900 !important;
  text-shadow: 1.5px 1.5px 0 #1e272e !important;
  cursor: pointer !important;
  box-shadow: 0 5px 0 #2f3542, 0 8px 12px rgba(0, 0, 0, 0.25) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  transition: transform 0.1s ease, filter 0.1s ease !important;
}
.btn-prep-back:hover { filter: brightness(1.1) !important; }
.btn-prep-back:active { transform: translateY(3px) !important; box-shadow: 0 2px 0 #2f3542 !important; }

.prep-back-arrow {
  font-size: 1.3rem !important;
}

.btn-prep-deploy {
  flex: 1 !important;
  height: 100% !important;
  background: #2ecc71 !important;
  border: 3.5px solid #1e8449 !important;
  border-radius: 14px !important;
  color: #ffffff !important;
  font-family: var(--font-title) !important;
  font-size: 1.7rem !important;
  font-weight: 900 !important;
  text-shadow: 2px 2px 0 #145a32, 0 0 8px rgba(0, 0, 0, 0.4) !important;
  cursor: pointer !important;
  box-shadow: 0 6px 0 #1e8449, 0 8px 14px rgba(0, 0, 0, 0.3) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 14px !important;
  letter-spacing: 0.8px !important;
  transition: transform 0.1s ease, filter 0.1s ease !important;
}
.btn-prep-deploy:hover { filter: brightness(1.08) !important; }
.btn-prep-deploy:active { transform: translateY(3px) !important; box-shadow: 0 3px 0 #1e8449 !important; }

.prep-deploy-swords {
  width: 36px !important;
  height: 36px !important;
  object-fit: contain !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35)) !important;
}

/* 4. Lower Decks Container (Leaderboard & Quests) */
.prep-decks-container {
  display: flex !important;
  gap: 16px !important;
  width: 100% !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

.prep-deck-card {
  background: #00225e !important;
  border: 3.5px solid #00d2ff !important;
  border-radius: 16px !important;
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.6), 0 6px 14px rgba(0, 0, 0, 0.25) !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 10px 14px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.prep-leaderboard-card {
  flex: 1 !important;
}

.prep-quests-card {
  flex: 1.25 !important;
}

.prep-deck-header {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding-bottom: 8px !important;
  border-bottom: 2px solid #00d2ff !important;
  margin-bottom: 8px !important;
  flex-shrink: 0 !important;
}

.prep-header-icon {
  width: 26px !important;
  height: 26px !important;
  object-fit: contain !important;
}

.prep-deck-title {
  font-family: var(--font-title) !important;
  font-size: 1.15rem !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  text-shadow: 1.5px 1.5px 0 #000 !important;
  letter-spacing: 0.5px !important;
}

/* Speedrun Leaderboard Rows */
.prep-records-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  flex: 1 1 auto !important;
  overflow-y: auto !important;
}

.prep-leaderboard-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  background: rgba(0, 60, 160, 0.45) !important;
  border: 2px solid #0088ff !important;
  border-radius: 10px !important;
  padding: 6px 14px !important;
}

.rank-name-cluster {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

.rank-icon-slot {
  font-size: 1.4rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
}

.rank-blue-badge {
  background: #0088ff !important;
  color: #ffffff !important;
  font-family: var(--font-title) !important;
  font-size: 0.95rem !important;
  font-weight: 900 !important;
  width: 24px !important;
  height: 24px !important;
  border-radius: 6px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1.5px solid #00ffe0 !important;
}

.rank-player-name {
  font-family: var(--font-title) !important;
  font-size: 1.05rem !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  text-shadow: 1px 1px 2px #000 !important;
}

.rank-time-text {
  font-family: var(--font-title) !important;
  font-size: 1.15rem !important;
  font-weight: 900 !important;
  color: #00ffe0 !important;
  text-shadow: 1px 1px 2px #000 !important;
}

/* Daily Quests Rows */
.prep-quests-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  flex: 1 1 auto !important;
  overflow-y: auto !important;
}

.prep-quest-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  background: rgba(255, 255, 255, 0.95) !important;
  border: 2.5px solid #00d2ff !important;
  border-radius: 10px !important;
  padding: 6px 12px !important;
  gap: 10px !important;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.18) !important;
}

.quest-row-left {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex: 1 !important;
}

.quest-row-icon {
  width: 28px !important;
  height: 28px !important;
  object-fit: contain !important;
  flex-shrink: 0 !important;
}

.quest-row-info {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
  flex: 1 !important;
}

.quest-title-line {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}

.quest-name {
  font-family: var(--font-title) !important;
  font-size: 0.92rem !important;
  font-weight: 900 !important;
  color: #0b2e68 !important;
}

.quest-counter {
  font-family: var(--font-title) !important;
  font-size: 0.85rem !important;
  font-weight: 900 !important;
  color: #f39c12 !important;
}

.quest-track {
  width: 100% !important;
  height: 8px !important;
  background: #d8e8f8 !important;
  border-radius: 4px !important;
  overflow: hidden !important;
}

.quest-fill {
  height: 100% !important;
  background: linear-gradient(90deg, #00d2ff, #0088ff) !important;
  border-radius: 4px !important;
  transition: width 0.3s ease !important;
}

.quest-reward-pill {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  flex-shrink: 0 !important;
}

.quest-reward-label {
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  color: #7f8c8d !important;
}

.quest-coin-img {
  width: 18px !important;
  height: 18px !important;
  object-fit: contain !important;
}

.quest-reward-val {
  font-family: var(--font-title) !important;
  font-size: 0.85rem !important;
  font-weight: 900 !important;
  color: #b8860b !important;
}

/* ─── 100% FULLSCREEN MATCH OVERRIDE (NO BLUE BORDERS) ─── */
#app-container.in-game-match {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  width: 100dvw !important;
  height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  transform: none !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 1000 !important;
  overflow: hidden !important;
  background: #1a2230 !important;
}

#app-container.in-game-match #game-view {
  width: 100% !important;
  height: 100% !important;
}

#app-container.in-game-match #game-wrapper {
  flex: 1 1 auto !important;
  height: 100% !important;
  width: calc(100% - 320px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #1a2230 !important;
}

#app-container.in-game-match #canvas-container {
  height: 100% !important;
  max-height: 100% !important;
  aspect-ratio: 4 / 3 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#app-container.in-game-match #game-canvas {
  width: auto !important;
  height: 100% !important;
  aspect-ratio: 4 / 3 !important;
  border: none !important;
  border-radius: 0 !important;
}

#app-container.in-game-match #game-sidebar {
  width: 320px !important;
  height: 100% !important;
  flex-shrink: 0 !important;
  border-left: 4px solid var(--border-color) !important;
}

/* ─── LIVE EXPORTED UI OVERRIDES ─── */
#app-container {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  width: 2122px !important;
  height: 1188px !important;
  transform: translate(-50%, -50%) scale(var(--app-scale, 1)) !important;
  transform-origin: center center !important;
  overflow: visible !important;
}

#lobby-view {
  width: 1858px !important;
  height: 876px !important;
  overflow: visible !important;
}

#lobby-content {
  width: 1830px !important;
  height: 608px !important;
  overflow: visible !important;
}

#lobby-panels {
  transform: translate(133px, -68px) scale(1) !important;
  width: 1596px !important;
  height: 751px !important;
  position: relative !important;
  z-index: 50 !important;
}

/* ─── Tabs & Navigation ─── */
#lobby-tabs {
  width: 340px !important;
  height: 608px !important;
}

.tab-btn {
  transform: translate(10px, 0px) scale(1.29) !important;
  transform-origin: left center !important;
  width: 340px !important;
  height: 80px !important;
  margin-bottom: 38px !important;
  padding: 0 48px 0 16px !important;
  box-sizing: border-box !important;
  z-index: 10 !important;
}

.tab-icon {
  transform: scale(1.4) !important;
  width: 36px !important;
  height: 36px !important;
  margin-right: 12px !important;
  flex-shrink: 0 !important;
}

.tab-label {
  transform: none !important;
  width: auto !important;
  height: auto !important;
  font-size: 1.4rem !important;
  font-weight: 900 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  text-align: left !important;
  flex: 1 !important;
}

#main-lobby-logo {
  transform: translate(28px, -7px) scale(1) !important;
  width: 413px !important;
  height: 238px !important;
}

/* ─── Profile & Avatar ─── */
#cg-profile-widget {
  transform: translate(317px, -25px) scale(0.96) !important;
  width: 427px !important;
  height: 124px !important;
  overflow: visible !important;
}

#cg-avatar {
  transform: translate(37px, 37px) scale(1.58) !important;
  width: 67px !important;
  height: 67px !important;
}

#cg-username {
  transform: translate(124px, 0px) scale(2.5) !important;
  width: auto !important;
  min-width: max-content !important;
  white-space: nowrap !important;
  font-size: 19.2px !important;
  overflow: visible !important;
}

/* ─── Level, XP, and Coins HUD ─── */
.hud-level-badge {
  transform: translate(177px, -25px) scale(1) !important;
  width: 107px !important;
  height: 107px !important;
  font-size: 25.6px !important;
}

#label-level {
  transform: translate(177px, -42px) scale(1.79) !important;
  width: 44px !important;
  height: 16px !important;
  font-size: 13px !important;
}

#player-level {
  transform: scale(1.78) !important;
  font-size: 25.6px !important;
}

.hud-xp-wrapper {
  width: 281px !important;
  height: 92px !important;
}

.hud-xp-track {
  transform: translate(160px, -25px) scale(1) !important;
  width: 281px !important;
  height: 72px !important;
}

#player-xp-fill {
  transform: translate(10px, 0px) !important;
  transform-origin: left center !important;
  height: 39px !important;
}

#label-xp {
  transform: translate(151px, -42px) scale(1.89) !important;
  width: 93px !important;
  height: 16px !important;
  font-size: 13px !important;
}

#player-xp-text {
  transform: translate(-16px, -7px) scale(2.06) !important;
  width: 47px !important;
  height: 17px !important;
  font-size: 14.08px !important;
}

#player-coins {
  transform: translate(195px, -33px) scale(1.42) !important;
  width: 155px !important;
  height: 48px !important;
  font-size: 24px !important;
}

#player-coins-val {
  font-size: 24px !important;
}

#label-coins {
  transform: translate(186px, -51px) scale(1.92) !important;
  width: 40px !important;
  height: 16px !important;
  font-size: 13px !important;
}

#btn-add-coins {
  transform: translate(228px, -25px) scale(1.45) !important;
  transform-origin: center center !important;
  width: 48px !important;
  height: 48px !important;
}

#btn-add-coins:hover {
  transform: translate(228px, -25px) scale(1.6) !important;
  scale: none !important;
  transform-origin: center center !important;
  filter: brightness(1.2) drop-shadow(0 4px 10px rgba(46, 204, 113, 0.6)) !important;
}

#btn-add-coins:active {
  transform: translate(228px, -25px) scale(1.35) !important;
  scale: none !important;
  transform-origin: center center !important;
}

/* ─── Splash Screen Artwork and Buttons ─── */
.splash-art-backdrop {
  transform: translate(0px, -175px) scale(1) !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background-position: center 25% !important;
}

.splash-curved-podium {
  position: absolute !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 437px !important;
  top: auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-end !important;
  z-index: 2 !important;
}

.splash-curve-svg {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100%;
}

.splash-podium-content {
  position: relative !important;
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  box-sizing: border-box !important;
  z-index: 50 !important;
}

.splash-title-img {
  transform: translate(0px, 40px) scale(1) !important;
  width: 960px !important;
  max-width: 90% !important;
  height: auto !important;
  margin-top: -65px !important;
  margin-bottom: 8px !important;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.95)) !important;
}

.splash-subtext {
  transform: translate(0px, 24px) scale(1) !important;
  width: 860px !important;
  max-width: 85% !important;
  height: auto !important;
  font-size: 1.45rem !important;
  font-weight: 800 !important;
  line-height: 1.35 !important;
  text-align: center !important;
  margin: 0 0 28px 0 !important;
  color: #ffffff !important;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9) !important;
}

.splash-action-row {
  display: flex !important;
  gap: 48px !important;
  width: 100% !important;
  max-width: 1200px !important;
  justify-content: center !important;
  margin: 0 !important;
  position: relative !important;
  z-index: 55 !important;
}

#btn-select-solo {
  transform: translate(0px, 40px) scale(1) !important;
  width: 440px !important;
  height: 128px !important;
  font-size: 2.3rem !important;
  font-weight: 900 !important;
  border-radius: 26px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 16px !important;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45) !important;
  position: relative !important;
  z-index: 60 !important;
  cursor: pointer !important;
}

#btn-select-coop {
  transform: translate(0px, 40px) scale(1) !important;
  width: 440px !important;
  height: 128px !important;
  font-size: 2.3rem !important;
  font-weight: 900 !important;
  border-radius: 26px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 16px !important;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45) !important;
  position: relative !important;
  z-index: 60 !important;
  cursor: pointer !important;
}

.splash-btn-icon {
  width: 52px !important;
  height: 52px !important;
}

#btn-return-lobby {
  width: auto !important;
  min-width: 120px !important;
  height: 36px !important;
  font-size: 12px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 12px !important;
}

/* ─── DIFFICULTY SCREEN TUNING (MERGED SURGICAL EDITS) ─── */
.diff-banner-strip {
  width: 1433px !important;
  max-width: none !important;
  flex: 0 0 auto !important;
  height: 137px !important;
}

.diff-badge-container {
  width: 388px !important;
  height: 84px !important;
  transform: scale(1.16) !important;
}

#btn-wizard-back-diff {
  transform: translate(-111px, 0px) scale(1.48) !important;
  width: 100px !important;
  height: 44px !important;
  font-size: 15.2px !important;
}

#btn-wizard-next-diff {
  transform: translate(-56px, 0px) scale(1.43) !important;
  width: 156px !important;
  height: 44px !important;
  font-size: 15.2px !important;
}

.difficulty-wizard-deck {
  transform: translate(0px, -4px) scale(1) !important;
  width: 1542px !important;
  height: 567px !important;
}

.diff-card-header {
  transform: scale(0.97) !important;
  width: 295px !important;
  height: 70px !important;
}

.diff-title {
  transform: translate(0px, 8px) scale(1.13) !important;
}

.diff-sub {
  transform: translate(0px, 16px) scale(1.62) !important;
}

/* Updated Body Height */
.diff-card-body {
  transform: translate(0px, 4px) scale(0.95) !important;
  width: 295px !important;
  height: 446px !important;
}

/* Updated Easy Card Height */
.diff-card-easy {
  transform: translate(-24px, 0px) scale(0.83) !important;
  height: 527px !important;
}

/* Updated Casual Card Height */
.diff-card-casual {
  transform: translate(-56px, 24px) scale(0.91) !important;
  height: 486px !important;
}

/* Updated Intermediate Card Height */
.diff-card-intermediate {
  transform: translate(-79px, 24px) scale(0.92) !important;
  height: 493px !important;
}

/* Updated Molten Card Height */
.diff-card-molten {
  transform: translate(-87px, 32px) scale(0.93) !important;
  height: 480px !important;
}

/* Updated Fallen Card Position and Height */
.diff-card-fallen {
  transform: translate(-89px, 21px) scale(0.91) !important;
  height: 506px !important;
}

.diff-boss-preview {
  transform: scale(2.11) !important;
  width: 95px !important;
  height: 95px !important;
}

.diff-metric-icon {
  transform: translate(0px, -8px) scale(1) !important;
  width: 24px !important;
  height: 24px !important;
}

/* Updated Metric Text Offset */
.diff-metric-text {
  transform: translate(0px, -4px) scale(1) !important;
  width: 189px !important;
  height: 22px !important;
  font-size: 15.68px !important;
}

#wizard-step-maps,
#wizard-step-diff,
#wizard-step-prep,
#coop-header-panel {
  background: #ffffff !important;
  border-radius: 16px !important;
  padding: 16px 20px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  height: 100% !important;
  overflow-y: auto !important;
}

/* Ensure hidden panels disappear completely when .hidden is added */
#coop-header-panel.hidden,
#wizard-step-maps.hidden,
#wizard-step-diff.hidden,
#wizard-step-prep.hidden {
  display: none !important;
}
/* ═══════════════════════════════════════════════════════════════════════════
   QA READABILITY PASS (CrazyGames QA, Oct 2026)
   ---------------------------------------------------------------------------
   The whole UI is laid out on a 2122x1188 canvas and scaled down to fit the
   window (see autoScaleGame in index.html). At the ~800x420 non-fullscreen
   CrazyGames frame that scale is ~0.35, so a text must be at least ~25px
   "effective" on the canvas to stay readable (the header COINS label =
   13px * 1.92 ≈ 25px, which QA uses as the reference).
   Rule used below: body text >= 26px, labels/buttons 28-32px, titles 34px+.
   Everything here is scoped with an id so it overrides the older rules.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── HEADER: LEVEL / XP labels match the COINS label size ─── */
#lobby-header #label-level,
#lobby-header #label-xp {
  font-size: 13px !important;
  white-space: nowrap !important;
}
#lobby-header #label-level { transform: translate(177px, -42px) scale(1.95) !important; }
#lobby-header #label-xp    { transform: translate(151px, -42px) scale(1.95) !important; width: 110px !important; text-align: center !important; }
#lobby-header #label-coins { transform: translate(186px, -51px) scale(1.95) !important; }

/* ─── HEADER: USERNAME PILL ───
   3-slice border-image keeps the avatar ring round while the pill widens, so a
   6-20 character name fits without overflowing or being cut with "...".
   The name is auto-fitted by LobbyUI.fitUsername(). */
#lobby-header #cg-profile-widget {
  position: absolute !important;
  left: 468px !important;
  top: 52px !important;
  width: 770px !important;
  height: 116px !important;
  transform: none !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  background: none !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-width: 0 36px 0 122px !important;
  border-image: url('assets/ui/menu/sprite_08.webp') 0 60 0 200 fill / 0 36px 0 122px stretch !important;
  display: flex !important;
  align-items: center !important;
  overflow: visible !important;
  z-index: 30 !important;
}
#lobby-header #cg-profile-widget .profile-avatar-wrapper {
  position: absolute !important;
  left: -107px !important;
  top: 12px !important;
  width: 92px !important;
  height: 92px !important;
  transform: none !important;
}
#lobby-header #cg-avatar {
  transform: none !important;
  width: 100% !important;
  height: 100% !important;
}
#lobby-header #cg-profile-widget .profile-name-cluster {
  flex: 1 1 auto !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  padding: 0 4px 0 18px !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: center !important;
  overflow: hidden !important;
}
#lobby-header #cg-username {
  transform: none !important;
  font-size: 44px !important;
  line-height: 1.1 !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
}
#lobby-header #cg-username.fit-2line {
  white-space: normal !important;
  word-break: break-all !important;
  line-height: 1.02 !important;
}

/* ─── SPLASH ─── */
#lobby-panels .splash-subtext { font-size: 30px !important; text-wrap: balance !important; max-width: 1100px !important; width: 82% !important; }

/* ═══════════════ SOLO: CHOOSE MAP ═══════════════ */
#lobby-panels #wizard-step-maps { gap: 12px !important; padding: 16px 22px !important; }
#lobby-panels .solo-pill-badge { height: 60px !important; min-width: 190px !important; }
#lobby-panels .solo-pill-title { font-size: 34px !important; }
#lobby-panels .solo-user-img-icon { width: 38px !important; height: 38px !important; }
#lobby-panels .solo-tagline-cluster { font-size: 28px !important; gap: 12px !important; }
#lobby-panels .solo-tagline-icon { font-size: 28px !important; }
#lobby-panels .btn-solo-back-action {
  font-size: 28px !important;
  height: 60px !important;
  min-width: 160px !important;
  padding: 0 24px !important;
}
#lobby-panels .solo-hero-card { height: 205px !important; }
#lobby-panels .solo-hero-overlay { width: 56% !important; padding: 0 34px !important; }
#lobby-panels .solo-hero-title { font-size: 42px !important; }
#lobby-panels .solo-hero-swords { width: 42px !important; height: 42px !important; }
#lobby-panels .solo-hero-desc { font-size: 28px !important; line-height: 1.25 !important; max-width: 720px !important; }
#lobby-panels .solo-section-tab-bar { margin-bottom: 12px !important; }
#lobby-panels .solo-section-tab { font-size: 28px !important; height: 50px !important; padding: 0 26px !important; }
#lobby-panels .solo-map-row { gap: 14px !important; }
#lobby-panels .solo-map-row .map-card { height: 228px !important; padding: 10px 8px 12px !important; justify-content: flex-start !important; gap: 6px !important; }
#lobby-panels .solo-map-row .map-preview-canvas { width: 150px !important; height: 100px !important; }
#lobby-panels .map-card .map-info { display: flex !important; flex-direction: column !important; align-items: center !important; gap: 4px !important; text-align: center !important; }
#lobby-panels .map-card .map-info .name { font-size: 29px !important; line-height: 1.1 !important; margin-top: 2px !important; white-space: nowrap !important; }
#lobby-panels .map-card .map-info .difficulty { font-size: 26px !important; line-height: 1.15 !important; margin-top: 0 !important; white-space: nowrap !important; }
#lobby-panels .map-card .map-info .locked-badge { padding: 2px 10px !important; border-radius: 8px !important; }
#lobby-panels .btn-solo-green-play { font-size: 32px !important; height: 84px !important; min-width: 520px !important; }

/* ═══════════════ SOLO: CHOOSE DIFFICULTY ═══════════════ */
#lobby-panels #wizard-step-diff { gap: 14px !important; padding: 16px 22px 18px !important; }
/* Banner: title badge now sits INSIDE the blue frame (was hanging off the left edge) */
#lobby-panels .diff-banner-strip {
  width: 100% !important;
  height: 124px !important;
  padding: 0 34px 0 36px !important;
  flex: 0 0 auto !important;
  box-sizing: border-box !important;
}
#lobby-panels .diff-badge-container {
  transform: none !important;
  height: 80px !important;
  width: auto !important;
  min-width: 470px !important;
  padding: 0 56px 0 18px !important;
  gap: 14px !important;
}
#lobby-panels .diff-map-icon { width: 50px !important; height: 50px !important; }
#lobby-panels .diff-badge-title { font-size: 36px !important; white-space: nowrap !important; }
#lobby-panels .diff-nav-buttons { gap: 16px !important; }
#lobby-panels #btn-wizard-back-diff,
#lobby-panels #btn-wizard-next-diff {
  transform: none !important;
  height: 66px !important;
  width: auto !important;
  font-size: 28px !important;
  white-space: nowrap !important;
  padding: 0 28px !important;
}
#lobby-panels #btn-wizard-back-diff { min-width: 160px !important; }
#lobby-panels #btn-wizard-next-diff { min-width: 280px !important; }
#lobby-panels .difficulty-wizard-deck {
  transform: none !important;
  width: 100% !important;
  height: auto !important;
  flex: 1 1 auto !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 10px !important;
  padding: 6px 2px 8px !important;
  box-sizing: border-box !important;
}
#lobby-panels .diff-wizard-card,
#lobby-panels .diff-card-easy,
#lobby-panels .diff-card-casual,
#lobby-panels .diff-card-intermediate,
#lobby-panels .diff-card-molten,
#lobby-panels .diff-card-fallen {
  transform: none !important;
  height: 100% !important;
  width: 100% !important;
  min-width: 0 !important;
}
#lobby-panels .diff-card-header {
  transform: none !important;
  width: 100% !important;
  height: 22.5% !important;
  padding: 6px 10px 0 !important;
  gap: 2px !important;
  box-sizing: border-box !important;
}
#lobby-panels .diff-title { transform: none !important; font-size: 31px !important; line-height: 1.05 !important; white-space: nowrap !important; }
#lobby-panels .diff-sub { transform: none !important; font-size: 26px !important; line-height: 1.05 !important; text-align: center !important; }
#lobby-panels .diff-card-body {
  transform: none !important;
  width: 100% !important;
  height: auto !important;
  padding: 8px 12px 30px !important;
  justify-content: space-evenly !important;
  gap: 10px !important;
  box-sizing: border-box !important;
}
#lobby-panels .diff-boss-preview { transform: none !important; width: 140px !important; height: 140px !important; flex-shrink: 0 !important; }
#lobby-panels .diff-metrics-list { gap: 8px !important; }
#lobby-panels .diff-metric { gap: 8px !important; align-items: center !important; }
#lobby-panels .diff-metric-icon { transform: none !important; width: 26px !important; height: 26px !important; }
#lobby-panels .diff-metric-text {
  transform: none !important;
  width: auto !important;
  height: auto !important;
  font-size: 26px !important;
  line-height: 1.05 !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  min-width: 0 !important;
}

/* ═══════════════ SOLO: PREPARATION ═══════════════ */
#lobby-panels #wizard-step-prep { gap: 12px !important; padding: 14px 18px !important; }
#lobby-panels .prep-top-banner { height: 70px !important; padding: 0 30px !important; }
#lobby-panels .prep-badge-title { font-size: 34px !important; }
#lobby-panels .prep-swords-icon { width: 44px !important; height: 44px !important; }
#lobby-panels .prep-hero-card { height: 104px !important; padding-bottom: 10px !important; }
#lobby-panels .prep-hardcore-pill { padding: 8px 24px !important; max-width: 96% !important; }
#lobby-panels .prep-hc-checkbox { width: 26px !important; height: 26px !important; }
#lobby-panels .prep-hc-label { font-size: 26px !important; line-height: 1.2 !important; }
#lobby-panels .prep-hc-flame { font-size: 28px !important; }
#lobby-panels .prep-action-row { height: 74px !important; }
#lobby-panels .btn-prep-back { flex: 0 0 380px !important; font-size: 28px !important; }
#lobby-panels .prep-back-arrow { font-size: 32px !important; }
#lobby-panels .btn-prep-deploy { font-size: 38px !important; }
#lobby-panels .prep-deploy-swords { width: 44px !important; height: 44px !important; }
#lobby-panels .prep-deck-card { padding: 12px 16px !important; }
#lobby-panels .prep-deck-header { gap: 12px !important; padding-bottom: 10px !important; margin-bottom: 10px !important; }
#lobby-panels .prep-header-icon { width: 34px !important; height: 34px !important; }
#lobby-panels .prep-deck-title { font-size: 30px !important; }
#lobby-panels .prep-records-list { gap: 8px !important; }
#lobby-panels .prep-leaderboard-row { padding: 6px 16px !important; min-height: 52px !important; box-sizing: border-box !important; }
#lobby-panels .rank-name-cluster { gap: 14px !important; min-width: 0 !important; }
#lobby-panels .rank-icon-slot { font-size: 30px !important; width: 38px !important; }
#lobby-panels .rank-blue-badge { font-size: 26px !important; width: 38px !important; height: 38px !important; border-radius: 8px !important; }
#lobby-panels .rank-player-name { font-size: 28px !important; white-space: nowrap !important; }
#lobby-panels .rank-time-text { font-size: 28px !important; }
#lobby-panels .prep-quests-list { gap: 8px !important; }
#lobby-panels .prep-quest-row { padding: 6px 14px !important; gap: 14px !important; }
#lobby-panels .quest-row-icon { width: 36px !important; height: 36px !important; }
#lobby-panels .quest-row-info { gap: 6px !important; min-width: 0 !important; }
#lobby-panels .quest-title-line { gap: 10px !important; }
#lobby-panels .quest-name { font-size: 26px !important; line-height: 1.1 !important; }
#lobby-panels .quest-counter { font-size: 26px !important; white-space: nowrap !important; }
#lobby-panels .quest-track { height: 12px !important; border-radius: 6px !important; }
#lobby-panels .quest-reward-pill { gap: 6px !important; flex-direction: row !important; align-items: center !important; background: #fff7d6 !important; border: 2px solid #f1c40f !important; border-radius: 12px !important; padding: 4px 12px !important; }
#lobby-panels .quest-reward-label { font-size: 26px !important; color: #64748b !important; line-height: 1 !important; }
#lobby-panels .quest-coin-img { width: 28px !important; height: 28px !important; }
#lobby-panels .quest-reward-val { font-size: 28px !important; white-space: nowrap !important; line-height: 1 !important; }
#lobby-panels .quest-progress-line { display: flex !important; align-items: center !important; gap: 12px !important; width: 100% !important; }
#lobby-panels .quest-progress-line .quest-track { flex: 1 1 auto !important; }

/* ═══════════════ AGENT SHOP ═══════════════ */
#lobby-panels #panel-shop { padding: 20px 22px 24px !important; }
#lobby-panels .shop-header-banner { padding: 14px 22px !important; gap: 24px !important; margin-bottom: 18px !important; }
#lobby-panels .shop-header-left { gap: 16px !important; min-width: 0 !important; flex: 1 1 auto !important; }
#lobby-panels .shop-header-icon-disc { width: 66px !important; height: 66px !important; }
#lobby-panels .shop-header-icon { width: 42px !important; height: 42px !important; }
#lobby-panels .shop-header-title { font-size: 38px !important; line-height: 1.1 !important; }
#lobby-panels .shop-header-subtitle { font-size: 26px !important; line-height: 1.2 !important; margin-top: 4px !important; }
#lobby-panels .shop-header-tagline { font-size: 26px !important; white-space: nowrap !important; flex-shrink: 0 !important; }

/* Category strip: title pill + tag badge on the strip, description as a caption under it */
#lobby-panels .shop-category-wrapper { gap: 14px !important; margin-bottom: 26px !important; }
#lobby-panels .cat-banner-strip {
  height: 66px !important;
  border-radius: 34px !important;
  overflow: visible !important;
  margin-bottom: 42px !important;
}
#lobby-panels .cat-pill-badge { border-radius: 30px !important; padding: 0 26px 0 18px !important; gap: 12px !important; }
#lobby-panels .cat-star-icon { font-size: 30px !important; }
#lobby-panels .cat-icon-small { width: 34px !important; height: 34px !important; }
#lobby-panels .cat-title-text { font-size: 30px !important; white-space: nowrap !important; }
#lobby-panels .cat-middle-desc {
  position: absolute !important;
  left: 18px !important;
  right: 18px !important;
  top: calc(100% + 6px) !important;
  margin: 0 !important;
  font-size: 26px !important;
  line-height: 1.2 !important;
  color: #d6e9ff !important;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6) !important;
  white-space: nowrap !important;
}
#lobby-panels .cat-slanted-badge {
  font-size: 26px !important;
  padding: 0 34px 0 30px !important;
  border-radius: 0 30px 30px 0 !important;
  white-space: nowrap !important;
}

/* Every agent card uses one readable horizontal layout, 2 per row */
#lobby-panels .starter-wide-grid,
#lobby-panels .intermediate-vertical-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 16px !important;
}
#lobby-panels .shop-wide-card { padding: 16px 18px !important; gap: 18px !important; align-items: center !important; }
#lobby-panels .troop-disc-avatar { width: 112px !important; height: 112px !important; border-width: 3px !important; }
#lobby-panels .troop-disc-avatar .agent-preview-canvas { width: 86px !important; height: 86px !important; }
#lobby-panels .wide-card-right { gap: 8px !important; }
#lobby-panels .wide-name-row { gap: 12px !important; }
#lobby-panels .wide-troop-name { font-size: 34px !important; line-height: 1.1 !important; }
#lobby-panels .wide-tag-starter { font-size: 26px !important; padding: 2px 12px !important; border-radius: 8px !important; }
#lobby-panels .wide-stat-row { font-size: 26px !important; gap: 10px !important; flex-wrap: wrap !important; white-space: nowrap !important; }
#lobby-panels .stat-unit { gap: 6px !important; }
#lobby-panels .stat-icon { width: 26px !important; height: 26px !important; }
#lobby-panels .wide-desc-row { font-size: 26px !important; gap: 10px !important; line-height: 1.2 !important; align-items: flex-start !important; }
#lobby-panels .ability-icon { width: 28px !important; height: 28px !important; margin-top: 2px !important; }

#lobby-panels .shop-vert-card {
  display: grid !important;
  grid-template-columns: 112px minmax(0, 1fr) auto !important;
  grid-template-areas:
    "av name cost"
    "av stats stats"
    "av desc desc"
    "av btn btn" !important;
  column-gap: 18px !important;
  row-gap: 8px !important;
  align-items: center !important;
  justify-items: start !important;
  height: auto !important;
  padding: 16px 18px !important;
  text-align: left !important;
}
#lobby-panels .shop-vert-card .agent-preview-canvas {
  grid-area: av !important;
  align-self: center !important;
  width: 112px !important;
  height: 112px !important;
  padding: 12px !important;
  box-sizing: border-box !important;
  border-radius: 50% !important;
  border: 3px solid #00d2ff !important;
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #cce9ff 60%, #9cd3ff 100%) !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.12), 0 3px 6px rgba(0, 0, 0, 0.15) !important;
}
#lobby-panels .shop-vert-card .vert-name { grid-area: name !important; font-size: 34px !important; line-height: 1.1 !important; margin: 0 !important; }
#lobby-panels .shop-vert-card .cost-text { grid-area: cost !important; justify-self: end !important; font-size: 30px !important; white-space: nowrap !important; display: inline-flex !important; align-items: center !important; gap: 6px !important; }
#lobby-panels .shop-vert-card .vert-stats { grid-area: stats !important; font-size: 26px !important; color: #475569 !important; white-space: normal !important; margin: 0 !important; line-height: 1.2 !important; }
#lobby-panels .shop-vert-card .vert-desc { grid-area: desc !important; font-size: 26px !important; line-height: 1.2 !important; gap: 10px !important; margin: 0 !important; }
#lobby-panels .shop-vert-card .vert-ability-icon { width: 28px !important; height: 28px !important; margin-top: 2px !important; }
#lobby-panels .shop-vert-card .btn-shop-action,
#lobby-panels .shop-vert-card .btn-unlocked-pill { grid-area: btn !important; }
#lobby-panels .coin-icon-mini { width: 30px !important; height: 30px !important; margin-right: 4px !important; }

#lobby-panels .btn-shop-action,
#lobby-panels .btn-unlocked-pill {
  height: 54px !important;
  font-size: 28px !important;
  border-radius: 14px !important;
  white-space: nowrap !important;
}
/* Hover: glow only. Scaling big cards made the list jitter under the cursor. */
#lobby-panels .shop-card:hover,
#lobby-panels .shop-wide-card:hover,
#lobby-panels .shop-vert-card:hover {
  scale: none !important;
  transform: none !important;
  filter: brightness(1.05) drop-shadow(0 4px 10px rgba(0, 210, 255, 0.35)) !important;
}

/* ═══════════════ LOADOUT ═══════════════ */
#lobby-panels .loadout-main-panel { padding: 20px 22px !important; gap: 18px !important; }
#lobby-panels .loadout-header-banner { padding: 14px 22px !important; gap: 20px !important; }
#lobby-panels .loadout-header-left { gap: 16px !important; min-width: 0 !important; flex: 1 1 auto !important; }
#lobby-panels .loadout-header-icon-disc { width: 66px !important; height: 66px !important; }
#lobby-panels .loadout-header-icon { width: 42px !important; height: 42px !important; }
#lobby-panels .loadout-header-title { font-size: 38px !important; line-height: 1.1 !important; }
#lobby-panels .loadout-header-subtitle { font-size: 26px !important; line-height: 1.2 !important; margin-top: 4px !important; }
#lobby-panels .loadout-counter-pill { font-size: 30px !important; padding: 10px 24px !important; white-space: nowrap !important; flex-shrink: 0 !important; }
#lobby-panels .loadout-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 18px !important; }
#lobby-panels .loadout-card-v2 { padding: 14px 14px 16px !important; min-height: 0 !important; gap: 6px !important; }
#lobby-panels .loadout-card-top-tag { height: auto !important; }
#lobby-panels .tag-equipped-badge,
#lobby-panels .tag-ready-badge { font-size: 26px !important; padding: 3px 12px !important; border-radius: 8px !important; }
#lobby-panels .loadout-disc-avatar { width: 112px !important; height: 112px !important; border-width: 3px !important; }
#lobby-panels .loadout-disc-avatar canvas { width: 84px !important; height: 84px !important; }
#lobby-panels .loadout-info-cluster { gap: 4px !important; width: 100% !important; }
#lobby-panels .loadout-agent-name { font-size: 32px !important; line-height: 1.1 !important; }
#lobby-panels .loadout-stat-line { font-size: 26px !important; gap: 4px 10px !important; flex-wrap: wrap !important; white-space: nowrap !important; margin: 4px 0 6px !important; }
#lobby-panels .loadout-skin-container { font-size: 26px !important; gap: 8px !important; }
#lobby-panels .custom-skin-dropdown { font-size: 26px !important; }
#lobby-panels .skin-dropdown-selected { font-size: 26px !important; padding: 4px 12px !important; }
#lobby-panels .skin-option { font-size: 26px !important; padding: 6px 12px !important; }
#lobby-panels .btn-loadout-equip,
#lobby-panels .btn-loadout-unequip { height: 56px !important; font-size: 28px !important; }

/* ═══════════════ CRATES ═══════════════ */
#lobby-panels #crates-unlocked-view { padding: 20px 22px !important; gap: 18px !important; }
#lobby-panels #crates-unlocked-view .shop-header-banner { margin-bottom: 0 !important; }
#lobby-panels .crates-unlocked-deck { max-width: 1320px !important; gap: 24px !important; margin-top: 4px !important; }
#lobby-panels .crate-shop-card { padding: 18px 20px 20px !important; min-height: 0 !important; gap: 6px !important; }
#lobby-panels .crate-rarity-pill { font-size: 26px !important; padding: 4px 14px !important; border-radius: 8px !important; margin-bottom: 2px !important; }
#lobby-panels .crate-img-preview { width: 120px !important; height: 120px !important; margin: 4px 0 !important; }
#lobby-panels .crate-card-title { font-size: 36px !important; line-height: 1.1 !important; }
#lobby-panels .crate-card-desc { font-size: 26px !important; line-height: 1.25 !important; color: #475569 !important; margin: 4px 0 12px !important; }
#lobby-panels .btn-buy-crate {
  height: 62px !important;
  font-size: 30px !important;
  gap: 8px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
#lobby-panels .btn-buy-crate .crate-coin-icon {
  width: 34px !important;
  height: 34px !important;
  object-fit: contain !important;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3)) !important;
}
/* Locked crates view (player level < 5) */
#lobby-panels .crates-locked-pill { font-size: 34px !important; }
#lobby-panels .crates-locked-subtexts { font-size: 28px !important; }
#lobby-panels .btn-crates-shop { font-size: 30px !important; height: 82px !important; }

/* ═══════════════ FREE COINS ═══════════════ */
/* Daily limit = information, not a button: flat translucent panel, dashed outline,
   no 3D sprite, no shadow, no pointer. */
#lobby-panels .ad-daily-limit-badge {
  transform: none !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  padding: 14px 26px 14px 20px !important;
  gap: 16px !important;
  background: rgba(4, 16, 48, 0.78) !important;
  border: 3px dashed rgba(186, 214, 255, 0.6) !important;
  border-radius: 18px !important;
  box-shadow: none !important;
  filter: none !important;
  cursor: default !important;
  pointer-events: none !important;
  margin-right: 6px !important;
}
#lobby-panels .ad-limit-clapper-icon { width: 58px !important; height: 58px !important; filter: none !important; opacity: 0.95 !important; }
#lobby-panels .ad-limit-text-group { gap: 2px !important; }
#lobby-panels .ad-limit-label { font-size: 26px !important; color: #b9d4ff !important; text-shadow: none !important; letter-spacing: 1px !important; white-space: nowrap !important; }
#lobby-panels .ad-limit-count { font-size: 42px !important; line-height: 1.05 !important; text-shadow: 2px 2px 0 #000 !important; white-space: nowrap !important; }
#lobby-panels .btn-ad-heading,
#lobby-panels .btn-ad-reward { white-space: nowrap !important; }

/* ═══════════════ CO-OP: SQUAD BROWSER ═══════════════ */
#lobby-panels #coop-header-panel { padding: 16px 20px !important; }
#lobby-panels .coop-phase-view { gap: 12px !important; }
#lobby-panels .coop-header-icon { width: 56px !important; height: 56px !important; }
#lobby-panels .coop-header-title-img { height: 50px !important; }
#lobby-panels .coop-btn-change-mode { height: 60px !important; font-size: 28px !important; padding: 0 24px !important; gap: 10px !important; }
#lobby-panels .coop-gear-icon { font-size: 28px !important; }
#lobby-panels .coop-controls-row { gap: 16px !important; }
#lobby-panels .coop-field-block { gap: 6px !important; min-width: 0 !important; }
#lobby-panels .coop-field-label { font-size: 26px !important; }
#lobby-panels .coop-input-pill { height: 66px !important; padding: 0 16px !important; }
#lobby-panels .coop-pencil-icon,
#lobby-panels .coop-code-icon { font-size: 28px !important; margin-right: 10px !important; }
#lobby-panels .coop-input-pill input { font-size: 28px !important; min-width: 0 !important; }
#lobby-panels .btn-coop-pill-host,
#lobby-panels .btn-coop-pill-join { height: 70px !important; font-size: 30px !important; }
#lobby-panels .btn-coop-host-icon { width: 38px !important; height: 38px !important; }
#lobby-panels .btn-coop-join-icon { width: 34px !important; height: 34px !important; }
#lobby-panels .coop-browser-header { height: 66px !important; padding: 0 18px !important; }
#lobby-panels .coop-browser-title-left { font-size: 30px !important; gap: 12px !important; }
#lobby-panels .coop-browser-header-icon { width: 36px !important; height: 36px !important; }
#lobby-panels .btn-coop-refresh { height: 50px !important; font-size: 26px !important; padding: 0 20px !important; gap: 8px !important; }
#lobby-panels .btn-coop-refresh-icon { width: 26px !important; height: 26px !important; }
#lobby-panels .coop-empty-heading { font-size: 34px !important; }
#lobby-panels .coop-empty-caption { font-size: 28px !important; color: #9fd0ff !important; }
#lobby-panels .coop-rooms-deck { gap: 10px !important; padding: 14px !important; }
#lobby-panels .coop-room-row { padding: 12px 18px !important; gap: 16px !important; }
#lobby-panels .coop-room-title-line { gap: 14px !important; flex-wrap: wrap !important; }
#lobby-panels .coop-room-code { font-size: 30px !important; }
#lobby-panels .coop-room-host { font-size: 28px !important; }
#lobby-panels .coop-room-status { font-size: 26px !important; padding: 2px 10px !important; border-radius: 6px !important; }
#lobby-panels .coop-room-meta { font-size: 26px !important; margin-top: 4px !important; }
#lobby-panels .btn-quick-join { height: 58px !important; font-size: 28px !important; padding: 0 26px !important; }

/* ═══════════════ CO-OP: SQUAD ROOM ═══════════════ */
#lobby-panels .coop-room-header-strip { padding: 10px 18px !important; gap: 16px !important; }
#lobby-panels .coop-room-badge-cluster { gap: 16px !important; }
#lobby-panels .coop-code-display { font-size: 34px !important; white-space: nowrap !important; }
#lobby-panels .btn-coop-copy-code { font-size: 26px !important; padding: 8px 16px !important; gap: 8px !important; white-space: nowrap !important; }
#lobby-panels .copy-icon-img { width: 28px !important; height: 28px !important; }
#lobby-panels .coop-privacy-toggle { font-size: 26px !important; gap: 8px !important; white-space: nowrap !important; }
#lobby-panels .coop-privacy-toggle input { width: 26px !important; height: 26px !important; }
#lobby-panels .coop-room-right-cluster { gap: 16px !important; }
#lobby-panels .coop-status-tag { font-size: 28px !important; white-space: nowrap !important; }
#lobby-panels .btn-coop-leave-room { font-size: 26px !important; padding: 8px 18px !important; white-space: nowrap !important; }
#lobby-panels .coop-roster-section { gap: 8px !important; }
#lobby-panels .coop-section-label { font-size: 28px !important; }
#lobby-panels .coop-slots-grid { gap: 10px !important; }
#lobby-panels .coop-slot-card { height: 102px !important; padding: 0 14px !important; gap: 14px !important; }
#lobby-panels .slot-avatar-wrapper { width: 54px !important; height: 54px !important; }
#lobby-panels .slot-id-pill { font-size: 26px !important; line-height: 1 !important; padding: 1px 6px !important; bottom: -6px !important; right: -16px !important; }
#lobby-panels .slot-info-col { min-width: 0 !important; gap: 2px !important; }
#lobby-panels .slot-name {
  font-size: 26px !important;
  line-height: 1.0 !important;
  white-space: normal !important;
  word-break: break-all !important;
  overflow: visible !important;
  text-overflow: clip !important;
}
#lobby-panels .slot-role-badge { font-size: 26px !important; line-height: 1.1 !important; white-space: nowrap !important; }
#lobby-panels .slot-empty-icon { font-size: 32px !important; }
#lobby-panels .slot-empty-text { font-size: 26px !important; }
#lobby-panels .coop-map-section { gap: 8px !important; }
#lobby-panels .coop-map-row { gap: 12px !important; }
#lobby-panels .coop-map-card { gap: 4px !important; padding: 8px !important; justify-content: flex-start !important; }
#lobby-panels .coop-map-card .map-preview-canvas { width: 140px !important; height: 92px !important; }
#lobby-panels .coop-client-live-deck { max-width: 1240px !important; gap: 28px !important; padding-top: 14px !important; }
#lobby-panels .coop-client-live-deck .coop-single-live-card { max-width: 600px !important; padding: 22px 22px 16px !important; gap: 20px !important; }
#lobby-panels .live-card-badge { font-size: 26px !important; top: -20px !important; padding: 2px 16px !important; white-space: nowrap !important; }
#lobby-panels .live-map-title { font-size: 36px !important; }
#lobby-panels .live-map-sub { font-size: 28px !important; }
#lobby-panels .coop-bottom-action-bar { height: 76px !important; }
#lobby-panels .btn-coop-launch { font-size: 32px !important; width: 520px !important; }
#lobby-panels .coop-waiting-pill { font-size: 28px !important; padding: 14px 34px !important; }
/* Connecting state while joining a friend's squad from an invite */
#lobby-panels .coop-connecting-card {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
}
#lobby-panels .coop-connecting-card.hidden { display: none !important; }
#lobby-panels .coop-connecting-spinner {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 10px solid rgba(0, 210, 255, 0.25);
  border-top-color: #00ffe0;
  animation: coopSpin 0.9s linear infinite;
}
#lobby-panels .coop-connecting-title { font-family: var(--font-title); font-size: 40px; font-weight: 900; color: #ffffff; text-shadow: 2px 2px 0 #000; }
#lobby-panels .coop-connecting-sub { font-family: var(--font-title); font-size: 28px; font-weight: 800; color: #9fd0ff; }
@keyframes coopSpin { to { transform: rotate(360deg); } }
#lobby-panels #coop-room-phase.is-connecting > .coop-roster-section,
#lobby-panels #coop-room-phase.is-connecting > .coop-map-section,
#lobby-panels #coop-room-phase.is-connecting > .coop-bottom-action-bar {
  display: none !important;
}

/* Stat chips wrap cleanly: spacing instead of "|" separators that could dangle at a line end */
#lobby-panels .stat-divider,
#lobby-panels .stat-sep { display: none !important; }
#lobby-panels .wide-stat-row { gap: 6px 22px !important; }
#lobby-panels .loadout-stat-line { gap: 2px 18px !important; justify-content: center !important; }
/* Empty squad list heading was picking up the dark ".lobby-panel h2" style (dark on navy) */
#lobby-panels .coop-empty-heading { color: #ffffff !important; border: none !important; padding: 0 !important; font-size: 34px !important; }
/* Free coins subtitle: a bit wider so it never runs under the WATCH AD button */
#lobby-panels .coins-ad-subtext { width: 372px !important; }
#lobby-panels .shop-vert-card .vert-stats { display: flex !important; flex-wrap: wrap !important; gap: 2px 22px !important; }
#lobby-panels .shop-vert-card .vert-stat { white-space: nowrap !important; }
/* Co-op lobby is designed for a navy panel (light text). An older generic rule
   painted it white, which made labels like "PLAYER NAME" / "SQUAD MEMBERS" unreadable. */
#lobby-panels #coop-header-panel { background: #00225e !important; }
#lobby-panels .btn-coop-copy-code.hidden,
#lobby-panels .coop-privacy-toggle.hidden { display: none !important; }
#lobby-panels #coop-live-diff-boss { color: #c9e4ff !important; }

/* ─── CRATE OPENING / REVEAL (inside the scaled app canvas) ─── */
#app-container .crate-opening-container { width: 960px !important; height: 640px !important; }
#app-container #crate-opening-canvas { width: 960px !important; height: 640px !important; }
#app-container #crate-reveal-card { width: 560px !important; padding: 34px 36px !important; gap: 18px !important; border-width: 5px !important; border-radius: 26px !important; }
#app-container #crate-reveal-rarity { font-size: 40px !important; padding: 4px 24px !important; }
#app-container #crate-reveal-agent-canvas { width: 180px !important; height: 180px !important; }
#app-container #crate-reveal-name { font-size: 46px !important; line-height: 1.1 !important; }
#app-container #crate-reveal-unlocked { font-size: 30px !important; line-height: 1.2 !important; }
#app-container #btn-equip-revealed,
#app-container #btn-close-reveal { font-size: 32px !important; height: 72px !important; padding: 0 20px !important; border-radius: 16px !important; margin-top: 4px !important; }

/* Header stats: the app box is really 1920 wide (max-width) while the scaler fits 2122,
   so at 16:9 / 4:3 fullscreen the "+" coins button was cut off at the right edge.
   Shift the LEVEL / XP / COINS cluster left so everything stays on screen. */
#lobby-header .player-meta-box { transform: translateX(-104px) !important; }
#lobby-panels .shop-wide-card .wide-card-right { text-align: left !important; align-items: flex-start !important; }
#lobby-panels .shop-wide-card .wide-desc-row { justify-content: flex-start !important; text-align: left !important; }

/* Difficulty cards: keep everything inside the panel with the real Fredoka font.
   - selected/hovered cards no longer grow (scale pushed them past the panel edges)
   - titles a bit smaller so "INTERMEDIATE" fits inside the card header */
#lobby-panels .difficulty-wizard-deck {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  padding: 10px 10px 14px !important;
  gap: 12px !important;
}
#lobby-panels .diff-wizard-card:hover,
#lobby-panels .diff-wizard-card.active,
#lobby-panels .diff-wizard-card.active:hover {
  scale: none !important;
  transform: none !important;
}
#lobby-panels .diff-wizard-card:hover { filter: brightness(1.06) !important; }
#lobby-panels .diff-wizard-card.active { filter: drop-shadow(0 0 8px #00ffe0) drop-shadow(0 0 2px #00ffe0) !important; }
#lobby-panels .diff-title { font-size: 28px !important; letter-spacing: 0.2px !important; max-width: 100% !important; }
#lobby-panels .diff-sub { font-size: 26px !important; letter-spacing: 0 !important; }
#lobby-panels .diff-card-header { padding: 6px 12px 0 !important; overflow: hidden !important; }

/* Difficulty card body: slightly smaller text/icons, kept inside the frame's inner area and centered */
#lobby-panels .diff-card-body {
  padding: 10px 26px 30px !important;
  align-items: center !important;
}
#lobby-panels .diff-boss-preview { width: 120px !important; height: 120px !important; }
#lobby-panels .diff-metrics-list {
  width: auto !important;
  max-width: 100% !important;
  align-self: center !important;
  align-items: flex-start !important;
  gap: 6px !important;
  margin: 0 auto !important;
}
#lobby-panels .diff-metric { width: auto !important; max-width: 100% !important; gap: 7px !important; }
#lobby-panels .diff-metric-icon { width: 22px !important; height: 22px !important; }
#lobby-panels .diff-metric-text { font-size: 25px !important; }
#lobby-panels .diff-title { font-size: 27px !important; }
#lobby-panels .diff-sub { font-size: 25px !important; }
#lobby-panels .diff-card-header { padding: 6px 22px 0 !important; }
#lobby-panels .btn-quick-join:disabled { filter: grayscale(1) brightness(0.8) !important; opacity: 0.7 !important; cursor: not-allowed !important; scale: none !important; }

/* ─── RECONNECT TO MATCH PROMPT (inside the scaled 2122x1188 app canvas) ─── */
#rejoin-prompt-overlay {
  position: absolute;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 12, 32, 0.72);
  backdrop-filter: blur(3px);
}
#rejoin-prompt-overlay .rejoin-card {
  position: relative;
  width: 1080px;
  max-width: 92%;
  padding: 56px 64px 44px;
  box-sizing: border-box;
  background: linear-gradient(180deg, #0b4cb4 0%, #052a6b 100%);
  border: 6px solid #00d2ff;
  border-radius: 34px;
  box-shadow: 0 0 0 5px #001f54, 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 60px rgba(0, 210, 255, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  text-align: center;
  animation: rejoinPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes rejoinPop { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
#rejoin-prompt-overlay .rejoin-pulse-dot {
  position: absolute; top: 34px; left: 40px;
  width: 30px; height: 30px; border-radius: 50%;
  background: #2ecc71; box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
  animation: rejoinPulse 1.4s infinite;
}
@keyframes rejoinPulse { 0% { box-shadow: 0 0 0 0 rgba(46,204,113,0.7); } 70% { box-shadow: 0 0 0 26px rgba(46,204,113,0); } 100% { box-shadow: 0 0 0 0 rgba(46,204,113,0); } }
#rejoin-prompt-overlay .rejoin-title {
  font-family: var(--font-title);
  font-size: 64px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 1px;
  text-shadow: 4px 4px 0 #001f54, 0 0 24px rgba(0, 255, 224, 0.5);
}
#rejoin-prompt-overlay .rejoin-sub {
  font-family: var(--font-title);
  font-size: 34px;
  font-weight: 800;
  line-height: 1.3;
  color: #d6ecff;
  text-shadow: 2px 2px 0 #001f54;
  max-width: 900px;
}
#rejoin-prompt-overlay .rejoin-sub b { color: #00ffe0; }
#rejoin-prompt-overlay .btn-rejoin-big {
  width: 720px;
  max-width: 100%;
  height: 150px;
  background: url('assets/ui/solo/sprite_06.png') no-repeat center center / 100% 100%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  font-family: var(--font-title);
  font-size: 66px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 2px;
  text-shadow: 4px 4px 0 #005a18;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.45));
  animation: rejoinBreathe 1.6s ease-in-out infinite;
  margin-top: 6px;
}
@keyframes rejoinBreathe { 0%, 100% { scale: 1; } 50% { scale: 1.04; } }
#rejoin-prompt-overlay .btn-rejoin-big:hover { filter: brightness(1.1) drop-shadow(0 10px 22px rgba(0, 255, 128, 0.45)); }
#rejoin-prompt-overlay .btn-rejoin-big:active { scale: 0.96; animation: none; }
#rejoin-prompt-overlay .btn-rejoin-swords { width: 70px; height: 70px; object-fit: contain; }
#rejoin-prompt-overlay .btn-rejoin-dismiss {
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font-title);
  font-size: 30px;
  font-weight: 800;
  color: #a9c8ef;
  text-decoration: underline;
  padding: 8px 16px;
}
#rejoin-prompt-overlay .btn-rejoin-dismiss:hover { color: #ffffff; }

/* ═══════════════ REWARDED: SOLO START BOOST + VICTORY DOUBLE COINS ═══════════════ */
/* Start boost: gold segment docked on the right end of DEPLOY (split button, own hit area) */
#lobby-panels .prep-action-row.has-boost .btn-prep-deploy {
  border-top-right-radius: 4px !important;
  border-bottom-right-radius: 4px !important;
}
.prep-boost-dock {
  position: relative;
  flex: 0 0 390px;
  width: 390px;
  min-width: 390px;
  max-width: 390px;
  box-sizing: border-box;
  height: 100%;
  margin-left: -10px; /* row gap is 16px -> 6px seam between DEPLOY and the segment */
  border-radius: 4px 14px 14px 4px;
  border: 3px solid #B26B00;
  background: linear-gradient(180deg, #FFD84D, #F5A623);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.55), 0 6px 0 #B26B00, 0 8px 14px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  padding: 0 18px 0 96px;
  cursor: pointer;
  overflow: visible;
  font-family: var(--font-title);
  transition: transform 0.1s ease, filter 0.1s ease;
}
.prep-boost-dock:hover:not(:disabled) { filter: brightness(1.06); }
.prep-boost-dock:active:not(:disabled) { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.55), 0 3px 0 #B26B00; }
.prep-boost-dock:disabled { cursor: default; }
.prep-boost-dock.is-busy { cursor: progress; }
/* shine sweep, clipped to the segment */
.prep-boost-dock::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.6) 50%, transparent 65%) no-repeat;
  background-size: 250% 100%;
  background-position: 150% 0;
  animation: prepBoostShine 5s ease-in-out infinite;
}
@keyframes prepBoostShine { 0%, 90% { background-position: 150% 0; } 100% { background-position: -50% 0; } }
.prep-boost-cash {
  position: absolute;
  left: 12px;
  top: -8px;
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.4));
  animation: prepBoostBob 2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes prepBoostBob { 50% { transform: translateY(-3px); } }
.prep-boost-check {
  display: none;
  position: absolute;
  left: 56px;
  top: 30px;
  width: 36px;
  height: 36px;
  box-sizing: border-box;
  border-radius: 50%;
  background: #FFC93C;
  border: 3px solid #4A2700;
  color: #4A2700;
  font-size: 22px;
  font-weight: 900;
  line-height: 30px;
  text-align: center;
  font-family: Arial, sans-serif;
}
.prep-boost-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  line-height: 1;
  white-space: nowrap;
}
.prep-boost-text b {
  font-size: 30px;
  font-weight: 900;
  color: #4A2700;
  letter-spacing: 0.3px;
}
.prep-boost-text i {
  font-style: normal;
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  background: #E53935;
  border-radius: 6px;
  padding: 2px 10px 3px;
  box-shadow: 0 2px 0 #9E1F1C;
  letter-spacing: 0.4px;
  min-width: 250px;
  box-sizing: border-box;
  text-align: center;
}
/* claimed: the segment merges into DEPLOY (clicking it deploys) */
.prep-boost-dock.is-ready {
  background: #1E9E55;
  border-color: #157A40;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.25), 0 6px 0 #157A40, 0 8px 14px rgba(0, 0, 0, 0.3);
}
.prep-boost-dock.is-ready::after { animation: prepBoostShine 0.6s ease-out 1; }
.prep-boost-dock.is-ready .prep-boost-cash { animation: none; }
.prep-boost-dock.is-ready .prep-boost-check { display: block; }
.prep-boost-dock.is-ready .prep-boost-text b { color: #fff; text-shadow: 2px 2px 0 #145a32; }
.prep-boost-dock.is-ready .prep-boost-text i { display: none; }
.prep-boost-dock.is-busy .prep-boost-text i { background: #A0522D; box-shadow: 0 2px 0 #6b3519; }
.prep-boost-dock.is-error .prep-boost-text i { background: #8A6A3A; box-shadow: 0 2px 0 #5c4626; }
/* claimed: one wide DEPLOY bar (2px line instead of the 6px seam) */
#lobby-panels .prep-action-row.boost-ready .btn-prep-deploy {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  border-right-width: 0 !important;
}
.prep-action-row.boost-ready .prep-boost-dock {
  margin-left: -16px;
  border-left: 2px solid #157A40;
  border-radius: 0 14px 14px 0;
}
@media (prefers-reduced-motion: reduce) {
  .prep-boost-dock::after, .prep-boost-cash { animation: none !important; }
}
#btn-summary-double {
  background: linear-gradient(180deg, #f9d84a, #f1c40f);
  color: #3b2a00;
  width: 100%;
  font-size: 1.0rem;
  font-weight: 900;
  padding: 10px;
  margin-bottom: 6px;
  border: 2px solid #b7950b;
  box-shadow: 0 3px 0 #b7950b, 0 3px 0 var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  animation: pulseLikePrompt 1.6s infinite ease-in-out;
}
#btn-summary-double:disabled { animation: none; cursor: default; }
#btn-summary-double.is-done { background: #27ae60; color: #fff; border-color: #1e8449; box-shadow: 0 3px 0 #1e8449; }

/* ═══════════════════════════════════════════════════════════════════════════
   HUD V2 (Oct 2026): top bar + map + right command column.
   Everything sizes with --u (1% of the 16:9-fitted screen height) so it scales
   cleanly from small CrazyGames windows to fullscreen.
   ═══════════════════════════════════════════════════════════════════════════ */
body #app-container.in-game-match {
  --u: min(1vh, 0.5625vw);
  --hud-ink: #1b1b1b;
  --hud-navy: #143374;
  --hud-navy-2: #1c4596;
  --hud-cream: #fdf3dc;
  --hud-cream-2: #f3e1bb;
}
body #app-container.in-game-match #game-view:not(.hidden) {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  grid-template-rows: calc(var(--u) * 9) minmax(0, 1fr) !important;
  background: var(--hud-navy) !important;
}

/* ─── Shared chunky text & button look ─── */
body #app-container.in-game-match #hud-topbar,
body #app-container.in-game-match #game-sidebar {
  font-family: var(--font-title) !important;
}
body #app-container.in-game-match .hud2-ink,
body #app-container.in-game-match #hud-map-name,
body #app-container.in-game-match .tb-wave-plaque,
body #app-container.in-game-match #hud-enemies-left,
body #app-container.in-game-match #hud-lives-val,
body #app-container.in-game-match #hud-gold-val,
body #app-container.in-game-match #game-sidebar .btn,
body #app-container.in-game-match .placement-btn .name {
  color: #fff !important;
  -webkit-text-stroke: calc(var(--u) * 0.28) var(--hud-ink);
  paint-order: stroke fill;
  text-shadow: 0 calc(var(--u) * 0.35) 0 var(--hud-ink) !important;
  letter-spacing: 0.02em;
}

/* ─── TOP BAR ─── */
body #app-container.in-game-match #hud-topbar {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(var(--u) * 2);
  padding: 0 calc(var(--u) * 1.6);
  background: linear-gradient(180deg, #2f66cf 0%, #1f4aa6 100%);
  border-bottom: calc(var(--u) * 0.5) solid #0b1d45;
  box-shadow: 0 calc(var(--u) * 0.4) 0 rgba(0, 0, 0, 0.25);
  position: relative;
  z-index: 20;
  min-width: 0;
}
#hud-topbar { display: none; }
body #app-container.in-game-match #hud-topbar .tb-left,
body #app-container.in-game-match #hud-topbar .tb-right {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 1.4);
  min-width: 0;
}
body #app-container.in-game-match #hud-topbar .tb-right { justify-content: flex-end; gap: calc(var(--u) * 2.2); }
body #app-container.in-game-match .hud2-mapico { width: calc(var(--u) * 6); height: calc(var(--u) * 6); flex-shrink: 0; }
body #app-container.in-game-match #hud-map-name {
  background: none !important; border: none !important; box-shadow: none !important; padding: 0 !important;
  font-size: calc(var(--u) * 3.3) !important; font-weight: 900 !important; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
body #app-container.in-game-match .tb-wave {
  flex: 0 0 auto;
  width: calc(var(--u) * 44);
  display: flex; flex-direction: column; align-items: center;
  align-self: stretch; justify-content: flex-start;
}
body #app-container.in-game-match .tb-wave-plaque {
  background: linear-gradient(180deg, #b07a43 0%, #7d5026 100%);
  border: calc(var(--u) * 0.45) solid var(--hud-ink);
  border-top: none;
  border-radius: 0 0 calc(var(--u) * 1.2) calc(var(--u) * 1.2);
  box-shadow: inset 0 calc(var(--u) * 0.4) 0 rgba(255, 255, 255, 0.18);
  padding: calc(var(--u) * 0.1) calc(var(--u) * 3) calc(var(--u) * 0.3);
  font-size: calc(var(--u) * 3.4) !important; font-weight: 900; line-height: 1.05; white-space: nowrap;
}
body #app-container.in-game-match .tb-wave-plaque #hud-wave,
body #app-container.in-game-match .tb-wave-plaque #hud-wave-val { color: inherit !important; font: inherit !important; background: none !important; }
body #app-container.in-game-match .tb-wave-bar {
  position: relative;
  width: 100%;
  height: calc(var(--u) * 3);
  margin-top: calc(var(--u) * 0.5);
  background: #0d1b3d;
  border: calc(var(--u) * 0.45) solid var(--hud-ink);
  border-radius: calc(var(--u) * 1.6);
  overflow: hidden;
}
body #app-container.in-game-match #hud-wave-fill {
  position: absolute; inset: 0;
  transform-origin: left center;
  background: linear-gradient(180deg, #7ef06a 0%, #2fb52a 60%, #22912a 100%);
  transition: transform 0.25s ease-out;
}
body #app-container.in-game-match #hud-wave-fill.is-ready { background: linear-gradient(180deg, #5db8ff 0%, #2f7de1 100%); }
body #app-container.in-game-match #hud-enemies-left {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: calc(var(--u) * 1.8) !important; font-weight: 900; white-space: nowrap;
  -webkit-text-stroke-width: calc(var(--u) * 0.22);
  text-shadow: 0 calc(var(--u) * 0.2) 0 var(--hud-ink) !important;
}
body #app-container.in-game-match .tb-stat .value {
  display: flex !important; align-items: center; gap: calc(var(--u) * 0.9);
  background: none !important; border: none !important; padding: 0 !important; font-size: inherit !important;
}
body #app-container.in-game-match .tb-stat .hud-icon { width: calc(var(--u) * 5.4) !important; height: calc(var(--u) * 5.4) !important; margin: 0 !important; flex-shrink: 0; }
body #app-container.in-game-match .tb-stat-text { display: flex; flex-direction: column; line-height: 1; }
body #app-container.in-game-match .tb-stat .label {
  font-size: calc(var(--u) * 1.6) !important; font-weight: 900; color: #cfe0ff !important; letter-spacing: 0.04em;
}
body #app-container.in-game-match #hud-lives-val,
body #app-container.in-game-match #hud-gold-val { font-size: calc(var(--u) * 3.1) !important; font-weight: 900; }
body #app-container.in-game-match #btn-return-lobby {
  font-size: calc(var(--u) * 2.7) !important; padding: calc(var(--u) * 0.8) calc(var(--u) * 2.4) !important;
  background: linear-gradient(180deg, #ff6457 0%, #d9281f 100%) !important;
  border: calc(var(--u) * 0.45) solid var(--hud-ink) !important;
  border-radius: calc(var(--u) * 1.2) !important;
  box-shadow: 0 calc(var(--u) * 0.6) 0 #7d120d !important;
  color: #fff !important; -webkit-text-stroke: calc(var(--u) * 0.25) var(--hud-ink); paint-order: stroke fill;
  text-shadow: 0 calc(var(--u) * 0.3) 0 var(--hud-ink) !important;
  width: auto !important; height: auto !important; min-width: 0 !important; margin: 0 !important; line-height: 1.1 !important;
}

/* ─── MAP ─── */
body #app-container.in-game-match #game-wrapper {
  grid-column: 1; grid-row: 2;
  width: min(calc((100dvh - var(--u) * 9) * 4 / 3), calc(100vw - var(--u) * 46)) !important;
  height: 100% !important;
  flex: none !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
  background: var(--hud-navy) !important;
  min-width: 0;
}
body #app-container.in-game-match #canvas-container {
  width: 100% !important; height: auto !important; max-height: 100% !important; aspect-ratio: 4 / 3 !important;
}
body #app-container.in-game-match #game-canvas { width: 100% !important; height: 100% !important; }

/* ─── RIGHT COMMAND COLUMN ─── */
body #app-container.in-game-match #game-sidebar {
  grid-column: 2; grid-row: 2;
  width: auto !important; min-width: 0 !important; height: 100% !important;
  display: flex !important; flex-direction: column !important;
  gap: calc(var(--u) * 1.1) !important;
  padding: calc(var(--u) * 1.3) !important;
  background: linear-gradient(180deg, var(--hud-navy-2) 0%, var(--hud-navy) 100%) !important;
  border-left: calc(var(--u) * 0.5) solid #0b1d45 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  position: relative !important; transform: none !important; right: auto !important; top: auto !important;
}
body #app-container.in-game-match #game-controls { display: flex !important; flex-direction: column !important; gap: calc(var(--u) * 1) !important; flex-shrink: 0; margin: 0 !important; }
body #app-container.in-game-match #game-controls .control-row { display: flex !important; gap: calc(var(--u) * 1) !important; margin: 0 !important; }
body #app-container.in-game-match #game-sidebar #game-controls .btn {
  height: calc(var(--u) * 6.4) !important;
  min-height: 0 !important;
  padding: 0 calc(var(--u) * 1.4) !important;
  margin: 0 !important;
  font-size: calc(var(--u) * 2.5) !important; font-weight: 900 !important; line-height: 1 !important;
  border: calc(var(--u) * 0.45) solid var(--hud-ink) !important;
  border-radius: calc(var(--u) * 1.3) !important;
  display: flex !important; align-items: center !important; justify-content: center !important; gap: calc(var(--u) * 0.9) !important;
  white-space: nowrap !important; text-transform: uppercase;
  transition: transform 0.08s ease, filter 0.15s ease !important;
}
body #app-container.in-game-match #game-sidebar #game-controls .btn.hidden { display: none !important; }
body #app-container.in-game-match #game-sidebar #game-controls .btn:not(:disabled):hover { transform: translateY(calc(var(--u) * -0.3)) !important; filter: brightness(1.07); }
body #app-container.in-game-match #game-sidebar #game-controls .btn:not(:disabled):active { transform: translateY(calc(var(--u) * 0.4)) !important; }
body #app-container.in-game-match #game-sidebar #btn-next-wave {
  flex: 1.25 1 0 !important;
  font-size: calc(var(--u) * 2.8) !important;
  background: linear-gradient(180deg, #6fdc4f 0%, #36b52c 55%, #2a9a23 100%) !important;
  box-shadow: 0 calc(var(--u) * 0.6) 0 #14560f, inset 0 calc(var(--u) * 0.4) 0 rgba(255,255,255,0.3) !important;
}
body #app-container.in-game-match #game-sidebar #btn-next-wave::before {
  content: ''; width: 0; height: 0; flex-shrink: 0;
  border-left: calc(var(--u) * 2) solid #fff; border-top: calc(var(--u) * 1.25) solid transparent; border-bottom: calc(var(--u) * 1.25) solid transparent;
  filter: drop-shadow(0 calc(var(--u) * 0.3) 0 var(--hud-ink));
}
body #app-container.in-game-match #game-sidebar #btn-next-wave:disabled { filter: saturate(0.55) brightness(0.92); }
body #app-container.in-game-match #game-sidebar #btn-skip-wave {
  flex: 1 1 0 !important;
  background: linear-gradient(180deg, #5aa9ff 0%, #2f7de1 55%, #2466c2 100%) !important;
  box-shadow: 0 calc(var(--u) * 0.6) 0 #12366f, inset 0 calc(var(--u) * 0.4) 0 rgba(255,255,255,0.3) !important;
}
body #app-container.in-game-match #game-sidebar #btn-skip-wave::before { content: '\25B6\25B6'; font-size: 0.7em; letter-spacing: -0.25em; margin-right: 0.15em; }
body #app-container.in-game-match #game-sidebar #btn-auto-wave {
  flex: 1 1 0 !important;
  background: linear-gradient(180deg, #8f9aa8 0%, #6b7684 100%) !important;
  box-shadow: 0 calc(var(--u) * 0.6) 0 #39414c !important;
  opacity: 1 !important;
}
body #app-container.in-game-match #game-sidebar #btn-auto-wave.is-on {
  background: linear-gradient(180deg, #4fd06a 0%, #24a148 100%) !important;
  box-shadow: 0 calc(var(--u) * 0.6) 0 #13612a !important;
}
body #app-container.in-game-match .hud2-toggle {
  position: relative; width: calc(var(--u) * 5.4); height: calc(var(--u) * 3);
  background: rgba(0, 0, 0, 0.35); border: calc(var(--u) * 0.35) solid var(--hud-ink); border-radius: calc(var(--u) * 2);
  flex-shrink: 0; box-sizing: border-box;
}
body #app-container.in-game-match .hud2-toggle i {
  position: absolute; top: 50%; left: calc(var(--u) * 0.25);
  width: calc(var(--u) * 2.1); height: calc(var(--u) * 2.1); transform: translateY(-50%);
  background: #fff; border: calc(var(--u) * 0.3) solid var(--hud-ink); border-radius: 50%; box-sizing: border-box;
  transition: left 0.15s ease;
}
body #app-container.in-game-match #btn-auto-wave.is-on .hud2-toggle { background: #b8ffb0; }
body #app-container.in-game-match #btn-auto-wave.is-on .hud2-toggle i { left: calc(100% - var(--u) * 2.35); }
body #app-container.in-game-match #game-sidebar #btn-speed {
  flex: 1.35 1 0 !important;
  background: linear-gradient(180deg, #24427e 0%, #172f60 100%) !important;
  box-shadow: 0 calc(var(--u) * 0.6) 0 #0a1a3c !important;
  justify-content: space-between !important;
}
body #app-container.in-game-match .hud2-spd {
  font-weight: 900; padding: calc(var(--u) * 0.6) calc(var(--u) * 1.1); border-radius: calc(var(--u) * 0.8);
  color: #9fb4dd !important; -webkit-text-stroke: 0; text-shadow: none !important;
}
body #app-container.in-game-match .hud2-spd.on {
  background: linear-gradient(180deg, #5aa9ff, #2f7de1); color: #fff !important;
  border: calc(var(--u) * 0.3) solid var(--hud-ink);
  -webkit-text-stroke: calc(var(--u) * 0.2) var(--hud-ink); text-shadow: 0 calc(var(--u) * 0.2) 0 var(--hud-ink) !important;
}

/* ─── AGENT SHOP ─── */
body #app-container.in-game-match #placement-shop {
  flex: 1 1 auto !important; min-height: 0 !important;
  display: flex !important; flex-direction: column !important;
  background: none !important; border: none !important; padding: 0 !important; margin: 0 !important; box-shadow: none !important;
}
body #app-container.in-game-match .hud2-shop-head { display: flex; justify-content: center; margin-bottom: calc(var(--u) * -1.3); position: relative; z-index: 2; }
body #app-container.in-game-match #placement-limit-badge {
  background: var(--hud-cream) !important; color: #3b2a14 !important;
  border: calc(var(--u) * 0.4) solid var(--hud-ink) !important; border-radius: calc(var(--u) * 1) !important;
  font-family: var(--font-title) !important; font-size: calc(var(--u) * 2) !important; font-weight: 900 !important;
  padding: calc(var(--u) * 0.3) calc(var(--u) * 2.4) !important; line-height: 1.1 !important;
}
body #app-container.in-game-match #equipped-agents-list {
  flex: 1 1 auto; min-height: 0;
  display: grid !important;
  grid-template-columns: repeat(6, 1fr) !important;
  grid-auto-rows: auto;
  align-content: start;
  gap: calc(var(--u) * 1) !important;
  padding: calc(var(--u) * 2.2) calc(var(--u) * 1.1) calc(var(--u) * 1.1) !important;
  background: linear-gradient(180deg, var(--hud-cream) 0%, var(--hud-cream-2) 100%) !important;
  border: calc(var(--u) * 0.45) solid var(--hud-ink) !important;
  border-radius: calc(var(--u) * 1.5) !important;
  box-shadow: 0 calc(var(--u) * 0.6) 0 #8a5a24 !important;
  overflow-y: auto !important; overflow-x: hidden !important;
  max-height: none !important; height: auto !important;
}
body #app-container.in-game-match .placement-btn {
  grid-column: span 2;
  display: flex !important; flex-direction: column !important; align-items: center !important; justify-content: space-between !important;
  gap: calc(var(--u) * 0.4) !important;
  min-width: 0 !important; width: auto !important; height: auto !important;
  padding: calc(var(--u) * 0.7) calc(var(--u) * 0.5) calc(var(--u) * 0.8) !important;
  margin: 0 !important;
  border: calc(var(--u) * 0.45) solid var(--hud-ink) !important;
  border-radius: calc(var(--u) * 1.3) !important;
  background: linear-gradient(180deg, #9fcbff 0%, #5d9cf0 100%) !important;
  box-shadow: 0 calc(var(--u) * 0.55) 0 rgba(0, 0, 0, 0.35), inset 0 calc(var(--u) * 0.4) 0 rgba(255,255,255,0.35) !important;
  cursor: pointer; opacity: 1 !important;
  transition: transform 0.1s ease, filter 0.15s ease, box-shadow 0.1s ease !important;
  transform: none !important;
}
body #app-container.in-game-match .placement-btn:nth-child(5n+2) { background: linear-gradient(180deg, #b9ec98 0%, #6fc84a 100%) !important; }
body #app-container.in-game-match .placement-btn:nth-child(5n+3) { background: linear-gradient(180deg, #f7dfa8 0%, #d9ab5e 100%) !important; }
body #app-container.in-game-match .placement-btn:nth-child(5n+4) { background: linear-gradient(180deg, #d8dee8 0%, #9aa6b8 100%) !important; }
body #app-container.in-game-match .placement-btn:nth-child(5n+5) { background: linear-gradient(180deg, #ddc8fb 0%, #a27ee6 100%) !important; }
/* 3 on top, 2 wide ones below (5 agents); 4 agents = 2 x 2 */
body #app-container.in-game-match .placement-btn:nth-child(4):nth-last-child(2),
body #app-container.in-game-match .placement-btn:nth-child(5):nth-last-child(1),
body #app-container.in-game-match .placement-btn:nth-child(1):nth-last-child(4),
body #app-container.in-game-match .placement-btn:nth-child(2):nth-last-child(3),
body #app-container.in-game-match .placement-btn:nth-child(3):nth-last-child(2),
body #app-container.in-game-match .placement-btn:nth-child(4):nth-last-child(1) { grid-column: span 3; }
/* 1 or 2 agents (new players): wide cards instead of thin ones */
body #app-container.in-game-match .placement-btn:only-child { grid-column: 2 / span 4; }
body #app-container.in-game-match .placement-btn:nth-child(1):nth-last-child(2),
body #app-container.in-game-match .placement-btn:nth-child(2):nth-last-child(1) { grid-column: span 3; }
body #app-container.in-game-match .placement-btn:hover { transform: translateY(calc(var(--u) * -0.4)) !important; filter: brightness(1.06); }
body #app-container.in-game-match .placement-btn.active {
  box-shadow: 0 0 0 calc(var(--u) * 0.5) #ffd23f, 0 calc(var(--u) * 0.55) 0 rgba(0,0,0,0.35) !important;
  transform: translateY(calc(var(--u) * -0.4)) !important;
}
body #app-container.in-game-match .placement-btn.unaffordable { filter: grayscale(0.9) brightness(0.82); }
body #app-container.in-game-match .placement-btn.unaffordable:hover { transform: none !important; }
body #app-container.in-game-match .placement-btn .name {
  font-family: var(--font-title) !important;
  font-size: calc(var(--u) * 2.2) !important; font-weight: 700 !important; line-height: 1.35 !important;
  text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
  -webkit-text-stroke-width: calc(var(--u) * 0.2);
  text-shadow: 0 calc(var(--u) * 0.25) 0 var(--hud-ink) !important;
  padding: 0 calc(var(--u) * 0.3);
}
body #app-container.in-game-match .placement-btn .icon {
  width: auto !important; height: calc(var(--u) * 8.5) !important; flex: 0 0 auto; min-height: 0;
  display: flex !important; align-items: center; justify-content: center;
  background: none !important; border: none !important; margin: 0 !important; padding: 0 !important;
}
body #app-container.in-game-match .placement-btn .icon { width: 100% !important; overflow: hidden !important; border-radius: calc(var(--u) * 0.8) !important; }
body #app-container.in-game-match .placement-btn .name, body #app-container.in-game-match .placement-btn .cost { position: relative; z-index: 2; }
body #app-container.in-game-match .placement-btn .icon canvas {
  height: 100% !important; width: auto !important; aspect-ratio: 1 / 1;
  max-width: 100% !important; max-height: none !important; min-height: 0;
  filter: drop-shadow(0 calc(var(--u) * 0.25) 0 rgba(0,0,0,0.35));
  pointer-events: none;
}
body #app-container.in-game-match .placement-btn .cost {
  display: inline-flex !important; align-items: center; gap: calc(var(--u) * 0.5);
  background: #fff8e8 !important; color: #2b1d08 !important;
  border: calc(var(--u) * 0.3) solid var(--hud-ink) !important; border-radius: calc(var(--u) * 2) !important;
  padding: calc(var(--u) * 0.15) calc(var(--u) * 1) calc(var(--u) * 0.15) calc(var(--u) * 0.3) !important;
  font-family: var(--font-title) !important; font-size: calc(var(--u) * 1.8) !important; font-weight: 900 !important; line-height: 1.1 !important;
}
body #app-container.in-game-match .placement-btn.unaffordable .cost { color: #c0392b !important; }
body #app-container.in-game-match .hud2-coin {
  width: calc(var(--u) * 1.9); height: calc(var(--u) * 1.9); border-radius: 50%; flex-shrink: 0;
  background: radial-gradient(circle at 35% 30%, #fff7c2 0 18%, #ffd23f 20% 60%, #e09b00 62%);
  border: calc(var(--u) * 0.25) solid var(--hud-ink); box-sizing: border-box;
}

/* ─── SELECTED AGENT PANEL (docked) ─── */
body #app-container.in-game-match #selection-panel:not(.hidden),
body #app-container.in-game-match #selection-panel.hidden + #selection-empty {
  position: relative !important; inset: auto !important; transform: none !important;
  width: auto !important; flex-shrink: 0;
  background: linear-gradient(180deg, var(--hud-cream) 0%, var(--hud-cream-2) 100%) !important;
  border: calc(var(--u) * 0.45) solid var(--hud-ink) !important;
  border-radius: calc(var(--u) * 1.6) !important;
  box-shadow: 0 calc(var(--u) * 0.6) 0 #8a5a24 !important;
  padding: calc(var(--u) * 1.2) !important;
  margin: 0 !important;
  z-index: 5 !important;
  font-family: var(--font-title) !important;
}
body #app-container.in-game-match #selection-empty { display: none; }
body #app-container.in-game-match #selection-panel.hidden + #selection-empty {
  display: flex; align-items: center; gap: calc(var(--u) * 1.6); min-height: calc(var(--u) * 12);
}
body #app-container.in-game-match .hud2-empty-portrait {
  width: calc(var(--u) * 8); height: calc(var(--u) * 8); flex-shrink: 0;
  border-radius: calc(var(--u) * 1.2); border: calc(var(--u) * 0.4) solid #b9a27a; background: #e9dcc0;
  background-image: radial-gradient(circle at 50% 38%, #c7b48f 0 22%, transparent 23%), radial-gradient(ellipse at 50% 100%, #c7b48f 0 45%, transparent 46%);
}
body #app-container.in-game-match .hud2-empty-text { display: flex; flex-direction: column; font-size: calc(var(--u) * 2.5); font-weight: 900; color: #3b2a14; line-height: 1.1; }
body #app-container.in-game-match .hud2-empty-text small { font-family: var(--font-body); font-size: calc(var(--u) * 1.55); font-weight: 800; color: #7a6544; margin-top: calc(var(--u) * 0.5); }
body #app-container.in-game-match .selection-panel-inner { gap: calc(var(--u) * 0.9) !important; }
body #app-container.in-game-match .sp-head { display: flex; align-items: center; gap: calc(var(--u) * 1.3); }
body #app-container.in-game-match .sp-portrait {
  width: calc(var(--u) * 8.5); height: calc(var(--u) * 8.5); flex-shrink: 0; object-fit: cover;
  background: linear-gradient(180deg, #8fc3ff 0%, #4f8fe8 100%);
  border: calc(var(--u) * 0.45) solid var(--hud-ink); border-radius: calc(var(--u) * 1.2);
  box-shadow: inset 0 calc(var(--u) * 0.4) 0 rgba(255,255,255,0.35);
}
body #app-container.in-game-match .sp-title { display: flex; flex-direction: column; gap: calc(var(--u) * 0.3); min-width: 0; }
body #app-container.in-game-match #selection-info .unit-name {
  font-family: var(--font-title) !important; font-size: calc(var(--u) * 3) !important; font-weight: 900 !important;
  color: #2b1d08 !important; margin: 0 !important; line-height: 1 !important; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body #app-container.in-game-match .sp-stars { display: flex; gap: calc(var(--u) * 0.2); }
body #app-container.in-game-match .sp-stars i { font-style: normal; font-size: calc(var(--u) * 2.6); line-height: 1; color: #cfc3a8;
  -webkit-text-stroke: calc(var(--u) * 0.18) var(--hud-ink); paint-order: stroke fill; }
body #app-container.in-game-match .sp-stars i::before { content: '\2605'; }
body #app-container.in-game-match .sp-stars i.on { color: #ffc61a; }
body #app-container.in-game-match .sp-lv {
  margin-left: auto; align-self: flex-start;
  background: #1f4aa6; color: #fff; border: calc(var(--u) * 0.3) solid var(--hud-ink); border-radius: calc(var(--u) * 0.8);
  font-size: calc(var(--u) * 1.7); font-weight: 900; padding: calc(var(--u) * 0.2) calc(var(--u) * 0.9);
}
body #app-container.in-game-match .sp-stats { display: flex; flex-direction: column; }
body #app-container.in-game-match .sp-row {
  display: flex; align-items: center; gap: calc(var(--u) * 0.9);
  padding: calc(var(--u) * 0.35) calc(var(--u) * 0.3);
  border-bottom: calc(var(--u) * 0.2) dashed rgba(59, 42, 20, 0.22);
}
body #app-container.in-game-match .sp-row svg { width: calc(var(--u) * 2.4); height: calc(var(--u) * 2.4); flex-shrink: 0; }
body #app-container.in-game-match .sp-row span { font-size: calc(var(--u) * 1.75); font-weight: 900; color: #3b2a14; }
body #app-container.in-game-match .sp-row b { margin-left: auto; font-size: calc(var(--u) * 2); font-weight: 900; color: #2b1d08; }
body #app-container.in-game-match #selection-info .unit-stats {
  font-family: var(--font-body) !important; font-size: calc(var(--u) * 1.5) !important; font-weight: 800 !important;
  margin: calc(var(--u) * 0.5) 0 0 !important; line-height: 1.25 !important;
}
body #app-container.in-game-match .targeting-container {
  background: transparent !important; border: none !important; padding: 0 !important;
  display: flex; align-items: center; justify-content: space-between; gap: calc(var(--u) * 1);
}
body #app-container.in-game-match .targeting-container label { font-size: calc(var(--u) * 1.8) !important; font-weight: 900 !important; color: #3b2a14 !important; }
body #app-container.in-game-match .targeting-container .custom-dropdown { flex: 1; max-width: 60%; font-size: calc(var(--u) * 1.8) !important; }
body #app-container.in-game-match .targeting-container .dropdown-selected {
  border: calc(var(--u) * 0.35) solid var(--hud-ink) !important; border-radius: calc(var(--u) * 0.9) !important;
  padding: calc(var(--u) * 0.5) calc(var(--u) * 1) !important; text-align: left !important; color: #1f2a44 !important;
}
body #app-container.in-game-match .selection-actions { display: flex !important; gap: calc(var(--u) * 1) !important; }
body #app-container.in-game-match .selection-actions .btn {
  flex: 1 1 0 !important; position: relative;
  height: calc(var(--u) * 7) !important; padding: 0 !important; margin: 0 !important;
  display: flex !important; flex-direction: column !important; align-items: center !important; justify-content: center !important;
  border: calc(var(--u) * 0.45) solid var(--hud-ink) !important; border-radius: calc(var(--u) * 1.3) !important;
  font-family: var(--font-title) !important; line-height: 1 !important;
  color: #fff !important; -webkit-text-stroke: calc(var(--u) * 0.25) var(--hud-ink); paint-order: stroke fill;
  text-shadow: 0 calc(var(--u) * 0.3) 0 var(--hud-ink) !important;
  transition: transform 0.08s ease !important;
}
body #app-container.in-game-match .selection-actions .btn:not(:disabled):hover { transform: translateY(calc(var(--u) * -0.3)) !important; }
body #app-container.in-game-match .selection-actions .btn:not(:disabled):active { transform: translateY(calc(var(--u) * 0.4)) !important; }
body #app-container.in-game-match .selection-actions .btn .b1 { font-size: calc(var(--u) * 2.2); font-weight: 900; }
body #app-container.in-game-match .selection-actions .btn .b2 { font-size: calc(var(--u) * 2.5); font-weight: 900; margin-top: calc(var(--u) * 0.2); }
body #app-container.in-game-match .selection-actions .btn small {
  position: absolute; top: calc(var(--u) * 0.4); right: calc(var(--u) * 0.6);
  font-size: calc(var(--u) * 1.2); -webkit-text-stroke: 0; text-shadow: none !important;
  background: rgba(0,0,0,0.28); border-radius: calc(var(--u) * 0.4); padding: 0 calc(var(--u) * 0.5);
}
body #app-container.in-game-match #btn-upgrade {
  background: linear-gradient(180deg, #6fdc4f 0%, #36b52c 55%, #2a9a23 100%) !important;
  box-shadow: 0 calc(var(--u) * 0.6) 0 #14560f, inset 0 calc(var(--u) * 0.4) 0 rgba(255,255,255,0.3) !important;
}
body #app-container.in-game-match #btn-sell {
  background: linear-gradient(180deg, #ff6457 0%, #d9281f 100%) !important;
  box-shadow: 0 calc(var(--u) * 0.6) 0 #7d120d, inset 0 calc(var(--u) * 0.4) 0 rgba(255,255,255,0.25) !important;
}
body #app-container.in-game-match #btn-ability:not(.hidden) {
  height: calc(var(--u) * 5) !important; font-family: var(--font-title) !important; font-size: calc(var(--u) * 2.2) !important;
  border: calc(var(--u) * 0.45) solid var(--hud-ink) !important; border-radius: calc(var(--u) * 1.2) !important;
  margin-top: calc(var(--u) * 0.8) !important; color: #fff !important;
  -webkit-text-stroke: calc(var(--u) * 0.22) var(--hud-ink); paint-order: stroke fill; text-shadow: 0 calc(var(--u) * 0.3) 0 var(--hud-ink) !important;
}
body #app-container.in-game-match #btn-toggle-sidebar { display: none !important; }

/* Cards keep their natural height; if the sidebar gets short (e.g. a tall upgrade panel)
   the card tray scrolls instead of squashing and clipping the cards. */
body #app-container.in-game-match .placement-btn { flex-shrink: 0; justify-content: center !important; overflow: visible !important; }
body #app-container.in-game-match #equipped-agents-list { scrollbar-width: thin; }
body #app-container.in-game-match #selection-info .unit-name,
body #app-container.in-game-match .hud2-empty-text,
body #app-container.in-game-match .selection-actions .btn .b1,
body #app-container.in-game-match .selection-actions .btn .b2 { line-height: 1.2 !important; }
body #app-container.in-game-match #game-sidebar #game-controls .btn { line-height: 1.2 !important; }

/* Ability button joins the UPGRADE / SELL row as a third button */
body #app-container.in-game-match .selection-actions #btn-ability:not(.hidden) {
  flex: 0.9 1 0 !important; width: auto !important; height: calc(var(--u) * 7) !important; margin: 0 !important;
  font-size: calc(var(--u) * 1.9) !important; white-space: normal !important; line-height: 1.1 !important;
  background: linear-gradient(180deg, #ffb347 0%, #f08a12 100%) !important;
  box-shadow: 0 calc(var(--u) * 0.6) 0 #8a4a05 !important;
}
/* Agent description: one tidy line (full text on hover) */
body #app-container.in-game-match #selection-info .unit-stats {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Stats as 3 compact chips (DAMAGE / RANGE / RATE) so the panel stays short */
body #app-container.in-game-match .sp-stats { display: grid !important; grid-template-columns: repeat(3, 1fr); gap: calc(var(--u) * 0.7); }
body #app-container.in-game-match .sp-row {
  display: grid !important; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: calc(var(--u) * 0.6);
  align-items: center; padding: calc(var(--u) * 0.5) calc(var(--u) * 0.8) !important;
  background: rgba(255, 255, 255, 0.65); border: calc(var(--u) * 0.25) solid rgba(59, 42, 20, 0.35) !important;
  border-radius: calc(var(--u) * 0.9);
}
body #app-container.in-game-match .sp-row svg { grid-row: 1 / span 2; width: calc(var(--u) * 2.6) !important; height: calc(var(--u) * 2.6) !important; }
body #app-container.in-game-match .sp-row span { font-size: calc(var(--u) * 1.3) !important; color: #7a6544 !important; line-height: 1.1; }
body #app-container.in-game-match .sp-row b { margin-left: 0 !important; font-size: calc(var(--u) * 2.1) !important; line-height: 1.1; }
body #app-container.in-game-match .sp-portrait { width: calc(var(--u) * 7.5) !important; height: calc(var(--u) * 7.5) !important; }
body #app-container.in-game-match .selection-actions .btn.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════
   HUD V2 readability floors (CrazyGames QA, Oct 2026)
   Chromebooks without fullscreen give the game ~800x420 px, where
   --u is ~4.2px and the small labels dropped to 5-8px. Every HUD text
   now has a pixel floor, and short screens get a tighter layout so the
   bigger text still fits.
   ═══════════════════════════════════════════════════════════════════ */
body #app-container.in-game-match #hud-map-name { font-size: max(13px, calc(var(--u) * 3.3)) !important; }
body #app-container.in-game-match .tb-wave-plaque { font-size: max(13px, calc(var(--u) * 3.4)) !important; }
body #app-container.in-game-match .tb-wave-bar { height: max(15px, calc(var(--u) * 3)); }
body #app-container.in-game-match #hud-enemies-left { font-size: max(10.5px, calc(var(--u) * 1.8)) !important; -webkit-text-stroke-width: max(1px, calc(var(--u) * 0.22)); }
body #app-container.in-game-match .tb-stat .label { font-size: max(10px, calc(var(--u) * 1.6)) !important; letter-spacing: 0.02em; }
body #app-container.in-game-match #hud-lives-val,
body #app-container.in-game-match #hud-gold-val { font-size: max(14px, calc(var(--u) * 3.1)) !important; }
body #app-container.in-game-match #btn-return-lobby { font-size: max(12px, calc(var(--u) * 2.7)) !important; }

body #app-container.in-game-match #game-sidebar #game-controls .btn { font-size: max(11.5px, calc(var(--u) * 2.5)) !important; height: max(28px, calc(var(--u) * 6.4)) !important; }
body #app-container.in-game-match #game-sidebar #btn-next-wave { font-size: max(12px, calc(var(--u) * 2.8)) !important; }
body #app-container.in-game-match #placement-limit-badge { font-size: max(11px, calc(var(--u) * 2)) !important; }

body #app-container.in-game-match .placement-btn .name { font-size: max(11.5px, calc(var(--u) * 2.2)) !important; line-height: 1.3 !important; }
body #app-container.in-game-match .placement-btn .cost { font-size: max(11px, calc(var(--u) * 1.8)) !important; }
body #app-container.in-game-match .hud2-coin { width: max(10px, calc(var(--u) * 1.9)); height: max(10px, calc(var(--u) * 1.9)); }

body #app-container.in-game-match .hud2-empty-text { font-size: max(12px, calc(var(--u) * 2.5)); }
body #app-container.in-game-match .hud2-empty-text small { font-size: max(10.5px, calc(var(--u) * 1.55)); line-height: 1.2; }
body #app-container.in-game-match #selection-info .unit-name { font-size: max(14px, calc(var(--u) * 3)) !important; }
body #app-container.in-game-match .sp-stars i { font-size: max(12px, calc(var(--u) * 2.6)); }
body #app-container.in-game-match .sp-lv { font-size: max(10.5px, calc(var(--u) * 1.7)); }
body #app-container.in-game-match .sp-row span { font-size: max(10px, calc(var(--u) * 1.3)) !important; letter-spacing: 0.02em; }
body #app-container.in-game-match .sp-row b { font-size: max(12.5px, calc(var(--u) * 2.1)) !important; }
body #app-container.in-game-match .sp-row svg { width: max(13px, calc(var(--u) * 2.6)) !important; height: max(13px, calc(var(--u) * 2.6)) !important; }
body #app-container.in-game-match #selection-info .unit-stats { font-size: max(10.5px, calc(var(--u) * 1.5)) !important; }
body #app-container.in-game-match .targeting-container label,
body #app-container.in-game-match .targeting-container .custom-dropdown { font-size: max(11px, calc(var(--u) * 1.8)) !important; }
body #app-container.in-game-match .selection-actions .btn,
body #app-container.in-game-match .selection-actions #btn-ability:not(.hidden) { height: max(36px, calc(var(--u) * 7)) !important; }
body #app-container.in-game-match .selection-actions .btn .b1 { font-size: max(11.5px, calc(var(--u) * 2.2)); }
body #app-container.in-game-match .selection-actions .btn .b2 { font-size: max(12.5px, calc(var(--u) * 2.5)); margin-top: 0; }
body #app-container.in-game-match .selection-actions #btn-ability:not(.hidden) { font-size: max(11px, calc(var(--u) * 1.9)) !important; }
body #app-container.in-game-match .selection-actions .btn small {
  font-size: max(10px, calc(var(--u) * 1.2)); line-height: 1.25;
  top: max(2px, calc(var(--u) * 0.4)); right: max(3px, calc(var(--u) * 0.6)); padding: 0 max(3px, calc(var(--u) * 0.5));
}

/* Short screens (Chromebook windowed, small laptops): win back height for the bigger text */
@media (max-height: 560px) {
  body #app-container.in-game-match .placement-btn .icon { height: calc(var(--u) * 6.2) !important; }
  body #app-container.in-game-match #equipped-agents-list { gap: 4px !important; padding-top: calc(var(--u) * 2.4) !important; }
  body #app-container.in-game-match .placement-btn { padding-top: 2px !important; padding-bottom: 3px !important; gap: 1px !important; }
  body #app-container.in-game-match .sp-portrait { width: 30px !important; height: 30px !important; }
  body #app-container.in-game-match .hud2-empty-portrait { width: 30px; height: 30px; }
  body #app-container.in-game-match .selection-panel-inner { gap: 4px !important; }
  body #app-container.in-game-match .sp-row { padding: 2px 5px !important; }
  body #app-container.in-game-match .targeting-container .dropdown-selected { padding: 2px 6px !important; }
}

/* ═══════════════════════════════════════════════════════════════════
   GEMS (meta currency) vs $ cash in matches — Dom (CrazyGames) feedback
   ═══════════════════════════════════════════════════════════════════ */
.hud-coins-pill { background-image: url('assets/halloween/ui/gem_pill.webp') !important; }
img.coin-icon-mini, img.quest-coin-img { content: url('assets/halloween/ui/gem.webp'); }

/* ═══════════════════════════════════════════════════════════════════
   HALLOWEEN 2026: candy counter, 🎃 shop, popups, graveyard card
   ═══════════════════════════════════════════════════════════════════ */
.hw-candy-wrapper { cursor: pointer; position: absolute !important; right: calc(100% + 18px); top: 50%; transform: translateY(-46%) scale(1.3); transform-origin: right center; display: flex; flex-direction: column; align-items: center; }
body.hw-on #lobby-header .player-meta-box { position: relative; }
.hw-candy-pill {
  width: 140px; height: 48px; display: flex; align-items: center; justify-content: flex-end; gap: 6px;
  padding-right: 20px; box-sizing: border-box;
  background: url('assets/halloween/ui/candy_pill.webp') no-repeat center / 100% 100%;
  font-family: var(--font-title); font-size: 1.4rem; font-weight: 900; color: #fff; text-shadow: 2px 2px 0 #000;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}
.hw-candy-pill img { display: none; }
.tab-btn-halloween { background: url('assets/halloween/ui/tab_hw.webp') no-repeat center center / 100% 100% !important; }
.tab-btn-halloween .tab-label { color: #fff !important; text-shadow: 1.5px 1.5px 0 #7a2e00 !important; }
body.hw-on #lobby-header .player-meta-box { flex-wrap: nowrap !important; }
.hw-earn > span { color: #ffd9a8; }
#hw-modal canvas { display: block; margin: 4px auto; }

#panel-halloween { overflow-y: auto; }
#hw-shop { padding: 24px; color: #fff; font-family: var(--font-body); font-size: 28px; }
.hw-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  background: linear-gradient(135deg, #2b1747 0%, #4a1f5c 55%, #8a3b12 100%); border: 4px solid #1b1b1b; border-radius: 22px; padding: 22px 30px; box-shadow: 0 6px 0 #1b1b1b; }
.hw-head h2 { margin: 0; font-family: var(--font-title); font-size: 50px; color: #ffb347; text-shadow: 2px 2px 0 #1b1b1b; }
.hw-head p { margin: 4px 0 0; font-size: 28px; line-height: 1.25; color: #f3e6ff; }
.hw-balance { display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,0.35); border: 3px solid #1b1b1b; border-radius: 18px; padding: 8px 22px; }
.hw-balance img { width: 72px; height: 72px; object-fit: contain; }
.hw-balance span { font-family: var(--font-title); font-size: 52px; font-weight: 900; text-shadow: 2px 2px 0 #000; }
.hw-balance small { font-weight: 900; font-size: 28px; color: #ffb347; }
.hw-earn { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0; font-weight: 800; font-size: 28px; color: #3b2a14; }
.hw-earn b { background: #fff3dc; border: 3px solid #1b1b1b; border-radius: 999px; padding: 4px 16px; font-size: 27px; }
.hw-daily { display: flex; align-items: center; gap: 18px; background: linear-gradient(180deg, #ffe2b8 0%, #ffbf73 100%); border: 3px solid #1b1b1b; border-radius: 18px; padding: 12px 20px; margin-bottom: 16px; color: #3b2a14; font-size: 28px; }
.hw-daily img { width: 84px; height: 84px; object-fit: contain; }
.hw-daily div { display: flex; flex-direction: column; flex: 1; }
.hw-daily.done { filter: saturate(0.6); }
.hw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.hw-skin { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  background: linear-gradient(180deg, #3d2363 0%, #241238 100%); border: 3px solid #1b1b1b; border-radius: 18px; padding: 16px 12px; box-shadow: 0 5px 0 #1b1b1b; gap: 8px; }
.hw-skin.owned { background: linear-gradient(180deg, #5a3a17 0%, #2f1d0a 100%); }
.hw-skin canvas { width: 160px; height: 160px; background: radial-gradient(circle at 50% 55%, rgba(255,160,60,0.35), transparent 70%); border-radius: 12px; }
.hw-skin b { font-family: var(--font-title); font-size: 30px; line-height: 1.15; min-height: 2.3em; display: flex; align-items: center; }
.hw-skin small { min-height: 1.2em; color: #d6c7ea; font-size: 26px; }
.hw-tag { position: absolute; top: 10px; left: 10px; background: #ff8a1f; color: #fff; border: 3px solid #1b1b1b; border-radius: 10px; padding: 2px 10px; font-size: 26px; font-weight: 900; }
.hw-tag.own { background: #27ae60; }
#hw-modal .hw-tag { font-size: 0.8rem; border-width: 2px; padding: 0 6px; }
.hw-tag.big { position: static; display: inline-block; font-size: 0.9rem; padding: 2px 10px; margin-bottom: 4px; }
.hw-btn { display: inline-flex !important; align-items: center; justify-content: center; gap: 4px; min-width: 110px; padding: 6px 12px !important;
  background: linear-gradient(180deg, #ffb347 0%, #f07d12 100%) !important; color: #fff !important; border: 3px solid #1b1b1b !important; border-radius: 10px !important;
  font-family: var(--font-title) !important; font-weight: 900 !important; font-size: 0.95rem !important; text-shadow: 1px 1px 0 #1b1b1b; box-shadow: 0 3px 0 #1b1b1b !important; cursor: pointer; }
.hw-btn img { width: 20px; height: 20px; object-fit: contain; }
.hw-btn.on { background: linear-gradient(180deg, #6fdc4f 0%, #2a9a23 100%) !important; }
.hw-btn.ghost { background: linear-gradient(180deg, #8f9aa8 0%, #5d6878 100%) !important; }
#hw-shop .hw-btn { min-width: 190px; padding: 10px 20px !important; font-size: 28px !important; border-radius: 14px !important; }
#hw-shop .hw-btn img { width: 34px; height: 34px; }
.hw-btn:disabled { filter: grayscale(0.7) brightness(0.85); cursor: default; }

#hw-modal { position: fixed; inset: 0; z-index: 1000001; background: rgba(8, 4, 20, 0.72); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fadeIn 0.15s ease-out; }
#hw-modal .hw-card { width: min(380px, 100%); text-align: center; color: #fff; font-family: var(--font-body);
  background: linear-gradient(180deg, #3d2363 0%, #1d0f2e 100%); border: 4px solid #1b1b1b; border-radius: 18px; padding: 18px; box-shadow: 0 8px 0 #1b1b1b, 0 0 40px rgba(255,138,31,0.35); }
#hw-modal h3 { font-family: var(--font-title); font-size: 1.5rem; color: #ffb347; margin: 6px 0; text-shadow: 2px 2px 0 #1b1b1b; }
#hw-modal p { margin: 6px 0 12px; color: #f0e6ff; font-size: 0.98rem; }
#hw-modal canvas { width: 150px; height: 150px; }
#hw-modal .hw-big { width: 110px; height: 110px; object-fit: contain; animation: hwBob 1.6s ease-in-out infinite; }
#hw-modal .hw-row { display: flex; gap: 8px; justify-content: center; }
.hw-days { display: flex; gap: 4px; justify-content: center; margin: 8px 0; }
.hw-days span { display: flex; flex-direction: column; align-items: center; min-width: 40px; padding: 4px 2px; border: 2px solid #1b1b1b; border-radius: 8px; background: #2a1840; font-size: 0.7rem; font-weight: 900; color: #b9a6d6; }
.hw-days span b { font-size: 0.95rem; color: #fff; }
.hw-days span.got { background: #27ae60; } .hw-days span.now { background: #ff8a1f; transform: scale(1.08); }
@keyframes hwBob { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-8px) rotate(4deg); } }

.hw-map-card.hw-locked { filter: grayscale(0.85) brightness(0.8); }
.hw-map-card .difficulty { white-space: nowrap; }
.nudge { animation: hwNudge 0.35s ease; }
@keyframes hwNudge { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.hw-sum-candy { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 6px 0 8px; padding: 6px 10px;
  background: linear-gradient(180deg, #ff9a3d 0%, #d4561a 100%); border: 3px solid #1b1b1b; border-radius: 10px;
  font-family: var(--font-title); font-weight: 900; font-size: 1.05rem; color: #fff; text-shadow: 1px 1px 0 #1b1b1b; }
.hw-sum-candy img { width: 26px; height: 26px; object-fit: contain; }
.hw-sum-candy small { font-family: var(--font-body); font-size: 0.75rem; opacity: 0.9; }

/* ═══ A/B: unlock goals + all agents in the match shop ═══ */
.goal-line { margin-top: 6px; font-size: 26px; font-weight: 800; color: #1f6f2f; background: #e8ffe0; border: 2px solid #1b1b1b; border-radius: 8px; padding: 2px 6px; text-align: center; }
.goal-line span { color: #555; }
#goal-toast { position: fixed; left: 50%; top: 14px; transform: translate(-50%, -140%); z-index: 1000002; display: flex; flex-direction: column; align-items: center;
  background: linear-gradient(180deg, #6fdc4f 0%, #2a9a23 100%); border: 4px solid #1b1b1b; border-radius: 14px; padding: 8px 18px; color: #fff;
  font-family: var(--font-title); font-size: 1.1rem; text-shadow: 1px 1px 0 #1b1b1b; box-shadow: 0 5px 0 #1b1b1b; transition: transform 0.35s cubic-bezier(.2,1.4,.4,1); pointer-events: none; }
#goal-toast span { font-family: var(--font-body); font-size: 0.85rem; font-weight: 800; }
#goal-toast.show { transform: translate(-50%, 0); }
body #app-container.in-game-match .placement-btn.locked { filter: grayscale(1) brightness(0.78); cursor: help; }
body #app-container.in-game-match .placement-btn.locked:hover { transform: none !important; filter: grayscale(0.8) brightness(0.9); }
body #app-container.in-game-match .placement-btn .cost.lock-hint { white-space: normal !important; text-align: center; line-height: 1.15 !important; font-size: max(9.5px, calc(var(--u) * 1.4)) !important; padding: 1px 4px !important; color: #3b2a14 !important; }
body #app-container.in-game-match .placement-btn.nudge { animation: hwNudge 0.35s ease; }
/* 6 map cards during Halloween (Haunted Graveyard added) */
body.hw-on .solo-map-row, body.hw-on .coop-map-row { grid-template-columns: repeat(6, 1fr) !important; gap: 10px !important; }
body.hw-on #lobby-panels .solo-map-row .map-preview-canvas { width: 100% !important; max-width: 150px !important; height: auto !important; aspect-ratio: 4 / 3; }
body.hw-on #lobby-panels .map-card .map-info .name { font-size: 27px !important; line-height: 1.1 !important; white-space: normal !important; }
body.hw-on #lobby-panels .map-card .map-info .difficulty { font-size: 26px !important; white-space: normal !important; }

/* Halloween items stay hidden when the event is off (other rules set display with !important) */
.hw-map-card[hidden], .tab-btn-halloween[hidden], #hw-candy-wrap[hidden] { display: none !important; }

/* ═══════════════ HALLOWEEN MENU SKIN (only while the event is on: body.hw-on) ═══════════════
   Art: assets/halloween/menu/*. All text stays real HTML on top of the art. */
body.hw-on {
  background-color: #1a0b2e !important;
  background-image: url('assets/halloween/menu/bg.webp') !important;
  background-size: cover !important;
  background-position: center center !important;
}
body.hw-on #main-lobby-logo { object-fit: contain !important; }

/* sidebar buttons */
body.hw-on #lobby-tabs .tab-btn {
  background: url('assets/halloween/menu/btn_menu.webp') no-repeat center center / 100% 100% !important;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.45)) !important;
}
body.hw-on #lobby-tabs .tab-btn .tab-label { color: #3a2208 !important; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) !important; }
body.hw-on #lobby-tabs .tab-btn.active {
  background-image: url('assets/halloween/menu/btn_menu_active.webp') !important;
}
body.hw-on #lobby-tabs .tab-btn.active .tab-label { color: #fff !important; text-shadow: 2px 2px 0 #2c0a4f !important; }
body.hw-on #lobby-tabs .tab-btn.tab-btn-coins,
body.hw-on #lobby-tabs .tab-btn.tab-btn-halloween {
  background-image: url('assets/halloween/menu/btn_menu_special.webp') !important;
}
body.hw-on #lobby-tabs .tab-btn.tab-btn-coins .tab-label,
body.hw-on #lobby-tabs .tab-btn.tab-btn-halloween .tab-label { color: #fff !important; text-shadow: 2px 2px 0 #7a2e00 !important; }
body.hw-on #lobby-tabs .tab-btn.tab-btn-coins.active,
body.hw-on #lobby-tabs .tab-btn.tab-btn-halloween.active {
  background-image: url('assets/halloween/menu/btn_menu_active.webp') !important;
}
/* the new buttons have no painted arrow, so draw one */
body.hw-on #lobby-tabs .tab-arrow-slot { position: relative; width: 22px; flex: 0 0 22px; }
body.hw-on #lobby-tabs .tab-arrow-slot::after {
  content: '›'; position: absolute; right: 0; top: 50%; transform: translateY(-54%);
  font: 900 34px/1 var(--font-title); color: inherit;
}
body.hw-on #lobby-tabs .tab-btn .tab-arrow-slot { color: #3a2208; }
body.hw-on #lobby-tabs .tab-btn.active .tab-arrow-slot,
body.hw-on #lobby-tabs .tab-btn.tab-btn-coins .tab-arrow-slot,
body.hw-on #lobby-tabs .tab-btn.tab-btn-halloween .tab-arrow-slot { color: #fff; }
/* candy count shown on the Halloween button */
/* little bubble on the button's top-right corner, so the label keeps its full width */
#lobby-tabs .tab-btn-halloween .hw-tab-candy {
  position: absolute; right: -8px; top: -16px; z-index: 3;
  display: flex; align-items: center; gap: 4px;
  padding: 3px 10px 3px 5px; border-radius: 16px;
  background: #3b0e5e; border: 2px solid #ffb347; box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5);
  font: 900 26px/1 var(--font-title); color: #fff; white-space: nowrap;
}
#lobby-tabs .tab-btn-halloween .hw-tab-candy img { width: 28px; height: 28px; object-fit: contain; }

/* header pieces: same art, shifted from blue to purple */
body.hw-on #cg-profile-widget,
body.hw-on .hud-level-badge,
body.hw-on .hud-xp-track,
body.hw-on #btn-lobby-back {
  filter: hue-rotate(58deg) saturate(1.15) drop-shadow(0 5px 10px rgba(0, 0, 0, 0.45)) !important;
}
body.hw-on .player-meta-box .hud-label {
  color: #fff !important;
  text-shadow: -2px -2px 0 #2c0a4f, 2px -2px 0 #2c0a4f, -2px 2px 0 #2c0a4f, 2px 2px 0 #2c0a4f, 0 3px 6px rgba(0, 0, 0, 0.8) !important;
}

/* main panel frame */
body.hw-on #lobby-panels {
  border-color: #ff8a1f !important;
  background-color: #1d0c35 !important;
  box-shadow: 0 0 0 3px #2a0d00, 0 0 24px rgba(255, 138, 31, 0.55), inset 0 0 20px rgba(0, 0, 0, 0.5) !important;
}
/* gameplay-mode splash: full Halloween scene, title + buttons on the calm ground area */
body.hw-on .splash-art-backdrop {
  transform: none !important;  /* the normal art is shifted up 175px; this scene is framed to fit as-is */
  background: #1d0c35 url('assets/halloween/menu/panel_art.webp') no-repeat 50% 80% / 125% auto !important;
}
body.hw-on .splash-curve-svg { display: none !important; }
body.hw-on .splash-curved-podium {
  background: linear-gradient(180deg, rgba(29, 12, 53, 0) 0%, rgba(29, 12, 53, 0.55) 45%, rgba(20, 8, 38, 0.85) 100%) !important;
}
body.hw-on .splash-title-img { filter: hue-rotate(-18deg) saturate(1.25) drop-shadow(0 6px 10px rgba(0, 0, 0, 0.6)) !important; }
body.hw-on .splash-subtext { color: #fff !important; text-shadow: 2px 2px 0 #1a0630, 0 0 10px rgba(0, 0, 0, 0.8) !important; }
body.hw-on .btn-splash-solo {
  background: url('assets/halloween/menu/btn_green.webp') no-repeat center center / 100% 100% !important;
  text-shadow: 2px 2px 0 #0d4a12 !important;
}
body.hw-on .btn-splash-coop {
  background: url('assets/halloween/menu/btn_purple.webp') no-repeat center center / 100% 100% !important;
  text-shadow: 2px 2px 0 #2c0a4f !important;
}
/* blue sprite-based pieces (images, so the colour rewrite can't reach them): shift to purple */
body.hw-on .solo-pill-badge,
body.hw-on .solo-section-tab,
body.hw-on .btn-solo-back-action,
body.hw-on .btn-diff-back,
body.hw-on .diff-banner-strip,
body.hw-on .prep-top-banner,
body.hw-on .diff-badge-container,
body.hw-on #btn-join-coop,
body.hw-on #btn-refresh-servers,
body.hw-on .coop-btn-change-mode,
body.hw-on .coop-header-title-img { filter: hue-rotate(58deg) saturate(1.1) !important; }
