/* ========================================
   BATTLE SYSTEM V2 - TokenLordsRPG
   Clean, Modern UI
   ======================================== */

/* ========================================
   BODY LAYOUT OVERRIDE FOR BATTLE PAGE
   Override login.css centered layout
   ======================================== */
body:has(.battle-hub),
body:has(.battle-arena),
body:has(.class-selection),
body:has(.pre-battle-overlay) {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
  min-height: 100vh;
}

/* Ensure content takes full width */
.content:has(.battle-hub),
.content:has(.battle-arena),
.content:has(.class-selection),
.content:has(.pre-battle-overlay) {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 2rem clamp(1.5rem, 5vw, 3rem);
  overflow-y: auto;
}

/* Battle hub should take full width */
.battle-hub {
  width: 100%;
}

/* ========================================
   FONT IMPORT - Orbitron for Headers
   ======================================== */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&display=swap');

/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
  --energy-color: #00d9ff;
  --health-player: #22c55e;
  --health-enemy: #ef4444;
  --elite-glow: #a855f7;
  --fire: #f97316;
  --water: #3b82f6;
  --earth: #84cc16;
  --air: #a78bfa;
  --gold: #fbbf24;
  --bronze: #cd7f32;
  --xp-color: #22d3ee;
  --surface: rgba(20, 25, 35, 0.95);
  --surface-light: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.1);
  --text: #f8fbff;
  --text-muted: rgba(255, 255, 255, 0.6);
  --primary: #3b82f6;
  --text-bright: #ffffff;
  --tl-primary: #f7a00f;
}

/* ========================================
   TOP BAR - Page Header
   ======================================== */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.top-bar-line {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  line-height: 1;
  padding: 0.5rem 1.2rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2rem;
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.58);
}

.header-divider {
  opacity: 0.45;
}

.page-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.05rem, 1.8vw, 1.4rem);
  color: var(--tl-primary);
  letter-spacing: 0.4rem;
  text-transform: uppercase;
}

/* Ensure all interactive elements are properly clickable */
button,
.btn,
.class-card,
.skill-btn,
.adventure-level-btn {
  position: relative;
  z-index: 1;
}

/* ========================================\n   ADVENTURE PANEL - AAA+ GAME UI\n   ======================================== */\n.adventure-panel {\n  padding: 16px;\n}\n\n.adventure-panel h3 {\n  font-family: 'Orbitron', sans-serif;\n  font-size: 1rem;\n  margin: 0 0 12px 0;\n  color: var(--gold);\n  letter-spacing: 1px;\n  display: flex;\n  align-items: center;\n  gap: 8px;\n}\n\n/* LOCKED ADVENTURE PANEL */\n.adventure-panel.adventure-locked {\n  position: relative;\n  min-height: 120px;\n}\n\n.adventure-panel.adventure-locked h3 {\n  opacity: 0.5;\n}\n\n.adventure-locked-overlay {\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  padding: 1.5rem;\n  text-align: center;\n}\n\n.adventure-locked-overlay .locked-icon {\n  font-size: 2.5rem;\n  margin-bottom: 0.75rem;\n  opacity: 0.8;\n}\n\n.adventure-locked-overlay .locked-text {\n  font-family: 'Orbitron', sans-serif;\n  font-size: 1.1rem;\n  font-weight: 700;\n  color: rgba(255, 255, 255, 0.7);\n  text-transform: uppercase;\n  letter-spacing: 0.1em;\n  margin-bottom: 0.5rem;\n}\n\n.adventure-locked-overlay .locked-subtext {\n  font-size: 0.85rem;\n  color: rgba(255, 255, 255, 0.5);\n}\n\n.adventure-clues {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.85rem;
}

.adventure-clues .clue-icon {
  font-size: 1.1rem;
}

.adventure-clues strong {
  color: var(--gold);
  font-family: 'Orbitron', sans-serif;
}

/* Adventure Cards Grid */
.adventure-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.adventure-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.2s cubic-bezier(.2,.8,.2,1),
              border-color 0.2s ease,
              box-shadow 0.2s cubic-bezier(.2,.8,.2,1);
  cursor: pointer;
}

.adventure-card:hover:not(.locked) {
  transform: translateY(-5px);
  border-color: hsla(38, 90%, 65%, 0.5);
  box-shadow: 
    0 12px 32px rgba(0, 0, 0, 0.4),
    0 0 20px hsla(38, 90%, 65%, 0.25);
}

.adventure-card:active:not(.locked) {
  transform: translateY(-2px) scale(0.98);
  box-shadow: 
    0 6px 16px rgba(0, 0, 0, 0.3),
    0 0 12px hsla(38, 90%, 65%, 0.2);
}

.adventure-card.locked {
  filter: grayscale(0.5);
  opacity: 0.8;
}

.adventure-card-image {
  position: relative;
  height: 90px;
  background-size: cover;
  background-position: center;
}

.adventure-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.2) 50%, transparent 100%);
}

.adventure-card-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 8px;
  background: var(--accent, var(--gold));
  color: #000;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.adventure-lock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.adventure-lock-overlay .lock-icon {
  font-size: 1.5rem;
  opacity: 0.8;
}

.adventure-card-content {
  padding: 10px;
}

.adventure-card-title {
  margin: 0 0 6px 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.adventure-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.adventure-meta-item {
  font-size: 0.65rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 3px;
}

.adventure-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.adventure-cost {
  font-size: 0.7rem;
  font-weight: 600;
}

.adventure-cost.affordable {
  color: var(--gold);
}

.adventure-cost.expensive {
  color: var(--text-muted);
}

.adventure-start-btn {
  padding: 6px 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--accent, var(--gold));
  color: #000;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.adventure-start-btn:hover:not(.disabled) {
  transform: scale(1.05);
  box-shadow: 0 0 15px var(--accent, var(--gold));
}

.adventure-start-btn.disabled {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Active Adventure Card */
.active-adventure-card {
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--accent, var(--gold));
  box-shadow: 0 0 20px rgba(var(--accent, 251, 191, 36), 0.15);
}

.active-adventure-card .adventure-card-image {
  height: 120px;
}

.active-adventure-card .adventure-card-content {
  padding: 16px;
}

.active-adventure-card .adventure-card-title {
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--accent, var(--gold));
}

.adventure-card-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.adventure-progress-track {
  flex: 1;
  height: 8px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  overflow: hidden;
}

.adventure-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
  box-shadow: 0 0 10px currentColor;
}

.adventure-progress-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 36px;
  text-align: right;
}

.adventure-card-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.adventure-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}

.adventure-stat-icon {
  font-size: 1rem;
}

.adventure-stat-value {
  color: var(--text);
}

.ready-pulse {
  color: #22c55e;
  font-weight: 600;
  animation: ready-pulse 1.5s ease infinite;
}

@keyframes ready-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.adventure-claim-btn {
  width: 100%;
  padding: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  animation: claim-glow 2s ease infinite;
}

@keyframes claim-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(34, 197, 94, 0.4); }
  50% { box-shadow: 0 0 30px rgba(34, 197, 94, 0.7); }
}

.adventure-claim-btn:hover {
  transform: scale(1.02);
}

/* Legacy styles kept for backward compat */
.adventure-levels {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.adventure-levels .adventure-level-btn {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 4px 12px;
  padding: 14px 16px;
  background: var(--surface-light);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  color: var(--text);
}

.adventure-levels .adventure-level-btn:hover:not(.disabled) {
  border-color: var(--gold);
  background: rgba(251, 191, 36, 0.08);
}

.adventure-levels .adventure-level-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.adventure-levels .level-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.adventure-levels .level-cost {
  color: var(--gold);
  font-weight: 600;
  text-align: right;
}

.adventure-levels .level-duration {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.adventure-levels .level-chests {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: right;
}

.clue-count {
  margin: 12px 0 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

.active-adventure {
  text-align: left;
  border-radius: 12px;
  overflow: hidden;
}

.active-adventure.ready {
  animation: readyPulse 2s ease-in-out infinite;
}

@keyframes readyPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50% { box-shadow: 0 0 20px 5px rgba(34, 197, 94, 0.2); }
}

.active-adventure-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid;
  border-radius: 12px;
  margin-bottom: 16px;
}

.active-adventure-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.active-adventure-info {
  flex: 1;
}

.active-adventure-info h4 {
  margin: 0 0 4px 0;
  font-size: 1.1rem;
  color: var(--text);
  font-family: 'Orbitron', sans-serif;
}

.active-adventure-level {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.active-adventure-chests {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
}

.active-adventure-chests .chest-count {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--gold);
}

.active-adventure-chests .chest-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.active-adventure-progress {
  margin-bottom: 16px;
}

.progress-bar-container {
  position: relative;
  height: 12px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s ease;
}

.progress-shimmer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.progress-percent {
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--text);
}

.progress-time {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: 'IBM Plex Mono', monospace;
}

.adventure-claim-btn {
  width: 100%;
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.adventure-claim-btn.pulse {
  animation: claimPulse 1.5s ease-in-out infinite;
}

@keyframes claimPulse {
  0%, 100% { 
    transform: scale(1);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
  }
  50% { 
    transform: scale(1.02);
    box-shadow: 0 8px 30px rgba(34, 197, 94, 0.5);
  }
}

.adventure-claim-btn:disabled {
  background: var(--surface-light);
  color: var(--text-muted);
  cursor: not-allowed;
  animation: none;
}

/* ========================================
   LAYOUT & GRID
   ======================================== */
.hub-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  align-items: start;
}

.hub-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hub-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (max-width: 900px) {
  .hub-grid {
    grid-template-columns: 1fr;
  }
  
  .hub-left {
    order: 2;
  }
  
  .hub-right {
    order: 1;
  }
}

/* ========================================
   LOADING STATE
   ======================================== */
.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  gap: 16px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-overlay p {
  color: var(--text-muted);
  margin-top: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.hidden {
  display: none !important;
}

/* ========================================
   CLASS SELECTION
   ======================================== */
.class-selection {
  text-align: center;
  padding: 20px 0;
}

.class-selection h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.75rem;
  margin-bottom: 8px;
  color: var(--gold);
  letter-spacing: 2px;
}

.class-selection > p {
  color: var(--text-muted);
  margin-bottom: 12px;
}

.class-warning {
  color: #f97316;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 32px;
  padding: 10px 20px;
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.3);
  border-radius: 8px;
  display: inline-block;
}

.class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  max-width: 1000px;
  margin: 0 auto;
}

.class-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  color: var(--text);
  position: relative;
  overflow: hidden;
}

.class-info-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 10;
}

.class-info-btn:hover {
  opacity: 1;
  transform: scale(1.2);
}

.class-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.class-card:hover {
  border-color: var(--gold);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(251, 191, 36, 0.15);
}

.class-card:hover::before {
  opacity: 1;
}

.class-card:active {
  transform: translateY(-2px);
  background: rgba(251, 191, 36, 0.05);
}

.class-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 10px rgba(255,255,255,0.2));
}

.class-card h3 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
  margin: 0 0 8px 0;
  color: var(--text);
  letter-spacing: 1px;
}

.class-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 16px 0;
  min-height: 2.4em;
  line-height: 1.4;
}

.class-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'IBM Plex Mono', monospace;
}

.class-stats span {
  background: var(--surface-light);
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.05);
}

/* ========================================
   BATTLE HUB
   ======================================== */
.battle-hub {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Stage Header */
.stage-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.stage-header {
  text-align: center;
}

.stage-header h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  margin: 0 0 8px 0;
  color: var(--text);
  letter-spacing: 2px;
}

/* Compact Element Hint */
.element-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 6px 12px;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.15);
  border-radius: 8px;
  margin-bottom: 12px;
}

.element-hint.hidden {
  display: none;
}

.element-hint #hint-icon {
  font-size: 1rem;
}

/* Button energy badge */
.btn-energy {
  background: rgba(0, 217, 255, 0.2);
  color: var(--energy-color);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  margin-left: 8px;
}

.stage-energy {
  font-size: 0.85rem;
  color: var(--energy-color);
  margin: 0 0 12px 0;
  font-family: 'IBM Plex Mono', monospace;
}

/* ========================================
   BOUNTY BOARD
   ======================================== */
.bounty-board {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.bounty-board h4 {
  margin: 0 0 12px 0;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  color: var(--gold);
  letter-spacing: 1px;
}

.bounty-row {
  display: grid;
  grid-template-columns: 90px 1fr 60px;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.bounty-row:last-of-type {
  border-bottom: none;
}

.bounty-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  font-family: 'Orbitron', sans-serif;
  padding: 3px 8px;
  border-radius: 4px;
  text-align: center;
}

/* Bounty label colors */
.bounty-easy .bounty-label {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.bounty-medium .bounty-label {
  background: rgba(234, 179, 8, 0.2);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.bounty-hard .bounty-label {
  background: rgba(249, 115, 22, 0.2);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.bounty-super .bounty-label {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.bounty-bar {
  height: 10px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}

.bounty-fill {
  height: 100%;
  transition: width 0.4s ease;
  border-radius: 5px;
}

.bounty-easy .bounty-fill {
  background: linear-gradient(90deg, #22c55e, #4ade80);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.bounty-medium .bounty-fill {
  background: linear-gradient(90deg, #eab308, #facc15);
  box-shadow: 0 0 8px rgba(234, 179, 8, 0.5);
}

.bounty-hard .bounty-fill {
  background: linear-gradient(90deg, #f97316, #fb923c);
  box-shadow: 0 0 8px rgba(249, 115, 22, 0.5);
}

.bounty-super .bounty-fill {
  background: linear-gradient(90deg, #ef4444, #f87171);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.bounty-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'IBM Plex Mono', monospace;
  text-align: right;
}

.bounty-row.complete .bounty-count {
  color: #22c55e;
}

.bounty-row.complete .bounty-count::after {
  content: ' ✓';
}

.bounty-hint {
  margin: 12px 0 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
}

.bounty-hint.stage-ready {
  color: var(--gold);
  font-weight: 600;
  font-style: normal;
}

/* Disabled button - claim rewards to continue */
.btn-disabled,
.start-fight-btn.btn-disabled {
  background: linear-gradient(135deg, #4a4a4a, #3a3a3a) !important;
  color: var(--text-muted) !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  opacity: 0.8;
  font-size: 0.85rem;
}

.btn-disabled:hover,
.start-fight-btn.btn-disabled:hover {
  transform: none !important;
  box-shadow: none !important;
  background: linear-gradient(135deg, #4a4a4a, #3a3a3a) !important;
}

/* =====================================================
   STAGE ENERGY BAR - Below Start Fight Button
   Simple Clean Design - Enhanced visibility
   ===================================================== */
.stage-energy-bar {
  --energy-color: #00d4ff;
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(0, 20, 40, 0.7), rgba(0, 40, 80, 0.5));
  border-radius: 12px;
  border: 2px solid rgba(0, 212, 255, 0.4);
  position: relative;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.15);
}

.stage-energy-bar .energy-bar-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  position: relative;
  z-index: 1;
}

.stage-energy-bar .energy-icon {
  font-size: 1.3rem;
  filter: drop-shadow(0 0 4px rgba(0, 212, 255, 0.6));
}

.stage-energy-bar .energy-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--energy-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stage-energy-bar .energy-count {
  margin-left: auto;
  font-size: 1rem;
  font-weight: 700;
  color: var(--energy-color);
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

.stage-energy-bar .energy-bar-track {
  height: 16px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Remove the electric border - we're using simple design */
.stage-energy-bar .energy-bar-electric-border {
  display: none;
}

.stage-energy-bar .energy-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, 
    #0066cc 0%, 
    #00aaff 50%, 
    #00d4ff 100%);
  background-size: 200% 100%;
  border-radius: 7px;
  transition: width 0.3s ease;
  position: relative;
  overflow: hidden;
  animation: energy-slow-shimmer 8s ease-in-out infinite;
}

@keyframes energy-slow-shimmer {
  0%, 100% { background-position: 0% 0; }
  50% { background-position: 100% 0; }
}

/* Subtle inner glow */
.stage-energy-bar .energy-bar-fill::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 50%);
  border-radius: 7px;
}

/* Remove the spark dot at end */
.stage-energy-bar .energy-bar-fill::after {
  display: none;
}

/* Low energy state */
.stage-energy-bar .energy-bar-fill.low-energy {
  background: linear-gradient(90deg, #dc2626 0%, #ef4444 50%, #f87171 100%);
  animation: energy-slow-shimmer 4s ease-in-out infinite;
}

/* Energy Refill Button */
.energy-refill-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.6rem 1rem;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(0, 170, 255, 0.1));
  border: 2px solid rgba(0, 212, 255, 0.4);
  border-radius: 8px;
  color: var(--electric-color, #00d4ff);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  z-index: 1;
}

.energy-refill-btn:hover {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.25), rgba(0, 170, 255, 0.2));
  transform: translateY(-2px);
  box-shadow: 
    0 0 15px rgba(0, 212, 255, 0.4),
    0 0 30px rgba(0, 212, 255, 0.2);
}

.energy-refill-btn:active {
  transform: scale(0.98);
}

/* Low Energy Glow Animation - Shows when energy < 30% */
.energy-refill-btn.low-energy {
  animation: electric-button-pulse 1s ease-in-out infinite;
  border-color: rgba(0, 212, 255, 0.8);
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.3), rgba(0, 170, 255, 0.2));
}

@keyframes electric-button-pulse {
  0%, 100% {
    box-shadow: 0 0 5px rgba(0, 212, 255, 0.4),
                0 0 10px rgba(0, 212, 255, 0.2);
  }
  50% {
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.8),
                0 0 30px rgba(0, 212, 255, 0.5),
                0 0 45px rgba(0, 212, 255, 0.3);
  }
}

/* Also apply to inline refill button in player panel */
.refill-energy-btn-inline.low-energy {
  animation: electric-button-pulse 1s ease-in-out infinite;
  border-color: rgba(0, 212, 255, 0.8) !important;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.3), rgba(0, 170, 255, 0.2)) !important;
}

/* Low energy bar visual indicator */
.energy-bar-fill.low-energy,
.energy-fill-mini.low-energy {
  animation: energy-bar-low-pulse 0.8s ease-in-out infinite;
}

@keyframes energy-bar-low-pulse {
  0%, 100% {
    opacity: 1;
    filter: brightness(1);
  }
  50% {
    opacity: 0.8;
    filter: brightness(1.3);
  }
}

.energy-refill-btn .refill-icon {
  font-size: 1rem;
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.8);
}

.energy-refill-btn .refill-text {
  letter-spacing: 0.5px;
}

/* Mobile energy bar */
@media (max-width: 600px) {
  .stage-energy-bar {
    padding: 0.5rem 0.75rem;
    margin-top: 0.5rem;
  }
  
  .stage-energy-bar .energy-bar-header {
    margin-bottom: 0.35rem;
  }
  
  .stage-energy-bar .energy-icon {
    font-size: 1rem;
  }
  
  .stage-energy-bar .energy-label {
    font-size: 0.75rem;
  }
  
  .stage-energy-bar .energy-count {
    font-size: 0.8rem;
  }
  
  .stage-energy-bar .energy-bar-track {
    height: 10px;
  }
  
  .energy-refill-btn {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }
  
  .energy-refill-btn .refill-icon {
    font-size: 0.9rem;
  }
}

/* =====================================================
   KILL RANK INFO
   Shows player's rank by kills below Start Fight button
   ===================================================== */
.kill-rank-info {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
}

.rank-progress {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rank-current {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.rank-trophy {
  font-size: 1.1rem;
}

.rank-text strong {
  color: var(--tl-primary);
  font-weight: 600;
}

.kills-count {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
}

.rank-target {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding-left: 0.25rem;
  line-height: 1.4;
}

.rank-arrow {
  font-size: 0.9rem;
  flex-shrink: 0;
}

.rank-target strong {
  color: #22c55e;
}

.rank-target .player-name {
  color: #60a5fa;
  font-style: italic;
}

.rank-threats {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.threat-icon {
  font-size: 1rem;
  animation: threat-pulse 2s ease-in-out infinite;
}

@keyframes threat-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.threat-text {
  color: #f59e0b;
}

.threat-text strong {
  color: #ef4444;
}

/* Training Grounds specific */
.bounty-board.training-mode .bounty-row.bounty-medium,
.bounty-board.training-mode .bounty-row.bounty-hard,
.bounty-board.training-mode .bounty-row.bounty-super {
  display: none;
}

.bounty-board.training-mode h4::after {
  content: ' (Tutorial)';
  color: var(--text-muted);
  font-weight: normal;
}

.stage-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.progress-bar {
  width: 100%;
  max-width: 400px;
  height: 6px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #fff);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
  transition: width 0.3s ease;
}

#stage-progress-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: 'IBM Plex Mono', monospace;
}

/* Strategy Warning */
.strategy-warning {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(251, 191, 36, 0.05);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.strategy-warning.warning-good {
  background: rgba(34, 197, 94, 0.05);
  border-color: rgba(34, 197, 94, 0.2);
}

.strategy-warning.warning-bad {
  background: rgba(239, 68, 68, 0.05);
  border-color: rgba(239, 68, 68, 0.2);
}

.warning-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.warning-text {
  flex: 1;
}

.warning-text strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 4px;
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 1px;
}

.warning-text p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.equipped-element {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.element-badge {
  background: var(--surface-light);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.element-badge.element-fire {
  background: rgba(249, 115, 22, 0.15);
  border-color: rgba(249, 115, 22, 0.3);
  color: #fdba74;
}

.element-badge.element-water {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}

.element-badge.element-earth {
  background: rgba(132, 204, 22, 0.15);
  border-color: rgba(132, 204, 22, 0.3);
  color: #bef264;
}

.element-badge.element-air {
  background: rgba(167, 139, 250, 0.15);
  border-color: rgba(167, 139, 250, 0.3);
  color: #d8b4fe;
}

/* Player Panel */
.player-panel {
  padding: 20px;
}

.player-info {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.player-identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* Class box with level number inside */
.player-class-box {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--surface-light), var(--surface));
  border-radius: 12px;
  border: 2px solid #f7a00f;
  box-shadow: 0 4px 12px rgba(247, 160, 15, 0.3);
}

.class-level {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  font-weight: bold;
  color: #f7a00f;
  text-shadow: 0 0 10px rgba(247, 160, 15, 0.5);
}

.player-class {
  font-size: 2rem;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-light);
  border-radius: 10px;
  border: 1px solid var(--border);
}

/* Level Badge - Yellow circle below class icon */
.level-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f7a00f, #ffd700);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(247, 160, 15, 0.4);
}

.level-badge .level-number {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  font-weight: bold;
  color: #1a1a2e;
}

.player-details {
  flex: 1;
}

.player-details h3 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
  margin: 0 0 8px 0;
  letter-spacing: 1px;
}

/* Inline XP Progress Bar */
.player-xp-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.xp-bar-mini {
  flex: 1;
  height: 8px;
  background: var(--surface-light);
  border-radius: 4px;
  overflow: hidden;
}

.xp-fill-mini {
  height: 100%;
  background: linear-gradient(90deg, #f7a00f, #ffd700);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.xp-text-mini {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'IBM Plex Mono', monospace;
  white-space: nowrap;
}

/* Energy Bar - Compact inline version (directly below XP) */
.energy-inline {
  margin-top: 6px;
}

.energy-inline .energy-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.energy-inline .energy-label {
  font-size: 0.7rem;
  color: var(--energy-color);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.energy-inline .energy-timer-mini {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: 'IBM Plex Mono', monospace;
}

.energy-bar-mini {
  height: 6px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 3px;
}

.energy-fill-mini {
  height: 100%;
  background: linear-gradient(90deg, var(--energy-color), #00ffd5);
  box-shadow: 0 0 8px var(--energy-color);
  transition: width 0.3s ease;
}

.energy-text-mini {
  display: block;
  text-align: right;
  font-size: 0.7rem;
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
}

/* Adventure Clues Display */
.adventure-clues {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(247, 160, 15, 0.1);
  border-radius: 8px;
  margin-bottom: 12px;
}

.adventure-clues .clue-icon {
  font-size: 1.1rem;
}

.adventure-clues .clue-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.adventure-clues .clue-count strong {
  color: #f7a00f;
  font-weight: 600;
}

.player-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-item {
  background: var(--surface-light);
  padding: 10px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.03);
}

.stat-label {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
}

/* Secondary Stats */
.secondary-stats {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px;
  background: rgba(0,0,0,0.15);
  border-radius: 8px;
}

.sec-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.sec-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sec-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  font-family: 'IBM Plex Mono', monospace;
}

/* Equipped Elements Breakdown */
.elements-breakdown {
  margin-bottom: 16px;
  padding: 10px;
  background: rgba(0,0,0,0.15);
  border-radius: 8px;
}

.elements-title {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.element-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.elem-icon {
  width: 18px;
  font-size: 0.9rem;
}

.elem-bar-track {
  flex: 1;
  height: 5px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}

.elem-bar-fill {
  height: 100%;
  transition: width 0.3s ease;
}

.elem-bar-fill.fire { background: linear-gradient(90deg, #ff6b35, #ff4500); }
.elem-bar-fill.water { background: linear-gradient(90deg, #00b4d8, #0088ff); }
.elem-bar-fill.earth { background: linear-gradient(90deg, #cd853f, #8b5a2b); }
.elem-bar-fill.air { background: linear-gradient(90deg, #e0e0e0, #a0a0a0); }

.elem-pct {
  font-size: 0.7rem;
  font-weight: 600;
  min-width: 30px;
  text-align: right;
  font-family: 'IBM Plex Mono', monospace;
}

.elem-row:nth-child(1) .elem-pct { color: #ff6b35; }
.elem-row:nth-child(2) .elem-pct { color: #00b4d8; }
.elem-row:nth-child(3) .elem-pct { color: #cd853f; }
.elem-row:nth-child(4) .elem-pct { color: #e0e0e0; }

/* XP Bar */
.xp-container {
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  padding: 12px;
}

.xp-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--xp-color), #06b6d4);
  transition: width 0.5s ease;
}

.xp-text {
  display: block;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'IBM Plex Mono', monospace;
}

/* Energy Bar - Inline version (inside player panel) */
.energy-container-inline {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.energy-container-inline .energy-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.energy-container-inline .energy-header span:first-child {
  color: var(--energy-color);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.75rem;
}

.energy-container-inline #energy-timer {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: 'IBM Plex Mono', monospace;
}

.energy-container-inline .energy-bar {
  height: 8px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}

.energy-container-inline .energy-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--energy-color), #00ffd5);
  box-shadow: 0 0 12px var(--energy-color);
  transition: width 0.3s ease;
}

.energy-container-inline .energy-text {
  display: block;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text);
  font-weight: 600;
  font-family: 'IBM Plex Mono', monospace;
}

/* Energy Bar */
.energy-container {
  padding: 16px;
}

.energy-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.85rem;
}

.energy-header span:first-child {
  color: var(--energy-color);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.75rem;
}

#energy-timer {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: 'IBM Plex Mono', monospace;
}

.energy-bar {
  height: 8px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.energy-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--energy-color), #00ffd5);
  box-shadow: 0 0 12px var(--energy-color);
  transition: width 0.3s ease;
}

.energy-text {
  display: block;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 600;
  font-family: 'IBM Plex Mono', monospace;
}

/* Skills Preview */
.skills-preview {
  padding: 16px 0 0 0;
  margin-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.stage-card .skills-preview {
  padding: 0;
  margin-top: 20px;
  padding-top: 20px;
}

/* Skills Preview Inline (in player panel) */
.skills-preview-inline {
  padding: 16px 0 0 0;
  margin-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.skills-preview-inline h4 {
  margin: 0 0 12px 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.skills-preview h4 {
  margin: 0 0 12px 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.skills-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: 8px;
}

.skill-preview-item {
  background: var(--surface-light);
  padding: 10px 6px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.05);
}

.skill-preview-item .skill-icon {
  font-size: 1.25rem;
  display: block;
  margin-bottom: 4px;
}

.skill-preview-item .skill-name {
  color: var(--text-muted);
  font-size: 0.65rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Skill Locking & Info */
.skill-preview-item.locked {
  opacity: 0.5;
  filter: grayscale(100%);
  cursor: not-allowed;
  border-style: dashed;
}

/* =====================================================
   CLASS PASSIVES SECTION
   ===================================================== */
.passives-preview-inline {
  padding: 16px 0 0 0;
  margin-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.passives-header {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin-bottom: 10px;
}

.passives-header h4 {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.passives-summary {
  font-size: 0.7rem;
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.expand-icon {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.passive-bonuses-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.passive-bonus {
  font-size: 0.65rem;
  padding: 3px 6px;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: 4px;
  color: #4ade80;
}

.next-passive-unlock {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 8px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.next-passive-label {
  color: #9ca3af;
}

.next-passive-name {
  color: #fbbf24;
  font-weight: 600;
}

.next-passive-level {
  color: #6b7280;
  margin-left: 4px;
}

.passives-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 4px;
}

.passive-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.passive-item.unlocked {
  border-color: rgba(74, 222, 128, 0.2);
}

.passive-item.locked {
  opacity: 0.5;
  border-style: dashed;
}

.passive-item.mythic {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(139, 92, 246, 0.05));
  border-color: rgba(168, 85, 247, 0.3);
}

.passive-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.passive-info {
  flex: 1;
  min-width: 0;
}

.passive-name {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.passive-desc {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.passive-unlock-req {
  display: block;
  font-size: 0.65rem;
  color: #fbbf24;
  font-style: italic;
  margin-top: 4px;
}

/* ============================================
   ENHANCED PASSIVE SKILL DISPLAY
   ============================================ */

/* Info button in header */
.passives-info-btn {
  cursor: pointer;
  font-size: 0.75rem;
  opacity: 0.6;
  transition: opacity 0.2s;
  margin-left: 4px;
}

.passives-info-btn:hover {
  opacity: 1;
}

/* How Passives Work tooltip */
.passives-info-tooltip {
  background: rgba(30, 30, 40, 0.95);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  font-size: 0.7rem;
  animation: fadeInUp 0.2s ease-out;
}

.info-tooltip-header {
  font-weight: 600;
  color: #c084fc;
  margin-bottom: 8px;
  font-size: 0.75rem;
}

.info-tooltip-list {
  margin: 0;
  padding: 0 0 0 16px;
  color: var(--text-muted);
  line-height: 1.6;
}

.info-tooltip-list li {
  margin-bottom: 4px;
}

.info-tooltip-list strong {
  color: var(--text-primary);
}

.info-tooltip-types {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.type-badge {
  font-size: 0.6rem;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.type-badge.stat-bonus {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.type-badge.conditional {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.type-badge.proc {
  background: rgba(251, 146, 60, 0.15);
  color: #fb923c;
  border: 1px solid rgba(251, 146, 60, 0.3);
}

.type-badge.mythic {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

/* Level badge on passive items */
.passive-level-badge {
  width: 28px;
  height: 28px;
  min-width: 28px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.passive-item.unlocked .passive-level-badge {
  background: rgba(74, 222, 128, 0.15);
  border-color: rgba(74, 222, 128, 0.3);
}

.passive-item.locked .passive-level-badge {
  background: rgba(100, 100, 100, 0.2);
}

.passive-item.mythic .passive-level-badge {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(236, 72, 153, 0.2));
  border-color: rgba(168, 85, 247, 0.4);
}

.passive-level-badge .level-num {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
}

.passive-item.unlocked .passive-level-badge .level-num {
  color: #4ade80;
}

.passive-item.mythic .passive-level-badge .level-num {
  color: #c084fc;
}

/* Passive name row with type badge */
.passive-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.passive-type-badge {
  font-size: 0.55rem;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

/* Effect details styling */
.passive-effect-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.effect-detail-line {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.4;
}

.passive-item.unlocked .effect-detail-line {
  color: rgba(255, 255, 255, 0.85);
}

.passive-item.locked .effect-detail-line {
  color: rgba(255, 255, 255, 0.5);
}

.passive-item.mythic .effect-detail-line {
  color: rgba(192, 132, 252, 0.9);
}

/* Update passive item layout for new structure */
.passive-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s;
}

.passive-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.passive-item.unlocked {
  border-color: rgba(74, 222, 128, 0.2);
  background: rgba(74, 222, 128, 0.03);
}

.passive-item.locked {
  opacity: 0.7;
  border-style: dashed;
}

.passive-item.mythic {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.08), rgba(236, 72, 153, 0.05));
  border-color: rgba(168, 85, 247, 0.3);
  border-width: 2px;
}

.passive-item.mythic.unlocked {
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.2);
}

/* Expanded passives list */
.passives-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 350px;
  overflow-y: auto;
  padding-right: 4px;
  margin-top: 8px;
}

.passives-list::-webkit-scrollbar {
  width: 4px;
}

.passives-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.passives-list::-webkit-scrollbar-thumb {
  background: rgba(168, 85, 247, 0.3);
  border-radius: 4px;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =====================================================
   PASSIVE SKILLS BUTTON & POPUP
   ===================================================== */

/* Check Passive Skills Button */
.passive-skills-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  margin-top: 16px;
  background: #111;
  border: 1px solid rgba(249, 115, 22, 0.4);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.passive-skills-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(249, 115, 22, 0.2), transparent);
  transition: left 0.5s ease;
}

.passive-skills-btn:hover::before {
  left: 100%;
}

.passive-skills-btn:hover {
  background: #1a1a1a;
  border-color: rgba(249, 115, 22, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.passive-skills-btn .btn-icon {
  font-size: 1.2rem;
  animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.2); }
}

.passive-skills-btn .btn-text {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fdba74;
  text-align: left;
}

.passive-skills-btn .btn-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  background: rgba(74, 222, 128, 0.2);
  border: 1px solid rgba(74, 222, 128, 0.4);
  border-radius: 20px;
  color: #4ade80;
}

/* Passive Skills Popup Overlay */
.passive-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
  padding: 20px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Popup Container */
.passive-popup {
  width: 100%;
  max-width: 800px;
  height: 90vh;
  background: #0a0a0a;
  border: 1px solid rgba(249, 115, 22, 0.3);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  animation: popupSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 
    0 0 60px rgba(0, 0, 0, 0.8),
    0 0 120px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

@keyframes popupSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(30px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Popup Header */
.passive-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  border-bottom: 1px solid rgba(249, 115, 22, 0.2);
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.1), transparent);
}

.passive-popup-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fdba74;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 0 20px rgba(249, 115, 22, 0.4);
}

.popup-close-btn {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #9ca3af;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
  transform: rotate(90deg);
}

/* Popup Content */
.passive-popup-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
  scrollbar-width: thin;
  scrollbar-color: rgba(249, 115, 22, 0.3) transparent;
}

.passive-popup-content::-webkit-scrollbar {
  width: 8px;
}

.passive-popup-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.passive-popup-content::-webkit-scrollbar-thumb {
  background: rgba(249, 115, 22, 0.3);
  border-radius: 4px;
}

.passive-popup-content::-webkit-scrollbar-thumb:hover {
  background: rgba(249, 115, 22, 0.5);
}

/* Progress Summary */
.skill-tree-progress {
  margin-bottom: 32px;
  background: rgba(0, 0, 0, 0.3);
  padding: 20px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-bar-container {
  height: 12px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ea580c, #f97316, #fdba74);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.popup-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
  transform: rotate(90deg);
}

/* Popup Content */
.passive-popup-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(249, 115, 22, 0.3) transparent;
}

.passive-popup-content::-webkit-scrollbar {
  width: 6px;
}

.passive-popup-content::-webkit-scrollbar-track {
  background: transparent;
}

.passive-popup-content::-webkit-scrollbar-thumb {
  background: rgba(249, 115, 22, 0.3);
  border-radius: 3px;
}

/* Progress Summary */
.skill-tree-progress {
  margin-bottom: 20px;
}

.progress-bar-container {
  height: 8px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6, #a78bfa, #c084fc);
  border-radius: 4px;
  transition: width 0.5s ease;
  position: relative;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-text {
  font-size: 0.8rem;
  color: #9ca3af;
  text-align: center;
  display: block;
}

/* Active Bonuses Summary */
.active-bonuses-summary {
  background: rgba(249, 115, 22, 0.05);
  border: 1px solid rgba(249, 115, 22, 0.2);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.active-bonuses-summary h3 {
  margin: 0 0 12px 0;
  font-size: 0.85rem;
  color: #4ade80;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.bonuses-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bonus-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: 20px;
  color: #4ade80;
}

.bonus-tag.empty {
  background: rgba(156, 163, 175, 0.1);
  border-color: rgba(156, 163, 175, 0.3);
  color: #9ca3af;
  font-style: italic;
}

/* Skill Tree Container */
.skill-tree-container {
  margin-bottom: 20px;
}

.skill-tree-container h3 {
  margin: 0 0 16px 0;
  font-size: 0.85rem;
  color: #c084fc;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Skill Tree - Vertical Layout */
.skill-tree {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: 20px;
}

.skill-tree-node-wrapper {
  position: relative;
}

/* Connection line between nodes */
.skill-tree-line {
  position: absolute;
  left: 15px;
  top: -16px;
  width: 3px;
  height: 16px;
  background: rgba(156, 163, 175, 0.3);
  border-radius: 2px;
}

.skill-tree-line.active {
  background: linear-gradient(180deg, #8b5cf6, #a78bfa);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

/* Skill Tree Node */
.skill-tree-node {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
  position: relative;
}

.skill-tree-node.unlocked {
  background: rgba(74, 222, 128, 0.05);
  border-color: rgba(74, 222, 128, 0.3);
}

.skill-tree-node.locked {
  opacity: 0.6;
  border-style: dashed;
}

.skill-tree-node.next-unlock {
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.4);
  animation: nextGlow 2s ease-in-out infinite;
}

@keyframes nextGlow {
  0%, 100% { box-shadow: 0 0 5px rgba(251, 191, 36, 0.2); }
  50% { box-shadow: 0 0 20px rgba(251, 191, 36, 0.4); }
}

.skill-tree-node.mythic {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(139, 92, 246, 0.08));
  border-color: rgba(168, 85, 247, 0.5);
}

.skill-tree-node.mythic.unlocked {
  animation: mythicGlow 3s ease-in-out infinite;
}

@keyframes mythicGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(168, 85, 247, 0.3); }
  50% { box-shadow: 0 0 30px rgba(168, 85, 247, 0.6), 0 0 50px rgba(139, 92, 246, 0.3); }
}

/* Level marker */
.node-level-marker {
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: #16162a;
  border: 2px solid rgba(156, 163, 175, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.skill-tree-node.unlocked .node-level-marker {
  border-color: #4ade80;
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.2), rgba(34, 197, 94, 0.1));
}

.skill-tree-node.next-unlock .node-level-marker {
  border-color: #fbbf24;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(245, 158, 11, 0.1));
}

.skill-tree-node.mythic .node-level-marker {
  border-color: #a855f7;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(139, 92, 246, 0.1));
}

.level-text {
  font-size: 0.55rem;
  font-weight: 700;
  color: #9ca3af;
}

.skill-tree-node.unlocked .level-text {
  color: #4ade80;
}

.skill-tree-node.mythic .level-text {
  color: #c084fc;
}

/* Icon container */
.node-icon-container {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  position: relative;
  flex-shrink: 0;
}

.node-icon {
  font-size: 1.5rem;
}

.unlocked-check {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, #22c55e, #4ade80);
  border-radius: 50%;
  font-size: 0.65rem;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(34, 197, 94, 0.4);
}

.next-indicator {
  position: absolute;
  top: -6px;
  right: -10px;
  font-size: 0.5rem;
  font-weight: 700;
  padding: 2px 6px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  border-radius: 4px;
  color: #1a1a2e;
  animation: pulse 1.5s ease-in-out infinite;
}

/* Node info */
.node-info {
  flex: 1;
  min-width: 0;
}

.node-name {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.node-type-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid;
  margin-bottom: 6px;
}

.node-effects {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.effect-line {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Next Unlock Banner */
.next-unlock-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.05));
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 12px;
  animation: bannerPulse 3s ease-in-out infinite;
}

@keyframes bannerPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(251, 191, 36, 0.1); }
  50% { box-shadow: 0 0 20px rgba(251, 191, 36, 0.2); }
}

.banner-icon {
  font-size: 1.5rem;
  animation: bounce 2s ease-in-out infinite;
}

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

.banner-text {
  flex: 1;
  font-size: 0.85rem;
  color: #fbbf24;
}

.banner-text strong {
  color: #fcd34d;
}

.levels-away {
  margin-left: 6px;
  font-size: 0.75rem;
  color: #9ca3af;
}

/* Element Advantage Guide */
.element-advantage-guide {
  padding: 16px 0 0 0;
  margin-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.element-advantage-guide h4 {
  margin: 0 0 12px 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
}

.advantage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.advantage-item {
  font-size: 0.75rem;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  gap: 4px;
}

.advantage-item .bonus {
  margin-left: auto;
  color: #4ade80;
  font-weight: 600;
  font-size: 0.7rem;
}

/* Element Cycle Display */
.advantage-cycle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 8px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  font-size: 0.85rem;
}

.advantage-cycle span {
  white-space: nowrap;
}

.advantage-cycle .cycle-arrow {
  color: #4ade80;
  font-weight: bold;
  font-size: 0.75rem;
}

.advantage-tip {
  margin: 12px 0 0 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
}

.advantage-tip strong {
  color: #4ade80;
}

/* Class Matchup Matrix */
.class-matchup-guide {
  margin-top: 12px;
}

.class-matchup-matrix {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 8px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  max-width: 280px;
  margin: 0 auto;
}

.class-matchup-row {
  display: grid;
  grid-template-columns: 28px repeat(5, 1fr);
  gap: 2px;
  align-items: center;
}

.class-matchup-row.class-matchup-header {
  margin-bottom: 4px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.class-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  font-size: 0.75rem;
  border-radius: 4px;
}

.class-cell.header-empty {
  background: transparent;
}

.class-cell.header-icon {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
}

.class-cell.row-label {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  background: transparent;
}

.class-cell.neutral {
  color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.02);
}

.class-cell.advantage {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
  font-weight: 600;
}

.class-cell.disadvantage {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
  font-weight: 600;
}

.skill-info-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  margin-left: auto;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.skill-info-btn:hover {
  opacity: 1;
}

.skill-btn.locked {
  opacity: 0.4;
  filter: grayscale(100%);
  cursor: not-allowed;
  background: #1a1a1a;
  border-color: #333;
}

.skill-info-icon {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  opacity: 0.6;
  z-index: 2;
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Skill Modal Overlay - Full Screen Centered */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay .modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  max-width: 450px;
  width: 100%;
  text-align: center;
  position: relative;
}

.modal-overlay .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.modal-overlay .modal-header h2 {
  margin: 0;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.3rem;
  color: var(--gold);
}

.modal-overlay .close-modal-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: color 0.2s;
}

.modal-overlay .close-modal-btn:hover {
  color: var(--text);
}

.modal-overlay .modal-body {
  color: var(--text);
}

/* Skill Modal */
.skill-modal-content {
  max-width: 400px;
}

.skill-modal-icon {
  font-size: 4rem;
  text-align: center;
  margin-bottom: 1rem;
}

.skill-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
  background: rgba(0,0,0,0.2);
  padding: 1rem;
  border-radius: 8px;
}

.skill-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.skill-stat .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.skill-stat .value {
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--gold);
}

.skill-effects-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.skill-effect-tag {
  background: rgba(255,255,255,0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.85rem;
  color: var(--text-bright);
}

.cooldown-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.7);
  font-size: 2rem;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 10px rgba(0,0,0,0.8);
  border-radius: inherit;
  z-index: 1;
}

/* ========================================
   BATTLE ARENA - CLEAN COMPACT UI
   ======================================== */

.battle-arena {
  position: relative;
  height: calc(100vh - 120px);
  max-height: 700px;
}

.arena-container {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100%;
  background: linear-gradient(180deg, #0c0a08 0%, #080604 100%);
  border: 1px solid rgba(251, 191, 36, 0.15);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.8);
}

/* Background Effects */
.arena-bg-effects {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.arena-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 30%, transparent 0%, rgba(0, 0, 0, 0.6) 100%);
}

.arena-fog {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 70%, rgba(251, 191, 36, 0.03) 0%, transparent 50%);
  animation: fogDrift 15s ease-in-out infinite;
}

@keyframes fogDrift {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.8; }
}

.arena-particles { display: none; }

.effect-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 100;
}

/* ========================================
   HEADER - Turn Info
   ======================================== */

.battle-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(20, 16, 10, 0.9), transparent);
  border-bottom: 1px solid rgba(251, 191, 36, 0.08);
  position: relative;
  z-index: 10;
}

.turn-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(20, 16, 10, 0.8);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 8px;
  padding: 6px 14px;
  min-width: 55px;
}

.turn-label {
  font-size: 0.5rem;
  color: rgba(251, 191, 36, 0.7);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
}

.turn-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
  color: #fbbf24;
  font-weight: 700;
}

.turn-indicator {
  display: flex;
  align-items: center;
  padding: 8px 20px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(249, 115, 22, 0.08));
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 20px;
  position: relative;
  overflow: hidden;
}

.turn-indicator-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(251, 191, 36, 0.2), transparent);
  animation: indicatorSweep 2s linear infinite;
}

@keyframes indicatorSweep {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

.turn-indicator span {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7rem;
  color: #fde68a;
  text-transform: uppercase;
  letter-spacing: 2px;
  position: relative;
  z-index: 1;
}

.turn-indicator.enemy-turn {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(185, 28, 28, 0.1));
  border-color: rgba(239, 68, 68, 0.35);
}

.turn-indicator.enemy-turn span { color: #fca5a5; }

.battle-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.battle-timer {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 16, 10, 0.8);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 8px;
  font-size: 1rem;
}

/* ========================================
   MAIN - Monster + Combat Log
   ======================================== */

.battle-main {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 12px;
  padding: 12px 16px;
  min-height: 0;
  overflow: hidden;
}

/* Monster Section */
.monster-section {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 10px;
}

/* Intent Badge */
.intent-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(185, 28, 28, 0.1));
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 16px;
  margin-bottom: 8px;
}

.intent-badge .intent-icon {
  font-size: 0.9rem;
  animation: intentBounce 1s ease-in-out infinite;
}

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

.intent-badge .intent-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.65rem;
  color: #fca5a5;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

/* Monster Card - Horizontal Layout */
.monster-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  position: relative;
  height: 100%;
}

.monster-card.elite .monster-glow {
  background: radial-gradient(circle, rgba(249, 115, 22, 0.4) 0%, transparent 70%);
  animation: eliteGlow 2s ease-in-out infinite;
}

@keyframes eliteGlow {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* Large Monster Image - BIGGER */
.monster-image-wrap {
  position: relative;
  width: 320px;
  height: 320px;
  flex-shrink: 0;
}

/* Tags Overlay on Monster Image - Top Left */
.monster-tags-overlay {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.monster-tags-overlay .tag-difficulty,
.monster-tags-overlay .tag-element {
  padding: 4px 10px;
  border-radius: 8px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.monster-tags-overlay .tag-element {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 1.2rem;
  padding: 4px 8px;
}

.monster-glow {
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.15) 0%, transparent 70%);
  filter: blur(15px);
  z-index: 0;
  animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.8; }
}

.monster-image {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
  background: linear-gradient(145deg, #1a1510, #0f0c08);
  border: 2px solid rgba(251, 191, 36, 0.25);
  border-radius: 12px;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8), 0 8px 30px rgba(0, 0, 0, 0.6);
  z-index: 1;
  overflow: hidden;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.monster-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

/* Monster Info Panel - Right Side */
.monster-info-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  min-width: 180px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(251, 191, 36, 0.15);
  border-radius: 10px;
}

/* Monster Hit Animation */
.monster-card.hit .monster-image {
  animation: monsterHit 0.4s ease-out;
}

@keyframes monsterHit {
  0% { transform: scale(1); filter: brightness(1); }
  20% { transform: scale(1.05) rotate(-2deg); filter: brightness(2); }
  40% { transform: scale(0.95) translateX(-10px); }
  60% { transform: scale(1.02) translateX(5px); }
  100% { transform: scale(1); filter: brightness(1); }
}

/* Monster Attack Animation */
.monster-card.attacking .monster-image {
  animation: monsterAttack 0.5s ease-out;
}

@keyframes monsterAttack {
  0% { transform: scale(1) translateY(0); }
  30% { transform: scale(1.08) translateY(-15px); }
  60% { transform: scale(1.15) translateY(30px); filter: brightness(1.3); }
  100% { transform: scale(1) translateY(0); }
}

/* Monster Info - Inside Panel */
.monster-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.monster-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  letter-spacing: 1px;
  text-align: center;
}

/* Circular HP Bar */
.circular-hp-container {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 10px auto;
}

.circular-hp-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.circular-hp-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 8;
}

.circular-hp-fill {
  fill: none;
  stroke: url(#hpGradient);
  stroke: #ef4444;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.5s ease, stroke 0.3s ease;
  filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.5));
}

.circular-hp-fill.healthy {
  stroke: #22c55e;
  filter: drop-shadow(0 0 6px rgba(34, 197, 94, 0.5));
}

.circular-hp-fill.warning {
  stroke: #fbbf24;
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.5));
}

.circular-hp-fill.critical {
  stroke: #ef4444;
  filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.5));
  animation: criticalPulse 1s ease-in-out infinite;
}

@keyframes criticalPulse {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.5)); }
  50% { filter: drop-shadow(0 0 12px rgba(239, 68, 68, 0.8)); }
}

.circular-hp-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.circular-hp-text .hp-current {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.circular-hp-text .hp-divider {
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.4);
  margin: 2px 0;
}

.circular-hp-text .hp-max {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1;
}

.monster-tags {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tag-difficulty {
  padding: 4px 12px;
  border-radius: 12px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.55rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.tag-difficulty.easy,
.tag-difficulty[style*="rgb(74, 222, 128)"] { 
  background: rgba(34, 197, 94, 0.2) !important;
  color: #4ade80 !important;
  border: 1px solid rgba(34, 197, 94, 0.4) !important;
}

.tag-difficulty.medium,
.tag-difficulty[style*="rgb(251, 191, 36)"] { 
  background: rgba(251, 191, 36, 0.2) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(251, 191, 36, 0.4) !important;
}

.tag-difficulty.hard,
.tag-difficulty[style*="rgb(248, 113, 113)"] { 
  background: rgba(239, 68, 68, 0.2) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
}

.tag-difficulty.super,
.tag-difficulty[style*="rgb(192, 132, 252)"] { 
  background: rgba(249, 115, 22, 0.25) !important;
  color: #fb923c !important;
  border: 1px solid rgba(249, 115, 22, 0.5) !important;
}

.tag-element {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: rgba(20, 16, 10, 0.8);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 50%;
}

/* Monster HP */
.monster-hp {
  width: 180px;
  text-align: center;
}

.hp-bar-bg {
  height: 14px;
  background: linear-gradient(180deg, #1a1510, #0a0806);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.hp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #dc2626, #f97316, #eab308);
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.4);
  border-radius: 7px;
  transition: width 0.4s ease;
}

.hp-text {
  display: block;
  margin-top: 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Combat Log Section */
.combat-log-section {
  display: flex;
  flex-direction: column;
  background: rgba(15, 12, 8, 0.6);
  border: 1px solid rgba(251, 191, 36, 0.1);
  border-radius: 10px;
  overflow: hidden;
  min-height: 0;
}

.log-header {
  padding: 8px 12px;
  background: rgba(251, 191, 36, 0.08);
  border-bottom: 1px solid rgba(251, 191, 36, 0.08);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.6rem;
  color: rgba(251, 191, 36, 0.7);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.log-body {
  flex: 1;
  padding: 8px;
  overflow-y: auto;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.6);
  min-height: 0;
}

.log-body::-webkit-scrollbar { width: 3px; }
.log-body::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); }
.log-body::-webkit-scrollbar-thumb { background: rgba(251, 191, 36, 0.2); border-radius: 2px; }

.log-entry {
  padding: 5px 8px;
  margin-bottom: 4px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
}

.log-player { color: #86efac; border-left-color: rgba(34, 197, 94, 0.5); }
.log-enemy { color: #fca5a5; border-left-color: rgba(239, 68, 68, 0.5); }

/* ========================================
   FOOTER - Player Status + Actions
   ======================================== */

.battle-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: linear-gradient(180deg, transparent, rgba(15, 12, 8, 0.95));
  border-top: 1px solid rgba(251, 191, 36, 0.1);
  position: relative;
  z-index: 10;
}

/* Player Section */
.player-section {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 200px;
}

.player-avatar {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(22, 163, 74, 0.1));
  border: 2px solid rgba(34, 197, 94, 0.35);
  border-radius: 8px;
  flex-shrink: 0;
}

.player-hp-wrap {
  flex: 1;
}

.player-hp-bar {
  height: 22px;
  background: linear-gradient(180deg, #1a1510, #0a0806);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.player-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #16a34a, #22c55e, #4ade80);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.4);
  border-radius: 7px;
  transition: width 0.4s ease;
}

.player-hp-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.player-stats {
  display: flex;
  gap: 12px;
  margin-top: 4px;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.5);
}

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

/* Actions Section */
.actions-section {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
}

.skill-buttons {
  display: flex;
  gap: 6px;
}

.skill-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: linear-gradient(145deg, #1a1510, #0f0c08);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  padding: 8px;
  box-sizing: border-box;
}

.skill-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(251, 191, 36, 0.5);
  box-shadow: 0 4px 20px rgba(251, 191, 36, 0.2);
}

.skill-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.skill-btn .skill-icon {
  font-size: 1.7rem;
  margin-bottom: 4px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.skill-btn .skill-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.55rem;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1.1;
}

.skill-btn .cooldown-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
}

/* Skill Type Accents */
.skill-btn.attack { border-bottom: 2px solid rgba(249, 115, 22, 0.6); }
.skill-btn.defend { border-bottom: 2px solid rgba(59, 130, 246, 0.6); }
.skill-btn.charge { border-bottom: 2px solid rgba(251, 191, 36, 0.6); }
.skill-btn.special { border-bottom: 2px solid rgba(249, 115, 22, 0.6); }

/* Flee Button */
.flee-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 60px;
  background: linear-gradient(145deg, #201510, #150c08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #fca5a5;
  font-size: 0.45rem;
  font-family: 'Orbitron', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.flee-btn span:first-child {
  font-size: 1.2rem;
  margin-bottom: 2px;
}

.flee-btn:hover {
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
}

/* ========================================
   RESPONSIVE - Battle Arena
   ======================================== */

@media (max-width: 900px) {
  .battle-main {
    grid-template-columns: 1fr;
  }
  
  .combat-log-section {
    display: none;
  }
  
  .monster-image-wrap {
    width: 140px;
    height: 140px;
  }
  
  .monster-image {
    font-size: 3.5rem;
  }
}

@media (max-width: 600px) {
  .battle-footer {
    flex-direction: column;
    gap: 10px;
  }
  
  .player-section {
    width: 100%;
    min-width: unset;
  }
  
  .actions-section {
    width: 100%;
    justify-content: center;
  }
  
  .skill-btn {
    width: 52px;
    height: 52px;
  }
  
  .skill-btn .skill-icon {
    font-size: 1.2rem;
  }
  
  .flee-btn {
    width: 44px;
    height: 52px;
  }
  
  .monster-image-wrap {
    width: 120px;
    height: 120px;
  }
}

.fct-crit {
  font-size: 3rem;
  color: #f97316;
  text-shadow:
    0 0 15px rgba(249, 115, 22, 0.9),
    0 0 40px rgba(249, 115, 22, 0.6),
    0 4px 8px rgba(0, 0, 0, 0.9);
  animation: fctCrit 1.2s ease-out forwards;
}

.fct-heal {
  font-size: 2rem;
  color: #4ade80;
  text-shadow:
    0 0 10px rgba(74, 222, 128, 0.8),
    0 0 30px rgba(74, 222, 128, 0.5),
    0 4px 8px rgba(0, 0, 0, 0.9);
}

.fct-block {
  font-size: 1.6rem;
  color: #60a5fa;
  font-style: italic;
  text-shadow:
    0 0 10px rgba(96, 165, 250, 0.8),
    0 0 30px rgba(96, 165, 250, 0.5),
    0 4px 8px rgba(0, 0, 0, 0.9);
}

@keyframes fctFloat {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  50% { opacity: 1; transform: translateY(-30px) scale(1.1); }
  100% { opacity: 0; transform: translateY(-60px) scale(0.8); }
}

@keyframes fctCrit {
  0% { opacity: 1; transform: translateY(0) scale(0.5) rotate(-5deg); }
  20% { transform: translateY(-20px) scale(1.3) rotate(3deg); }
  50% { opacity: 1; transform: translateY(-40px) scale(1.1) rotate(-2deg); }
  100% { opacity: 0; transform: translateY(-80px) scale(0.9) rotate(0deg); }
}

/* Effect Animations */
.effect-slash {
  position: absolute;
  width: 150px;
  height: 40px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.95), transparent);
  border-radius: 50%;
  transform-origin: left center;
  opacity: 0;
  mix-blend-mode: screen;
}

.effect-slash.active {
  animation: slashAnim 0.35s ease-out;
}

@keyframes slashAnim {
  0% { opacity: 1; transform: scale(0.5) rotate(-20deg); }
  100% { opacity: 0; transform: scale(1.5) rotate(15deg); }
}

.effect-impact {
  position: absolute;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.9), transparent 60%);
  border-radius: 50%;
  opacity: 0;
  mix-blend-mode: screen;
}

.effect-impact.active {
  animation: impactAnim 0.4s ease-out;
}

@keyframes impactAnim {
  0% { opacity: 1; transform: scale(0.2); }
  100% { opacity: 0; transform: scale(1.8); }
}

/* ========================================
   RESPONSIVE DESIGN - Battle Arena
   ======================================== */

@media (max-width: 1200px) {
  .battle-stage {
    grid-template-columns: 1fr 160px;
    gap: 10px;
  }

  .combat-feed-container {
    max-height: 200px;
  }

  .monster-portrait {
    width: 180px;
    height: 180px;
  }

  .portrait-inner {
    width: 165px;
    height: 165px;
  }

  .enemy-avatar {
    font-size: 4.5rem;
  }

  .monster-vitals {
    width: 200px;
  }
}

@media (max-width: 1024px) {
  .battle-stage {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .combat-feed-container {
    max-height: 100px;
  }
}


@media (max-width: 480px) {
  .battle-top-hud {
    padding: 6px 10px;
  }

  .turn-badge {
    padding: 4px 8px;
    min-width: 50px;
  }

  .turn-value {
    font-size: 1rem;
  }

  .turn-indicator {
    padding: 5px 12px;
  }

  .turn-indicator span {
    font-size: 0.6rem;
  }

  .battle-timer {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }

  .monster-portrait {
    width: 140px;
    height: 140px;
  }

  .portrait-inner {
    width: 125px;
    height: 125px;
  }

  .enemy-avatar {
    font-size: 3.5rem;
  }

  .monster-name {
    font-size: 1rem;
  }

  .tag-difficulty {
    padding: 3px 10px;
    font-size: 0.55rem;
  }

  .tag-element {
    width: 28px;
    height: 28px;
    font-size: 1rem;
  }

  .monster-vitals {
    width: 160px;
  }

  .vital-bar {
    height: 14px;
  }

  .skill-btn {
    width: 50px;
    height: 50px;
  }

  .skill-btn .skill-icon {
    font-size: 1.2rem;
  }

  .skill-btn .skill-name {
    font-size: 0.4rem;
  }

  .flee-button {
    width: 44px;
    height: 50px;
  }

  .player-hp-bar {
    height: 20px;
  }

  .hp-text-overlay {
    font-size: 0.7rem;
  }
}

/* ========================================
   HEALTH BARS - General styles
   ======================================== */

/* Health Bars */
.health-bar {
  height: 14px;
  background: linear-gradient(to right, #111827, #020617);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
  box-shadow: 
    inset 0 0 8px rgba(0, 0, 0, 0.8),
    0 2px 4px rgba(0, 0, 0, 0.5);
  position: relative;
}

.health-fill {
  height: 100%;
  transition: width 0.3s ease-out;
  border-radius: 999px;
}

.enemy-health .health-fill {
  background: linear-gradient(90deg, #dc2626, #f97316, #facc15);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}

.player-health .health-fill {
  background: linear-gradient(90deg, #16a34a, #22c55e, #4ade80);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
}

.health-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: 'IBM Plex Mono', monospace;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* ========================================
   EFFECT LAYER - Slash/Impact animations
   ======================================== */

/* Effect Layer for slash/impact effects */
.effect-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 100;
}

.effect-slash {
  position: absolute;
  width: 150px;
  height: 40px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(248, 250, 252, 0.95), rgba(248, 250, 252, 0));
  transform-origin: left center;
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
}

.effect-slash.active {
  animation: slashAnim 0.3s ease-out;
}

@keyframes slashAnim {
  0% { opacity: 1; transform: scale(0.6) rotate(-18deg); }
  100% { opacity: 0; transform: scale(1.5) rotate(10deg); }
}

.effect-impact {
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(248, 250, 252, 0.95), rgba(248, 250, 252, 0) 65%);
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
}

.effect-impact.active {
  animation: impactAnim 0.4s ease-out;
}

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

/* Floating Combat Text - Enhanced */
.fct {
  position: absolute;
  font-weight: 900;
  font-size: 1.6rem;
  text-shadow: 
    0 0 6px rgba(0, 0, 0, 0.95),
    0 0 12px currentColor;
  pointer-events: none;
  animation: fct-float 1s ease-out forwards;
  z-index: 200;
  font-family: 'Orbitron', sans-serif;
}

.fct-damage { 
  color: #facc15; 
  text-shadow: 
    0 0 6px rgba(0, 0, 0, 0.95),
    0 0 15px rgba(250, 204, 21, 0.9);
}

.fct-crit { 
  font-size: 2.5rem; 
  color: #f97316; 
  animation: fct-crit 1.2s ease-out forwards;
  text-shadow: 
    0 0 8px rgba(0, 0, 0, 0.95),
    0 0 20px rgba(249, 115, 22, 0.95);
}

.fct-heal { 
  color: #4ade80;
  text-shadow: 
    0 0 6px rgba(0, 0, 0, 0.95),
    0 0 15px rgba(74, 222, 128, 0.9);
}

.fct-block { 
  color: #60a5fa; 
  font-style: italic;
  text-shadow: 
    0 0 6px rgba(0, 0, 0, 0.95),
    0 0 15px rgba(96, 165, 250, 0.9);
}

.fct-xp { 
  color: #4ade80;
  font-size: 1.2rem;
  text-shadow: 
    0 0 6px rgba(0, 0, 0, 0.95),
    0 0 15px rgba(74, 222, 128, 0.9);
  animation: fct-xp 1.5s ease-out forwards;
}

@keyframes fct-float {
  0% { opacity: 1; transform: translate(-10px, 0); }
  100% { opacity: 0; transform: translate(0, -50px); }
}

@keyframes fct-crit {
  0% { opacity: 1; transform: translate(-10px, 0) scale(0.5); }
  20% { transform: translate(-5px, -15px) scale(1.4); }
  100% { opacity: 0; transform: translate(0, -50px) scale(0.9); }
}

@keyframes fct-xp {
  0% { opacity: 1; transform: translate(-10px, 10px) scale(0.8); }
  20% { transform: translate(-5px, 0) scale(1.1); }
  60% { opacity: 1; transform: translate(0, -30px) scale(1); }
  100% { opacity: 0; transform: translate(0, -60px) scale(0.9); }
}

/* Player Area */
.player-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 550px;
  margin: 0 auto;
  width: 100%;
  transform-style: preserve-3d;
  z-index: 2;
}

.player-battle-card {
  background: 
    radial-gradient(circle at 20% 0, rgba(190, 242, 100, 0.15), transparent 50%),
    linear-gradient(145deg, #0a1a0a, #050a05);
  border: 2px solid rgba(34, 197, 94, 0.4);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 
    0 15px 35px rgba(0, 0, 0, 0.7),
    0 0 25px rgba(22, 163, 74, 0.2),
    inset 0 0 15px rgba(0, 0, 0, 0.4);
  transform: translateZ(20px);
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

/* Hit animation for player */
.player-battle-card.hit {
  animation: hitFlash 0.25s ease-out;
}

/* Guard animation */
@keyframes guardPulse {
  0% { box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7), 0 0 25px rgba(22, 163, 74, 0.2); }
  100% { box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7), 0 0 40px rgba(34, 197, 94, 0.5); }
}

.player-battle-card.guard {
  animation: guardPulse 0.3s ease-out;
}

/* Player attacking lunge */
@keyframes playerLunge {
  0% { transform: translateZ(20px) translateY(0); }
  50% { transform: translateZ(20px) translateY(-25px) scale(1.03); }
  100% { transform: translateZ(20px) translateY(0); }
}

.player-battle-card.attacking {
  animation: playerLunge 0.28s ease-out;
}

.player-combat-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
  justify-content: center;
}

.combat-stat {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-muted);
}

.combat-stat i {
  color: var(--primary);
}

.combat-stat span {
  color: var(--text-bright);
  font-weight: 600;
}

/* Skill Bar */
.skill-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.skill-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text);
  position: relative;
  overflow: hidden;
  height: 80px;
}

.skill-btn:hover:not(:disabled) {
  transform: translateY(-4px);
  border-color: var(--gold);
  background: rgba(251, 191, 36, 0.1);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.skill-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(0,0,0,0.2);
}

.skill-btn.attack { border-bottom: 3px solid rgba(239, 68, 68, 0.6); }
.skill-btn.defend { border-bottom: 3px solid rgba(59, 130, 246, 0.6); }
.skill-btn.charge { border-bottom: 3px solid rgba(251, 191, 36, 0.6); }
.skill-btn.special { border-bottom: 3px solid rgba(168, 85, 247, 0.6); }

.skill-btn .skill-icon {
  font-size: 1.6rem;
  margin-bottom: 4px;
}

.skill-btn .skill-name {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.skill-btn .skill-meta {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.skill-btn .cooldown-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  font-family: 'Orbitron', sans-serif;
}

/* Flee Button */
.flee-btn {
  padding: 12px 24px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  align-self: center;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.flee-btn:hover {
  border-color: var(--health-enemy);
  color: var(--health-enemy);
  background: rgba(239, 68, 68, 0.05);
}

/* Turn Indicator */
.turn-indicator {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 18px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.7);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #e5e7eb;
  z-index: 5;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.turn-indicator.enemy-turn {
  border-color: rgba(239, 68, 68, 0.6);
  color: #fca5a5;
}

/* Turn Counter */
.turn-counter {
  position: absolute;
  top: 12px;
  right: 16px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 5px 14px;
  background: rgba(0,0,0,0.5);
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  font-family: 'IBM Plex Mono', monospace;
  z-index: 5;
}

/* ========================================
   DEATH OVERLAY
   ======================================== */
.death-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
}

.death-content {
  max-width: 400px;
}

.death-icon {
  font-size: 5rem;
  margin-bottom: 20px;
  animation: pulse-skull 2s ease-in-out infinite;
}

@keyframes pulse-skull {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; }
}

.death-content h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
  color: #ef4444;
  margin-bottom: 12px;
  letter-spacing: 2px;
}

.death-content > p {
  color: var(--text-muted);
  margin-bottom: 32px;
}

.death-timer {
  font-size: 3.5rem;
  font-weight: 700;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--text);
  margin-bottom: 32px;
  text-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

.death-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.death-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.death-links .btn {
  padding: 12px 24px;
  background: var(--surface-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.death-links .btn:hover {
  background: var(--surface);
  border-color: var(--gold);
}

/* Revive Options */
.revive-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.revive-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.btn-revive {
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 250px;
}

.btn-revive.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-revive.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-revive.btn-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border: none;
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-revive.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-revive:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.revive-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

#free-revives-remaining {
  font-size: 0.85em;
  opacity: 0.9;
}

/* ========================================
   POST-BATTLE MODAL
   ======================================== */
.post-battle-overlay {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.post-battle-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  max-width: 380px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

/* Mobile optimization for post-battle modal */
@media (max-width: 480px) {
  .post-battle-overlay {
    padding: 10px;
    align-items: flex-start;
    padding-top: 40px;
  }
  
  .post-battle-modal {
    padding: 16px;
    max-width: 100%;
    max-height: calc(100vh - 60px);
    border-radius: 16px;
  }
  
  .victory-content h2,
  .defeat-content h2 {
    font-size: 1.4rem;
    margin-bottom: 12px;
  }
  
  .chest {
    font-size: 2.2rem;
  }
  
  .chest-animation {
    margin-bottom: 10px;
  }
  
  .rewards-reveal {
    gap: 6px;
    margin-bottom: 12px;
  }
  
  .reward-item {
    padding: 6px 10px;
  }
  
  .reward-icon {
    font-size: 0.95rem;
  }
  
  .reward-value {
    font-size: 0.8rem;
  }
  
  .level-up-notice,
  .stage-unlock-notice {
    padding: 8px;
    font-size: 0.7rem;
    margin-bottom: 10px;
  }
  
  .clue-search-section {
    padding: 12px;
  }
  
  .clue-search-header h3 {
    font-size: 0.9rem;
  }
  
  .clue-search-info {
    font-size: 0.75rem;
  }
  
  .clue-search-chance {
    font-size: 0.75rem;
  }
  
  .clue-search-buttons {
    flex-direction: column;
    gap: 8px;
  }
  
  .clue-search-buttons .btn {
    width: 100%;
    padding: 12px;
    font-size: 0.85rem;
  }
  
  .clue-slot-machine {
    transform: scale(0.85);
    transform-origin: center top;
    margin: -10px 0;
  }
  
  .slot-machine-header .slot-title {
    font-size: 0.9rem;
  }
  
  .slot-machine-header .slot-subtitle {
    font-size: 0.7rem;
  }
  
  .death-penalty {
    padding: 12px 16px;
  }
  
  .penalty-icon {
    font-size: 1.4rem;
  }
  
  .penalty-text {
    font-size: 1.1rem;
  }
  
  .near-miss {
    padding: 14px;
    margin: 16px 0;
  }
  
  .near-miss-text {
    font-size: 1.2rem;
  }
  
  .post-battle-modal .btn {
    padding: 14px;
    font-size: 1rem;
  }
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  max-width: 380px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

/* Victory */
.victory-content h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.8rem;
  color: var(--gold);
  margin-bottom: 16px;
  letter-spacing: 2px;
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
}

.chest-animation {
  margin-bottom: 16px;
}

.chest {
  font-size: 3rem;
  animation: chest-bounce 0.5s ease-out;
}

@keyframes chest-bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.rewards-reveal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}

.reward-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--surface-light);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.05);
}

.reward-icon {
  font-size: 1.1rem;
}

.reward-value {
  font-size: 0.9rem;
  font-weight: 600;
  font-family: 'IBM Plex Mono', monospace;
}

.level-up-notice,
.stage-unlock-notice {
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.8rem;
}

.level-up-notice {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.15), rgba(6, 182, 212, 0.15));
  border: 1px solid rgba(34, 211, 238, 0.3);
  color: var(--xp-color);
}

.stage-unlock-notice {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(124, 58, 237, 0.15));
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: var(--elite-glow);
}

/* Defeat */
.defeat-content h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.5rem;
  color: #ef4444;
  margin-bottom: 24px;
  letter-spacing: 2px;
}

.death-penalty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 24px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(185, 28, 28, 0.15));
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 12px;
  margin: 16px auto;
  max-width: 280px;
}

.penalty-icon {
  font-size: 1.8rem;
  animation: pulse 1.5s ease-in-out infinite;
}

.penalty-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: #ef4444;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.near-miss {
  padding: 20px;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 12px;
  margin: 24px 0;
}

.near-miss-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  display: block;
  margin-bottom: 8px;
  font-family: 'Orbitron', sans-serif;
}

.death-cooldown-msg {
  color: var(--text-muted);
  margin: 24px 0;
  font-size: 1.1rem;
}

/* XP from battle (shown on defeat) */
.xp-from-battle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(22, 163, 74, 0.15));
  border: 1px solid rgba(34, 197, 94, 0.4);
  border-radius: 10px;
  margin: 16px auto;
  max-width: 320px;
}

.xp-from-battle .xp-icon {
  font-size: 1.4rem;
}

.xp-from-battle .xp-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #22c55e;
  text-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

/* Buttons */
.modal .btn {
  width: 100%;
  padding: 18px;
  font-size: 1.1rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.modal .btn-primary {
  background: linear-gradient(135deg, var(--health-player), #16a34a);
  color: white;
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.modal .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(34, 197, 94, 0.5);
}

.modal .btn-secondary {
  background: var(--surface-light);
  color: var(--text);
  border: 1px solid var(--border);
}

.modal .btn-secondary:hover {
  background: var(--surface);
  border-color: var(--text-muted);
}

/* ========================================
   CLASS INFO MODAL
   ======================================== */
.class-info-content {
  max-width: 550px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 32px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--text);
}

.class-info-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.class-info-icon {
  font-size: 3.5rem;
}

.class-info-header h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.8rem;
  color: var(--gold);
  letter-spacing: 2px;
  margin: 0;
}

.class-info-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.class-info-section h4 {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 10px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.class-info-section p {
  color: var(--text);
  line-height: 1.6;
  margin: 0;
  font-size: 0.95rem;
}

.class-info-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.class-info-stats .stat-box {
  background: var(--surface-light);
  padding: 12px 8px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.05);
}

.class-info-stats .stat-label {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
}

.class-info-stats .stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
}

.class-info-skills {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skill-info-item {
  background: var(--surface-light);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.skill-info-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.skill-info-details {
  flex: 1;
}

.skill-info-details strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 4px;
  color: var(--text);
}

.skill-info-details span {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ========================================
   CLASS INFO PASSIVES PREVIEW
   ======================================== */
.passives-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-style: italic;
}

.passives-loading,
.passives-empty {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.class-info-passives {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.passive-preview-item {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
  border: 1px solid rgba(147, 51, 234, 0.2);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: all 0.2s ease;
}

.passive-preview-item:hover {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.15) 0%, rgba(59, 130, 246, 0.15) 100%);
  border-color: rgba(147, 51, 234, 0.35);
}

.passive-preview-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.passive-preview-details {
  flex: 1;
  min-width: 0;
}

.passive-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  gap: 8px;
}

.passive-preview-header strong {
  font-size: 0.9rem;
  color: var(--text);
}

.passive-preview-level {
  background: rgba(147, 51, 234, 0.3);
  color: #c4b5fd;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.passive-preview-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
  display: block;
}

.passives-more {
  text-align: center;
  padding: 10px;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(251, 191, 36, 0.1);
  border-radius: 8px;
  border: 1px dashed rgba(251, 191, 36, 0.3);
}

/* ========================================
   FLEE BUTTON GLOW (Near Death)
   ======================================== */
.flee-btn.danger-glow {
  animation: flee-pulse 1s ease-in-out infinite;
  border-color: var(--health-enemy);
  color: var(--health-enemy);
  background: rgba(239, 68, 68, 0.1);
}

@keyframes flee-pulse {
  0%, 100% {
    box-shadow: 0 0 5px rgba(239, 68, 68, 0.4), 0 0 15px rgba(239, 68, 68, 0.2);
  }
  50% {
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.6), 0 0 30px rgba(239, 68, 68, 0.4);
  }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.screen-shake {
  animation: shake 0.3s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}

/* ========================================
   CLUE SEARCH SECTION
   ======================================== */
.clue-search-section {
  margin-top: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  border: 1px solid rgba(255, 179, 71, 0.3);
  text-align: center;
}

.clue-search-header h3 {
  color: var(--accent);
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.clue-search-info {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-bottom: 4px;
}

.clue-search-chance {
  color: var(--text);
  font-size: 0.8rem;
  margin-bottom: 10px;
}

.clue-search-chance span {
  color: #22c55e;
  font-weight: 700;
  font-size: 0.95rem;
}

.clue-search-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.clue-search-buttons .btn {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.clue-search-buttons .energy-cost {
  opacity: 0.7;
  font-size: 0.7rem;
}

/* ========================================
   CLUE SLOT MACHINE - 3D DESIGN
   ======================================== */
.clue-slot-machine {
  margin-top: 16px;
  perspective: 1000px;
}

.slot-machine-container {
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
  border-radius: 16px;
  padding: 16px;
  border: 3px solid #3d3d5c;
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.8),
    inset 0 2px 0 rgba(255, 255, 255, 0.1),
    inset 0 -2px 0 rgba(0, 0, 0, 0.3);
}

.slot-machine-header {
  text-align: center;
  margin-bottom: 12px;
}

.slot-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffd700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.6), 0 2px 4px rgba(0, 0, 0, 0.8);
  margin-bottom: 4px;
}

.slot-subtitle {
  font-size: 0.7rem;
  color: #8892b0;
  letter-spacing: 0.1em;
}

.slot-cabinet {
  background: linear-gradient(145deg, #2d2d44, #1a1a2e);
  border-radius: 12px;
  padding: 12px;
  border: 2px solid #4a4a6a;
  box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.5);
}

.slot-frame {
  position: relative;
  background: #000;
  border-radius: 8px;
  padding: 4px;
  border: 3px solid #5a5a7a;
  box-shadow: 
    inset 0 0 20px rgba(0, 0, 0, 0.9),
    0 4px 12px rgba(0, 0, 0, 0.5);
}

.slot-window {
  position: relative;
  height: 80px;
  overflow: hidden;
  border-radius: 6px;
  background: linear-gradient(180deg, 
    rgba(0, 0, 0, 0.8) 0%, 
    rgba(20, 20, 40, 0.4) 20%, 
    rgba(40, 40, 80, 0.2) 50%, 
    rgba(20, 20, 40, 0.4) 80%, 
    rgba(0, 0, 0, 0.8) 100%
  );
}

.slot-reels {
  display: flex;
  height: 100%;
  gap: 4px;
  padding: 0 4px;
}

.reel {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, 
    #1a1a2e 0%, 
    #2a2a4e 20%, 
    #3a3a6e 50%, 
    #2a2a4e 80%, 
    #1a1a2e 100%
  );
  border-radius: 4px;
  box-shadow: 
    inset 0 0 10px rgba(0, 0, 0, 0.8),
    inset 2px 0 4px rgba(255, 255, 255, 0.05),
    inset -2px 0 4px rgba(255, 255, 255, 0.05);
}

.reel::before,
.reel::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 25px;
  z-index: 5;
  pointer-events: none;
}

.reel::before {
  top: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent);
}

.reel::after {
  bottom: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.9), transparent);
}

.reel-strip {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.symbol {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
}

@keyframes reelSpin {
  0% { transform: translateY(0); }
  100% { transform: translateY(-640px); }
}

.reel-strip.spinning {
  animation: reelSpin 0.12s linear infinite;
}

.slot-payline {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 215, 0, 0.8) 20%, 
    rgba(255, 215, 0, 1) 50%, 
    rgba(255, 215, 0, 0.8) 80%, 
    transparent
  );
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
  z-index: 10;
}

.slot-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.1) 0%, 
    transparent 50%
  );
  pointer-events: none;
  border-radius: 6px;
}

.slot-result-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  z-index: 20;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.slot-result-overlay.active {
  opacity: 1;
}

.slot-result-overlay .result-badge {
  padding: 10px 24px;
  border-radius: 50px;
  font-weight: 800;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  animation: badgePop 0.4s ease-out;
}

@keyframes badgePop {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.result-badge.jackpot {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #1a1a2e;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.8), 0 4px 20px rgba(0, 0, 0, 0.5);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.result-badge.success {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.6), 0 4px 15px rgba(0, 0, 0, 0.4);
}

.result-badge.fail {
  background: linear-gradient(135deg, #6b7280, #4b5563);
  color: #e5e7eb;
  box-shadow: 0 0 15px rgba(107, 114, 128, 0.5), 0 4px 15px rgba(0, 0, 0, 0.4);
}

.slot-result-text {
  text-align: center;
  margin-top: 12px;
  min-height: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.slot-result-text.success {
  color: #22c55e;
}

.slot-result-text.jackpot {
  color: #ffd700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.slot-result-text.fail {
  color: #9ca3af;
}

/* Win glow effects */
.slot-machine-container.glow-success {
  border-color: rgba(34, 197, 94, 0.6);
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.8),
    0 0 30px rgba(34, 197, 94, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.1);
}

.slot-machine-container.glow-jackpot {
  border-color: rgba(255, 215, 0, 0.8);
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.8),
    0 0 50px rgba(255, 215, 0, 0.5),
    inset 0 2px 0 rgba(255, 255, 255, 0.1);
  animation: jackpotGlow 0.5s ease-in-out 3;
}

@keyframes jackpotGlow {
  0%, 100% { 
    box-shadow: 
      0 10px 40px rgba(0, 0, 0, 0.8),
      0 0 50px rgba(255, 215, 0, 0.5);
  }
  50% { 
    box-shadow: 
      0 10px 40px rgba(0, 0, 0, 0.8),
      0 0 80px rgba(255, 215, 0, 0.8);
  }
}

/* ========================================
   VICTORY CONFETTI
   ======================================== */
.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1001;
  overflow: hidden;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -20px;
  opacity: 0;
  animation: confettiFall 3s ease-out forwards;
}

.confetti.square {
  border-radius: 2px;
}

.confetti.circle {
  border-radius: 50%;
}

.confetti.ribbon {
  width: 4px;
  height: 16px;
  border-radius: 2px;
}

@keyframes confettiFall {
  0% {
    opacity: 1;
    top: -20px;
    transform: translateX(0) rotate(0deg);
  }
  100% {
    opacity: 0;
    top: 100vh;
    transform: translateX(var(--drift, 50px)) rotate(var(--rotation, 720deg));
  }
}

/* ========================================
   QUEST CIRCLES SECTION
   ======================================== */
.quest-circles-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.quest-circles-section h4 {
  margin: 0 0 16px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.quest-circles-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.quest-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.quest-circle:hover {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.3);
  transform: translateY(-2px);
}

.quest-circle.completed {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
}

.quest-circle.claimable {
  background: rgba(251, 191, 36, 0.15);
  border-color: rgba(251, 191, 36, 0.5);
  animation: questPulse 2s ease-in-out infinite;
}

@keyframes questPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.4); }
  50% { box-shadow: 0 0 15px 3px rgba(251, 191, 36, 0.3); }
}

.quest-ring-container {
  position: relative;
  width: 60px;
  height: 60px;
}

.quest-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.quest-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 6;
}

.quest-ring-fill {
  fill: none;
  stroke: var(--gold);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 264;
  stroke-dashoffset: 264;
  transition: stroke-dashoffset 0.5s ease;
}

.quest-circle.completed .quest-ring-fill {
  stroke: #22c55e;
  stroke-dashoffset: 0;
}

.quest-ring-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.4rem;
}

.quest-label {
  margin-top: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  letter-spacing: 0.5px;
}

.quest-status {
  margin-top: 4px;
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
}

.quest-circle.claimable .quest-status {
  color: var(--gold);
  font-weight: 600;
}

.quest-circle.completed .quest-status {
  color: #22c55e;
}

/* Quest Modal */
.quest-modal-content {
  max-width: 400px;
  margin: auto;
  text-align: left;
}

.quest-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.quest-modal-icon {
  font-size: 2rem;
}

.quest-modal-header h2 {
  margin: 0;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.2rem;
  color: var(--text);
}

.quest-modal-description {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0 0 20px 0;
}

.quest-modal-rewards {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.quest-reward-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.quest-reward-item:last-child {
  border-bottom: none;
}

.quest-reward-item.completed {
  opacity: 0.5;
}

.quest-reward-item.completed .quest-reward-text::after {
  content: ' ✓';
  color: #22c55e;
}

.quest-reward-item.claimable {
  background: rgba(251, 191, 36, 0.1);
  border-radius: 6px;
  padding: 8px 10px;
  margin: -8px -10px;
}

.quest-reward-icon {
  font-size: 1.2rem;
}

.quest-reward-text {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text);
}

.quest-reward-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  color: var(--gold);
  font-weight: 600;
}

.quest-reward-locked {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.quest-reward-locked .lock-icon {
  font-size: 0.9rem;
  opacity: 0.6;
}

.quest-modal-progress {
  margin-top: 16px;
}

.quest-progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}

.quest-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #f59e0b);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.quest-progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.quest-modal-actions {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}

.quest-claim-btn {
  padding: 12px 32px;
  font-size: 1rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold), #f59e0b);
  border: none;
  border-radius: 8px;
  color: #000;
  cursor: pointer;
  transition: all 0.3s ease;
}

.quest-claim-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
}

.quest-claim-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ========================================
   QUICK VICTORY TOAST
   Non-intrusive reward notification
   ======================================== */
.quick-victory-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  z-index: 10000;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.95), rgba(16, 185, 129, 0.95));
  border-radius: 12px;
  padding: 12px 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(34, 197, 94, 0.3);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.quick-victory-toast.show {
  transform: translateX(-50%) translateY(0);
}

.quick-victory-toast .toast-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quick-victory-toast .toast-icon {
  font-size: 1.5rem;
}

.quick-victory-toast .toast-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

/* ========================================
   MOBILE RESPONSIVE FIXES
   ======================================== */

/* Hide sidebar logo and toggle on mobile - cleaner layout */

/* Mobile portrait - stack buttons vertically */
@media (max-width: 480px) {
  .skill-buttons {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    width: 100%;
  }
  
  .skill-btn {
    width: 100% !important;
    height: 48px !important;
    min-width: unset !important;
    font-size: 0.7rem !important;
    padding: 6px !important;
  }
  
  .skill-btn-icon {
    font-size: 1.1rem !important;
  }
  
  .battle-footer {
    padding: 0.75rem !important;
    gap: 8px !important;
  }
  
  .actions-section {
    flex-direction: column !important;
    gap: 8px !important;
  }
  
  .flee-btn {
    width: 100% !important;
    padding: 10px !important;
  }
  
  /* Ensure mob and HP visible */
  .battle-arena {
    min-height: auto !important;
    padding: 0.5rem !important;
  }
  
  #arena-container {
    min-height: 180px !important;
    max-height: 35vh !important;
  }
  
  .enemy-health-bar {
    width: 100% !important;
    max-width: none !important;
  }
  
  /* Compact header */
  .top-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.5rem !important;
  }
  
  .top-bar-line {
    font-size: 0.7rem !important;
    padding: 0.4rem 0.8rem !important;
    justify-content: center;
  }
}

/* Mobile landscape - ensure visibility */
@media (max-height: 500px) and (orientation: landscape) {
  .battle-main {
    grid-template-rows: auto 1fr auto !important;
    max-height: 100vh !important;
    overflow-y: auto !important;
  }
  
  #arena-container {
    min-height: 120px !important;
    max-height: 30vh !important;
  }
  
  .skill-buttons {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
  }
  
  .skill-btn {
    width: 44px !important;
    height: 44px !important;
    flex-shrink: 0;
  }
  
  .battle-footer {
    padding: 0.5rem !important;
  }
  
  .combat-log-section {
    display: none !important;
  }
}

/* Ensure modal is scrollable on mobile */
.modal {
  max-height: 90vh !important;
  overflow-y: auto !important;
}

.modal-content {
  max-height: 85vh !important;
  overflow-y: auto !important;
}

/* Fix notification z-index */
.notification-panel,
.notification-overlay {
  z-index: 9999 !important;
}

/* ========================================
   COMBO BADGE
   ======================================== */
.combo-badge {
  position: absolute;
  top: 50px;
  left: 50%;
  transform: translateX(-50%) scale(0);
  padding: 8px 20px;
  background: linear-gradient(135deg, #f97316, #fbbf24);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #000;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
  z-index: 150;
  opacity: 0;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.5);
}

.combo-badge.active {
  opacity: 1;
  transform: translateX(-50%) scale(var(--combo-scale, 1));
  animation: comboPulse 0.5s ease-in-out infinite;
}

.combo-badge.break {
  animation: comboBreak 0.5s ease-out;
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

@keyframes comboPulse {
  0%, 100% { 
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.5);
  }
  50% { 
    box-shadow: 0 4px 30px rgba(249, 115, 22, 0.8);
  }
}

@keyframes comboBreak {
  0% { 
    transform: translateX(-50%) scale(1.2);
    opacity: 1;
  }
  100% { 
    transform: translateX(-50%) scale(0.5);
    opacity: 0;
  }
}

/* ========================================
   DEATH PARTICLES
   ======================================== */
.death-particle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  pointer-events: none;
  animation: deathParticle 0.6s ease-out forwards;
  z-index: 200;
}

@keyframes deathParticle {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx, 50px), var(--dy, -50px)) scale(0.2);
  }
}

/* ========================================
   SOUND TOGGLE BUTTON
   ======================================== */
.sound-toggle,
.sound-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(20, 16, 10, 0.8);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s ease;
  color: var(--text);
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 50;
}

.sound-toggle:hover,
.sound-toggle-btn:hover {
  background: rgba(251, 191, 36, 0.15);
  border-color: rgba(251, 191, 36, 0.4);
}

.sound-toggle-btn.muted {
  opacity: 0.6;
  border-color: rgba(255, 100, 100, 0.3);
}

/* ========================================
   PASSIVES TOGGLE BUTTON
   ======================================== */
.passives-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(20, 16, 10, 0.8);
  border: 1px solid rgba(147, 51, 234, 0.3);
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s ease;
  color: var(--text);
  position: absolute;
  top: 8px;
  left: 52px;
  z-index: 50;
}

.passives-toggle-btn:hover {
  background: rgba(147, 51, 234, 0.2);
  border-color: rgba(147, 51, 234, 0.5);
  transform: scale(1.05);
}

.passives-toggle-btn:active {
  transform: scale(0.95);
}

/* ========================================
   COMBO BADGE
   ======================================== */
.combo-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, var(--gold) 0%, #f59e0b 100%);
  border-radius: 12px;
  padding: 4px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: comboPulse 0.5s ease-out, comboFloat 2s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
  z-index: 50;
}

.combo-badge.super {
  background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
  box-shadow: 0 0 25px rgba(249, 115, 22, 0.6);
}

.combo-badge.mega {
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
  box-shadow: 0 0 30px rgba(236, 72, 153, 0.7);
  animation: comboPulse 0.5s ease-out, comboFloat 2s ease-in-out infinite, megaGlow 1s ease-in-out infinite;
}

.combo-count {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1a0f00;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
  line-height: 1;
}

.combo-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: #1a0f00;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@keyframes comboPulse {
  0% { transform: scale(1.3); }
  50% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

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

@keyframes megaGlow {
  0%, 100% { box-shadow: 0 0 30px rgba(236, 72, 153, 0.7); }
  50% { box-shadow: 0 0 45px rgba(139, 92, 246, 0.9); }
}

/* ========================================
   ENHANCED SHAKE WITH INTENSITY
   ======================================== */
.arena-container.shake {
  animation: arenaShake calc(0.26s * var(--shake-intensity, 1)) ease-out;
}

@keyframes arenaShake {
  0%, 100% { transform: translateX(0); }
  10% { transform: translateX(calc(-5px * var(--shake-intensity, 1))); }
  20% { transform: translateX(calc(5px * var(--shake-intensity, 1))); }
  30% { transform: translateX(calc(-4px * var(--shake-intensity, 1))); }
  40% { transform: translateX(calc(4px * var(--shake-intensity, 1))); }
  50% { transform: translateX(calc(-3px * var(--shake-intensity, 1))); }
  60% { transform: translateX(calc(3px * var(--shake-intensity, 1))); }
  70% { transform: translateX(calc(-2px * var(--shake-intensity, 1))); }
  80% { transform: translateX(calc(2px * var(--shake-intensity, 1))); }
  90% { transform: translateX(calc(-1px * var(--shake-intensity, 1))); }
}

/* ========================================
   MOBILE BATTLE IMPROVEMENTS
   ======================================== */

@media (max-width: 480px) {
  /* Extra small screens */
  .monster-image-wrap {
    width: 140px !important;
    height: 140px !important;
  }
  
  .monster-card {
    gap: 8px !important;
  }
  
  .circular-hp-container {
    width: 65px !important;
    height: 65px !important;
  }
  
  .intent-badge {
    padding: 3px 8px !important;
    font-size: 0.55rem !important;
  }
  
  .monster-name {
    font-size: 0.9rem !important;
  }
  
  /* 2x2 skill grid on very small screens */
  .skill-buttons {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  .skill-btn {
    height: 56px !important;
  }
  
  .skill-btn .skill-name {
    display: block !important;
    font-size: 0.5rem !important;
  }
}

/* ========================================
   ENERGY REFILL MODAL
   ======================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease-out;
}

.energy-refill-modal {
  width: 90%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(135deg, rgba(26, 15, 0, 0.98) 0%, rgba(20, 12, 0, 0.98) 100%);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 16px;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.energy-refill-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(251, 191, 36, 0.2);
}

.energy-refill-modal .modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--gold);
}

.energy-refill-modal .modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.energy-refill-modal .modal-close-btn:hover {
  background: rgba(255, 100, 100, 0.1);
  color: #ff6b6b;
}

.energy-refill-modal .modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.energy-status {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.energy-status > div {
  background: rgba(0, 0, 0, 0.3);
  padding: 12px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.energy-status .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.energy-status .value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.energy-balance .value {
  color: var(--gold);
}

.refill-selector label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.preset-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.preset-btn {
  flex: 1;
  padding: 10px 8px;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 8px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.preset-btn:hover {
  background: rgba(251, 191, 36, 0.2);
  border-color: rgba(251, 191, 36, 0.4);
}

.preset-btn.active {
  background: var(--gold);
  color: #1a0f00;
  border-color: var(--gold);
}

.custom-amount {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.energy-slider {
  width: 100%;
  height: 8px;
  appearance: none;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  outline: none;
}

.energy-slider::-webkit-slider-thumb {
  appearance: none;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--gold) 0%, #f59e0b 100%);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.4);
}

.energy-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--gold) 0%, #f59e0b 100%);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.4);
}

.amount-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
}

.amount-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
}

.amount-label {
  font-size: 1rem;
  color: var(--text-muted);
}

.cost-summary {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  padding: 12px;
}

.cost-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.cost-row + .cost-row {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.cost-row.total {
  font-weight: 600;
  color: var(--text);
  font-size: 1rem;
}

.cost-row.total .affordable {
  color: #4ade80;
}

.cost-row.total .expensive {
  color: #ff6b6b;
}

.cost-row.result {
  color: var(--text);
}

.new-energy {
  color: var(--gold);
  font-weight: 600;
}

.overflow-badge {
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  color: #064e3b;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  font-weight: 700;
}

.refill-error {
  background: rgba(255, 100, 100, 0.1);
  border: 1px solid rgba(255, 100, 100, 0.3);
  color: #ff6b6b;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  text-align: center;
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.modal-actions button {
  flex: 1;
  padding: 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}

.cancel-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.cancel-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
}

.refill-btn {
  background: linear-gradient(135deg, var(--gold) 0%, #f59e0b 100%);
  border: none;
  color: #1a0f00;
}

.refill-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
}

.refill-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.energy-refill-modal .modal-footer {
  padding: 12px 20px 16px;
  border-top: 1px solid rgba(251, 191, 36, 0.1);
}

.refill-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

/* Energy Refill Button in Player Panel */
.refill-energy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2) 0%, rgba(245, 158, 11, 0.2) 100%);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 8px;
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
  width: 100%;
}

.refill-energy-btn:hover {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.3) 0%, rgba(245, 158, 11, 0.3) 100%);
  border-color: var(--gold);
  transform: translateY(-1px);
}

.refill-energy-btn .btn-icon {
  font-size: 1rem;
}

.low-energy-pulse {
  animation: lowEnergyPulse 2s ease-in-out infinite;
}

@keyframes lowEnergyPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0); }
  50% { box-shadow: 0 0 15px 3px rgba(251, 191, 36, 0.4); }
}

/* Mobile responsive */
@media (max-width: 480px) {
  .energy-refill-modal {
    width: 95%;
    max-height: 85vh;
  }
  
  .preset-buttons {
    flex-wrap: wrap;
  }
  
  .preset-btn {
    min-width: calc(33% - 6px);
  }
  
  .amount-value {
    font-size: 1.75rem;
  }
}

/* ========================================
   ENHANCED MOBILE BATTLE OPTIMIZATIONS
   Touch-friendly, readable, fast UX
   ======================================== */


@media (max-width: 480px) {
  /* Full-width skill bar on small screens */
  .battle-footer {
    padding: 10px !important;
  }
  
  .skill-buttons {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px !important;
    width: 100% !important;
  }
  
  .skill-btn {
    width: 100% !important;
    height: 56px !important;
    padding: 6px !important;
    border-radius: 10px !important;
  }
  
  .skill-btn .skill-icon {
    font-size: 1.5rem !important;
  }
  
  .skill-btn .skill-name {
    font-size: 0.55rem !important;
    margin-top: 2px;
  }
  
  /* Compact monster card */
  .monster-card {
    gap: 10px !important;
  }
  
  .monster-image-wrap {
    width: 100px !important;
    height: 100px !important;
  }
  
  .monster-name {
    font-size: 1rem !important;
  }
  
  /* Player HP bar prominent */
  .player-hp-bar {
    height: 28px !important;
    border-radius: 8px !important;
  }
  
  .player-hp-text {
    font-size: 0.9rem !important;
    font-weight: 700 !important;
  }
}

/* ========================================
   PRE-BATTLE SCREEN - Modern Design
   ======================================== */

.pre-battle-screen {
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 20, 0.95);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: pbFadeIn 0.25s ease-out;
  overflow: hidden; /* No scrollbar on overlay itself */
}

@keyframes pbFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.pre-battle-card {
  background: linear-gradient(180deg, rgba(26, 28, 33, 0.98) 0%, rgba(15, 17, 20, 0.99) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 
    0 0 0 1px rgba(247, 160, 15, 0.1),
    0 20px 40px rgba(0, 0, 0, 0.5);
}

/* Header */
.pb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pb-back-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;

/* Hint modal (popup) */
.pb2-hint-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1002;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.pb2-hint-modal {
  width: min(520px, 100%);
  max-height: 80vh;
  background: #0b0f14;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.6);
  overflow: hidden;
}

.pb2-hint-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.pb2-hint-modal-title {
  font-weight: 700;
  letter-spacing: 0.2px;
}

.pb2-hint-modal-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.92);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.pb2-hint-modal-body {
  padding: 12px;
  overflow: auto;
  max-height: calc(80vh - 54px);
  -webkit-overflow-scrolling: touch;
}
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pb-back-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.pb-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--tl-primary, #f7a00f);
  margin: 0;
  letter-spacing: 1px;
}

.pb-spacer {
  width: 36px;
}

/* Element Matchup */
.pb-element-matchup {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.25rem;
  text-align: center;
}

.pb-element-matchup.effect-advantage {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(34, 197, 94, 0.05) 100%);
  border-color: rgba(34, 197, 94, 0.3);
}

.pb-element-matchup.effect-disadvantage {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.05) 100%);
  border-color: rgba(239, 68, 68, 0.3);
}

.pb-element-matchup.effect-neutral {
  background: linear-gradient(135deg, rgba(156, 163, 175, 0.1) 0%, rgba(156, 163, 175, 0.03) 100%);
  border-color: rgba(156, 163, 175, 0.2);
}

.pb-matchup-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.pb-element-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.pb-elem-icon {
  font-size: 1.75rem;
}

.pb-elem-name {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.6);
}

.pb-vs {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
  padding: 0.25rem 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.pb-matchup-result {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.effect-advantage .pb-matchup-result {
  color: #4ade80;
}

.effect-disadvantage .pb-matchup-result {
  color: #f87171;
}

.pb-result-icon {
  font-size: 1rem;
}

.pb-element-tip {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
}

.pb-element-tip strong {
  color: var(--tl-primary, #f7a00f);
}

/* Stats Grid */
.pb-stats-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.pb-stats-panel {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 1rem;
}

.pb-player {
  border-color: rgba(0, 217, 255, 0.2);
}

.pb-enemy {
  border-color: rgba(239, 68, 68, 0.2);
}

.pb-panel-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pb-panel-icon {
  font-size: 1.25rem;
}

.pb-panel-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
}

.pb-enemy-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.pb-enemy-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.pb-diff-badge,
.pb-elite-badge,
.pb-tier-badge {
  font-size: 0.55rem;
  padding: 2px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.pb-diff-badge {
  color: #000;
}

.pb-elite-badge {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
}

.pb-tier-badge {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
}

.pb-stats-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pb-stat-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
}

.pb-stat-row.reverse {
  flex-direction: row-reverse;
}

.pb-stat-icon {
  font-size: 0.9rem;
  width: 20px;
  text-align: center;
}

.pb-stat-label {
  flex: 1;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pb-stat-row.reverse .pb-stat-label {
  text-align: right;
}

.pb-stat-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  min-width: 40px;
}

.pb-stat-value.win {
  color: #4ade80;
}

.pb-stat-value.lose {
  color: #f87171;
}

.pb-stat-row.reverse .pb-stat-value {
  text-align: left;
}

/* VS Arrows */
.pb-vs-arrows {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
  padding-top: 2.5rem;
}

.pb-arrow {
  width: 20px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: bold;
  border-radius: 4px;
}

.pb-arrow.win {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.15);
}

.pb-arrow.lose {
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
}

/* Equipment Section */
.pb-equipment-section {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.pb-equipment-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary, #9ca3af);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
  text-align: center;
}

.pb-equipment-row {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.pb-equip-slot {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: var(--slot-bg, rgba(75, 85, 99, 0.3));
  border: 2px solid var(--slot-border, #4b5563);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.pb-equip-slot.equipped {
  box-shadow: 0 0 8px var(--slot-border, #4b5563);
}

.pb-equip-slot.empty {
  opacity: 0.5;
}

.pb-equip-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

.pb-equip-slot.empty .pb-equip-img {
  opacity: 0.4;
  filter: grayscale(100%);
}

.pb-equip-tier {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--slot-border, #4b5563);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
  line-height: 1;
}

.pb-equip-element {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}

.pb-equip-empty {
  position: absolute;
  bottom: 2px;
  font-size: 0.6rem;
  color: #6b7280;
}

/* Element colors for slots */
.pb-equip-slot[data-element="fire"] {
  --slot-border: #f97316;
  --slot-bg: rgba(249, 115, 22, 0.2);
}

.pb-equip-slot[data-element="water"] {
  --slot-border: #3b82f6;
  --slot-bg: rgba(59, 130, 246, 0.2);
}

.pb-equip-slot[data-element="earth"] {
  --slot-border: #84cc16;
  --slot-bg: rgba(132, 204, 22, 0.2);
}

.pb-equip-slot[data-element="air"] {
  --slot-border: #a78bfa;
  --slot-bg: rgba(167, 139, 250, 0.2);
}

/* Equipment Actions Row */
.pb-equipment-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.75rem;
}

.pb-equipment-actions .pb-btn {
  flex: 0 1 auto;
  padding: 0.5rem 1rem;
}

/* Action Buttons */
.pb-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.pb-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  min-width: 100px;
}

.pb-equip-btn {
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.pb-equip-btn:hover {
  background: rgba(249, 115, 22, 0.25);
  transform: translateY(-1px);
}

.pb-auto-equip-btn {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
  position: relative;
}

.pb-auto-equip-btn:hover:not(.disabled) {
  background: rgba(168, 85, 247, 0.25);
  transform: translateY(-1px);
}

.pb-auto-equip-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pb-auto-uses {
  font-size: 0.65rem;
  opacity: 0.8;
  background: rgba(0,0,0,0.3);
  padding: 2px 6px;
  border-radius: 8px;
  margin-left: 4px;
}

.pb-fight-btn {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.pb-fight-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(34, 197, 94, 0.4);
}

/* Mobile Responsive */
@media (max-width: 600px) {
  .pre-battle-card {
    padding: 1rem;
    border-radius: 12px;
    max-height: 95vh;
  }
  
  .pb-title {
    font-size: 0.95rem;
  }
  
  .pb-equipment-row {
    gap: 0.35rem;
  }
  
  .pb-equip-slot {
    width: 42px;
    height: 42px;
  }
  
  .pb-equip-img {
    width: 28px;
    height: 28px;
  }
  
  .pb-stats-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .pb-vs-arrows {
    display: none;
  }
  
  .pb-stat-row.reverse {
    flex-direction: row;
  }
  
  .pb-stat-row.reverse .pb-stat-label {
    text-align: left;
  }
  
  .pb-matchup-row {
    gap: 0.75rem;
  }
  
  .pb-elem-icon {
    font-size: 1.5rem;
  }
  
  .pb-actions {
    flex-direction: column;
  }
  
  .pb-btn {
    padding: 0.875rem;
    flex: none;
    width: 100%;
  }
}

/* End of Pre-Battle Screen */


/* ========================================
   PRE-BATTLE SCREEN V2 - Interactive Equipment
   ======================================== */

.pre-battle-screen.pb2 {
  padding: 0.5rem;
}

.pb2-card {
  max-width: 700px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Header */
.pb2-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pb2-back-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pb2-back-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.pb2-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--tl-primary, #f7a00f);
  margin: 0;
}

.pb2-spacer {
  width: 32px;
}

/* Element Tip Banner */
.pb2-element-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(247, 160, 15, 0.12) 0%, rgba(247, 160, 15, 0.05) 100%);
  border: 1px solid rgba(247, 160, 15, 0.25);
}

.pb2-element-banner.pb2-tip-banner {
  background: linear-gradient(90deg, rgba(247, 160, 15, 0.15) 0%, rgba(247, 160, 15, 0.05) 100%);
  border-color: rgba(247, 160, 15, 0.3);
}

/* Element Hint Section - Shows below actions after reveal */
.pb2-element-hint-section {
  margin: 0.5rem 0 0 0;
  display: flex;
  justify-content: center;
  max-height: 200px;
  overflow-y: auto;
}

/* Custom scrollbar for element hint section */
.pb2-element-hint-section::-webkit-scrollbar {
  width: 6px;
}

.pb2-element-hint-section::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.pb2-element-hint-section::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.pb2-element-hint-section::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Old reveal button - no longer used but keeping for reference */
.pb2-reveal-hint-btn {
  display: none;
}

/* Hint button in action bar - grey style */
.pb2-btn.pb2-hint-btn {
  background: linear-gradient(135deg, rgba(100, 100, 110, 0.3) 0%, rgba(70, 70, 80, 0.25) 100%);
  border: 1px solid rgba(150, 150, 160, 0.4);
  color: #b0b0b8;
}

.pb2-btn.pb2-hint-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(120, 120, 130, 0.4) 0%, rgba(90, 90, 100, 0.35) 100%);
  border-color: rgba(180, 180, 190, 0.5);
  box-shadow: 0 4px 12px rgba(100, 100, 110, 0.3);
}

.pb2-btn.pb2-hint-btn.disabled,
.pb2-btn.pb2-hint-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pb2-hint-icon {
  font-size: 1.1rem;
}

.pb2-hint-label {
  flex: 1;
}

.pb2-hint-cost {
  padding: 0.25rem 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  font-size: 0.7rem;
  color: #fbbf24;
}

/* Element Matchup Tooltip */
.pb2-element-matchup-tooltip {
  width: 100%;
  max-width: 400px;
  background: linear-gradient(180deg, rgba(30, 32, 45, 0.98) 0%, rgba(20, 22, 30, 0.99) 100%);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 12px;
  padding: 1rem;
  animation: pb2FadeIn 0.3s ease-out;
}

.pb2-matchup-header {
  text-align: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pb2-matchup-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pb2-matchup-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
}

.pb2-matchup-row.boost {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.pb2-matchup-row.penalty {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.pb2-matchup-row.neutral {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.pb2-matchup-element {
  font-size: 0.85rem;
  font-weight: 500;
  color: #fff;
}

.pb2-matchup-effect {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
}

.pb2-matchup-row.boost .pb2-matchup-effect {
  color: #4ade80;
}

.pb2-matchup-row.penalty .pb2-matchup-effect {
  color: #f87171;
}

.pb2-matchup-row.neutral .pb2-matchup-effect {
  color: rgba(255, 255, 255, 0.6);
}

.pb2-tip-text {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
}

.pb2-tip-text strong {
  color: var(--tl-primary, #f7a00f);
}

.pb2-element-banner.effect-advantage {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.15) 0%, rgba(34, 197, 94, 0.05) 100%);
  border-color: rgba(34, 197, 94, 0.3);
}

.pb2-element-banner.effect-disadvantage {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.05) 100%);
  border-color: rgba(239, 68, 68, 0.3);
}

.pb2-matchup-icons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pb2-elem {
  font-size: 1.25rem;
}

.pb2-vs-small {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
}

.pb2-matchup-text {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
}

.effect-advantage .pb2-matchup-text {
  color: #4ade80;
}

.effect-disadvantage .pb2-matchup-text {
  color: #f87171;
}

/* Arena */
.pb2-arena {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.5rem;
  align-items: start;
}

/* Combatant Sides */
.pb2-combatant {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pb2-combatant-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
}

.pb2-player-side .pb2-combatant-header {
  border-left: 3px solid #00d9ff;
}

.pb2-enemy-side .pb2-combatant-header {
  border-left: 3px solid #ef4444;
}

.pb2-avatar {
  font-size: 1.25rem;
}

.pb2-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
}

.pb2-enemy-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.pb2-enemy-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
}

.pb2-badge {
  font-size: 0.6rem;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: capitalize;
  font-weight: 600;
  color: #fff;
  background: rgba(100, 100, 100, 0.5);
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Element badge colors */
.pb2-badge.element-badge[data-element="fire"] {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.7), rgba(220, 38, 38, 0.5));
  border: 1px solid #f87171;
}
.pb2-badge.element-badge[data-element="water"] {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.7), rgba(37, 99, 235, 0.5));
  border: 1px solid #60a5fa;
}
.pb2-badge.element-badge[data-element="earth"] {
  background: linear-gradient(135deg, rgba(139, 69, 19, 0.7), rgba(120, 53, 15, 0.5));
  border: 1px solid #a16207;
}
.pb2-badge.element-badge[data-element="air"] {
  background: linear-gradient(135deg, rgba(156, 163, 175, 0.7), rgba(107, 114, 128, 0.5));
  border: 1px solid #9ca3af;
}

/* Class badge colors */
.pb2-badge.class-badge[data-class="warrior"] {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.7), rgba(185, 28, 28, 0.5));
  border: 1px solid #f87171;
}
.pb2-badge.class-badge[data-class="rogue"] {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.7), rgba(91, 33, 182, 0.5));
  border: 1px solid #a78bfa;
}
.pb2-badge.class-badge[data-class="mage"] {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.7), rgba(29, 78, 216, 0.5));
  border: 1px solid #60a5fa;
}
.pb2-badge.class-badge[data-class="archer"] {
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.7), rgba(21, 128, 61, 0.5));
  border: 1px solid #4ade80;
}
.pb2-badge.class-badge[data-class="healer"] {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.7), rgba(202, 138, 4, 0.5));
  border: 1px solid #fcd34d;
}

.pb2-badge.elite {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.5), rgba(139, 92, 246, 0.4));
  color: #e9d5ff;
  border: 1px solid #a78bfa;
}

/* =====================================================
   ENEMY IMAGE CONTAINER - Preview Screen
   ===================================================== */
.pb2-enemy-image-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  flex: 1;
}

/* ENLARGED mob image container */
.pb2-enemy-image-container.enlarged {
  padding: 0.5rem;
  gap: 0;
}

.pb2-enemy-image-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(139, 69, 19, 0.2));
  border: 3px solid rgba(239, 68, 68, 0.4);
  box-shadow: 
    0 0 30px rgba(239, 68, 68, 0.2),
    inset 0 0 30px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ENLARGED mob image - fill the enemy side */
.pb2-enemy-image-wrap.enlarged {
  width: 100%;
  max-width: 220px;
  height: auto;
  aspect-ratio: 1;
  border-radius: 16px;
  border-width: 4px;
  overflow: visible;
}

.pb2-enemy-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.pb2-enemy-image-wrap.enlarged .pb2-enemy-image {
  border-radius: 14px;
}

.pb2-enemy-fallback {
  font-size: 4rem;
  animation: pulse-glow 2s ease-in-out infinite;
}

.pb2-enemy-image-wrap.enlarged .pb2-enemy-fallback {
  font-size: 6rem;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

.pb2-enemy-element-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, rgba(20, 20, 30, 0.95), rgba(40, 40, 50, 0.9));
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.pb2-enemy-image-wrap.enlarged .pb2-enemy-element-badge {
  width: 44px;
  height: 44px;
  font-size: 1.5rem;
  bottom: -8px;
  right: -8px;
}

/* Level badge - BELOW image (legacy) */
.pb2-enemy-level-badge {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  padding: 0.4rem 1rem;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.3), rgba(139, 69, 19, 0.4));
  border: 2px solid rgba(239, 68, 68, 0.5);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.2);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Level badge - ON TOP of image */
.pb2-enemy-level-badge-top {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  padding: 0.3rem 0.8rem;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.9), rgba(139, 69, 19, 0.85));
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  z-index: 10;
  white-space: nowrap;
}

/* Stats overlay on image */
.pb2-enemy-stats-overlay {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  z-index: 10;
}

/* When stats are outside image-wrap (new structure), position relative to container */
.pb2-enemy-image-container > .pb2-enemy-stats-overlay {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
}

.pb2-stat-chip {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  background: rgba(20, 20, 30, 0.95);
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.pb2-stat-chip.win {
  background: rgba(239, 68, 68, 0.9);
  border-color: rgba(239, 68, 68, 0.8);
  color: #fff;
}

.pb2-stat-chip.lose {
  background: rgba(74, 222, 128, 0.15);
  border-color: rgba(74, 222, 128, 0.3);
  color: #4ade80;
}

/* =====================================================
   MOB PASSIVES SECTION
   ===================================================== */
.pb2-mob-passives {
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 10px;
}

.pb2-mob-passives-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(239, 68, 68, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pb2-passive-count {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
}

.pb2-mob-passives-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 120px;
  overflow-y: auto;
}

.pb2-mob-passives-list::-webkit-scrollbar {
  width: 3px;
}

.pb2-mob-passives-list::-webkit-scrollbar-thumb {
  background: rgba(239, 68, 68, 0.3);
  border-radius: 3px;
}

.pb2-mob-passive-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.pb2-passive-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.pb2-passive-info {
  flex: 1;
  min-width: 0;
}

.pb2-passive-name {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: #f87171;
  margin-bottom: 2px;
}

.pb2-passive-desc {
  display: block;
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.3;
}

.pb2-mob-passives-hint {
  font-size: 0.7rem;
  color: rgba(251, 191, 36, 0.9);
  text-align: center;
  padding: 8px;
  background: rgba(251, 191, 36, 0.1);
  border-radius: 6px;
}

/* =====================================================
   DESKTOP: Mob stats below picture instead of overlay
   ===================================================== */
@media (min-width: 900px) {
  /* Reorganize enemy image container for column layout */
  .pb2-enemy-image-container.enlarged {
    flex-direction: column;
    position: relative;
  }
  
  /* Stats below the image on desktop */
  .pb2-enemy-image-container > .pb2-enemy-stats-overlay {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    margin-top: 12px;
    justify-content: center;
  }
  
  /* Make stat chips slightly larger on desktop */
  .pb2-enemy-image-container > .pb2-enemy-stats-overlay .pb2-stat-chip {
    padding: 6px 12px;
    font-size: 0.8rem;
    gap: 5px;
  }
}

/* Equipment Column - 2x3 grid for card-like slots */
.pb2-equipment-col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  padding-top: 10px; /* Space for tier badges */
}

/* =====================================================
   SLOT CARD - Identical to GearCard styling
   ===================================================== */
.pb2-slot {
  --slot-bg: #4b5563;
  --slot-border: #6b7280;
  --slot-text: #9ca3af;
  --slot-glow: rgba(107, 114, 128, 0.4);
  
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0;
  
  width: 100%;
  aspect-ratio: 0.88;
  padding: 0;
  overflow: visible;
  
  background: linear-gradient(
    180deg, 
    color-mix(in srgb, var(--slot-bg) 25%, rgba(20, 22, 30, 0.98)) 0%, 
    rgba(12, 14, 20, 0.99) 100%
  );
  border: 2px solid var(--slot-border);
  border-radius: 10px;
  
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); /* Smoother easing */
  opacity: 0;
  transform: translateY(15px) scale(0.85);
}

.pb2-slot.revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.pb2-slot.enemy-slot {
  cursor: default;
  transform: translateY(15px) scale(0.85);
}

.pb2-slot.enemy-slot.revealed {
  transform: translateY(0) scale(1);
}

.pb2-slot.equipped {
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.4),
    0 0 20px var(--slot-glow);
}

.pb2-slot:not(.enemy-slot):hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.5),
    0 0 24px var(--slot-glow),
    0 0 40px color-mix(in srgb, var(--slot-glow) 50%, transparent);
}

.pb2-slot.selected {
  border-color: var(--tl-primary, #f7a00f);
  box-shadow: 
    0 0 0 2px rgba(247, 160, 15, 0.3),
    0 4px 20px rgba(247, 160, 15, 0.3);
}

.pb2-slot.has-upgrade {
  animation: pb2PulseGlow 2s ease-in-out infinite;
}

@keyframes pb2PulseGlow {
  0%, 100% { box-shadow: 0 0 8px var(--slot-glow); }
  50% { box-shadow: 0 0 16px var(--tl-primary, #f7a00f), 0 0 28px rgba(247, 160, 15, 0.4); }
}

/* ─────────────────────────────────────────────────────
   Tier Badge - Floats above slot (identical to GearCard)
   ───────────────────────────────────────────────────── */
.pb2-slot-tier-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 18px;
  padding: 0 6px;
  
  background: linear-gradient(135deg, var(--slot-border) 0%, var(--slot-bg) 100%);
  border: 1px solid color-mix(in srgb, var(--slot-border) 80%, white 20%);
  border-radius: 4px;
  
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.4),
    0 0 12px var(--slot-glow);
}

.pb2-tier-num {
  font-family: 'Cinzel', 'Times New Roman', serif;
  font-size: 0.6rem;
  font-weight: 700;
  color: #000;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
  letter-spacing: 0.03em;
}

/* ─────────────────────────────────────────────────────
   Element Overlay - Shows on hover (like GearCard)
   ───────────────────────────────────────────────────── */
.pb2-slot-element-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  
  font-size: 1.5rem;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.8));
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.pb2-slot:hover .pb2-slot-element-overlay {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
}

/* ─────────────────────────────────────────────────────
   Header Zone - Stars (like GearCard)
   ───────────────────────────────────────────────────── */
.pb2-slot-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 4px 4px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, transparent 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.pb2-slot-stars {
  display: flex;
  gap: 1px;
}

.pb2-slot-stars .star {
  font-size: 0.7rem;
  line-height: 1;
  transition: all 0.15s ease;
}

.pb2-slot-stars .star.lit {
  color: var(--slot-text);
  text-shadow: 
    0 0 6px var(--slot-glow),
    0 0 12px var(--slot-glow),
    0 1px 3px rgba(0, 0, 0, 0.5);
  filter: drop-shadow(0 0 3px var(--slot-border));
}

.pb2-slot-stars .star.dim {
  color: rgba(255, 255, 255, 0.15);
}

/* ─────────────────────────────────────────────────────
   Visual Zone - Item image with element coloring
   ───────────────────────────────────────────────────── */
.pb2-slot-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  
  background: radial-gradient(
    ellipse 80% 70% at center 50%,
    var(--slot-glow) 0%,
    transparent 65%
  );
}

.pb2-slot-img-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.pb2-slot-img {
  max-width: 85%;
  max-height: 42px;
  object-fit: contain;
  opacity: 0.75;
  
  filter: 
    drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6))
    drop-shadow(0 6px 16px var(--slot-glow));
  
  transition: transform 0.25s ease, filter 0.25s ease, opacity 0.25s ease;
}

.pb2-slot:hover .pb2-slot-img {
  opacity: 1;
  transform: scale(1.05) translateY(-1px);
}

/* ─────────────────────────────────────────────────────
   Element-based color effects (identical to GearCard)
   ───────────────────────────────────────────────────── */
/* Fire - Red tint */
.pb2-slot[data-element="fire"] .pb2-slot-img {
  filter: 
    drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6))
    sepia(0.5) saturate(2) hue-rotate(-20deg) brightness(1.05);
}

.pb2-slot[data-element="fire"]:hover .pb2-slot-img {
  filter: 
    drop-shadow(0 6px 12px rgba(0, 0, 0, 0.7))
    sepia(0.5) saturate(2.2) hue-rotate(-20deg) brightness(1.15);
}

/* Water - Blue tint */
.pb2-slot[data-element="water"] .pb2-slot-img {
  filter: 
    drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6))
    drop-shadow(0 6px 16px rgba(66, 165, 245, 0.4))
    sepia(0.2) saturate(1.3) hue-rotate(180deg);
}

.pb2-slot[data-element="water"]:hover .pb2-slot-img {
  filter: 
    drop-shadow(0 6px 12px rgba(0, 0, 0, 0.7))
    drop-shadow(0 10px 24px rgba(66, 165, 245, 0.5))
    sepia(0.2) saturate(1.4) hue-rotate(180deg) brightness(1.1);
}

/* Earth - White/bright */
.pb2-slot[data-element="earth"] .pb2-slot-img {
  filter: 
    drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6))
    drop-shadow(0 6px 16px rgba(200, 200, 220, 0.4))
    brightness(1.15) contrast(0.95) saturate(0.7);
}

.pb2-slot[data-element="earth"]:hover .pb2-slot-img {
  filter: 
    drop-shadow(0 6px 12px rgba(0, 0, 0, 0.7))
    drop-shadow(0 10px 24px rgba(200, 200, 220, 0.5))
    brightness(1.25) contrast(0.95) saturate(0.7);
}

/* Air - Greyscale/silver */
.pb2-slot[data-element="air"] .pb2-slot-img {
  filter: 
    drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6))
    grayscale(0.8) brightness(1.15) contrast(1.05);
}

.pb2-slot[data-element="air"]:hover .pb2-slot-img {
  filter: 
    drop-shadow(0 6px 12px rgba(0, 0, 0, 0.7))
    grayscale(0.7) brightness(1.25) contrast(1.1);
}

/* ─────────────────────────────────────────────────────
   Footer Zone - Element icon
   ───────────────────────────────────────────────────── */
.pb2-slot-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4px 4px 6px;
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  min-height: 20px;
}

.pb2-slot-element {
  font-size: 0.85rem;
  line-height: 1;
  opacity: 0.9;
}

/* ─────────────────────────────────────────────────────
   Tier Theme Specifics (identical to GearCard)
   ───────────────────────────────────────────────────── */
.pb2-slot[data-tier-theme="grey"] {
  background: linear-gradient(180deg, rgba(45, 50, 60, 0.95) 0%, rgba(20, 22, 28, 0.99) 100%);
}

.pb2-slot[data-tier-theme="bronze"] {
  background: linear-gradient(180deg, rgba(50, 38, 28, 0.95) 0%, rgba(25, 18, 12, 0.99) 100%);
}
.pb2-slot[data-tier-theme="bronze"] .pb2-tier-num { color: #1a1a1a; }

.pb2-slot[data-tier-theme="silver"] {
  background: linear-gradient(180deg, rgba(55, 55, 65, 0.95) 0%, rgba(28, 28, 35, 0.99) 100%);
}
.pb2-slot[data-tier-theme="silver"] .pb2-tier-num { color: #1a1a1a; }

.pb2-slot[data-tier-theme="gold"] {
  background: linear-gradient(180deg, rgba(55, 48, 25, 0.95) 0%, rgba(30, 25, 12, 0.99) 100%);
}
.pb2-slot[data-tier-theme="gold"] .pb2-tier-num { color: #1a1a1a; }

.pb2-slot[data-tier-theme="diamond"] {
  background: linear-gradient(180deg, rgba(35, 55, 65, 0.95) 0%, rgba(18, 28, 35, 0.99) 100%);
}
.pb2-slot[data-tier-theme="diamond"] .pb2-tier-num { color: #0a2a3a; }

.pb2-slot[data-tier-theme="ruby"] {
  background: linear-gradient(180deg, rgba(55, 25, 35, 0.95) 0%, rgba(30, 12, 18, 0.99) 100%);
}
.pb2-slot[data-tier-theme="ruby"] .pb2-tier-num { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }

.pb2-slot[data-tier-theme="emerald"] {
  background: linear-gradient(180deg, rgba(25, 50, 38, 0.95) 0%, rgba(12, 28, 20, 0.99) 100%);
}
.pb2-slot[data-tier-theme="emerald"] .pb2-tier-num { color: #0a2a1a; }

/* ─────────────────────────────────────────────────────
   Empty Slot Styling
   ───────────────────────────────────────────────────── */
.pb2-slot.empty {
  border-style: dashed;
  opacity: 0.7;
  background: rgba(30, 32, 40, 0.6);
}

.pb2-slot.empty .pb2-slot-header,
.pb2-slot.empty .pb2-slot-visual,
.pb2-slot.empty .pb2-slot-footer {
  display: none;
}

.pb2-slot-empty-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.pb2-slot-label {
  font-size: 1rem;
  opacity: 0.5;
}

.pb2-slot-plus {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.3);
  font-weight: bold;
}

/* Tier Change Indicator */
.pb2-tier-change {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  animation: pb2FadeInUp 0.3s ease-out;
}

.pb2-tier-change.up {
  background: rgba(34, 197, 94, 0.9);
  color: #fff;
}

.pb2-tier-change.down {
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
}

@keyframes pb2FadeInUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ─────────────────────────────────────────────────────
   Boost Animation - Element tier change reveal
   ───────────────────────────────────────────────────── */
.pb2-boost-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 30;
  
  font-family: 'Orbitron', 'Segoe UI', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 6px;
  
  animation: pb2BoostPop 1.2s ease-out forwards;
  pointer-events: none;
}

.pb2-boost-indicator.up {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.95) 0%, rgba(22, 163, 74, 0.95) 100%);
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  box-shadow: 
    0 0 20px rgba(34, 197, 94, 0.6),
    0 0 40px rgba(34, 197, 94, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.3);
}

.pb2-boost-indicator.down {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.95) 0%, rgba(220, 38, 38, 0.95) 100%);
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  box-shadow: 
    0 0 20px rgba(239, 68, 68, 0.6),
    0 0 40px rgba(239, 68, 68, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.3);
}

@keyframes pb2BoostPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.3);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.3);
  }
  30% {
    transform: translate(-50%, -50%) scale(0.95);
  }
  45% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  80% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
}

/* Permanent tier ribbon showing element matchup */
.pb2-tier-ribbon {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 25;
  
  font-family: 'Orbitron', 'Segoe UI', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  
  pointer-events: none;
}

.pb2-tier-ribbon.bonus {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.95) 0%, rgba(22, 163, 74, 0.95) 100%);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 2px 6px rgba(34, 197, 94, 0.5);
}

.pb2-tier-ribbon.penalty {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.95) 0%, rgba(220, 38, 38, 0.95) 100%);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.5);
}

.pb2-tier-ribbon.neutral {
  background: linear-gradient(135deg, rgba(107, 114, 128, 0.9) 0%, rgba(75, 85, 99, 0.9) 100%);
  color: #e5e7eb;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 2px 6px rgba(75, 85, 99, 0.4);
}

/* Slot boost state animations */
.pb2-slot.boost-up {
  animation: pb2SlotBoostUp 0.5s ease-out;
}

.pb2-slot.boost-down {
  animation: pb2SlotBoostDown 0.5s ease-out;
}

.pb2-slot.boost-neutral {
  animation: pb2SlotBoostNeutral 0.3s ease-out;
}

@keyframes pb2SlotBoostUp {
  0% {
    box-shadow: 0 0 0 rgba(34, 197, 94, 0);
  }
  50% {
    box-shadow: 
      0 0 30px rgba(34, 197, 94, 0.8),
      0 0 60px rgba(34, 197, 94, 0.5),
      inset 0 0 20px rgba(34, 197, 94, 0.2);
  }
  100% {
    box-shadow: 
      0 0 15px rgba(34, 197, 94, 0.4),
      0 0 30px rgba(34, 197, 94, 0.2);
  }
}

@keyframes pb2SlotBoostDown {
  0% {
    box-shadow: 0 0 0 rgba(239, 68, 68, 0);
  }
  50% {
    box-shadow: 
      0 0 30px rgba(239, 68, 68, 0.8),
      0 0 60px rgba(239, 68, 68, 0.5),
      inset 0 0 20px rgba(239, 68, 68, 0.2);
  }
  100% {
    box-shadow: 
      0 0 15px rgba(239, 68, 68, 0.4),
      0 0 30px rgba(239, 68, 68, 0.2);
  }
}

@keyframes pb2SlotBoostNeutral {
  0% {
    box-shadow: 0 0 0 rgba(156, 163, 175, 0);
  }
  50% {
    box-shadow: 
      0 0 20px rgba(156, 163, 175, 0.5),
      inset 0 0 10px rgba(156, 163, 175, 0.1);
  }
  100% {
    box-shadow: var(--slot-glow);
  }
}

/* Equip Result Animation */
.pb2-equip-result {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.85rem;
  animation: pb2ResultPop 0.4s ease-out;
  z-index: 10;
}

.pb2-equip-result.up {
  text-shadow: 0 0 8px #22c55e;
}

.pb2-equip-result.down {
  text-shadow: 0 0 8px #ef4444;
}

.pb2-equip-result.same {
  text-shadow: 0 0 8px #9ca3af;
}

@keyframes pb2ResultPop {
  0% {
    opacity: 0;
    transform: translateX(-50%) scale(0.5);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) scale(1.2);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
}

/* Slot States */
.pb2-slot.equipping {
  opacity: 0.5;
  pointer-events: none;
}

.pb2-slot.upgraded {
  animation: pb2ShakeUp 0.5s ease-out;
}

.pb2-slot.downgraded {
  animation: pb2ShakeDown 0.5s ease-out;
}

.pb2-slot.same {
  animation: pb2ShakeSame 0.3s ease-out;
}

@keyframes pb2ShakeUp {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-3px) rotate(-1deg); }
  40% { transform: translateX(3px) rotate(1deg); }
  60% { transform: translateX(-2px) rotate(-0.5deg); }
  80% { transform: translateX(2px) rotate(0.5deg); }
}

@keyframes pb2ShakeDown {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-3px) rotate(-1deg); }
  40% { transform: translateX(3px) rotate(1deg); }
  60% { transform: translateX(-2px) rotate(-0.5deg); }
  80% { transform: translateX(2px) rotate(0.5deg); }
}

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

/* Center VS */
.pb2-center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 60px;
}

.pb2-vs-badge {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

/* Stats Row */
.pb2-stats-row {
  display: flex;
  gap: 0.25rem;
  padding: 0.35rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
}

.pb2-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  font-size: 0.65rem;
  padding: 0.2rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
}

.pb2-stat span:first-child {
  font-size: 0.75rem;
}

.pb2-stat span:last-child {
  font-family: 'Orbitron', sans-serif;
  font-weight: 600;
}

.pb2-stat.win {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.1);
}

.pb2-stat.lose {
  color: #f87171;
  background: rgba(239, 68, 68, 0.1);
}

/* Drawer */
.pb2-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1001;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: pb2FadeIn 0.2s ease-out;
}

@keyframes pb2FadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.pb2-drawer {
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  background: linear-gradient(180deg, rgba(25, 28, 35, 0.99) 0%, rgba(15, 17, 22, 1) 100%);
  border-top: 3px solid var(--tl-primary, #f7a00f);
  border-radius: 24px 24px 0 0;
  padding: 1.5rem 1.5rem 2.5rem;
  overflow-y: auto;
  animation: pb2SlideUp 0.3s ease-out;
  
  /* Themed scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(247, 160, 15, 0.5) rgba(0, 0, 0, 0.2);
}

/* Webkit scrollbar styling for drawer */
.pb2-drawer::-webkit-scrollbar {
  width: 8px;
}

.pb2-drawer::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.pb2-drawer::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--tl-primary, #f7a00f) 0%, rgba(247, 160, 15, 0.6) 100%);
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.3);
}

.pb2-drawer::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #ffb733 0%, var(--tl-primary, #f7a00f) 100%);
}

@keyframes pb2SlideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.pb2-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pb2-drawer-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--tl-primary, #f7a00f);
}

.pb2-drawer-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pb2-drawer-close:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

/* Section Labels */
.pb2-drawer-section-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.75rem;
  margin-top: 0.5rem;
}

/* Currently Equipped Section */
.pb2-drawer-current {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.75rem;
  margin-bottom: 1rem;
}

.pb2-drawer-current .pb2-drawer-section-label {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.pb2-drawer-current-item {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  margin-bottom: 0.5rem;
}

.pb2-drawer-current-item .gc {
  width: 120px;
  min-width: 120px;
  flex-shrink: 0;
  margin-top: 14px; /* Space for tier badge */
}

.pb2-current-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pb2-current-tier {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
}

.pb2-current-element {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  width: fit-content;
}

.pb2-current-element.boost {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.pb2-current-element.penalty {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.pb2-unequip-btn {
  padding: 0.5rem 1rem;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  color: #f87171;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  width: fit-content;
}

.pb2-unequip-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
}

/* Drawer Grid - 3 columns for larger drawer, comfortable spacing */
.pb2-drawer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding: 16px 8px 24px;
}

.pb2-drawer-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.85rem;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

/* GearCard wrapper in drawer */
.pb2-drawer-card-wrap {
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 12px;
  padding: 0;
  padding-bottom: 16px; /* Space for element badge below */
}

/* GearCard in drawer - ensure proper sizing and spacing */
.pb2-drawer-card-wrap .gc {
  width: 100%;
  margin-top: 14px; /* Space for tier badge above */
}

.pb2-drawer-card-wrap:hover {
  transform: translateY(-4px);
}

.pb2-drawer-card-wrap:hover .gc {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* Element badge on drawer card - shows +2, -2, or +0 */
.pb2-card-element-badge {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.pb2-card-element-badge.up {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  border-color: rgba(34, 197, 94, 0.4);
}

.pb2-card-element-badge.down {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  border-color: rgba(239, 68, 68, 0.4);
}

.pb2-card-element-badge.neutral {
  background: linear-gradient(135deg, #4b5563, #374151);
  color: rgba(255, 255, 255, 0.85);
}

/* Legacy styles for backwards compat */
.pb2-card-element-boost {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 6px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 2px;
}

.pb2-card-element-boost.up {
  background: rgba(34, 197, 94, 0.95);
  color: #fff;
}

.pb2-card-element-boost.down {
  background: rgba(239, 68, 68, 0.95);
  color: #fff;
}

/* Comparison badge */
.pb2-card-compare {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 8px;
  z-index: 10;
  white-space: nowrap;
}

.pb2-card-compare.better {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
}

.pb2-card-compare.worse {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.pb2-card-compare.same {
  background: rgba(107, 114, 128, 0.8);
  color: #fff;
}

/* Best item badge */
.pb2-card-best-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ffd700, #f7a00f);
  color: #000;
  padding: 3px 10px;
  border-radius: 8px;
  z-index: 11;
  box-shadow: 0 2px 10px rgba(255, 215, 0, 0.5);
  white-space: nowrap;
}

/* Tip */
.pb2-tip {
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  padding: 0.5rem;
  background: rgba(247, 160, 15, 0.1);
  border: 1px solid rgba(247, 160, 15, 0.2);
  border-radius: 8px;
}

.pb2-tip strong {
  color: var(--tl-primary, #f7a00f);
}

/* Actions */
.pb2-actions {
  display: flex;
  gap: 0.5rem;
}

.pb2-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pb2-auto-btn {
  flex: 0 0 auto;
  background: linear-gradient(135deg, rgba(100, 100, 110, 0.3) 0%, rgba(70, 70, 80, 0.25) 100%);
  color: #b0b0b8;
  border: 1px solid rgba(150, 150, 160, 0.4);
}

.pb2-auto-btn:hover:not(.disabled):not(:disabled) {
  background: linear-gradient(135deg, rgba(120, 120, 130, 0.4) 0%, rgba(90, 90, 100, 0.35) 100%);
  border-color: rgba(180, 180, 190, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(100, 100, 110, 0.3);
}

.pb2-auto-btn.disabled,
.pb2-auto-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pb2-fight-btn {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.pb2-fight-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(34, 197, 94, 0.4);
}

/* Tablet Responsive - 2 column drawer */

/* Mobile Responsive */
@media (max-width: 480px) {
  .pb2-card {
    padding: 0.75rem;
    gap: 0.5rem;
  }
  
  .pb2-title {
    font-size: 0.9rem;
  }
  
  .pb2-arena {
    grid-template-columns: 1fr 30px 1fr;
    gap: 0.25rem;
  }
  
  .pb2-slot {
    height: 42px;
  }
  
  .pb2-slot-img {
    width: 26px;
    height: 26px;
  }
  
  .pb2-slot-label {
    font-size: 0.75rem;
    left: 4px;
  }
  
  .pb2-slot-tier {
    font-size: 0.5rem;
    padding: 1px 3px;
  }
  
  .pb2-slot-element {
    font-size: 0.6rem;
  }
  
  .pb2-center {
    padding-top: 50px;
  }
  
  .pb2-vs-badge {
    font-size: 0.6rem;
    padding: 0.2rem 0.35rem;
  }
  
  .pb2-stats-row {
    gap: 0.15rem;
    padding: 0.25rem;
  }
  
  .pb2-stat {
    font-size: 0.6rem;
    padding: 0.15rem;
  }
  
  .pb2-stat span:first-child {
    font-size: 0.65rem;
  }
  
  .pb2-drawer {
    max-height: 70vh;
    padding: 1rem;
  }
  
  .pb2-drawer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .pb2-drawer-item-img {
    width: 30px;
    height: 30px;
  }
  
  .pb2-actions {
    flex-direction: column;
  }
  
  .pb2-btn {
    width: 100%;
    padding: 0.875rem;
  }
  
  .pb2-auto-btn {
    flex: none;
  }
}

/* Very small screens */
@media (max-width: 360px) {
  .pb2-arena {
    grid-template-columns: 1fr 24px 1fr;
  }
  
  .pb2-slot {
    height: 38px;
  }
  
  .pb2-slot-img {
    width: 22px;
    height: 22px;
  }
  
  .pb2-slot-label {
    display: none;
  }
  
  .pb2-combatant-header {
    padding: 0.3rem 0.4rem;
  }
  
  .pb2-avatar {
    font-size: 1rem;
  }
  
  .pb2-name {
    font-size: 0.65rem;
  }
  
  .pb2-drawer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
}

/* End of Pre-Battle Screen V2 */

/* ========================================
   INLINE ENERGY REFILL BUTTON
   Always visible next to energy bar
   ======================================== */

.refill-energy-btn-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.25) 0%, rgba(245, 158, 11, 0.2) 100%);
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 6px;
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: auto;
  white-space: nowrap;
}

.refill-energy-btn-inline:hover {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.4) 0%, rgba(245, 158, 11, 0.35) 100%);
  border-color: var(--gold);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
}

.refill-energy-btn-inline .btn-icon {
  font-size: 0.85rem;
}

.refill-energy-btn-inline .btn-text {
  display: inline;
}

@media (max-width: 480px) {
  .refill-energy-btn-inline .btn-text {
    display: none;
  }
  
  .refill-energy-btn-inline {
    padding: 4px 8px;
  }
}

/* ========================================
   ENERGY PACKAGES MODAL
   New package-based refill system
   ======================================== */

/* Old .energy-packages-modal styles replaced by .epkg-* classes */

/* ========================================
   ENERGY PACKAGES MODAL - NEW DESIGN
   Horizontal layout with buttons in cards
   ======================================== */

.epkg-modal {
  width: min(95vw, 720px);
  max-height: 90vh;
  overflow-y: auto;
  padding: 0;
  background: linear-gradient(180deg, rgba(20, 25, 35, 0.98) 0%, rgba(15, 18, 25, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.epkg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.epkg-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.epkg-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.epkg-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.epkg-body {
  padding: 1.25rem;
}

/* Loading & Error */
.epkg-loading,
.epkg-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.epkg-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--energy-color);
  border-radius: 50%;
  animation: epkgSpin 0.8s linear infinite;
}

@keyframes epkgSpin {
  to { transform: rotate(360deg); }
}

/* Status Bar */
.epkg-status {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  margin-bottom: 1rem;
}

.epkg-stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.epkg-stat-icon {
  font-size: 1rem;
}

.epkg-stat-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.epkg-escalation {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--gold);
}

.epkg-escalation .epkg-reset {
  opacity: 0.7;
}

/* Packages Row - Horizontal 4 columns */
.epkg-packages {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.epkg-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1rem 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  text-align: center;
  transition: all 0.2s;
}

.epkg-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
}

.epkg-card.best-deal {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.08);
}

.epkg-card.best-deal:hover {
  border-color: rgba(34, 197, 94, 0.7);
  background: rgba(34, 197, 94, 0.12);
}

.epkg-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 8px;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  border-radius: 4px;
  font-size: 0.55rem;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
}

.epkg-energy {
  margin-bottom: 0.5rem;
}

.epkg-amount {
  display: inline;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--energy-color);
  line-height: 1;
  text-shadow: 0 0 20px rgba(0, 217, 255, 0.3);
}

.epkg-bonus {
  display: inline;
  font-size: 0.9rem;
  font-weight: 700;
  color: #22c55e;
  margin-left: 4px;
}

.epkg-unit {
  display: block;
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.epkg-price {
  margin-bottom: 0.75rem;
}

.epkg-eur-per {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
}

.epkg-total {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Buy Button - Green */
.epkg-buy-btn {
  width: 100%;
  padding: 0.625rem 0.5rem;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: auto;
}

.epkg-buy-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
}

.epkg-buy-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.epkg-btn-loading {
  display: inline-block;
  animation: epkgBtnPulse 0.8s ease-in-out infinite;
}

@keyframes epkgBtnPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Get TLRPG Button - Grey */
.epkg-get-tlrpg-btn {
  display: block;
  width: 100%;
  padding: 0.625rem 0.5rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  transition: all 0.2s;
  margin-top: auto;
}

.epkg-get-tlrpg-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text);
}

/* Note */
.epkg-note {
  padding: 0.625rem 1rem;
  background: rgba(0, 217, 255, 0.06);
  border: 1px solid rgba(0, 217, 255, 0.12);
  border-radius: 8px;
  font-size: 0.75rem;
  color: var(--energy-color);
  text-align: center;
}

/* Mobile Responsive - 2x2 grid */
@media (max-width: 600px) {
  .epkg-modal {
    width: 100%;
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 85vh;
  }
  
  .epkg-header {
    padding: 0.875rem 1rem;
  }
  
  .epkg-body {
    padding: 1rem;
  }
  
  .epkg-status {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
  }
  
  .epkg-stat {
    flex: 1 1 auto;
  }
  
  .epkg-escalation {
    flex: 1 1 100%;
    margin-left: 0;
    justify-content: center;
  }
  
  .epkg-packages {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.625rem;
  }
  
  .epkg-card {
    padding: 0.875rem 0.625rem;
  }
  
  .epkg-badge {
    font-size: 0.5rem;
    padding: 2px 6px;
  }
  
  .epkg-amount {
    font-size: 1.5rem;
  }
  
  .epkg-eur-per {
    font-size: 0.85rem;
  }
  
  .epkg-buy-btn,
  .epkg-get-tlrpg-btn {
    padding: 0.5rem;
    font-size: 0.6rem;
  }
}

/* Very small screens */
@media (max-width: 360px) {
  .epkg-packages {
    gap: 0.5rem;
  }
  
  .epkg-card {
    padding: 0.75rem 0.5rem;
  }
  
  .epkg-amount {
    font-size: 1.25rem;
  }
  
  .epkg-eur-per {
    font-size: 0.75rem;
  }
  
  .epkg-buy-btn,
  .epkg-get-tlrpg-btn {
    font-size: 0.55rem;
  }
}

/* ========================================
   ENHANCED MOBILE BATTLE HUB
   Optimized layout for small screens
   ======================================== */


@media (max-width: 480px) {
  /* Extra compact mode for small phones */
  .player-panel {
    padding: 0.75rem !important;
  }
  
  .player-class-box {
    width: 40px !important;
    height: 40px !important;
  }
  
  .class-level {
    font-size: 1rem !important;
  }
  
  .player-details h3 {
    font-size: 0.9rem !important;
  }
  
  .player-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.25rem !important;
  }
  
  .stat-item {
    padding: 0.25rem !important;
  }
  
  .stat-label {
    font-size: 0.5rem !important;
  }
  
  .stat-value {
    font-size: 0.75rem !important;
  }
  
  /* XP bar compact */
  .player-xp-inline {
    gap: 0.25rem !important;
  }
  
  .xp-text-mini {
    font-size: 0.55rem !important;
  }
  
  /* Energy bar compact */
  .energy-row {
    flex-wrap: wrap !important;
    gap: 0.25rem !important;
  }
  
  .energy-label {
    font-size: 0.65rem !important;
  }
  
  .energy-timer-mini {
    font-size: 0.55rem !important;
  }
  
  .energy-text-mini {
    font-size: 0.6rem !important;
  }
  
  /* Elements - horizontal scroll on very small screens */
  .element-bars {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    gap: 0.5rem !important;
    padding-bottom: 0.25rem !important;
  }
  
  .elem-row {
    flex: 0 0 auto !important;
    flex-direction: column !important;
    align-items: center !important;
    min-width: 50px !important;
  }
  
  .elem-bar-track {
    width: 100% !important;
    height: 4px !important;
  }
  
  /* Skills - horizontal scroll */
  .skills-row {
    display: flex !important;
    overflow-x: auto !important;
    gap: 0.5rem !important;
    padding-bottom: 0.25rem !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  .skill-preview-item {
    flex: 0 0 auto !important;
    min-width: 60px !important;
  }
}

/* Mobile pre-battle styles moved to end of file for proper cascade */
  
  /* Hint modal */
  .pb2-hint-modal {
    max-width: 95vw !important;
    margin: auto !important;
  }
}

/* ========================================
   MOBILE BATTLE ARENA FIXES
   Better mob visibility and combat logs
   ======================================== */

@media (max-width: 600px) {
  .battle-arena {
    height: auto !important;
    min-height: calc(100vh - 100px) !important;
    max-height: none !important;
    padding: 0.5rem !important;
  }
  
  .arena-container {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100% !important;
    padding: 0.5rem !important;
  }
  
  /* Header compact */
  .battle-header {
    padding: 0.5rem !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
  }
  
  .turn-badge {
    padding: 4px 8px !important;
    min-width: 40px !important;
  }
  
  .turn-label {
    font-size: 0.4rem !important;
  }
  
  .turn-value {
    font-size: 0.9rem !important;
  }
  
  .turn-indicator {
    padding: 4px 10px !important;
  }
  
  .turn-indicator span {
    font-size: 0.55rem !important;
  }
  
  /* Sound toggle smaller */
  .sound-toggle-btn {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.8rem !important;
  }
  
  /* MAIN BATTLE AREA - Stack vertically */
  .battle-main {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
    padding: 0.5rem !important;
    flex: 1 !important;
    min-height: 0 !important;
  }
  
  /* MONSTER SECTION - Prominent */
  .monster-section {
    flex: 0 0 auto !important;
  }
  
  .monster-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 0.75rem !important;
    background: rgba(20, 16, 10, 0.9) !important;
    border: 1px solid rgba(251, 191, 36, 0.2) !important;
    border-radius: 12px !important;
  }
  
  /* Monster image - visible and clear */
  .monster-image-wrap {
    flex: 0 0 auto !important;
    width: 80px !important;
    height: 80px !important;
    position: relative !important;
  }
  
  .monster-image {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(0, 0, 0, 0.3) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
  }
  
  .monster-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }
  
  .monster-image:not(:has(img)) {
    font-size: 2.5rem !important;
  }
  
  /* Monster tags overlay */
  .monster-tags-overlay {
    position: absolute !important;
    bottom: -4px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    gap: 4px !important;
    z-index: 5 !important;
  }
  
  .tag-difficulty,
  .tag-element {
    font-size: 0.5rem !important;
    padding: 2px 4px !important;
    border-radius: 3px !important;
    text-transform: uppercase !important;
  }
  
  /* Monster info panel */
  .monster-info-panel {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.35rem !important;
    min-width: 0 !important;
  }
  
  .intent-badge {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    font-size: 0.6rem !important;
    padding: 3px 6px !important;
    border-radius: 4px !important;
    width: fit-content !important;
  }
  
  .monster-name {
    font-size: 0.85rem !important;
    margin: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  
  /* Circular HP - use linear bar on mobile for clarity */
  .circular-hp-container {
    display: none !important;
  }
  
  .monster-hp.hidden {
    display: block !important;
  }
  
  .monster-hp {
    width: 100% !important;
  }
  
  .hp-bar-bg {
    height: 10px !important;
    background: rgba(0, 0, 0, 0.5) !important;
    border-radius: 5px !important;
    overflow: hidden !important;
  }
  
  .hp-bar-fill {
    height: 100% !important;
    background: linear-gradient(90deg, #ef4444, #dc2626) !important;
    border-radius: 5px !important;
    transition: width 0.3s ease !important;
  }
  
  .hp-text {
    font-size: 0.65rem !important;
    color: rgba(255, 255, 255, 0.8) !important;
    margin-top: 2px !important;
    display: block !important;
  }
  
  /* COMBAT LOG - Scrollable with max height */
  .combat-log-section {
    flex: 1 1 auto !important;
    min-height: 80px !important;
    max-height: 120px !important;
    display: flex !important;
    flex-direction: column !important;
    background: rgba(10, 10, 10, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
  }
  
  .log-header {
    padding: 0.35rem 0.5rem !important;
    font-size: 0.6rem !important;
    background: rgba(0, 0, 0, 0.3) !important;
    flex-shrink: 0 !important;
  }
  
  .log-body {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 0.35rem !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.2rem !important;
  }
  
  .log-entry {
    font-size: 0.6rem !important;
    padding: 0.2rem 0.35rem !important;
    border-radius: 4px !important;
    background: rgba(255, 255, 255, 0.03) !important;
  }
  
  /* FOOTER - Player and Skills */
  .battle-footer {
    flex: 0 0 auto !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
    padding: 0.5rem !important;
    background: rgba(10, 10, 10, 0.95) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
  }
  
  /* Player section compact */
  .player-section {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding: 0.35rem !important;
  }
  
  .player-avatar {
    font-size: 1.2rem !important;
    flex-shrink: 0 !important;
  }
  
  .player-hp-wrap {
    flex: 1 !important;
    min-width: 0 !important;
  }
  
  .player-hp-bar {
    height: 14px !important;
    background: rgba(0, 0, 0, 0.5) !important;
    border-radius: 7px !important;
    overflow: hidden !important;
    position: relative !important;
  }
  
  .player-hp-fill {
    height: 100% !important;
    background: linear-gradient(90deg, #22c55e, #16a34a) !important;
    border-radius: 7px !important;
  }
  
  .player-hp-text {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    font-size: 0.55rem !important;
    font-weight: 600 !important;
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8) !important;
  }
  
  /* Actions section */
  .actions-section {
    display: flex !important;
    gap: 0.5rem !important;
    align-items: center !important;
  }
  
  /* Skill buttons - horizontal scroll */
  .skill-buttons {
    display: flex !important;
    gap: 0.35rem !important;
    overflow-x: auto !important;
    flex: 1 !important;
    padding: 0.25rem 0 !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  .skill-btn {
    flex: 0 0 auto !important;
    width: 50px !important;
    height: 50px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    padding: 0.25rem !important;
    border-radius: 8px !important;
    background: rgba(20, 16, 10, 0.9) !important;
    border: 1px solid rgba(251, 191, 36, 0.2) !important;
    touch-action: manipulation !important;
    cursor: pointer !important;
  }
  
  .skill-icon {
    font-size: 1rem !important;
  }
  
  .skill-name {
    font-size: 0.4rem !important;
    max-width: 44px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  
  .cooldown-overlay {
    font-size: 0.8rem !important;
  }
  
  /* Flee button */
  .flee-btn {
    flex: 0 0 auto !important;
    width: 50px !important;
    height: 50px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    padding: 0.25rem !important;
    border-radius: 8px !important;
    background: rgba(239, 68, 68, 0.2) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    font-size: 0.7rem !important;
    touch-action: manipulation !important;
  }
  
  .flee-btn span:first-child {
    font-size: 1rem !important;
  }
  
  .flee-btn span:last-child {
    font-size: 0.4rem !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
  }
}

/* Very small screens */
@media (max-width: 360px) {
  .monster-image-wrap {
    width: 60px !important;
    height: 60px !important;
  }
  
  .skill-btn,
  .flee-btn {
    width: 44px !important;
    height: 44px !important;
  }
  
  .skill-icon {
    font-size: 0.9rem !important;
  }
  
  .skill-name {
    display: none !important;
  }
  
  .combat-log-section {
    max-height: 80px !important;
  }
}

/* ========================================
   MOBILE BATTLE ARENA - FINAL OVERRIDE
   This section must be last to override all conflicting rules
   ======================================== */
@media (max-width: 600px) {
  /* Full viewport battle arena */
  .battle-arena {
    height: auto !important;
    min-height: calc(100vh - 80px) !important;
    max-height: none !important;
    padding: 0.5rem !important;
    display: flex !important;
    flex-direction: column !important;
  }
  
  /* Arena container - flex column layout */
  .arena-container,
  #arena-container {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    min-height: calc(100vh - 100px) !important;
    max-height: none !important;
    padding: 0.5rem !important;
    grid-template-rows: unset !important;
  }
  
  /* BATTLE HEADER - Very compact */
  .battle-header {
    flex: 0 0 auto !important;
    padding: 0.4rem 0.5rem !important;
    gap: 0.4rem !important;
    min-height: unset !important;
  }
  
  .turn-badge {
    padding: 3px 8px !important;
    min-width: 36px !important;
  }
  
  .turn-label {
    font-size: 0.35rem !important;
  }
  
  .turn-value {
    font-size: 0.8rem !important;
  }
  
  .turn-indicator {
    padding: 3px 8px !important;
    font-size: 0.55rem !important;
  }
  
  .sound-toggle-btn {
    width: 26px !important;
    height: 26px !important;
    font-size: 0.75rem !important;
  }
  
  .combo-badge {
    padding: 4px 12px !important;
    font-size: 0.65rem !important;
  }
  
  /* BATTLE MAIN - Monster and combat log */
  .battle-main {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
    padding: 0.4rem !important;
    overflow-y: auto !important;
    min-height: 0 !important;
    grid-template-rows: unset !important;
  }
  
  /* MONSTER SECTION - Horizontal layout, takes up space */
  .monster-section {
    flex: 0 0 auto !important;
  }
  
  .monster-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.6rem !important;
    padding: 0.6rem !important;
    background: rgba(20, 16, 10, 0.95) !important;
    border: 1px solid rgba(251, 191, 36, 0.25) !important;
    border-radius: 10px !important;
  }
  
  /* Monster image - clear and visible */
  .monster-image-wrap {
    flex: 0 0 auto !important;
    width: 70px !important;
    height: 70px !important;
    position: relative !important;
    border-radius: 8px !important;
    overflow: hidden !important;
  }
  
  .monster-image {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(0, 0, 0, 0.4) !important;
    border-radius: 8px !important;
  }
  
  .monster-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }
  
  .monster-image:not(:has(img)) {
    font-size: 2rem !important;
  }
  
  /* Monster tags - bottom of image */
  .monster-tags-overlay {
    position: absolute !important;
    bottom: 2px !important;
    left: 2px !important;
    right: 2px !important;
    display: flex !important;
    gap: 3px !important;
    justify-content: center !important;
    z-index: 5 !important;
  }
  
  .tag-difficulty,
  .tag-element {
    font-size: 0.45rem !important;
    padding: 2px 4px !important;
    border-radius: 3px !important;
    text-transform: uppercase !important;
    font-weight: 600 !important;
  }
  
  /* Monster info - takes remaining space */
  .monster-info-panel {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.3rem !important;
    min-width: 0 !important;
  }
  
  .intent-badge {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    font-size: 0.55rem !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    width: fit-content !important;
    background: rgba(0, 0, 0, 0.4) !important;
  }
  
  .intent-icon {
    font-size: 0.7rem !important;
  }
  
  .intent-text {
    font-size: 0.5rem !important;
  }
  
  .monster-name {
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    margin: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    color: #fbbf24 !important;
  }
  
  /* Use linear HP bar on mobile for clarity */
  .circular-hp-container {
    display: none !important;
  }
  
  .monster-hp.hidden {
    display: block !important;
  }
  
  .monster-hp {
    width: 100% !important;
  }
  
  .hp-bar-bg {
    height: 12px !important;
    background: rgba(0, 0, 0, 0.6) !important;
    border-radius: 6px !important;
    overflow: hidden !important;
  }
  
  .hp-bar-fill {
    height: 100% !important;
    background: linear-gradient(90deg, #ef4444, #dc2626) !important;
    border-radius: 6px !important;
  }
  
  .hp-text {
    font-size: 0.6rem !important;
    color: rgba(255, 255, 255, 0.9) !important;
    margin-top: 3px !important;
    display: block !important;
    text-align: center !important;
  }
  
  /* COMBAT LOG - Compact scrollable */
  .combat-log-section {
    flex: 1 1 auto !important;
    min-height: 60px !important;
    max-height: 100px !important;
    display: flex !important;
    flex-direction: column !important;
    background: rgba(10, 10, 10, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
  }
  
  .log-header {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.55rem !important;
    background: rgba(0, 0, 0, 0.4) !important;
    flex-shrink: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  }
  
  .log-body {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 0.25rem 0.35rem !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.15rem !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  .log-entry {
    font-size: 0.55rem !important;
    padding: 0.15rem 0.25rem !important;
    border-radius: 3px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    line-height: 1.3 !important;
  }
  
  /* BATTLE FOOTER - Player HP and Skills */
  .battle-footer {
    flex: 0 0 auto !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.4rem !important;
    padding: 0.5rem !important;
    background: rgba(10, 10, 10, 0.98) !important;
    border-top: 1px solid rgba(251, 191, 36, 0.15) !important;
    border-radius: 10px 10px 0 0 !important;
  }
  
  /* Player section - horizontal */
  .player-section {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding: 0.3rem !important;
  }
  
  .player-avatar {
    font-size: 1.1rem !important;
    flex-shrink: 0 !important;
  }
  
  .player-hp-wrap {
    flex: 1 !important;
    min-width: 0 !important;
  }
  
  .player-hp-bar {
    height: 16px !important;
    background: rgba(0, 0, 0, 0.6) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    position: relative !important;
    border: 1px solid rgba(34, 197, 94, 0.3) !important;
  }
  
  .player-hp-fill {
    height: 100% !important;
    background: linear-gradient(90deg, #22c55e, #16a34a) !important;
    border-radius: 7px !important;
    transition: width 0.2s ease !important;
  }
  
  .player-hp-text {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    font-size: 0.6rem !important;
    font-weight: 700 !important;
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9) !important;
  }
  
  /* ACTIONS - Skills in horizontal row */
  .actions-section {
    display: flex !important;
    flex-direction: row !important;
    gap: 0.35rem !important;
    align-items: stretch !important;
  }
  
  /* Skill buttons - horizontal scroll row */
  .skill-buttons {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 0.25rem !important;
    overflow-x: auto !important;
    flex: 1 !important;
    padding: 0.15rem !important;
    -webkit-overflow-scrolling: touch !important;
    grid-template-columns: unset !important;
    scrollbar-width: none !important;
  }
  
  .skill-buttons::-webkit-scrollbar {
    display: none !important;
  }
  
  .skill-btn {
    flex: 0 0 auto !important;
    width: 56px !important;
    height: 52px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    padding: 0.25rem !important;
    border-radius: 10px !important;
    background: linear-gradient(145deg, rgba(30, 26, 20, 0.98), rgba(20, 16, 10, 0.98)) !important;
    border: 1px solid rgba(251, 191, 36, 0.3) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
    touch-action: manipulation !important;
    cursor: pointer !important;
    min-width: unset !important;
    transition: transform 0.1s ease, box-shadow 0.1s ease !important;
  }
  
  .skill-btn:active {
    transform: scale(0.92) !important;
    background: linear-gradient(145deg, rgba(251, 191, 36, 0.2), rgba(245, 158, 11, 0.15)) !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
  }
  
  .skill-btn.on-cooldown {
    opacity: 0.4 !important;
    filter: grayscale(0.5) !important;
  }
  
  .skill-icon,
  .skill-btn-icon {
    font-size: 1.15rem !important;
    line-height: 1 !important;
  }
  
  .skill-name {
    font-size: 0.5rem !important;
    max-width: 52px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500 !important;
    line-height: 1 !important;
  }
  
  .cooldown-overlay {
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    color: #fbbf24 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8) !important;
  }
  
  /* Flee button - at end */
  .flee-btn {
    flex: 0 0 auto !important;
    width: 52px !important;
    height: 52px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    padding: 0.25rem !important;
    border-radius: 10px !important;
    background: linear-gradient(145deg, rgba(239, 68, 68, 0.25), rgba(185, 28, 28, 0.2)) !important;
    border: 1px solid rgba(239, 68, 68, 0.5) !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
    touch-action: manipulation !important;
    cursor: pointer !important;
    transition: transform 0.1s ease !important;
  }
  
  .flee-btn:active {
    transform: scale(0.92) !important;
    background: linear-gradient(145deg, rgba(239, 68, 68, 0.4), rgba(185, 28, 28, 0.35)) !important;
  }
  
  .flee-btn span:first-child {
    font-size: 1.15rem !important;
  }
  
  .flee-btn span:last-child {
    font-size: 0.5rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    font-weight: 600 !important;
    color: #fca5a5 !important;
  }
}

/* ========================================
   MOBILE OPTIMIZED - 480px and below
   2025 Touch-First Design
   ======================================== */
@media (max-width: 480px) {
  /* Override any grid layouts for skills */
  .skill-buttons {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    grid-template-columns: unset !important;
  }
  
  .skill-btn {
    width: 52px !important;
    height: 48px !important;
  }
  
  .flee-btn {
    width: 48px !important;
    height: 48px !important;
  }
  
  .monster-image-wrap {
    width: 65px !important;
    height: 65px !important;
  }
  
  /* Combat log more compact */
  .combat-log-section {
    min-height: 50px !important;
    max-height: 70px !important;
  }
  
  .log-entry {
    font-size: 0.5rem !important;
    padding: 0.12rem 0.25rem !important;
  }
}

/* ========================================
   VERY SMALL SCREENS - 360px
   Ultra-compact but usable
   ======================================== */
@media (max-width: 360px) {
  .skill-btn {
    width: 46px !important;
    height: 44px !important;
  }
  
  .flee-btn {
    width: 44px !important;
    height: 44px !important;
  }
  
  .skill-icon,
  .skill-btn-icon {
    font-size: 1rem !important;
  }
  
  .skill-name {
    font-size: 0.4rem !important;
  }
  
  .monster-image-wrap {
    width: 55px !important;
    height: 55px !important;
  }
  
  .combat-log-section {
    max-height: 60px !important;
  }
}

/* ========================================
   PRE-BATTLE SCREEN MOBILE OPTIMIZATION
   Clean equipment slots with visible elements
   ======================================== */
@media (max-width: 600px) {
  .pre-battle-screen.pb2 {
    padding: 0.25rem !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    overflow: hidden !important;
  }
  
  .pb2-card {
    padding: 0.5rem !important;
    gap: 0.4rem !important;
    max-width: 100% !important;
    max-height: calc(100vh - 80px) !important;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
  }
  
  /* Header ultra-compact */
  .pb2-header {
    padding: 0.25rem 0 !important;
    flex-shrink: 0 !important;
  }
  
  .pb2-back-btn {
    width: 32px !important;
    height: 32px !important;
    font-size: 1rem !important;
  }
  
  .pb2-title {
    font-size: 0.8rem !important;
    letter-spacing: 1px !important;
  }
  
  /* Arena - 3 column grid */
  .pb2-arena {
    display: grid !important;
    grid-template-columns: 1fr 24px 1fr !important;
    gap: 0.2rem !important;
    min-height: auto !important;
    flex: 1 1 auto !important;
    overflow: visible !important;
  }
  
  /* Combatant columns */
  .pb2-combatant {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.2rem !important;
    overflow: visible !important;
  }
  
  .pb2-combatant-header {
    padding: 0.2rem 0.3rem !important;
    gap: 0.25rem !important;
    background: rgba(0, 0, 0, 0.3) !important;
    border-radius: 6px !important;
  }
  
  .pb2-avatar {
    font-size: 0.85rem !important;
  }
  
  .pb2-name {
    font-size: 0.6rem !important;
    max-width: 70px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  
  /* Enemy badges compact */
  .pb2-enemy-badges {
    display: flex !important;
    gap: 3px !important;
  }
  
  .pb2-badge {
    font-size: 0.4rem !important;
    padding: 1px 4px !important;
    border-radius: 3px !important;
  }
  
  /* Equipment grid - 2x2 for 4 slots */
  .pb2-equipment-col {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 4px !important;
  }
  
  /* EQUIPMENT SLOTS - Clean modern design */
  .pb2-slot {
    height: 58px !important;
    min-width: 0 !important;
    position: relative !important;
    border-radius: 8px !important;
    background: linear-gradient(145deg, rgba(25, 22, 18, 0.95), rgba(15, 12, 8, 0.95)) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 4px !important;
  }
  
  .pb2-slot.equipped {
    border-color: rgba(251, 191, 36, 0.4) !important;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.15) !important;
  }
  
  /* Item image */
  .pb2-slot-visual {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 1 !important;
  }
  
  .pb2-slot-img-wrap {
    width: 30px !important;
    height: 30px !important;
    border-radius: 4px !important;
    overflow: hidden !important;
  }
  
  .pb2-slot-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
  }
  
  /* Tier badge - top right corner */
  .pb2-slot-tier-badge {
    position: absolute !important;
    top: 3px !important;
    right: 3px !important;
    font-size: 0.5rem !important;
    padding: 2px 4px !important;
    border-radius: 4px !important;
    font-weight: 700 !important;
    z-index: 10 !important;
    line-height: 1 !important;
  }
  
  /* Element overlay - bottom left, ALWAYS visible */
  .pb2-slot-element,
  .pb2-slot-element-overlay {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-size: 0.75rem !important;
    position: absolute !important;
    bottom: 3px !important;
    left: 3px !important;
    background: rgba(0, 0, 0, 0.75) !important;
    padding: 2px 4px !important;
    border-radius: 4px !important;
    z-index: 10 !important;
    line-height: 1 !important;
  }
  
  /* Tier ribbon - hide on mobile for cleaner look */
  .pb2-tier-ribbon {
    display: none !important;
  }
  
  /* Boost indicator - top left */
  .pb2-boost-indicator {
    position: absolute !important;
    top: 3px !important;
    left: 3px !important;
    font-size: 0.55rem !important;
    padding: 2px 4px !important;
    border-radius: 4px !important;
    font-weight: 700 !important;
    z-index: 11 !important;
    line-height: 1 !important;
  }
  
  .pb2-boost-indicator.up {
    background: rgba(34, 197, 94, 0.9) !important;
    color: #fff !important;
  }
  
  .pb2-boost-indicator.down {
    background: rgba(239, 68, 68, 0.9) !important;
    color: #fff !important;
  }
  
  /* Stars - hide on mobile */
  .pb2-slot-stars {
    display: none !important;
  }
  
  /* Slot footer - hide, we use overlays instead */
  .pb2-slot-footer {
    display: none !important;
  }
  
  /* Empty slot */
  .pb2-slot.empty {
    border-style: dashed !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
  }
  
  .pb2-slot-empty-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
  }
  
  .pb2-slot-label {
    font-size: 0.45rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    color: rgba(255, 255, 255, 0.4) !important;
  }
  
  .pb2-slot-plus {
    font-size: 1rem !important;
    color: rgba(255, 255, 255, 0.25) !important;
  }
  
  /* VS badge - centered */
  .pb2-center {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
  }
  
  .pb2-vs-badge {
    font-size: 0.55rem !important;
    padding: 0.15rem 0.3rem !important;
    border-radius: 4px !important;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(245, 158, 11, 0.15)) !important;
    border: 1px solid rgba(251, 191, 36, 0.3) !important;
  }
  
  /* Stats row - compact */
  .pb2-stats-row {
    display: flex !important;
    gap: 3px !important;
    padding: 0.15rem !important;
    flex-wrap: nowrap !important;
    background: rgba(0, 0, 0, 0.2) !important;
    border-radius: 4px !important;
    margin-top: auto !important;
  }
  
  .pb2-stat {
    font-size: 0.5rem !important;
    padding: 0.15rem 0.2rem !important;
    flex: 1 !important;
    text-align: center !important;
    border-radius: 3px !important;
  }
  
  .pb2-stat.win {
    background: rgba(34, 197, 94, 0.2) !important;
    color: #86efac !important;
  }
  
  .pb2-stat.lose {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #fca5a5 !important;
  }
  
  /* ACTION BUTTONS - Full width, prominent */
  .pb2-actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.4rem !important;
    padding: 0.4rem 0 0 !important;
    flex-shrink: 0 !important;
  }
  
  .pb2-btn {
    width: 100% !important;
    min-height: 44px !important;
    padding: 0.6rem 1rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
    transition: transform 0.1s ease !important;
  }
  
  .pb2-btn:active {
    transform: scale(0.98) !important;
  }
  
  /* Auto Best button */
  .pb2-auto-btn {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.25), rgba(126, 34, 206, 0.2)) !important;
    border: 1px solid rgba(147, 51, 234, 0.4) !important;
    color: #c4b5fd !important;
  }
  
  .pb2-auto-btn.disabled {
    opacity: 0.4 !important;
  }
  
  /* Hint button */
  .pb2-hint-btn {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(245, 158, 11, 0.15)) !important;
    border: 1px solid rgba(251, 191, 36, 0.4) !important;
    color: #fde68a !important;
  }
  
  .pb2-hint-cost {
    font-size: 0.7rem !important;
    opacity: 0.8 !important;
  }
  
  /* Fight button - most prominent */
  .pb2-fight-btn {
    background: linear-gradient(135deg, #22c55e, #16a34a) !important;
    border: none !important;
    color: #fff !important;
    min-height: 48px !important;
    font-size: 0.95rem !important;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3) !important;
  }
  
  .pb2-fight-btn:active {
    filter: brightness(1.1) !important;
  }
  
  /* Drawer - fullscreen on mobile */
  .pb2-drawer-backdrop {
    padding: 0.5rem !important;
    align-items: flex-end !important;
  }
  
  .pb2-drawer {
    max-width: 100% !important;
    max-height: 75vh !important;
    border-radius: 16px 16px 0 0 !important;
    padding: 0.75rem !important;
  }
  
  .pb2-drawer-header {
    padding-bottom: 0.5rem !important;
    margin-bottom: 0.5rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  }
  
  .pb2-drawer-title {
    font-size: 0.85rem !important;
  }
  
  .pb2-drawer-close {
    width: 32px !important;
    height: 32px !important;
    font-size: 1.2rem !important;
  }
  
  .pb2-drawer-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }
  
  /* Hint modal */
  .pb2-hint-modal-backdrop {
    padding: 1rem !important;
  }
  
  .pb2-hint-modal {
    max-width: 95vw !important;
    padding: 1rem !important;
    border-radius: 12px !important;
  }
  
  .pb2-hint-modal-title {
    font-size: 0.9rem !important;
  }
  
  .pb2-matchup-row {
    padding: 0.5rem !important;
    font-size: 0.75rem !important;
  }
  
  /* Enemy Image Container - Mobile */
  .pb2-enemy-image-container {
    padding: 0.5rem !important;
    gap: 0.5rem !important;
  }
  
  .pb2-enemy-image-wrap {
    width: 100px !important;
    height: 100px !important;
  }
  
  .pb2-enemy-image {
    width: 100% !important;
    height: 100% !important;
  }
  
  .pb2-enemy-fallback {
    font-size: 2.5rem !important;
  }
  
  .pb2-enemy-element-badge {
    width: 28px !important;
    height: 28px !important;
    font-size: 1rem !important;
  }
  
  .pb2-enemy-level-badge {
    font-size: 0.75rem !important;
    padding: 0.3rem 0.75rem !important;
  }
}

/* ========================================
   TABLET BATTLE OPTIMIZATION (600-900px)
   Enhanced monster visibility with balanced layout
   ======================================== */
@media (min-width: 601px) and (max-width: 900px) {
  /* Battle Arena - Larger monster with semi-overlay UI */
  .battle-arena {
    min-height: calc(100vh - 80px) !important;
    padding: 0.75rem !important;
  }
  
  .arena-container {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    gap: 0.5rem !important;
  }
  
  /* Battle header - compact */
  .battle-header {
    flex: 0 0 auto !important;
    padding: 0.5rem 0.75rem !important;
    gap: 0.75rem !important;
  }
  
  .turn-badge {
    padding: 6px 12px !important;
  }
  
  .turn-value {
    font-size: 1.1rem !important;
  }
  
  /* Battle main - monster takes most space */
  .battle-main {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
    position: relative !important;
    min-height: 0 !important;
  }
  
  /* Monster section - dominant display */
  .monster-section {
    flex: 1 1 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 0 !important;
  }
  
  .monster-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 400px !important;
    padding: 1rem !important;
    background: rgba(20, 16, 10, 0.9) !important;
    border: 1px solid rgba(251, 191, 36, 0.3) !important;
    border-radius: 16px !important;
  }
  
  .monster-image-wrap {
    width: 180px !important;
    height: 180px !important;
    border-radius: 12px !important;
    margin-bottom: 0.75rem !important;
  }
  
  .monster-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
  }
  
  .monster-image:not(:has(img)) {
    font-size: 5rem !important;
  }
  
  .monster-tags-overlay {
    position: absolute !important;
    top: 8px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    gap: 6px !important;
  }
  
  .tag-difficulty,
  .tag-element {
    font-size: 0.7rem !important;
    padding: 4px 10px !important;
    border-radius: 8px !important;
  }
  
  .monster-info-panel {
    width: 100% !important;
    text-align: center !important;
    gap: 0.5rem !important;
  }
  
  .monster-name {
    font-size: 1.3rem !important;
    font-weight: 700 !important;
    color: #fbbf24 !important;
  }
  
  .intent-badge {
    justify-content: center !important;
    margin: 0 auto !important;
    font-size: 0.75rem !important;
    padding: 6px 12px !important;
  }
  
  /* HP bar styles */
  .circular-hp-container {
    display: none !important;
  }
  
  .monster-hp.hidden {
    display: block !important;
  }
  
  .monster-hp {
    width: 100% !important;
  }
  
  .hp-bar-bg {
    height: 16px !important;
    border-radius: 8px !important;
  }
  
  .hp-text {
    font-size: 0.8rem !important;
    margin-top: 4px !important;
    text-align: center !important;
  }
  
  /* Combat log - side panel style */
  .combat-log-section {
    flex: 0 0 auto !important;
    max-height: 100px !important;
    background: rgba(10, 10, 10, 0.9) !important;
    border-radius: 10px !important;
  }
  
  .log-header {
    padding: 0.4rem 0.75rem !important;
    font-size: 0.7rem !important;
  }
  
  .log-entry {
    font-size: 0.7rem !important;
    padding: 0.25rem 0.5rem !important;
  }
  
  /* Battle footer - compact row */
  .battle-footer {
    flex: 0 0 auto !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 0.75rem !important;
    background: rgba(10, 10, 10, 0.95) !important;
    border-radius: 12px !important;
  }
  
  .player-section {
    flex: 0 0 auto !important;
    min-width: 140px !important;
    max-width: 180px !important;
    gap: 0.5rem !important;
  }
  
  .player-hp-bar {
    height: 20px !important;
    border-radius: 10px !important;
  }
  
  .player-hp-text {
    font-size: 0.7rem !important;
  }
  
  .actions-section {
    flex: 1 !important;
    display: flex !important;
    gap: 0.5rem !important;
    align-items: center !important;
  }
  
  .skill-buttons {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 0.4rem !important;
    overflow-x: auto !important;
    flex: 1 !important;
  }
  
  .skill-btn {
    width: 60px !important;
    height: 56px !important;
    border-radius: 12px !important;
  }
  
  .skill-icon {
    font-size: 1.3rem !important;
  }
  
  .skill-name {
    font-size: 0.55rem !important;
  }
  
  .flee-btn {
    width: 56px !important;
    height: 56px !important;
    border-radius: 12px !important;
  }
  
  /* ===== PRE-BATTLE TABLET ===== */
  .pre-battle-screen.pb2 {
    padding: 0.75rem !important;
  }
  
  .pb2-card {
    padding: 1rem !important;
    gap: 0.75rem !important;
  }
  
  .pb2-arena {
    grid-template-columns: 1fr 40px 1fr !important;
    gap: 0.5rem !important;
  }
  
  .pb2-combatant-header {
    padding: 0.4rem 0.5rem !important;
  }
  
  .pb2-name {
    font-size: 0.85rem !important;
    max-width: none !important;
  }
  
  .pb2-badge {
    font-size: 0.6rem !important;
    padding: 3px 8px !important;
  }
  
  /* Equipment slots */
  .pb2-equipment-col {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
  }
  
  .pb2-slot {
    height: 70px !important;
    border-radius: 10px !important;
  }
  
  .pb2-slot-img-wrap {
    width: 36px !important;
    height: 36px !important;
  }
  
  .pb2-slot-tier-badge {
    font-size: 0.6rem !important;
    padding: 3px 6px !important;
  }
  
  .pb2-slot-element,
  .pb2-slot-element-overlay {
    font-size: 0.85rem !important;
    padding: 3px 6px !important;
  }
  
  /* Enemy image - larger */
  .pb2-enemy-image-wrap {
    width: 160px !important;
    height: 160px !important;
  }
  
  .pb2-enemy-image-wrap.enlarged {
    width: 200px !important;
    height: 200px !important;
  }
  
  .pb2-enemy-fallback {
    font-size: 4rem !important;
  }
  
  .pb2-enemy-element-badge {
    width: 36px !important;
    height: 36px !important;
    font-size: 1.2rem !important;
  }
  
  /* VS badge */
  .pb2-vs-badge {
    font-size: 0.75rem !important;
    padding: 0.3rem 0.6rem !important;
  }
  
  /* Stats row */
  .pb2-stats-row {
    gap: 6px !important;
    padding: 0.3rem !important;
  }
  
  .pb2-stat {
    font-size: 0.65rem !important;
    padding: 0.25rem 0.35rem !important;
  }
  
  /* Action buttons */
  .pb2-actions {
    flex-direction: row !important;
    gap: 0.5rem !important;
    padding: 0.5rem 0 !important;
  }
  
  .pb2-btn {
    flex: 1 !important;
    min-height: 48px !important;
    font-size: 0.85rem !important;
    border-radius: 12px !important;
  }
  
  .pb2-fight-btn {
    flex: 1.3 !important;
    min-height: 52px !important;
    font-size: 0.95rem !important;
  }
}

/* ========================================
   MOBILE BATTLE ARENA - OPTIMIZED 2025
   Clean layout with visible skills
   ======================================== */
@media (max-width: 600px) {
  /* Full viewport battle arena */
  .battle-arena {
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    background: #0a0a0a !important;
    overflow: hidden !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 100 !important;
  }
  
  .arena-container,
  #arena-container {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    position: relative !important;
    overflow: hidden !important;
  }
  
  .arena-bg-effects {
    display: none !important;
  }
  
  /* ===== HEADER - Compact top bar ===== */
  .battle-header {
    position: relative !important;
    z-index: 50 !important;
    padding: 0.4rem 0.5rem !important;
    background: rgba(0, 0, 0, 0.9) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    flex-shrink: 0 !important;
    border-bottom: 1px solid rgba(251, 191, 36, 0.2) !important;
  }
  
  .sound-toggle-btn,
  .passives-toggle-btn {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.9rem !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 8px !important;
  }
  
  .turn-badge {
    padding: 4px 10px !important;
    background: rgba(0, 0, 0, 0.5) !important;
    border: 1px solid rgba(251, 191, 36, 0.4) !important;
    border-radius: 12px !important;
  }
  
  .turn-label {
    font-size: 0.45rem !important;
  }
  
  .turn-value {
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    color: #fbbf24 !important;
  }
  
  .turn-indicator {
    padding: 4px 10px !important;
    font-size: 0.6rem !important;
    background: rgba(34, 197, 94, 0.3) !important;
    border: 1px solid rgba(34, 197, 94, 0.5) !important;
    border-radius: 12px !important;
    color: #86efac !important;
  }
  
  .combo-badge {
    padding: 4px 10px !important;
    font-size: 0.65rem !important;
    border-radius: 12px !important;
  }
  
  /* ===== MAIN BATTLE AREA - Monster display ===== */
  .battle-main {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
  
  .monster-section {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    overflow: hidden !important;
  }
  
  .monster-card {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
  }
  
  .monster-image-wrap {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    position: relative !important;
  }
  
  .monster-image {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: radial-gradient(ellipse at center, rgba(20, 18, 15, 0.9) 0%, rgba(10, 8, 5, 0.98) 100%) !important;
  }
  
  .monster-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
  }
  
  .monster-tags-overlay {
    position: absolute !important;
    top: 8px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    gap: 6px !important;
    z-index: 10 !important;
  }
  
  .tag-difficulty {
    font-size: 0.55rem !important;
    padding: 3px 8px !important;
    border-radius: 8px !important;
    text-transform: uppercase !important;
    font-weight: 700 !important;
  }
  
  .tag-element {
    font-size: 0.9rem !important;
    padding: 3px 8px !important;
    border-radius: 8px !important;
    background: rgba(0, 0, 0, 0.6) !important;
  }
  
  /* Monster info panel - above footer */
  .monster-info-panel {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 20 !important;
    padding: 0.5rem !important;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 70%, transparent 100%) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.3rem !important;
    align-items: center !important;
  }
  
  .intent-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    font-size: 0.6rem !important;
    padding: 4px 10px !important;
    border-radius: 12px !important;
    background: rgba(251, 191, 36, 0.2) !important;
    border: 1px solid rgba(251, 191, 36, 0.4) !important;
  }
  
  .intent-icon {
    font-size: 0.75rem !important;
  }
  
  .intent-text {
    font-size: 0.55rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    color: #fde68a !important;
  }
  
  .monster-name {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
    color: #fbbf24 !important;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8) !important;
  }
  
  .circular-hp-container {
    display: none !important;
  }
  
  .monster-hp.hidden {
    display: flex !important;
  }
  
  .monster-hp {
    width: 100% !important;
    max-width: 280px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
  }
  
  .hp-bar-bg {
    height: 14px !important;
    background: rgba(0, 0, 0, 0.6) !important;
    border-radius: 7px !important;
    overflow: hidden !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
  }
  
  .hp-bar-fill {
    height: 100% !important;
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%) !important;
    border-radius: 6px !important;
    transition: width 0.3s ease !important;
  }
  
  .hp-text {
    font-size: 0.65rem !important;
    font-weight: 700 !important;
    color: #fff !important;
    text-align: center !important;
  }
  
  /* ===== COMBAT LOG - Collapsible above footer ===== */
  .combat-log-section {
    position: relative !important;
    z-index: 25 !important;
    max-height: 36px !important;
    min-height: 36px !important;
    overflow: hidden !important;
    background: rgba(15, 15, 15, 0.95) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    transition: max-height 0.3s ease, min-height 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
    flex-shrink: 0 !important;
  }
  
  .combat-log-section.expanded {
    max-height: 140px !important;
    min-height: 140px !important;
  }
  
  .log-header {
    padding: 0.4rem 0.6rem !important;
    font-size: 0.6rem !important;
    font-weight: 600 !important;
    background: rgba(0, 0, 0, 0.4) !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    cursor: pointer !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    color: rgba(255, 255, 255, 0.7) !important;
  }
  
  .log-header::after {
    content: '▼' !important;
    font-size: 0.45rem !important;
    opacity: 0.6 !important;
    transition: transform 0.3s ease !important;
  }
  
  .combat-log-section.expanded .log-header::after {
    transform: rotate(180deg) !important;
  }
  
  .log-body {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 0.3rem 0.5rem !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.2rem !important;
  }
  
  .log-entry {
    font-size: 0.55rem !important;
    padding: 0.25rem 0.4rem !important;
    border-radius: 4px !important;
    background: rgba(255, 255, 255, 0.05) !important;
  }
  
  .log-entry.log-player {
    background: rgba(34, 197, 94, 0.15) !important;
    border-left: 2px solid #22c55e !important;
  }
  
  .log-entry.log-enemy {
    background: rgba(239, 68, 68, 0.15) !important;
    border-left: 2px solid #ef4444 !important;
  }
  
  /* ===== FOOTER - Player HP + Skills ===== */
  .battle-footer {
    position: relative !important;
    z-index: 40 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.4rem !important;
    padding: 0.4rem !important;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 0.4rem) !important;
    background: rgba(10, 10, 10, 0.98) !important;
    border-top: 1px solid rgba(251, 191, 36, 0.25) !important;
    flex-shrink: 0 !important;
  }
  
  .player-section {
    display: flex !important;
    align-items: center !important;
    gap: 0.3rem !important;
    flex: 0 0 auto !important;
    min-width: 80px !important;
    max-width: 100px !important;
  }
  
  .player-avatar {
    font-size: 1rem !important;
    flex-shrink: 0 !important;
  }
  
  .player-hp-wrap {
    flex: 1 !important;
    min-width: 0 !important;
  }
  
  .player-hp-bar {
    height: 18px !important;
    background: rgba(0, 0, 0, 0.6) !important;
    border-radius: 9px !important;
    overflow: hidden !important;
    position: relative !important;
    border: 1px solid rgba(34, 197, 94, 0.4) !important;
  }
  
  .player-hp-fill {
    height: 100% !important;
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%) !important;
    border-radius: 8px !important;
    transition: width 0.2s ease !important;
  }
  
  .player-hp-text {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    font-size: 0.5rem !important;
    font-weight: 700 !important;
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9) !important;
  }
  
  /* Skills section */
  .actions-section {
    display: flex !important;
    flex: 1 !important;
    gap: 0.25rem !important;
    align-items: center !important;
    min-width: 0 !important;
  }
  
  .skill-buttons {
    display: flex !important;
    gap: 0.25rem !important;
    overflow-x: auto !important;
    flex: 1 !important;
    padding: 2px !important;
    scrollbar-width: none !important;
  }
  
  .skill-buttons::-webkit-scrollbar {
    display: none !important;
  }
  
  .skill-btn {
    flex: 0 0 auto !important;
    width: 44px !important;
    height: 44px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 1px !important;
    padding: 2px !important;
    border-radius: 10px !important;
    background: linear-gradient(145deg, rgba(35, 30, 22, 0.98), rgba(25, 20, 15, 0.98)) !important;
    border: 1px solid rgba(251, 191, 36, 0.35) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
    touch-action: manipulation !important;
    cursor: pointer !important;
  }
  
  .skill-btn:active {
    transform: scale(0.92) !important;
    background: linear-gradient(145deg, rgba(251, 191, 36, 0.25), rgba(245, 158, 11, 0.2)) !important;
    border-color: rgba(251, 191, 36, 0.6) !important;
  }
  
  .skill-btn.on-cooldown {
    opacity: 0.4 !important;
    filter: grayscale(0.5) !important;
  }
  
  .skill-icon,
  .skill-btn-icon {
    font-size: 1.1rem !important;
    line-height: 1 !important;
  }
  
  .skill-name {
    font-size: 0.35rem !important;
    max-width: 40px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    text-transform: uppercase !important;
    color: rgba(255, 255, 255, 0.7) !important;
    line-height: 1 !important;
  }
  
  .cooldown-overlay {
    position: absolute !important;
    font-size: 1rem !important;
    font-weight: 800 !important;
    color: #fbbf24 !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9) !important;
  }
  
  .flee-btn {
    flex: 0 0 auto !important;
    width: 40px !important;
    height: 44px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 1px !important;
    padding: 2px !important;
    border-radius: 10px !important;
    background: linear-gradient(145deg, rgba(239, 68, 68, 0.3), rgba(185, 28, 28, 0.25)) !important;
    border: 1px solid rgba(239, 68, 68, 0.5) !important;
    touch-action: manipulation !important;
    cursor: pointer !important;
  }
  
  .flee-btn:active {
    transform: scale(0.92) !important;
  }
  
  .flee-btn span:first-child {
    font-size: 1rem !important;
  }
  
  .flee-btn span:last-child {
    font-size: 0.35rem !important;
    text-transform: uppercase !important;
    font-weight: 700 !important;
    color: #fca5a5 !important;
  }
}

/* ===== BATTLE 480px refinements ===== */
@media (max-width: 480px) {
  .skill-btn {
    width: 40px !important;
    height: 40px !important;
  }
  
  .flee-btn {
    width: 36px !important;
    height: 40px !important;
  }
  
  .skill-icon,
  .skill-btn-icon {
    font-size: 1rem !important;
  }
  
  .player-section {
    min-width: 70px !important;
    max-width: 85px !important;
  }
  
  .player-hp-bar {
    height: 16px !important;
  }
}

/* ===== BATTLE 360px ultra-compact ===== */
@media (max-width: 360px) {
  .skill-btn {
    width: 36px !important;
    height: 36px !important;
    border-radius: 8px !important;
  }
  
  .flee-btn {
    width: 32px !important;
    height: 36px !important;
  }
  
  .skill-name,
  .flee-btn span:last-child {
    display: none !important;
  }
  
  .player-section {
    min-width: 60px !important;
    max-width: 75px !important;
  }
  
  .monster-name {
    font-size: 1rem !important;
  }
}

/* ========================================
   MOBILE PRE-BATTLE - OPTIMIZED 2025
   Clean layout with all elements visible
   ======================================== */
@media (max-width: 600px) {
  .pre-battle-screen.pb2 {
    padding: 0.5rem !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    overflow-y: auto !important;
    position: relative !important;
    background: #0a0a0a !important;
  }
  
  .pb2-card {
    padding: 0.5rem !important;
    gap: 0.5rem !important;
    max-width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
    background: rgba(15, 12, 8, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
  }
  
  .pb2-header {
    position: relative !important;
    padding: 0.5rem !important;
    background: transparent !important;
    flex-shrink: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  }
  
  .pb2-back-btn {
    width: 36px !important;
    height: 36px !important;
    font-size: 1rem !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 8px !important;
  }
  
  .pb2-title {
    font-size: 0.9rem !important;
    letter-spacing: 1px !important;
  }
  
  .pb2-arena {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: unset !important;
    gap: 0.5rem !important;
    padding: 0.25rem !important;
  }
  
  .pb2-center {
    position: relative !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 0.15rem 0 !important;
    order: 2 !important;
    transform: none !important;
    top: auto !important;
    left: auto !important;
  }
  
  .pb2-vs-badge {
    font-size: 0.7rem !important;
    padding: 0.25rem 0.6rem !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.25), rgba(245, 158, 11, 0.2)) !important;
    border: 1px solid rgba(251, 191, 36, 0.4) !important;
    font-weight: 700 !important;
  }
  
  /* ===== PLAYER SECTION ===== */
  .pb2-combatant.pb2-player-side {
    order: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.35rem !important;
    padding: 0.4rem !important;
    background: rgba(34, 197, 94, 0.08) !important;
    border: 1px solid rgba(34, 197, 94, 0.25) !important;
    border-radius: 10px !important;
  }
  
  .pb2-player-side .pb2-combatant-header {
    position: relative !important;
    padding: 0.2rem !important;
    background: transparent !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
  }
  
  .pb2-player-side .pb2-avatar {
    font-size: 1.1rem !important;
  }
  
  .pb2-player-side .pb2-name {
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    color: #86efac !important;
  }
  
  /* Equipment grid - 3 columns */
  .pb2-equipment-col {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 5px !important;
  }
  
  .pb2-slot {
    height: 56px !important;
    min-width: 0 !important;
    position: relative !important;
    border-radius: 8px !important;
    background: linear-gradient(145deg, rgba(25, 22, 18, 0.95), rgba(15, 12, 8, 0.95)) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 3px !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
  }
  
  .pb2-slot:active {
    transform: scale(0.95) !important;
    border-color: rgba(251, 191, 36, 0.6) !important;
  }
  
  .pb2-slot.equipped {
    border-color: rgba(251, 191, 36, 0.4) !important;
    box-shadow: inset 0 0 10px rgba(251, 191, 36, 0.1) !important;
  }
  
  .pb2-slot-visual {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 1 !important;
  }
  
  .pb2-slot-img-wrap {
    width: 30px !important;
    height: 30px !important;
    border-radius: 4px !important;
    overflow: hidden !important;
  }
  
  .pb2-slot-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
  }
  
  .pb2-slot-tier-badge {
    position: absolute !important;
    top: 2px !important;
    right: 2px !important;
    font-size: 0.45rem !important;
    padding: 1px 3px !important;
    border-radius: 3px !important;
    font-weight: 700 !important;
    z-index: 5 !important;
  }
  
  .pb2-slot-element,
  .pb2-slot-element-overlay {
    display: flex !important;
    font-size: 0.65rem !important;
    position: absolute !important;
    bottom: 2px !important;
    left: 2px !important;
    background: rgba(0, 0, 0, 0.7) !important;
    padding: 1px 2px !important;
    border-radius: 3px !important;
    z-index: 5 !important;
  }
  
  .pb2-tier-ribbon,
  .pb2-slot-stars,
  .pb2-slot-footer {
    display: none !important;
  }
  
  .pb2-slot.empty {
    border-style: dashed !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
  }
  
  .pb2-slot-label {
    font-size: 0.4rem !important;
  }
  
  .pb2-slot-plus {
    font-size: 0.85rem !important;
    color: rgba(255, 255, 255, 0.3) !important;
  }
  
  .pb2-boost-indicator {
    position: absolute !important;
    top: 2px !important;
    left: 2px !important;
    font-size: 0.45rem !important;
    padding: 1px 3px !important;
    border-radius: 3px !important;
    font-weight: 700 !important;
    z-index: 6 !important;
  }
  
  .pb2-boost-indicator.up {
    background: rgba(34, 197, 94, 0.9) !important;
    color: #fff !important;
  }
  
  .pb2-boost-indicator.down {
    background: rgba(239, 68, 68, 0.9) !important;
    color: #fff !important;
  }
  
  /* Stats row */
  .pb2-stats-row {
    display: flex !important;
    gap: 4px !important;
    padding: 0.2rem !important;
    background: rgba(0, 0, 0, 0.2) !important;
    border-radius: 6px !important;
  }
  
  .pb2-stat {
    font-size: 0.6rem !important;
    padding: 0.2rem 0.3rem !important;
    flex: 1 !important;
    text-align: center !important;
    border-radius: 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
  }
  
  .pb2-stat.win {
    background: rgba(34, 197, 94, 0.2) !important;
    color: #86efac !important;
  }
  
  .pb2-stat.lose {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #fca5a5 !important;
  }
  
  /* ===== ENEMY SECTION ===== */
  .pb2-combatant.pb2-enemy-side {
    order: 3 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.4rem !important;
    padding: 0.4rem !important;
    background: rgba(239, 68, 68, 0.08) !important;
    border: 1px solid rgba(239, 68, 68, 0.25) !important;
    border-radius: 10px !important;
  }
  
  .pb2-enemy-side .pb2-combatant-header {
    position: relative !important;
    padding: 0.2rem !important;
    background: transparent !important;
    text-align: center !important;
  }
  
  .pb2-enemy-side .pb2-enemy-info {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.25rem !important;
  }
  
  .pb2-enemy-side .pb2-name {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #fbbf24 !important;
    word-break: break-word !important;
  }
  
  .pb2-enemy-badges {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 4px !important;
  }
  
  .pb2-enemy-side .pb2-badge {
    font-size: 0.5rem !important;
    padding: 2px 6px !important;
    border-radius: 8px !important;
    background: rgba(0, 0, 0, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
  }
  
  /* Enemy image - larger and centered */
  .pb2-enemy-image-container {
    position: relative !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    padding: 0.4rem !important;
  }
  
  .pb2-enemy-image-wrap {
    width: 180px !important;
    height: 180px !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    background: radial-gradient(ellipse at center, rgba(30, 25, 20, 0.9) 0%, rgba(10, 8, 5, 0.98) 100%) !important;
    border: 2px solid rgba(251, 191, 36, 0.3) !important;
  }
  
  .pb2-enemy-image-wrap.enlarged {
    width: 200px !important;
    height: 200px !important;
  }
  
  .pb2-enemy-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
  }
  
  .pb2-enemy-fallback {
    font-size: 5rem !important;
  }
  
  .pb2-enemy-level-badge-top {
    position: absolute !important;
    top: -10px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    font-size: 0.6rem !important;
    padding: 0.2rem 0.5rem !important;
    background: rgba(0, 0, 0, 0.85) !important;
    border: 1px solid rgba(251, 191, 36, 0.5) !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    color: #fbbf24 !important;
    z-index: 10 !important;
  }
  
  .pb2-enemy-element-badge {
    position: absolute !important;
    bottom: 8px !important;
    right: 8px !important;
    width: 32px !important;
    height: 32px !important;
    font-size: 1rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(0, 0, 0, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 50% !important;
    z-index: 10 !important;
  }
  
  .pb2-enemy-stats-overlay {
    display: flex !important;
    gap: 6px !important;
    margin-top: 0.4rem !important;
    position: relative !important;
  }
  
  .pb2-stat-chip {
    padding: 0.25rem 0.5rem !important;
    border-radius: 10px !important;
    background: rgba(0, 0, 0, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    font-size: 0.6rem !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
    gap: 3px !important;
  }
  
  .pb2-stat-chip.win {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
  }
  
  .pb2-stat-chip.lose {
    background: rgba(34, 197, 94, 0.2) !important;
    border-color: rgba(34, 197, 94, 0.3) !important;
  }
  
  .pb2-enemy-image-container::before,
  .pb2-enemy-image-container::after {
    display: none !important;
  }
  
  .pb2-mob-passives {
    display: none !important;
  }
  
  /* ===== ACTIONS ===== */
  .pb2-actions {
    display: flex !important;
    flex-direction: row !important;
    gap: 0.35rem !important;
    padding: 0.4rem !important;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 0.4rem) !important;
    background: rgba(10, 10, 10, 0.95) !important;
    border-top: 1px solid rgba(251, 191, 36, 0.15) !important;
    margin-top: auto !important;
  }
  
  .pb2-btn {
    flex: 1 !important;
    min-height: 44px !important;
    padding: 0.35rem 0.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.25rem !important;
    font-size: 0.65rem !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
  }
  
  .pb2-btn:active {
    transform: scale(0.95) !important;
  }
  
  .pb2-auto-btn {
    background: linear-gradient(145deg, rgba(147, 51, 234, 0.3), rgba(126, 34, 206, 0.25)) !important;
    border: 1px solid rgba(147, 51, 234, 0.5) !important;
    color: #c4b5fd !important;
  }
  
  .pb2-hint-btn {
    background: linear-gradient(145deg, rgba(100, 100, 110, 0.3), rgba(70, 70, 80, 0.25)) !important;
    border: 1px solid rgba(150, 150, 160, 0.4) !important;
    color: #b0b0b8 !important;
  }
  
  .pb2-hint-cost {
    font-size: 0.5rem !important;
    opacity: 0.8 !important;
  }
  
  .pb2-fight-btn {
    flex: 1.3 !important;
    background: linear-gradient(145deg, #22c55e, #16a34a) !important;
    border: none !important;
    color: #fff !important;
    min-height: 48px !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3) !important;
  }
  
  /* Drawer */
  .pb2-drawer-backdrop {
    padding: 0 !important;
    align-items: flex-end !important;
  }
  
  .pb2-drawer {
    max-width: 100% !important;
    max-height: 75vh !important;
    border-radius: 16px 16px 0 0 !important;
    padding: 0.75rem !important;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 0.75rem) !important;
    background: rgba(15, 12, 8, 0.98) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
  }
  
  .pb2-drawer-header {
    padding-bottom: 0.5rem !important;
    margin-bottom: 0.5rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  }
  
  .pb2-drawer-title {
    font-size: 0.85rem !important;
    font-weight: 700 !important;
  }
  
  .pb2-drawer-close {
    width: 32px !important;
    height: 32px !important;
    font-size: 1.1rem !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 50% !important;
  }
  
  .pb2-drawer-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
    max-height: 50vh !important;
    overflow-y: auto !important;
  }
}

/* ===== PRE-BATTLE 480px ===== */
@media (max-width: 480px) {
  .pb2-enemy-image-wrap,
  .pb2-enemy-image-wrap.enlarged {
    width: 160px !important;
    height: 160px !important;
  }
  
  .pb2-enemy-fallback {
    font-size: 4rem !important;
  }
  
  .pb2-slot {
    height: 52px !important;
  }
  
  .pb2-slot-img-wrap {
    width: 26px !important;
    height: 26px !important;
  }
}

/* ===== PRE-BATTLE 360px ===== */
@media (max-width: 360px) {
  .pb2-enemy-side .pb2-name {
    font-size: 0.9rem !important;
  }
  
  .pb2-enemy-image-wrap,
  .pb2-enemy-image-wrap.enlarged {
    width: 140px !important;
    height: 140px !important;
  }
  
  .pb2-slot {
    height: 48px !important;
  }
  
  .pb2-slot-img-wrap {
    width: 24px !important;
    height: 24px !important;
  }
  
  .pb2-btn {
    min-height: 40px !important;
    font-size: 0.6rem !important;
  }
  
  .pb2-fight-btn {
    min-height: 44px !important;
  }
}

/* ========================================
   PASSIVE SKILLS MODAL
   ======================================== */

.passive-skills-modal {
  z-index: 1100;
}

.passive-skills-content {
  max-width: 520px;
  text-align: left;
  padding: 0;
  overflow: hidden;
}

.passive-modal-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  border-bottom: 3px solid;
  background: rgba(0, 0, 0, 0.3);
}

.passive-class-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.passive-header-info h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.3rem;
  margin: 0 0 0.25rem;
  color: var(--text-bright);
}

.passive-progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.mythic-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.passive-loading,
.passive-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  gap: 1rem;
  color: var(--text-muted);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Bonuses Summary */
.passive-bonuses-summary {
  padding: 1rem 1.5rem;
  background: rgba(59, 130, 246, 0.05);
  border-bottom: 1px solid var(--border);
}

.passive-bonuses-summary h4 {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.bonus-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.bonus-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  font-size: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.bonus-icon {
  font-size: 0.9rem;
}

.bonus-value {
  color: #4ade80;
  font-weight: 600;
  font-family: 'IBM Plex Mono', monospace;
}

/* Next Unlock Banner */
.next-unlock-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.1), transparent);
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.next-label {
  color: var(--text-muted);
}

.next-name {
  font-weight: 600;
  color: var(--xp-color);
}

.next-level {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-left: auto;
}

/* Passives List */
.passives-list {
  max-height: 350px;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.passive-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  transition: background 0.2s;
}

.passive-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.passive-item.locked {
  opacity: 0.5;
}

.passive-item.mythic {
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.1), transparent);
  border-left: 3px solid #f59e0b;
}

.passive-item.mythic.unlocked {
  opacity: 1;
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.15), transparent);
}

.passive-level-badge {
  min-width: 45px;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-align: center;
  color: white;
  text-transform: uppercase;
}

.passive-icon-wrap {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.passive-icon {
  font-size: 1.5rem;
}

.passive-icon.locked-icon {
  filter: grayscale(100%);
  opacity: 0.5;
}

.mythic-star {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 0.8rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.8; }
}

.passive-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.passive-name {
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mythic-label {
  font-size: 0.6rem;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-weight: 700;
}

.passive-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.passive-desc.locked-desc {
  font-style: italic;
  color: rgba(255, 255, 255, 0.35);
}

/* Unlock Timeline */
.unlock-timeline {
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.unlock-timeline h4 {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.timeline-bar {
  position: relative;
  height: 30px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  overflow: visible;
}

.timeline-progress {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  border-radius: 15px;
  transition: width 0.5s ease;
  opacity: 0.5;
}

.timeline-node {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #374151;
  border: 2px solid #4b5563;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  z-index: 1;
}

.timeline-node.unlocked {
  background: var(--primary);
  border-color: var(--primary);
}

.timeline-node.mythic-node {
  width: 30px;
  height: 30px;
  border-width: 3px;
}

.timeline-node.mythic-node.unlocked {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-color: #f59e0b;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
}

.node-level {
  font-size: 0.55rem;
  font-weight: 700;
  color: white;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .passive-skills-content {
    max-width: 100%;
    margin: 0 10px;
  }
  
  .passive-modal-header {
    padding: 1rem;
  }
  
  .passive-class-icon {
    width: 40px;
    height: 40px;
    font-size: 1.4rem;
  }
  
  .passive-header-info h2 {
    font-size: 1.1rem;
  }
  
  .passives-list {
    max-height: 280px;
  }
  
  .passive-item {
    padding: 0.6rem 1rem;
  }
  
  .passive-level-badge {
    min-width: 38px;
    font-size: 0.6rem;
  }
  
  .bonus-grid {
    gap: 0.35rem;
  }
  
  .bonus-item {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
  }
}

/* ========================================
   PASSIVES BUTTON IN BATTLE ARENA
   ======================================== */
   
.passives-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  background: rgba(124, 58, 237, 0.2);
  border: 1px solid rgba(124, 58, 237, 0.4);
  border-radius: 8px;
  color: #c4b5fd;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.passives-btn:hover {
  background: rgba(124, 58, 237, 0.3);
  border-color: rgba(124, 58, 237, 0.6);
}

.passives-btn .count {
  background: rgba(255, 255, 255, 0.15);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.7rem;
}

/* Enemy Class Badge */
.enemy-class-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.5rem;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.enemy-class-badge .class-icon {
  font-size: 0.85rem;
}

.enemy-class-badge .passive-count {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.65rem;
}


/* ========================================
   MOBILE BOTTOM BAR SAFE AREA
   Ensure battle content never goes behind bottom bars
   ======================================== */

@media (max-width: 768px) {
  /* Battle containers need proper layout, not extra padding that shows as black */
  .battle-arena-container,
  .battle-arena {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    padding-bottom: 0 !important;
    background: transparent !important;
  }
  
  /* Battle main takes remaining space above footer */
  .battle-main {
    flex: 1 !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
    overflow-y: auto !important;
    /* Space for fixed footer + bottom bars */
    padding-bottom: calc(130px + 52px + 44px + env(safe-area-inset-bottom, 0px)) !important;
  }
  
  /* Battle footer - fixed at bottom above the mobile status bars */
  .battle-footer {
    position: fixed !important;
    bottom: calc(52px + 44px + env(safe-area-inset-bottom, 0px)) !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 100 !important;
    background: linear-gradient(180deg, rgba(15, 12, 8, 0.98), rgba(10, 8, 5, 1)) !important;
    border-top: 1px solid rgba(251, 191, 36, 0.2) !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.6) !important;
    padding: 10px 12px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }
  
  /* Player HP section - compact horizontal layout */
  .battle-footer .player-section {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
  }
  
  .battle-footer .player-avatar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
  }
  
  .battle-footer .player-hp-wrap {
    flex: 1 !important;
    min-width: 0 !important;
    width: 100% !important;
  }
  
  .battle-footer .player-hp-bar {
    height: 36px !important;
    border-radius: 8px !important;
    background: rgba(0, 0, 0, 0.6) !important;
    border: 2px solid rgba(34, 197, 94, 0.4) !important;
    overflow: hidden !important;
    position: relative !important;
  }
  
  .battle-footer .player-hp-fill {
    height: 100% !important;
    background: linear-gradient(90deg, #16a34a, #22c55e) !important;
    border-radius: 8px !important;
  }
  
  .battle-footer .player-hp-text {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    font-size: 0.6rem !important;
    font-weight: 700 !important;
    color: #fff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9) !important;
  }
  
  /* Actions section - horizontal layout */
  .battle-footer .actions-section {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    width: 100% !important;
  }
  
  /* Skill buttons - horizontal scrollable row */
  .battle-footer .skill-buttons {
    display: flex !important;
    gap: 5px !important;
    flex: 1 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding: 2px 0 !important;
  }
  
  .battle-footer .skill-buttons::-webkit-scrollbar {
    display: none !important;
  }
  
  .battle-footer .skill-btn {
    flex: 0 0 auto !important;
    width: 52px !important;
    height: 52px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    padding: 4px !important;
    border-radius: 8px !important;
    background: linear-gradient(145deg, rgba(26, 21, 16, 0.95), rgba(15, 12, 8, 0.95)) !important;
    border: 1px solid rgba(251, 191, 36, 0.25) !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
  }
  
  .battle-footer .skill-btn:active:not(:disabled) {
    transform: scale(0.95) !important;
    background: rgba(251, 191, 36, 0.1) !important;
  }
  
  .battle-footer .skill-icon {
    font-size: 1.1rem !important;
    line-height: 1 !important;
  }
  
  .battle-footer .skill-name {
    font-size: 0.4rem !important;
    max-width: 46px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
    opacity: 0.8 !important;
  }
  
  .battle-footer .cooldown-overlay {
    font-size: 0.85rem !important;
    font-weight: 700 !important;
  }
  
  /* Flee/Run button */
  .battle-footer .flee-btn {
    flex: 0 0 auto !important;
    width: 52px !important;
    height: 52px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    padding: 4px !important;
    border-radius: 8px !important;
    background: rgba(239, 68, 68, 0.15) !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
  }
  
  .battle-footer .flee-btn span:first-child {
    font-size: 1.1rem !important;
    line-height: 1 !important;
  }
  
  .battle-footer .flee-btn span:last-child {
    font-size: 0.4rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    opacity: 0.9 !important;
    color: #ef4444 !important;
  }
  
  /* Pre-battle screen - add bottom padding */
  .pre-battle-screen,
  .pre-battle-content {
    padding-bottom: calc(52px + 44px + env(safe-area-inset-bottom, 0px) + 20px) !important;
  }
  
  /* Energy packages modal positioning */
  .energy-packages-modal {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    max-height: 80vh !important;
    z-index: 1001 !important;
  }
  
  /* Hide player stats row on mobile to save space */
  .battle-footer .player-stats {
    display: none !important;
  }
}
