/* ==========================================================================
   SPIRIT BEASTS - Web-based Creature TCG & Battler
   Giant Gamers Universe | Design System & Neon Arena Styling
   ========================================================================== */

:root {
  /* Brand Palettes */
  --bg: #05060f;
  --bg-deep: #020307;
  --surface: #0b1120;
  --surface-2: #111a2e;
  --surface-3: #18243e;
  --line: #22304a;
  --line-glow: rgba(51, 230, 255, 0.25);
  --text: #eef2f7;
  --muted: #a0aec0;
  --faint: #64748b;

  /* Neon Elements */
  --fire: #ff5500;
  --fire-glow: rgba(255, 85, 0, 0.45);
  --water: #00b4d8;
  --water-glow: rgba(0, 180, 216, 0.45);
  --nature: #2ecc71;
  --nature-glow: rgba(46, 204, 113, 0.45);
  --spark: #ffea00;
  --spark-glow: rgba(255, 234, 0, 0.45);
  --shadow: #bb42ff;
  --shadow-glow: rgba(187, 66, 255, 0.45);

  /* Accents */
  --cyan: #33e6ff;
  --magenta: #ff3fd2;
  --gold: #ffbe0b;
  --gold-glow: rgba(255, 190, 11, 0.5);
  --danger: #ff4757;
  --success: #2ed573;

  /* Rarity Tokens */
  --rarity-common: #8e9aad;
  --rarity-rare: #00b4d8;
  --rarity-epic: #bb42ff;
  --rarity-legendary: #ffbe0b;

  /* Typography & Layout */
  --font-main: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "Consolas", "Courier New", monospace;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
  --shadow-panel: 0 12px 36px -8px rgba(0, 0, 0, 0.75), 0 0 1px 1px rgba(255, 255, 255, 0.08);

  color-scheme: dark;
}

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

html, body {
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(51, 230, 255, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(255, 63, 210, 0.06) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(187, 66, 255, 0.04) 0%, transparent 60%);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   APP HEADER & NAVIGATION
   ========================================================================== */

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: rgba(8, 12, 24, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.brand-logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--cyan), var(--magenta));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(51, 230, 255, 0.4);
}

.brand-logo-icon svg {
  width: 24px;
  height: 24px;
  fill: #fff;
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, #fff 20%, var(--cyan) 70%, var(--magenta) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-size: 0.68rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-badge span {
  color: var(--gold);
  font-weight: 700;
}

/* Nav Tabs */
.nav-tabs {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 4px;
  gap: 2px;
}

.nav-tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-tab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab-btn.active {
  background: linear-gradient(135deg, var(--surface-3), rgba(51, 230, 255, 0.15));
  color: var(--cyan);
  border: 1px solid rgba(51, 230, 255, 0.4);
  box-shadow: 0 0 12px rgba(51, 230, 255, 0.25);
}

.nav-tab-btn svg {
  width: 16px;
  height: 16px;
}

/* Profile & Currency Widget */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.currency-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.88rem;
}

.currency-pill.coins {
  color: var(--gold);
  border-color: rgba(255, 190, 11, 0.3);
}

.currency-pill.dust {
  color: var(--shadow);
  border-color: rgba(187, 66, 255, 0.3);
}

.currency-icon {
  font-size: 1rem;
}

.profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  cursor: pointer;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.profile-btn:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(51, 230, 255, 0.2);
}

.avatar-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--shadow));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.75rem;
  color: #fff;
}

.level-tag {
  background: rgba(51, 230, 255, 0.15);
  color: var(--cyan);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 800;
}

.icon-btn {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--cyan);
  box-shadow: 0 0 10px rgba(51, 230, 255, 0.3);
}

/* ==========================================================================
   MAIN CONTAINER & VIEW SWITCHER
   ========================================================================== */

.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.view-section {
  display: none;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.view-section.active {
  display: block;
}

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

/* Section Header Titles */
.section-headline {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.section-headline h1 {
  font-size: 1.85rem;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-headline p {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 4px;
}

/* ==========================================================================
   BATTLE TOWER (PVE ARENA)
   ========================================================================== */

.tower-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stage-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-panel);
}

.stage-card:hover {
  transform: translateY(-4px);
  border-color: var(--cyan);
  box-shadow: 0 12px 30px rgba(51, 230, 255, 0.15);
}

.stage-card.locked {
  opacity: 0.65;
  filter: grayscale(0.6);
  cursor: not-allowed;
}

.stage-card.locked:hover {
  transform: none;
  border-color: var(--line);
  box-shadow: var(--shadow-panel);
}

.stage-card.completed {
  border-color: rgba(46, 204, 113, 0.4);
}

.stage-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  margin-bottom: 12px;
}

.stage-1 .stage-badge { background: rgba(46, 204, 113, 0.15); color: var(--nature); }
.stage-2 .stage-badge { background: rgba(255, 85, 0, 0.15); color: var(--fire); }
.stage-3 .stage-badge { background: rgba(187, 66, 255, 0.15); color: var(--shadow); }
.stage-4 .stage-badge { background: linear-gradient(135deg, rgba(255, 190, 11, 0.2), rgba(255, 63, 210, 0.2)); color: var(--gold); }

.stage-boss-portrait {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 2px solid var(--line);
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.5);
}

.stage-card h3 {
  font-size: 1.25rem;
  margin-bottom: 6px;
}

.stage-desc {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 16px;
  line-height: 1.45;
}

.stage-rewards {
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.82rem;
  color: var(--text);
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reward-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-start-stage {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-pill);
  border: none;
  background: linear-gradient(135deg, var(--cyan), #0077b6);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(51, 230, 255, 0.3);
}

.btn-start-stage:hover:not(:disabled) {
  filter: brightness(1.15);
  box-shadow: 0 6px 20px rgba(51, 230, 255, 0.5);
  transform: translateY(-1px);
}

.btn-start-stage:disabled {
  background: var(--surface-2);
  color: var(--faint);
  cursor: not-allowed;
  box-shadow: none;
}

/* Active Battle Arena Field */
.battle-arena-wrapper {
  display: none;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(51, 230, 255, 0.08);
  position: relative;
}

.battle-arena-wrapper.in-battle {
  display: flex;
  flex-direction: column;
}

/* Arena Top Bar */
.arena-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(11, 17, 32, 0.95);
  border-bottom: 1px solid var(--line);
}

.arena-stage-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1rem;
}

.turn-indicator {
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: rgba(51, 230, 255, 0.15);
  color: var(--cyan);
  border: 1px solid rgba(51, 230, 255, 0.3);
  box-shadow: 0 0 10px rgba(51, 230, 255, 0.2);
}

.turn-indicator.ai-turn {
  background: rgba(255, 71, 87, 0.15);
  color: var(--danger);
  border-color: rgba(255, 71, 87, 0.3);
  box-shadow: 0 0 10px rgba(255, 71, 87, 0.2);
}

.arena-controls {
  display: flex;
  gap: 8px;
}

/* Battle Board (AI Side & Player Side) */
.battle-board {
  display: flex;
  flex-direction: column;
  padding: 24px;
  gap: 24px;
  min-height: 580px;
  background-image: 
    radial-gradient(ellipse at center, rgba(30, 48, 80, 0.4) 0%, transparent 70%),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 40px 40px, 40px 40px;
  position: relative;
}

/* Combat Floaters */
.damage-floater {
  position: absolute;
  font-weight: 900;
  font-size: 1.6rem;
  pointer-events: none;
  animation: floatUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  z-index: 50;
  text-shadow: 0 0 12px currentColor;
}

@keyframes floatUp {
  0% { opacity: 0; transform: translateY(0) scale(0.6); }
  20% { opacity: 1; transform: translateY(-20px) scale(1.2); }
  70% { opacity: 1; transform: translateY(-45px) scale(1); }
  100% { opacity: 0; transform: translateY(-65px) scale(0.8); }
}

/* Side Sections */
.combatant-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
}

.combatant-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
}

.combatant-name {
  font-size: 1.1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bench-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bench-slot {
  width: 90px;
  height: 125px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.bench-slot.has-card {
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.15);
}

.active-battle-slot {
  width: 230px;
  height: 310px;
  border-radius: var(--radius-md);
  border: 2px dashed rgba(51, 230, 255, 0.3);
  background: rgba(11, 17, 32, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  transition: all 0.25s ease;
}

.active-battle-slot.occupied {
  border-style: solid;
  border-color: var(--cyan);
  box-shadow: 0 0 25px rgba(51, 230, 255, 0.2);
}

.active-battle-slot.shake {
  animation: shake 0.4s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px) rotate(-1deg); }
  40%, 80% { transform: translateX(8px) rotate(1deg); }
}

/* Combat Divider & Announcer */
.arena-center-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
}

.battle-combat-feed {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--cyan);
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.advantage-guide-pill {
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Action Bar for Player */
.player-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  gap: 16px;
  flex-wrap: wrap;
}

.energy-display-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.energy-label {
  font-weight: 800;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--spark);
}

.energy-orbs {
  display: flex;
  gap: 6px;
}

.energy-orb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(255, 234, 0, 0.3);
  background: rgba(0, 0, 0, 0.4);
  transition: all 0.25s ease;
}

.energy-orb.filled {
  background: radial-gradient(circle, #fff, var(--spark));
  border-color: #fff;
  box-shadow: 0 0 10px var(--spark);
}

/* Battle Action Buttons */
.action-buttons-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.action-btn {
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.action-btn:hover:not(:disabled) {
  border-color: var(--cyan);
  background: rgba(51, 230, 255, 0.12);
  box-shadow: 0 0 14px rgba(51, 230, 255, 0.25);
  transform: translateY(-2px);
}

.action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.action-btn.btn-strike {
  border-color: rgba(255, 85, 0, 0.4);
  color: #ffb85e;
}

.action-btn.btn-ability {
  border-color: rgba(187, 66, 255, 0.4);
  color: #d8a0ff;
  background: rgba(187, 66, 255, 0.08);
}

.action-btn.btn-swap {
  border-color: rgba(0, 180, 216, 0.4);
  color: #8ff2ff;
}

.action-btn.btn-endturn {
  background: linear-gradient(135deg, #ff4757, #ff6b81);
  border: none;
  color: #fff;
  box-shadow: 0 0 14px rgba(255, 71, 87, 0.3);
}

.action-btn.btn-endturn:hover:not(:disabled) {
  box-shadow: 0 0 20px rgba(255, 71, 87, 0.5);
}

/* Hand Strip */
.player-hand-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 20px;
  background: rgba(5, 6, 15, 0.95);
  border-top: 1px solid var(--line);
  overflow-x: auto;
  min-height: 190px;
}

.hand-empty-hint {
  color: var(--faint);
  font-style: italic;
  font-size: 0.9rem;
}

/* ==========================================================================
   CARD VISUAL COMPONENT
   ========================================================================== */

.spirit-card {
  width: 170px;
  height: 240px;
  border-radius: 12px;
  background: var(--surface);
  border: 2px solid var(--rarity-common);
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  user-select: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
  overflow: hidden;
}

.spirit-card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.8), 0 0 18px var(--card-glow, rgba(51, 230, 255, 0.3));
  z-index: 10;
}

.spirit-card[data-action="inspect-card"] {
  touch-action: pan-y;
}

/* Rarity Accents */
.spirit-card.rarity-common {
  --card-border: var(--rarity-common);
  --card-glow: rgba(142, 154, 173, 0.3);
  border-color: var(--rarity-common);
}

.spirit-card.rarity-rare {
  --card-border: var(--rarity-rare);
  --card-glow: var(--water-glow);
  border-color: var(--rarity-rare);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 10px rgba(0, 180, 216, 0.2);
}

.spirit-card.rarity-epic {
  --card-border: var(--rarity-epic);
  --card-glow: var(--shadow-glow);
  border-color: var(--rarity-epic);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 14px rgba(187, 66, 255, 0.25);
}

.spirit-card.rarity-legendary {
  --card-border: var(--rarity-legendary);
  --card-glow: var(--gold-glow);
  border-color: var(--rarity-legendary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 18px rgba(255, 190, 11, 0.4);
  background-image: linear-gradient(135deg, rgba(255, 190, 11, 0.06), transparent 50%);
}

.spirit-card.rarity-legendary::before {
  content: "";
  position: absolute;
  inset: -100%;
  background: linear-gradient(
    45deg,
    transparent 45%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 55%
  );
  animation: holoSheen 4s infinite linear;
  pointer-events: none;
}

@keyframes holoSheen {
  0% { transform: translateY(-50%) rotate(25deg); }
  100% { transform: translateY(50%) rotate(25deg); }
}

/* Mini Card Variant (For Bench and Compact displays) */
.spirit-card.mini {
  width: 86px;
  height: 120px;
  padding: 4px;
  border-radius: 8px;
}

.spirit-card.mini .card-art-box {
  height: 48px;
}

.spirit-card.mini .card-name {
  font-size: 0.68rem;
}

.spirit-card.mini .card-ability-box,
.spirit-card.mini .card-lore {
  display: none;
}

/* Active Arena Large Card Variant */
.spirit-card.active-arena-card {
  width: 220px;
  height: 300px;
  padding: 10px;
}

.spirit-card.active-arena-card .card-art-box {
  height: 110px;
}

/* Card Header */
.card-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.card-cost-gem {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff, var(--spark));
  color: #000;
  font-weight: 900;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px var(--spark);
}

.card-name {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  text-align: center;
  padding: 0 4px;
}

.card-element-pill {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Element color tags */
.elem-fire { background: rgba(255, 85, 0, 0.2); color: var(--fire); }
.elem-water { background: rgba(0, 180, 216, 0.2); color: var(--water); }
.elem-nature { background: rgba(46, 204, 113, 0.2); color: var(--nature); }
.elem-spark { background: rgba(255, 234, 0, 0.2); color: var(--spark); }
.elem-shadow { background: rgba(187, 66, 255, 0.2); color: var(--shadow); }

/* Card Art Box */
.card-art-box {
  width: 100%;
  height: 82px;
  border-radius: 8px;
  background: #03050a;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 6px;
}

.card-art-box .creature-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.spirit-card:hover .card-art-box .creature-portrait {
  transform: scale(1.05);
}

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

/* Card Stats Row */
.card-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 0.75rem;
  font-weight: 800;
  margin-bottom: 4px;
}

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

.stat-chip.stat-hp { color: #2ecc71; }
.stat-chip.stat-atk { color: #ff6b81; }
.stat-chip.stat-def { color: #33e6ff; }

/* Card Ability Box */
.card-ability-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 0.72rem;
  line-height: 1.25;
  margin-bottom: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.card-ability-title {
  font-weight: 700;
  color: var(--cyan-soft);
  margin-bottom: 1px;
}

/* Card Footer */
.card-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.65rem;
  color: var(--muted);
}

.card-rarity-lbl {
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.5px;
}

/* Health Bar Overlay in Arena */
.card-health-bar-wrap {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
  position: relative;
}

.card-health-fill {
  height: 100%;
  background: linear-gradient(90deg, #2ecc71, #62ff32);
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-health-fill.low {
  background: linear-gradient(90deg, #ff4757, #ff6b81);
}

/* ==========================================================================
   PACK OPENING SIMULATOR
   ========================================================================== */

.shop-packs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.booster-pack-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-panel);
}

.booster-pack-card:hover {
  transform: translateY(-4px);
  border-color: var(--cyan);
  box-shadow: 0 16px 36px rgba(51, 230, 255, 0.15);
}

.pack-foil-graphic {
  width: 140px;
  height: 200px;
  border-radius: 12px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.7);
  transition: transform 0.3s ease;
}

.booster-pack-card:hover .pack-foil-graphic {
  transform: scale(1.05) rotate(-1deg);
}

.pack-elemental .pack-foil-graphic {
  background: linear-gradient(135deg, #0077b6, #00b4d8 60%, #90e0ef);
  border: 2px solid var(--cyan);
}

.pack-cyber .pack-foil-graphic {
  background: linear-gradient(135deg, #5a189a, #bb42ff 60%, #ff3fd2);
  border: 2px solid var(--magenta);
}

.pack-cosmic .pack-foil-graphic {
  background: linear-gradient(135deg, #10002b, #ffbe0b 50%, #ff5500);
  border: 2px solid var(--gold);
}

.pack-foil-graphic::after {
  content: "";
  position: absolute;
  inset: -100%;
  background: linear-gradient(
    45deg,
    transparent 40%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 60%
  );
  animation: holoSheen 3s infinite linear;
}

.pack-foil-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  z-index: 2;
  margin-top: 10px;
}

.pack-details-list {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 20px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.btn-buy-pack {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-pill);
  border: none;
  background: linear-gradient(135deg, var(--gold), #ff8c00);
  color: #000;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(255, 190, 11, 0.35);
}

.btn-buy-pack:hover:not(:disabled) {
  filter: brightness(1.15);
  box-shadow: 0 6px 24px rgba(255, 190, 11, 0.55);
  transform: translateY(-2px);
}

.btn-buy-pack:disabled {
  background: var(--surface-2);
  color: var(--faint);
  cursor: not-allowed;
  box-shadow: none;
}

/* Pack Opening Overlay Stage */
.pack-open-stage {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(3, 4, 10, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.pack-open-stage.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.pack-tear-interactive {
  width: 200px;
  height: 290px;
  border-radius: 16px;
  position: relative;
  cursor: pointer;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 40px rgba(51, 230, 255, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.pack-tear-interactive:hover {
  transform: scale(1.05);
}

.pack-tear-strip {
  position: absolute;
  top: 45px;
  left: 0;
  right: 0;
  height: 28px;
  background: rgba(0, 0, 0, 0.4);
  border-top: 1px dashed #fff;
  border-bottom: 1px dashed #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #fff;
}

/* Revealed Cards Grid */
.cards-reveal-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  max-width: 1100px;
  margin-top: 30px;
  perspective: 1000px;
}

.card-flip-wrap {
  width: 170px;
  height: 240px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
}

.card-flip-wrap.flipped {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 12px;
}

.card-face.back {
  background: linear-gradient(135deg, #091224, #05060f);
  border: 2px solid var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transform: rotateY(0deg);
}

.card-face.back::after {
  content: "CLICK TO FLIP";
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--cyan);
  letter-spacing: 1px;
}

.card-face.front {
  transform: rotateY(180deg);
}

.new-card-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  background: linear-gradient(135deg, var(--gold), #ff5500);
  color: #000;
  font-weight: 900;
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  box-shadow: 0 0 12px var(--gold);
  z-index: 20;
  animation: pulse 1.5s infinite ease-in-out;
}

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

.reveal-controls-bar {
  margin-top: 36px;
  display: flex;
  gap: 16px;
}

/* ==========================================================================
   DECK BUILDER
   ========================================================================== */

.deck-builder-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
}

/* Left / Deck Drawer Column */
.deck-summary-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  height: fit-content;
  position: sticky;
  top: 80px;
  box-shadow: var(--shadow-panel);
}

.deck-count-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--cyan);
  font-weight: 700;
  margin-bottom: 16px;
}

.deck-count-banner.valid {
  border-left-color: var(--nature);
}

.deck-count-banner.invalid {
  border-left-color: var(--danger);
}

/* Curve Bar Chart */
.deck-curve-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 60px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.curve-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}

.curve-bar {
  width: 100%;
  background: var(--cyan);
  border-radius: 3px 3px 0 0;
  min-height: 4px;
  transition: height 0.3s ease;
}

.curve-lbl {
  font-size: 0.68rem;
  color: var(--muted);
}

/* Element pills row */
.deck-elements-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.elem-count-tag {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-weight: 700;
}

/* Deck Cards Scroll List */
.deck-cards-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 20px;
}

.deck-card-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.deck-card-strip:hover {
  background: var(--surface-3);
  border-color: var(--cyan);
  transform: translateX(3px);
}

.deck-strip-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.deck-strip-cost {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--spark);
  color: #000;
  font-weight: 800;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.deck-strip-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.deck-strip-btn-remove {
  background: transparent;
  border: none;
  color: var(--danger);
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 6px;
}

/* Right / Inventory Collection Column */
.collection-browser-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-input {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-family: var(--font-main);
  font-size: 0.88rem;
  min-width: 180px;
}

.search-input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 10px rgba(51, 230, 255, 0.2);
}

.filter-btn {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-btn:hover {
  color: var(--text);
}

.filter-btn.active {
  background: rgba(51, 230, 255, 0.15);
  border-color: var(--cyan);
  color: var(--cyan);
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 18px;
}

.inventory-card-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card-owned-badge {
  position: absolute;
  top: -8px;
  left: -6px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 800;
  font-size: 0.75rem;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.card-add-action-btn {
  margin-top: 8px;
  width: 100%;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.card-add-action-btn:hover:not(:disabled) {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(51, 230, 255, 0.1);
}

.card-add-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ==========================================================================
   COLLECTION DEX (ENCYCLOPEDIA)
   ========================================================================== */

.dex-progress-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: var(--shadow-panel);
}

.dex-progress-bar-bg {
  flex: 1;
  min-width: 200px;
  height: 12px;
  background: var(--surface-2);
  border-radius: 6px;
  overflow: hidden;
}

.dex-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  border-radius: 6px;
  transition: width 0.5s ease;
}

.spirit-card.uncollected {
  filter: grayscale(1) brightness(0.4);
  opacity: 0.6;
}

.spirit-card.uncollected:hover {
  transform: none;
  filter: grayscale(1) brightness(0.6);
  cursor: default;
}

/* ==========================================================================
   MODALS (VICTORY, DEFEAT, ACCOUNT LINK)
   ========================================================================== */

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(4, 6, 14, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
  animation: fadeIn 0.25s ease;
}

.modal-dialog {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(51, 230, 255, 0.15);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-dialog.victory {
  border-color: var(--cyan);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9), 0 0 40px rgba(51, 230, 255, 0.3);
}

.modal-dialog.defeat {
  border-color: var(--danger);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9), 0 0 40px rgba(255, 71, 87, 0.3);
}

.modal-header-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.modal-dialog.victory .modal-header-icon {
  background: rgba(51, 230, 255, 0.15);
  border: 2px solid var(--cyan);
}

.modal-dialog.defeat .modal-header-icon {
  background: rgba(255, 71, 87, 0.15);
  border: 2px solid var(--danger);
}

.modal-title {
  text-align: center;
  font-size: 1.5rem;
  font-family: var(--font-display);
  font-weight: 800;
}

.modal-rewards-box {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ==========================================================================
   CARD INSPECTION MODAL
   ========================================================================== */

.card-inspection-modal {
  display: flex;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.card-inspection-modal.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.card-inspection-dialog {
  max-width: 920px;
  max-height: min(760px, calc(100vh - 40px));
  padding: 22px;
  overflow: auto;
  border-color: rgba(51, 230, 255, 0.45);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.95), 0 0 48px rgba(51, 230, 255, 0.18);
  transform: translateY(18px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-inspection-modal.open .card-inspection-dialog {
  transform: translateY(0) scale(1);
}

.card-inspection-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.card-inspection-header .modal-title {
  text-align: left;
  margin-top: 3px;
}

.eyebrow-label {
  color: var(--cyan);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.modal-close-btn {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  transition: color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.modal-close-btn:hover,
.modal-close-btn:focus-visible {
  color: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 16px rgba(51, 230, 255, 0.25);
  outline: none;
}

.card-inspection-body {
  display: grid;
  grid-template-columns: minmax(245px, 300px) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  padding-top: 22px;
}

.card-inspection-preview {
  display: flex;
  justify-content: center;
  perspective: 1000px;
  touch-action: none;
}

.card-inspection-preview .spirit-card {
  width: 280px;
  height: 394px;
  padding: 13px;
  transform: rotateX(var(--inspect-rotate-x, 0deg)) rotateY(var(--inspect-rotate-y, 0deg));
  transform-style: preserve-3d;
  transition: transform 0.12s ease-out, box-shadow 0.2s ease;
  will-change: transform;
}

.card-inspection-preview .spirit-card:hover {
  transform: rotateX(var(--inspect-rotate-x, 0deg)) rotateY(var(--inspect-rotate-y, 0deg));
}

.card-inspection-preview .spirit-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
  background:
    linear-gradient(
      115deg,
      transparent 20%,
      rgba(255, 255, 255, 0.22) 43%,
      rgba(51, 230, 255, 0.18) 48%,
      transparent 64%
    );
  background-position: var(--inspect-sheen-x, 50%) var(--inspect-sheen-y, 50%);
  background-size: 220% 220%;
  mix-blend-mode: screen;
}

.card-inspection-preview .spirit-card.rarity-epic::after,
.card-inspection-preview .spirit-card.rarity-legendary::after {
  opacity: 0.7;
  background:
    linear-gradient(
      115deg,
      transparent 12%,
      rgba(255, 54, 180, 0.28) 32%,
      rgba(51, 230, 255, 0.32) 48%,
      rgba(255, 190, 11, 0.28) 64%,
      transparent 82%
    );
  background-size: 240% 240%;
  animation: inspectionRainbowFoil 5s linear infinite;
}

@keyframes inspectionRainbowFoil {
  0% { background-position: 0% 50%; }
  100% { background-position: 240% 50%; }
}

.card-inspection-preview .card-art-box {
  height: 145px;
}

.card-inspection-preview .card-name {
  font-size: 1.08rem;
}

.card-inspection-preview .card-ability-box {
  font-size: 0.82rem;
}

.card-inspection-details {
  min-width: 0;
}

.card-inspection-kicker {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-inspection-lore {
  margin: 8px 0 20px;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.65;
}

.card-inspection-section-title {
  margin: 20px 0 10px;
  color: var(--cyan-soft);
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-inspection-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.card-inspection-stat {
  padding: 10px 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  text-align: center;
}

.card-inspection-stat-value {
  display: block;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 900;
}

.card-inspection-stat-label {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.card-inspection-ability {
  padding: 13px;
  background: linear-gradient(135deg, rgba(51, 230, 255, 0.08), rgba(187, 66, 255, 0.08));
  border: 1px solid rgba(51, 230, 255, 0.24);
  border-radius: var(--radius-md);
}

.card-inspection-ability-name {
  color: var(--cyan);
  font-weight: 900;
}

.card-inspection-ability-meta {
  float: right;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 800;
}

.card-inspection-ability-description {
  clear: both;
  padding-top: 7px;
  color: var(--text);
  line-height: 1.5;
}

@media (max-width: 680px) {
  .card-inspection-dialog {
    max-height: calc(100vh - 20px);
    padding: 16px;
  }

  .card-inspection-body {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .card-inspection-preview .spirit-card {
    width: min(280px, 82vw);
    height: min(394px, 116vw);
  }

  .card-inspection-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .card-inspection-dialog,
  .card-inspection-preview .spirit-card,
  .card-inspection-modal {
    transition: none;
  }

  .card-inspection-preview .spirit-card.rarity-epic::after,
  .card-inspection-preview .spirit-card.rarity-legendary::after {
    animation: none;
  }
}

body.modal-open {
  overflow: hidden;
}

/* ==========================================================================
   RESPONSIVE DESIGN (390px, TABLET, DESKTOP)
   ========================================================================== */

@media (max-width: 992px) {
  .deck-builder-layout {
    grid-template-columns: 1fr;
  }
  .deck-summary-panel {
    position: static;
  }
  .active-battle-slot {
    width: 180px;
    height: 250px;
  }
}

@media (max-width: 680px) {
  .app-header {
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .brand-titles {
    display: none;
  }
  .nav-tabs {
    order: 3;
    width: 100%;
    justify-content: space-around;
    overflow-x: auto;
  }
  .nav-tab-btn {
    padding: 6px 10px;
    font-size: 0.78rem;
  }
  .nav-tab-btn span {
    display: none;
  }
  .main-content {
    padding: 16px 12px 60px;
  }
  .active-battle-slot {
    width: 140px;
    height: 195px;
  }
  .combatant-zone {
    flex-direction: column;
    align-items: center;
  }
  .bench-container {
    order: 2;
  }
  .player-actions-bar {
    justify-content: center;
  }
}
