/* =========================================================
   PROJECT NEXUS CLASH: TRI-SECTOR TACTICAL TCG
   Cutting-Edge Cyber-Fantasy Dark Aesthetics
========================================================= */

:root {
  --bg-dark: #06090e;
  --bg-surface: #0e141e;
  --bg-surface-elevated: #162030;
  --glass-bg: rgba(18, 26, 38, 0.75);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-border-hover: rgba(0, 229, 255, 0.4);

  --text-main: #f0f4f8;
  --text-muted: #8a99ad;
  --text-highlight: #00e5ff;

  --color-iron: #00e5ff;
  --color-void: #bd00ff;
  --color-solar: #ffb300;
  --color-chrono: #ff2a85;

  --energy-core: #00e5ff;
  --energy-res: #bd00ff;
  --hp-player: #00e676;
  --hp-opp: #ff1744;

  --font-title: 'Cinzel', serif;
  --font-ui: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-thai: 'Prompt', sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-card: 12px;
  --shadow-glow: 0 0 20px rgba(0, 229, 255, 0.25);
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-ui), var(--font-thai);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  line-height: 1.4;
}

/* =========================================================
   SCREEN SWITCHING & BACKDROPS
========================================================= */
.screen {
  display: none;
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

.lobby-backdrop, .arena-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: 
    radial-gradient(circle at 50% 20%, rgba(0, 229, 255, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 20% 80%, rgba(189, 0, 255, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 179, 0, 0.06) 0%, transparent 50%),
    linear-gradient(180deg, #070a10 0%, #030508 100%);
}

/* =========================================================
   LOBBY / DECK SELECTOR
========================================================= */
.lobby-header {
  padding: 24px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
}

.logo-badge {
  display: inline-block;
  padding: 2px 10px;
  background: rgba(0, 229, 255, 0.15);
  border: 1px solid var(--color-iron);
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--color-iron);
  margin-bottom: 4px;
}

.logo-title {
  font-family: var(--font-title);
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 3px;
  background: linear-gradient(135deg, #ffffff 30%, #8ae4ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.btn-icon {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  font-size: 1.2rem;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  border-color: var(--color-iron);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.3);
}

.lobby-main {
  flex: 1;
  overflow-y: auto;
  padding: 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
}

/* Deck Filter Tabs */
.deck-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.filter-tab {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #a0aec0;
  font-family: 'Prompt', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.filter-tab:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.filter-tab.active {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.25) 0%, rgba(189, 0, 255, 0.25) 100%);
  color: #ffffff;
  border-color: #00e5ff;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.4);
  font-weight: 700;
}

.faction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  max-height: 520px;
  overflow-y: auto;
  padding: 6px;
  scroll-behavior: smooth;
}

.faction-grid::-webkit-scrollbar {
  width: 6px;
}

.faction-grid::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.faction-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.faction-card {
  background: var(--bg-surface);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faction-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--faction-color, #fff);
  opacity: 0.6;
}

.faction-card:hover {
  transform: translateY(-4px);
  border-color: var(--faction-color);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px var(--faction-color);
}

.faction-card.selected {
  border-color: var(--faction-color);
  background: var(--bg-surface-elevated);
  box-shadow: 0 0 25px var(--faction-color), inset 0 0 15px rgba(255, 255, 255, 0.05);
}

.faction-card.selected::after {
  content: '✓ เลือกแล้ว';
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--faction-color);
  color: #000;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
}

.faction-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.faction-icon {
  font-size: 2rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.faction-names h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.faction-names .thai-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.faction-desc {
  font-size: 0.85rem;
  color: #ccd7e4;
  flex: 1;
}

.faction-stats-badge {
  display: flex;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.faction-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.btn-view-deck {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-view-deck:hover {
  color: #fff;
  border-color: #fff;
}

/* =========================================================
   RPG CHARACTER & STARTER DECK CREATION (NEW START SCREEN)
========================================================= */
.rpg-creation-flow {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.rpg-creation-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #00e5ff 0%, #0077ff 100%);
  color: #030810;
  border-radius: 50%;
  font-size: 0.9rem;
  font-weight: 900;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.5);
}

.section-hint {
  font-size: 0.85rem;
  color: #8da2bc;
  margin-left: auto;
}

/* Faction Picker Bar */
.rpg-faction-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.rpg-faction-tab {
  background: rgba(14, 20, 30, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 30px;
  padding: 10px 18px;
  color: #c0cfdf;
  font-family: var(--font-thai), sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.rpg-faction-tab:hover {
  transform: translateY(-2px);
  color: #ffffff;
  border-color: var(--f-color, #00e5ff);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4), 0 0 12px var(--f-color, #00e5ff)33;
}

.rpg-faction-tab.active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%), #131c2a;
  color: #ffffff;
  border-color: var(--f-color, #00e5ff);
  box-shadow: 0 0 20px var(--f-color, #00e5ff)55, inset 0 0 12px var(--f-color, #00e5ff)22;
  font-weight: 700;
}

.rpg-faction-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 3px;
  background: var(--f-color, #00e5ff);
  border-radius: 3px;
  box-shadow: 0 0 8px var(--f-color, #00e5ff);
}

.rpg-faction-tab .f-icon {
  font-size: 1.25rem;
}

.rpg-faction-tab .f-count {
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #8fa0b5;
}

/* Commander & Faction Showcase Banner */
.rpg-commander-showcase {
  display: flex;
  background: linear-gradient(135deg, rgba(16, 24, 38, 0.9) 0%, rgba(9, 14, 23, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 5px solid var(--f-color, #00e5ff);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 220px;
}

.showcase-banner-img-wrap {
  width: 260px;
  min-width: 260px;
  position: relative;
  overflow: hidden;
  background: #06090e;
}

.showcase-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.5s ease;
}

.rpg-commander-showcase:hover .showcase-img {
  transform: scale(1.04);
}

.showcase-overlay-glow {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(to right, transparent 60%, rgba(9, 14, 23, 0.95) 100%);
  pointer-events: none;
}

.showcase-info {
  flex: 1;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.showcase-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.showcase-faction-badge {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid;
  letter-spacing: 0.5px;
}

.showcase-title-tag {
  font-size: 0.8rem;
  color: #8da2bc;
  font-weight: 500;
}

.showcase-commander-name {
  font-family: var(--font-title), var(--font-thai);
  font-size: 1.8rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 1px;
  margin: 0;
}

.showcase-quote {
  font-size: 0.92rem;
  font-style: italic;
  color: #b0c2d8;
  line-height: 1.5;
  border-left: 2px solid rgba(255, 255, 255, 0.15);
  padding-left: 12px;
  margin: 2px 0 6px;
}

.showcase-playstyle-box {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.playstyle-label {
  color: #8fa0b5;
  font-weight: 600;
}

.playstyle-val {
  color: #ffffff;
  font-weight: 500;
}

.showcase-relic-row {
  margin-top: 4px;
}

.relic-perk-card {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.relic-perk-icon {
  font-size: 1.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.relic-perk-name {
  font-size: 0.88rem;
  color: #ffffff;
}

.relic-perk-benefit {
  font-size: 0.8rem;
  color: #c4d4e6;
  margin-top: 2px;
}

/* Starter Decks Grid */
.rpg-starter-deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px;
}

.rpg-deck-card {
  background: var(--bg-surface);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rpg-deck-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--f-color, #00e5ff);
  opacity: 0.5;
  transition: opacity 0.25s;
}

.rpg-deck-card:hover {
  transform: translateY(-4px);
  border-color: var(--f-color, #00e5ff);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 16px var(--f-color, #00e5ff)44;
}

.rpg-deck-card.selected {
  border-color: var(--f-color, #00e5ff);
  background: linear-gradient(180deg, #162030 0%, #0e1622 100%);
  box-shadow: 0 0 24px var(--f-color, #00e5ff)55, inset 0 0 12px rgba(255, 255, 255, 0.05);
}

.rpg-deck-card.selected::after {
  content: '✓ สำรับที่เลือก';
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--f-color, #00e5ff);
  color: #030810;
  font-weight: 800;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 4px;
}

.rpg-deck-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.deck-icon-badge {
  font-size: 1.5rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid;
}

.deck-head-titles h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
}

.deck-archetype {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.deck-desc {
  font-size: 0.85rem;
  color: #b8c8dc;
  flex: 1;
  line-height: 1.45;
}

.deck-meta-row {
  display: flex;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.35);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: #8ea1b7;
}

.deck-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.deck-theme-tag {
  font-size: 0.8rem;
  font-weight: 700;
}

.btn-preview-deck {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #c4d4e6;
  font-size: 0.78rem;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-thai), sans-serif;
}

.btn-preview-deck:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-color: #ffffff;
}

/* Bottom RPG Embark Dock */
.rpg-embark-dock {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  background: rgba(10, 15, 24, 0.92);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 16px;
  padding: 16px 28px;
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 229, 255, 0.15);
  margin-top: 8px;
  margin-bottom: 24px;
  z-index: 20;
}

.embark-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.summary-avatar-wrap {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid;
  overflow: hidden;
  position: relative;
  background: #000;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.summary-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.summary-f-icon {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 0.9rem;
  background: #0c121c;
  border-radius: 50%;
  padding: 1px;
}

.summary-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.summary-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
}

.summary-commander {
  color: #ffffff;
}

.summary-deck-line {
  font-size: 0.85rem;
  color: #b0c2d8;
}

.summary-relic-line {
  font-size: 0.82rem;
  color: #ffd54f;
}

.btn-resume-campaign {
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.15) 0%, rgba(0, 229, 255, 0.15) 100%);
  border: 1px solid #00e676;
  color: #00e676;
  font-family: var(--font-thai), sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 30px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 0 15px rgba(0, 230, 118, 0.25);
  transition: all 0.25s;
}

.btn-resume-campaign:hover {
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.25) 0%, rgba(0, 229, 255, 0.25) 100%);
  box-shadow: 0 0 25px rgba(0, 230, 118, 0.45);
  transform: translateY(-2px);
  color: #ffffff;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00e676;
  box-shadow: 0 0 8px #00e676;
  animation: pulseGreen 1.5s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 14px #00e676; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.btn-cta {
  background: linear-gradient(135deg, #00e5ff 0%, #0077ff 100%);
  color: #030810;
  border: none;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 16px 48px;
  border-radius: 40px;
  cursor: pointer;
  box-shadow: 0 0 25px rgba(0, 229, 255, 0.4);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
  font-family: var(--font-thai), var(--font-ui), sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-cta:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 35px rgba(0, 229, 255, 0.7);
}

@media (max-width: 860px) {
  .rpg-commander-showcase {
    flex-direction: column;
  }
  .showcase-banner-img-wrap {
    width: 100%;
    min-width: unset;
    height: 190px;
  }
  .showcase-overlay-glow {
    background: linear-gradient(to bottom, transparent 50%, rgba(9, 14, 23, 0.95) 100%);
  }
  .rpg-embark-dock {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-cta {
    width: 100%;
  }
}

/* =========================================================
   BATTLE ARENA LAYOUT
========================================================= */
.arena-header {
  height: 80px;
  padding: 8px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  z-index: 10;
}

.combatant-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.combatant-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-surface-elevated);
  border: 2px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

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

.combatant-name {
  font-size: 0.9rem;
  font-weight: 700;
}

.hero-defense-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.hero-defense-badge.protected {
  background: rgba(0, 229, 255, 0.15);
  border: 1px solid rgba(0, 229, 255, 0.5);
  color: #00e5ff;
  text-shadow: 0 0 6px rgba(0, 229, 255, 0.6);
}

.hero-defense-badge.vulnerable {
  background: rgba(255, 23, 68, 0.25);
  border: 1px solid #ff1744;
  color: #ff5252;
  text-shadow: 0 0 8px rgba(255, 23, 68, 0.8);
  animation: pulse-vulnerable 1.2s infinite alternate;
}

@keyframes pulse-vulnerable {
  0% { transform: scale(0.98); box-shadow: 0 0 4px rgba(255, 23, 68, 0.4); }
  100% { transform: scale(1.04); box-shadow: 0 0 12px rgba(255, 23, 68, 0.9); }
}

.combatant-card.targetable-blocked {
  outline: 3px dashed #ff1744 !important;
  box-shadow: 0 0 20px rgba(255, 23, 68, 0.7) !important;
  cursor: not-allowed !important;
}

.combatant-card.hero-vulnerable {
  border-color: rgba(255, 82, 82, 0.6) !important;
  box-shadow: 0 0 15px rgba(255, 23, 68, 0.35);
}

.hp-bar-wrapper {
  position: relative;
  width: 140px;
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 4px;
}

.hp-bar-fill {
  height: 100%;
  background: var(--hp-opp);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hp-bar-fill.player-fill {
  background: var(--hp-player);
}

.hp-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.65rem;
  font-weight: 700;
  text-shadow: 0 1px 2px #000;
}

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

.round-badge {
  background: rgba(0, 229, 255, 0.15);
  border: 1px solid var(--color-iron);
  border-radius: 20px;
  padding: 2px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.round-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.round-number {
  font-weight: 800;
  color: #fff;
  font-size: 0.9rem;
}

.dominance-meter {
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
  font-weight: 700;
}

.player-dom { color: var(--color-iron); }
.opp-dom { color: var(--color-void); }
.tie-dom { color: var(--text-muted); }

.opponent-hand {
  display: flex;
  gap: -15px;
}

.opp-card-back {
  width: 42px;
  height: 60px;
  background: linear-gradient(135deg, #1b263b 0%, #0d1b2a 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  margin-left: -12px;
  transform: rotate(-3deg);
}

/* =========================================================
   ARENA WORKSPACE (LEFT INSPECTOR + CENTRAL BATTLEFIELD)
========================================================= */
.arena-workspace {
  flex: 1;
  display: flex;
  gap: 18px;
  padding: 12px 24px;
  align-items: stretch;
  overflow: hidden;
}

/* ---------------------------------------------------------
   LEFT CARD INSPECTOR PANEL
--------------------------------------------------------- */
.card-inspector-panel {
  width: 280px;
  background: var(--glass-bg);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(12px);
  padding: 14px;
  overflow-y: auto;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.card-inspector-panel.has-card {
  border-color: var(--inspected-card-color, var(--color-iron));
  box-shadow: 0 0 25px rgba(0, 229, 255, 0.2);
}

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

.inspector-badge {
  font-family: var(--font-title);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--color-iron);
}

.inspector-thai {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.inspector-content.empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.empty-inspector-placeholder {
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-inspector-placeholder .empty-icon {
  font-size: 3rem;
  opacity: 0.5;
  animation: float-icon 3s ease-in-out infinite;
}

@keyframes float-icon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.inspector-card-preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fade-in-panel 0.25s ease;
}

@keyframes fade-in-panel {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.inspector-art-frame {
  height: 120px;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid var(--inspected-card-color, rgba(255, 255, 255, 0.15));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.6);
}

.inspector-art-frame svg {
  width: 90px;
  height: 90px;
}

.inspector-cost-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--color-iron);
  color: #000;
  font-weight: 900;
  font-size: 1rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.6);
}

.inspector-speed-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.7);
  border: 1px solid var(--glass-border);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}

.inspector-title-block h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
}

.inspector-title-block .inspector-sub {
  font-size: 0.8rem;
  color: var(--inspected-card-color, var(--text-muted));
  font-weight: 600;
}

.inspector-stats-row {
  display: flex;
  justify-content: space-around;
  background: rgba(0, 0, 0, 0.4);
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.inspector-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.inspector-stat .stat-lbl {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
}

.inspector-stat .stat-val {
  font-size: 1.15rem;
  font-weight: 900;
}

.stat-atk-val { color: #ffab00; }
.stat-arm-val { color: #00e5ff; }
.stat-hp-val { color: #00e676; }

.inspector-desc-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 0.8rem;
  color: #d1dbe6;
  line-height: 1.4;
}

.inspector-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.btn-inspect-deploy {
  background: linear-gradient(135deg, #00e5ff 0%, #0077ff 100%);
  color: #030810;
  border: none;
  font-weight: 800;
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.3);
  transition: all 0.2s;
}

.btn-inspect-deploy:hover {
  transform: scale(1.02);
  box-shadow: 0 0 25px rgba(0, 229, 255, 0.6);
}

.btn-inspect-recycle {
  background: rgba(189, 0, 255, 0.15);
  border: 1px solid var(--color-void);
  color: #fff;
  font-weight: 700;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-inspect-recycle:hover {
  background: var(--color-void);
}

/* ---------------------------------------------------------
   CENTRAL BATTLEFIELD ARENA
--------------------------------------------------------- */
.central-battlefield-arena {
  flex: 1;
  background: var(--glass-bg);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.central-battlefield-arena.drag-over {
  border-color: var(--color-iron);
  background: rgba(0, 229, 255, 0.08);
  box-shadow: inset 0 0 35px rgba(0, 229, 255, 0.25);
}

.arena-top-bar {
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.2);
}

.arena-title {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #ffffff 40%, #8ae4ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.arena-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.power-clash-gauge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 16px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
}

.power-side {
  display: flex;
  align-items: center;
  gap: 6px;
}

.power-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.power-value {
  font-size: 1.3rem;
  font-weight: 900;
}

.opp-side .power-value { color: #ff5252; }
.player-side .power-value { color: #00e5ff; }

.power-versus {
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0 4px;
}

.battlefield-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px 20px;
  position: relative;
}

.units-formation {
  flex: 1;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  min-height: 130px;
  position: relative;
}

.clash-trench {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 4px 0;
  position: relative;
  min-height: 28px;
}

.trench-line {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.4), transparent);
}

.trench-badge {
  font-family: var(--font-title);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.arena-drop-hint {
  display: none;
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 229, 255, 0.25);
  border: 2px dashed var(--color-iron);
  padding: 8px 24px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  pointer-events: none;
  animation: pulse-drop 1.5s infinite;
}

@keyframes pulse-drop {
  0%, 100% { box-shadow: 0 0 10px rgba(0, 229, 255, 0.3); }
  50% { box-shadow: 0 0 20px rgba(0, 229, 255, 0.8); }
}

.central-battlefield-arena.drag-over .arena-drop-hint {
  display: block;
}

.power-tag.opp-tag {
  background: rgba(255, 23, 68, 0.2);
  border: 1px solid var(--hp-opp);
  color: #ff5252;
}

.power-tag.player-tag {
  background: rgba(0, 229, 255, 0.2);
  border: 1px solid var(--color-iron);
  color: var(--color-iron);
}

.clash-icon {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.lane-drop-hint {
  display: none;
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 229, 255, 0.2);
  border: 1px dashed var(--color-iron);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: #fff;
  pointer-events: none;
}

.lane-sector.drag-over .lane-drop-hint {
  display: block;
}

/* =========================================================
   CARD STYLES (Units & Spells)
========================================================= */
.card-unit {
  width: 90px;
  height: 125px;
  background: var(--bg-surface-elevated);
  border: 2px solid var(--faction-card-color, #445566);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden;
}

.card-unit:hover {
  transform: translateY(-4px) scale(1.08);
  z-index: 100;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.7), 0 0 12px var(--faction-card-color);
}

.unit-cost-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-iron);
  color: #000;
  font-weight: 800;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.unit-speed-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 0.7rem;
  z-index: 2;
}

.unit-art {
  height: 55px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px;
}

.unit-art svg {
  width: 44px;
  height: 44px;
}

.unit-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-align: center;
  padding: 2px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(0, 0, 0, 0.4);
}

.unit-combat-stats {
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.6);
  font-weight: 800;
  font-size: 0.8rem;
}

.stat-atk { color: #ffab00; }
.stat-hp { color: #00e676; }
.stat-armor { color: #00e5ff; font-size: 0.7rem; }
.shield-aura {
  position: absolute;
  inset: 0;
  border: 2px solid #ffea00;
  border-radius: var(--radius-sm);
  pointer-events: none;
  animation: pulse-shield 1.5s infinite;
}

@keyframes pulse-shield {
  0% { box-shadow: 0 0 4px #ffea00; }
  50% { box-shadow: 0 0 12px #ffea00; }
  100% { box-shadow: 0 0 4px #ffea00; }
}

/* =========================================================
   PLAYER FOOTER (Hand & Energy Dashboard)
========================================================= */
.arena-footer {
  height: 250px;
  display: flex;
  flex-direction: column;
  background: var(--glass-bg);
  border-top: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  position: relative;
  z-index: 10;
}

.player-status-strip {
  padding: 10px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.energy-dashboard {
  display: flex;
  gap: 28px;
}

.energy-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.energy-title {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.energy-orbs-container, .resonance-crystals-container {
  display: flex;
  gap: 6px;
}

.core-orb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(0, 229, 255, 0.3);
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: all 0.2s;
}

.core-orb.active {
  background: var(--color-iron);
  border-color: #fff;
  box-shadow: 0 0 10px var(--color-iron);
}

.res-crystal {
  width: 22px;
  height: 22px;
  transform: rotate(45deg);
  border: 2px solid rgba(189, 0, 255, 0.3);
  background: rgba(0, 0, 0, 0.3);
  margin: 2px;
  transition: all 0.2s;
}

.res-crystal.active {
  background: var(--color-void);
  border-color: #fff;
  box-shadow: 0 0 10px var(--color-void);
}

.action-buttons-group {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn-utility {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  transition: all 0.2s;
}

.btn-utility:hover {
  border-color: var(--color-iron);
}

/* Tactile 3D Turn Pass Lever Button (End Turn) */
.btn-clash-trigger {
  position: relative;
  background: linear-gradient(180deg, #10b981 0%, #059669 50%, #047857 100%);
  border: 3px solid #f59e0b;
  color: #ffffff;
  padding: 10px 32px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 175px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), inset 0 -3px 0 rgba(0, 0, 0, 0.5), 0 6px 18px rgba(0, 0, 0, 0.6), 0 0 22px rgba(16, 185, 129, 0.45);
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  transform-style: preserve-3d;
  user-select: none;
}

.btn-clash-trigger:hover:not(:disabled) {
  background: linear-gradient(180deg, #34d399 0%, #10b981 50%, #059669 100%);
  border-color: #fbbf24;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.6), inset 0 -3px 0 rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 30px rgba(16, 185, 129, 0.7);
  transform: translateY(-2px);
}

.btn-clash-trigger:active:not(:disabled) {
  transform: translateY(2px) scale(0.97);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.5);
}

.btn-clash-trigger.flipping {
  animation: leverFlip 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes leverFlip {
  0% { transform: perspective(400px) rotateX(0deg) scale(1); }
  50% { transform: perspective(400px) rotateX(90deg) scale(0.9); }
  100% { transform: perspective(400px) rotateX(0deg) scale(1); }
}

.btn-clash-trigger:disabled, .btn-clash-trigger.enemy-turn {
  background: linear-gradient(180deg, #374151 0%, #1f2937 50%, #111827 100%) !important;
  border-color: #6b7280 !important;
  color: #9ca3af !important;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.1), inset 0 -3px 0 rgba(0, 0, 0, 0.7), 0 4px 10px rgba(0, 0, 0, 0.5) !important;
  cursor: not-allowed;
  transform: none !important;
}

.clash-text {
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: 1.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8), 0 0 10px rgba(255, 255, 255, 0.3);
}

.clash-sub {
  font-size: 0.68rem;
  font-weight: 600;
  opacity: 0.9;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* =========================================================
   PLAYER HAND (FANNED CARDS)
========================================================= */
.player-hand-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible;
  padding: 0 20px;
}

.player-deck-discard-tray {
  position: absolute;
  left: 20px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 15;
}

.hand-deck-counter {
  background: rgba(10, 15, 25, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  backdrop-filter: blur(8px);
  white-space: nowrap;
}

.player-hand {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: -20px;
  height: 100%;
}

.hand-card {
  width: 120px;
  height: 170px;
  background: var(--bg-surface-elevated);
  border: 2px solid var(--faction-card-color, #445566);
  border-radius: var(--radius-card);
  margin-left: -24px;
  cursor: grab;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 6px;
  box-shadow: -4px -4px 15px rgba(0, 0, 0, 0.6);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), margin 0.25s, box-shadow 0.25s;
  overflow: hidden;
  background: linear-gradient(180deg, #162030 0%, #0c121c 100%);
}

.hand-card:first-child {
  margin-left: 0;
}

.hand-card:hover {
  transform: translateY(-40px) scale(1.15) !important;
  margin-left: 0;
  margin-right: 16px;
  z-index: 100;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.8), 0 0 20px var(--faction-card-color);
  border-color: #fff;
}

.hand-card.selected-for-play {
  transform: translateY(-50px) scale(1.2) !important;
  border-color: var(--color-iron);
  box-shadow: 0 0 25px var(--color-iron);
}

.card-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.card-cost-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-iron);
  color: #000;
  font-weight: 900;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-speed-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.4);
}

.card-main-art {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 6px;
  margin-bottom: 6px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.card-main-art svg {
  width: 60px;
  height: 60px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
}

.card-label-title {
  font-size: 0.8rem;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
  padding: 0 2px;
  margin-bottom: 6px;
}

.card-text-body {
  display: none !important;
}

.card-footer-stats {
  display: flex;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.6);
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 0.85rem;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-card-detail-box {
  background: rgba(10, 20, 32, 0.95);
  border: 1px solid var(--color-iron);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 16px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6), 0 0 15px rgba(0, 229, 255, 0.2);
  animation: fadeIn 0.25s ease-out;
}

/* =========================================================
   MODALS & DRAWERS
========================================================= */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--bg-surface-elevated);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

.deck-modal-content {
  max-width: 850px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
}

.btn-close:hover { color: #fff; }

.deck-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.modal-deck-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px 0;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.deck-stat-pill {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #ccd7e4;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.deck-stat-pill.total { color: #ffffff; font-weight: 800; border: 1px solid rgba(255, 255, 255, 0.2); }
.deck-stat-pill.unit { color: #00e5ff; border: 1px solid rgba(0, 229, 255, 0.3); }
.deck-stat-pill.spell { color: #ffb300; border: 1px solid rgba(255, 179, 0, 0.3); }
.deck-stat-pill.trap { color: #bd00ff; border: 1px solid rgba(189, 0, 255, 0.3); }
.deck-stat-pill.field { color: #00e676; border: 1px solid rgba(0, 230, 118, 0.3); }

.gameover-content {
  text-align: center;
  max-width: 480px;
}

.victory-banner {
  font-family: var(--font-title);
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: 4px;
  color: #00e5ff;
  text-shadow: 0 0 25px rgba(0, 229, 255, 0.6);
  margin-bottom: 8px;
}

.victory-banner.defeat {
  color: #ff1744;
  text-shadow: 0 0 25px rgba(255, 23, 68, 0.6);
}

.gameover-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 24px;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
}

.btn-secondary:hover {
  border-color: #fff;
}

/* Battle Log Drawer */
.log-drawer {
  position: fixed;
  top: 0;
  right: -360px;
  width: 350px;
  height: 100vh;
  background: var(--bg-surface-elevated);
  border-left: 2px solid var(--glass-border);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.7);
  z-index: 500;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.log-drawer.active {
  right: 0;
}

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

.log-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.8rem;
}

.log-item {
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 10px;
  border-radius: 6px;
  border-left: 3px solid var(--color-iron);
}

/* Toast Container */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--color-iron);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
  animation: slide-in 0.3s ease;
}

@keyframes slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* =========================================================
   TACTICAL TARGETING ARROW OVERLAY
========================================================= */
.targeting-arrow-svg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  display: none;
}

.targeting-arrow-svg.active {
  display: block;
}

.arrow-line {
  fill: none;
  stroke: #ff1744;
  stroke-width: 5;
  stroke-dasharray: 8 6;
  filter: drop-shadow(0 0 8px rgba(255, 23, 68, 0.8));
  animation: dash-move 0.8s linear infinite;
}

@keyframes dash-move {
  to { stroke-dashoffset: -28; }
}

.arrow-head {
  fill: #ff1744;
  filter: drop-shadow(0 0 10px rgba(255, 23, 68, 1));
}

/* Ready to Attack Aura (High-Energy Plasma Glow) */
.card-unit.can-attack {
  border-color: #00e676 !important;
  box-shadow: 0 0 14px rgba(0, 230, 118, 0.8), inset 0 0 8px rgba(0, 230, 118, 0.4);
  cursor: crosshair;
  animation: pulse-ready 1.8s infinite alternate;
}

@keyframes pulse-ready {
  0% { transform: translateY(0); box-shadow: 0 0 8px rgba(0, 230, 118, 0.5); }
  100% { transform: translateY(-4px); box-shadow: 0 0 20px rgba(0, 230, 118, 1); }
}

/* Targetable Hover Highlight */
.card-unit.targetable-hover, .combatant-card.targetable-hover {
  outline: 3px solid #ff1744 !important;
  box-shadow: 0 0 25px rgba(255, 23, 68, 0.9) !important;
  transform: scale(1.06);
}

/* Taunt Indicator */
.card-unit.is-taunt::before {
  content: '🛡️ ยั่วยุ (TAUNT)';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffab00;
  color: #000;
  font-size: 0.6rem;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 4px;
  z-index: 5;
  box-shadow: 0 2px 6px rgba(0,0,0,0.6);
}

/* =========================================================
   NEXUS TRAP ZONES & FIELD PEDESTAL
========================================================= */
.trap-zone-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.zone-label {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.trap-slots {
  display: flex;
  gap: 6px;
}

.trap-slot {
  width: 32px;
  height: 44px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.75rem;
  transition: all 0.2s;
}

.trap-slot.occupied {
  border: 1px solid var(--color-void);
  background: linear-gradient(135deg, #2b0838 0%, #12031a 100%);
  box-shadow: 0 0 10px rgba(189, 0, 255, 0.4);
  cursor: pointer;
}

.trap-slot.occupied:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 15px rgba(189, 0, 255, 0.8);
}

.trap-secret-rune {
  color: var(--color-void);
  font-weight: 900;
  font-size: 0.9rem;
  text-shadow: 0 0 8px var(--color-void);
}

/* Field Spell Pedestal */
.active-field-pedestal {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(0, 229, 255, 0.4);
  padding: 4px 14px;
  border-radius: 20px;
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
  transition: all 0.3s;
}

.active-field-pedestal:hover {
  border-color: #fff;
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.5);
}

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

.field-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
}

/* Turn State Badge */
.turn-state-badge {
  background: rgba(0, 230, 118, 0.2);
  border: 1px solid #00e676;
  color: #00e676;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 1px;
  padding: 3px 12px;
  border-radius: 20px;
  text-shadow: 0 0 8px rgba(0, 230, 118, 0.6);
}

.turn-state-badge.opp-turn {
  background: rgba(255, 23, 68, 0.2);
  border-color: #ff1744;
  color: #ff1744;
  text-shadow: 0 0 8px rgba(255, 23, 68, 0.6);
}

/* ---------------------------------------------------------
   NEXUS CHRONO TURN TIMER & BURNING ENERGY FUSE
--------------------------------------------------------- */
.turn-timer-badge {
  background: rgba(13, 27, 42, 0.85);
  border: 1px solid rgba(0, 229, 255, 0.4);
  color: #00e5ff;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.25);
  transition: all 0.3s ease;
}

.turn-timer-badge .timer-icon {
  font-size: 0.85rem;
}

.turn-timer-badge .timer-seconds {
  font-family: var(--font-title, monospace);
  letter-spacing: 0.5px;
}

.turn-timer-badge.timer-critical {
  background: rgba(255, 23, 68, 0.28);
  border-color: #ff1744;
  color: #ff5252;
  box-shadow: 0 0 16px rgba(255, 23, 68, 0.8);
  animation: timer-panic 0.5s infinite alternate ease-in-out;
}

@keyframes timer-panic {
  0% {
    transform: scale(1);
    box-shadow: 0 0 8px rgba(255, 23, 68, 0.5);
  }
  100% {
    transform: scale(1.08);
    box-shadow: 0 0 24px rgba(255, 23, 68, 0.95);
  }
}

.arena-sound-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 0.85rem;
  padding: 2px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.arena-sound-btn:hover {
  background: rgba(0, 229, 255, 0.2);
  border-color: #00e5ff;
  transform: scale(1.08);
}

/* Burning Energy Fuse Track Across Center Clash Trench */
.turn-fuse-track {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 8px;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  overflow: visible;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 10;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.9);
}

.turn-fuse-track.active {
  opacity: 1;
}

.turn-fuse-bar {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff9100 0%, #ff3d00 50%, #ff1744 100%);
  border-radius: 6px;
  box-shadow: 0 0 12px rgba(255, 61, 0, 0.9), 0 0 24px rgba(255, 23, 68, 0.6);
  transition: width 1s linear;
}

.turn-fuse-bar.burning {
  animation: rope-flame 0.4s infinite alternate ease-in-out;
}

@keyframes rope-flame {
  0% {
    filter: brightness(1) drop-shadow(0 0 4px #ff9100);
  }
  100% {
    filter: brightness(1.3) drop-shadow(0 0 12px #ff1744);
  }
}

.fuse-spark {
  position: absolute;
  left: -12px;
  top: -14px;
  font-size: 1.3rem;
  filter: drop-shadow(0 0 8px #ffeb3b) drop-shadow(0 0 16px #ff3d00);
  animation: spark-dance 0.2s infinite alternate ease-in-out;
  pointer-events: none;
}

@keyframes spark-dance {
  0% {
    transform: scale(0.9) rotate(-8deg);
  }
  100% {
    transform: scale(1.2) rotate(10deg);
  }
}

/* =========================================================
   MODERN COMBAT VFX & DYNAMIC ANIMATIONS
========================================================= */
.floating-combat-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 10000;
  overflow: hidden;
}

.floating-combat-text {
  position: absolute;
  font-family: var(--font-title), var(--font-thai);
  font-weight: 900;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: float-pop-fade 1.1s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

.floating-combat-text.dmg {
  color: #ff1744;
  font-size: 2.2rem;
  text-shadow: 0 0 12px rgba(255, 23, 68, 0.9), 0 2px 4px #000;
}

.floating-combat-text.crit {
  color: #ff9100;
  font-size: 2.8rem;
  text-shadow: 0 0 18px rgba(255, 145, 0, 1), 0 2px 6px #000;
}

.floating-combat-text.shield {
  color: #00e5ff;
  font-size: 1.5rem;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.9), 0 2px 4px #000;
}

.floating-combat-text.heal {
  color: #00e676;
  font-size: 1.8rem;
  text-shadow: 0 0 12px rgba(0, 230, 118, 0.9), 0 2px 4px #000;
}

@keyframes float-pop-fade {
  0% {
    opacity: 0;
    transform: translate(-50%, -20%) scale(0.4);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -70%) scale(1.3);
  }
  40% {
    transform: translate(-50%, -90%) scale(1.0);
  }
  80% {
    opacity: 0.9;
    transform: translate(-50%, -130%) scale(0.95);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -160%) scale(0.7);
  }
}

/* Unit Attack Lunge Animation */
.unit-lunging {
  animation: unit-lunge-forward 0.4s ease-in-out forwards !important;
  z-index: 100 !important;
}

@keyframes unit-lunge-forward {
  0% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-30px) scale(1.15); box-shadow: 0 0 25px rgba(255, 23, 68, 0.8); }
  70% { transform: translateY(-38px) scale(1.2); }
  100% { transform: translateY(0) scale(1); }
}

/* Unit Impact Shake */
.unit-hit {
  animation: unit-hit-shake 0.4s ease forwards !important;
}

@keyframes unit-hit-shake {
  0% { transform: translate(0, 0) scale(1); filter: brightness(1.8) contrast(1.4); }
  20% { transform: translate(-8px, 4px) scale(0.95); }
  40% { transform: translate(8px, -4px) scale(1.02); }
  60% { transform: translate(-5px, 2px); }
  80% { transform: translate(3px, -1px); }
  100% { transform: translate(0, 0) scale(1); filter: brightness(1); }
}

/* Screen Shake on Direct Attack / Massive Blow */
.screen-rumble {
  animation: screen-rumble 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes screen-rumble {
  10%, 90% { transform: translate3d(-3px, 0, 0); }
  20%, 80% { transform: translate3d(5px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

/* Card Summon / Deployment Slam */
.unit-summon-slam {
  animation: summon-slam 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes summon-slam {
  0% {
    opacity: 0;
    transform: translateY(-50px) scale(1.4);
    box-shadow: 0 0 40px rgba(0, 229, 255, 0.9);
  }
  60% {
    opacity: 1;
    transform: translateY(4px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  }
}

/* Nexus 3D Trap Flip Reveal Overlay */
.trap-reveal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
}

.trap-reveal-card {
  width: 220px;
  height: 310px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2b0838 0%, #12031a 100%);
  border: 3px solid #bd00ff;
  box-shadow: 0 0 40px rgba(189, 0, 255, 0.9), 0 0 80px rgba(189, 0, 255, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px;
  text-align: center;
  transform-style: preserve-3d;
  animation: trap-flip-burst 1.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes trap-flip-burst {
  0% {
    opacity: 0;
    transform: scale(0.3) rotateY(180deg) translateZ(0);
  }
  30% {
    opacity: 1;
    transform: scale(1.15) rotateY(0deg) translateZ(100px);
    box-shadow: 0 0 60px rgba(189, 0, 255, 1), 0 0 100px rgba(255, 0, 128, 0.8);
  }
  70% {
    opacity: 1;
    transform: scale(1.05) rotateY(0deg) translateZ(50px);
  }
  100% {
    opacity: 0;
    transform: scale(0.8) translateY(-80px) translateZ(-50px);
  }
}

/* End Turn Prominent Pulse Glow */
.btn-end-turn-prominent {
  position: relative;
  overflow: hidden;
}

.btn-end-turn-prominent:not(:disabled) {
  animation: pulse-end-turn 2s infinite alternate ease-in-out;
}

@keyframes pulse-end-turn {
  0% {
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.3), inset 0 0 8px rgba(0, 230, 118, 0.2);
    border-color: #00e676;
  }
  100% {
    box-shadow: 0 0 25px rgba(0, 230, 118, 0.8), inset 0 0 15px rgba(0, 230, 118, 0.5);
    border-color: #69f0ae;
    transform: scale(1.03);
  }
}

/* Commander Ultimate Skill Button */
.btn-ultimate-skill {
  margin-top: 6px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.25) 0%, rgba(255, 145, 0, 0.35) 100%);
  border: 1px solid #ffd700;
  color: #fff;
  font-family: var(--font-title, sans-serif);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.5);
  animation: pulse-ultimate 1.5s infinite alternate ease-in-out;
  transition: all 0.25s ease;
}

.btn-ultimate-skill:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.9), 0 0 35px rgba(255, 145, 0, 0.6);
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.45) 0%, rgba(255, 145, 0, 0.55) 100%);
}

.btn-ultimate-skill:disabled,
.btn-ultimate-skill.used {
  animation: none;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-muted, #90a4ae);
  box-shadow: none;
  cursor: not-allowed;
}

@keyframes pulse-ultimate {
  0% {
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
    border-color: #ffd700;
  }
  100% {
    box-shadow: 0 0 22px rgba(255, 215, 0, 0.95), 0 0 30px rgba(255, 107, 0, 0.6);
    border-color: #fff;
  }
}

/* Nexus Sector Anomaly Battlefield Badge */
.nexus-anomaly-banner {
  position: absolute;
  top: 8px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(10, 15, 25, 0.85);
  border: 1px solid var(--anomaly-color, #00e5ff);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
  border-radius: 20px;
  padding: 4px 12px;
  backdrop-filter: blur(8px);
  z-index: 20;
  pointer-events: auto;
  transition: all 0.3s ease;
}

.nexus-anomaly-banner:hover {
  box-shadow: 0 0 25px var(--anomaly-color, #00e5ff);
  transform: translateY(-2px);
}

.anomaly-icon-badge {
  font-size: 1.1rem;
}

.anomaly-text-group {
  display: flex;
  flex-direction: column;
}

.anomaly-name {
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}

.anomaly-desc {
  font-size: 0.62rem;
  color: #b0bec5;
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Hand Card Holographic Sheen on hover */
.hand-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease;
}

.hand-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent 35%,
    rgba(255, 255, 255, 0.15) 50%,
    transparent 65%
  );
  transform: rotate(-30deg) translateX(-100%);
  transition: transform 0.6s ease;
  pointer-events: none;
}

.hand-card:hover::after {
  transform: rotate(-30deg) translateX(100%);
}

/* =========================================================
   VFX ENGINE (SHOCKWAVES, SLAMS, SLASHES, BANNERS, PARTICLES)
========================================================= */
.vfx-overlay-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

/* 1. Summoning Slam Shockwave Ring */
.vfx-shockwave-ring {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 4px solid #00e5ff;
  box-shadow: 0 0 25px #00e5ff, inset 0 0 15px #00e5ff;
  animation: shockwave-expand 0.65s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
  pointer-events: none;
}

.vfx-shockwave-ring.faction-void {
  border-color: #bd00ff;
  box-shadow: 0 0 30px #bd00ff, inset 0 0 15px #bd00ff;
}

.vfx-shockwave-ring.faction-solar {
  border-color: #ffb300;
  box-shadow: 0 0 30px #ffb300, inset 0 0 15px #ffb300;
}

.vfx-shockwave-ring.faction-chrono {
  border-color: #ff2a85;
  box-shadow: 0 0 30px #ff2a85, inset 0 0 15px #ff2a85;
}

@keyframes shockwave-expand {
  0% {
    width: 20px;
    height: 20px;
    opacity: 1;
  }
  100% {
    width: 260px;
    height: 260px;
    opacity: 0;
    border-width: 1px;
  }
}

/* 2. Unit Summoning Slam Bounce */
.unit-summon-slam {
  animation: unit-slam-drop 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards !important;
}

@keyframes unit-slam-drop {
  0% {
    transform: scale(1.45) translateY(-50px);
    filter: brightness(2.2);
    opacity: 0;
  }
  60% {
    transform: scale(0.92) translateY(5px);
    filter: brightness(1.5);
    opacity: 1;
  }
  100% {
    transform: scale(1) translateY(0);
    filter: brightness(1);
    opacity: 1;
  }
}

/* 3. Combat Slash Mark */
.vfx-slash-mark {
  position: absolute;
  width: 120px;
  height: 6px;
  background: linear-gradient(90deg, transparent 0%, #fff 50%, transparent 100%);
  border-radius: 4px;
  box-shadow: 0 0 20px #00e5ff, 0 0 40px #fff;
  pointer-events: none;
  animation: slash-fade 0.38s ease-out forwards;
}

.vfx-slash-mark.faction-void {
  box-shadow: 0 0 25px #bd00ff, 0 0 40px #e040fb;
}

.vfx-slash-mark.faction-solar {
  box-shadow: 0 0 25px #ffb300, 0 0 40px #ffea00;
}

.vfx-slash-mark.faction-chrono {
  box-shadow: 0 0 25px #ff2a85, 0 0 40px #f50057;
}

@keyframes slash-fade {
  0% {
    transform: translate(-50%, -50%) scaleX(0.2);
    opacity: 1;
  }
  50% {
    transform: translate(-50%, -50%) scaleX(1.4);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scaleX(1.8);
    opacity: 0;
  }
}

/* 4. Particle Sparks */
.vfx-spark-particle {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  pointer-events: none;
  animation: spark-fly 0.6s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes spark-fly {
  0% {
    transform: translate(-50%, -50%) scale(1.4);
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--vx)), calc(-50% + var(--vy))) scale(0.2);
    opacity: 0;
  }
}

/* 5. Full Screen Damage Vignette Flash */
.vfx-damage-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  box-shadow: inset 0 0 100px 30px rgba(255, 23, 68, 0.85);
  opacity: 0;
  transition: opacity 0.1s ease-out;
}

.vfx-damage-vignette.active {
  animation: vignette-pulse 0.55s ease-out forwards;
}

@keyframes vignette-pulse {
  0% { opacity: 0.9; }
  50% { opacity: 0.6; }
  100% { opacity: 0; }
}

/* 6. Cinematic Turn Announcement Banner */
.vfx-turn-banner {
  position: fixed;
  top: 40%;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  transform: translateY(-50%) scaleY(0);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
}

.vfx-turn-banner.active {
  transform: translateY(-50%) scaleY(1);
  opacity: 1;
}

.vfx-turn-banner-content {
  background: linear-gradient(90deg, transparent 0%, rgba(5, 12, 22, 0.94) 20%, rgba(5, 12, 22, 0.94) 80%, transparent 100%);
  border-top: 2px solid rgba(0, 229, 255, 0.7);
  border-bottom: 2px solid rgba(0, 229, 255, 0.7);
  padding: 16px 80px;
  text-align: center;
  position: relative;
  box-shadow: 0 0 50px rgba(0, 229, 255, 0.3);
}

.vfx-turn-title {
  font-family: var(--font-title);
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 3px;
  color: #00e5ff;
  text-shadow: 0 0 25px rgba(0, 229, 255, 0.8);
}

.vfx-turn-sub {
  font-size: 0.9rem;
  color: #cfd8dc;
  margin-top: 4px;
  letter-spacing: 1px;
}

/* 7. Holographic Rainbow Specular Foil Sheen */
.card-holo-foil {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(255, 0, 128, 0.25) 0%,
    rgba(0, 229, 255, 0.25) 25%,
    rgba(255, 235, 59, 0.25) 50%,
    rgba(0, 230, 118, 0.25) 75%,
    rgba(189, 0, 255, 0.25) 100%
  );
  background-size: 300% 300%;
  mix-blend-mode: screen;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 20;
}

/* 8. Arena Field Spell Aura Overlays */
.arena-screen.field-aura-iron {
  background: radial-gradient(circle at center, rgba(0, 229, 255, 0.08) 0%, #06090e 85%) !important;
}

.arena-screen.field-aura-void {
  background: radial-gradient(circle at center, rgba(189, 0, 255, 0.12) 0%, #06090e 85%) !important;
}

.arena-screen.field-aura-solar {
  background: radial-gradient(circle at center, rgba(255, 179, 0, 0.12) 0%, #06090e 85%) !important;
}

.arena-screen.field-aura-chrono {
  background: radial-gradient(circle at center, rgba(255, 42, 133, 0.12) 0%, #06090e 85%) !important;
}

/* 9. Critical Life Core Danger State */
.combatant-card.critical-danger {
  animation: hero-danger-pulse 1s infinite alternate;
}

@keyframes hero-danger-pulse {
  0% {
    box-shadow: 0 0 10px rgba(255, 23, 68, 0.4);
    border-color: rgba(255, 23, 68, 0.5);
  }
  100% {
    box-shadow: 0 0 35px rgba(255, 23, 68, 0.9), inset 0 0 20px rgba(255, 23, 68, 0.4);
    border-color: #ff1744;
  }
}

/* 10. Commander Avatar & Image Artwork Enhancements */
.commander-img-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-iron);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
}

.lobby-commander-banner {
  width: 100%;
  height: 120px;
  border-radius: 8px;
  object-fit: cover;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}




/* =========================================================
   NEXUS CHRONICLES, LORE & COMMANDER DIALOGUE STYLES
========================================================= */

/* Chronicles Header Button */
.btn-chronicles {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(255, 179, 0, 0.2), rgba(224, 64, 251, 0.25));
  border: 1px solid rgba(255, 179, 0, 0.6);
  color: #ffecb3;
  padding: 8px 18px;
  border-radius: 20px;
  font-family: 'Prompt', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 15px rgba(255, 179, 0, 0.2);
}

.btn-chronicles:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(255, 179, 0, 0.4), rgba(224, 64, 251, 0.45));
  border-color: #ffb300;
  box-shadow: 0 0 25px rgba(255, 179, 0, 0.5);
  color: #ffffff;
}

/* Filter Tab Colors for New Factions */
.filter-tab[data-filter="verdant"].active {
  border-color: #00e676 !important;
  color: #00e676 !important;
  box-shadow: 0 0 14px rgba(0, 230, 118, 0.4) !important;
}

.filter-tab[data-filter="crimson"].active {
  border-color: #ff1744 !important;
  color: #ff1744 !important;
  box-shadow: 0 0 14px rgba(255, 23, 68, 0.4) !important;
}

.filter-tab[data-filter="hybrid"].active {
  border-color: #e040fb !important;
  color: #e040fb !important;
  box-shadow: 0 0 14px rgba(224, 64, 251, 0.4) !important;
}

/* New Field Aura Overlays */
.arena-screen.field-aura-verdant {
  background: radial-gradient(circle at center, rgba(0, 230, 118, 0.12) 0%, #06090e 85%) !important;
}

.arena-screen.field-aura-crimson {
  background: radial-gradient(circle at center, rgba(255, 23, 68, 0.14) 0%, #06090e 85%) !important;
}

/* Chronicles Modal */
.chronicles-modal-content {
  max-width: 960px;
  width: 94%;
  max-height: 88vh;
  background: linear-gradient(180deg, #101622 0%, #080d14 100%);
  border: 1px solid rgba(255, 179, 0, 0.4);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(255, 179, 0, 0.15);
  display: flex;
  flex-direction: column;
}

.chronicles-header {
  border-bottom: 1px solid rgba(255, 179, 0, 0.2);
  padding: 16px 24px;
}

.chronicles-title-group .chronicles-badge {
  font-size: 0.72rem;
  letter-spacing: 2px;
  color: #ffb300;
  font-weight: 800;
  display: block;
  margin-bottom: 4px;
}

.chronicles-nav-tabs {
  display: flex;
  gap: 10px;
  padding: 12px 24px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chronicles-tab {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cfd8dc;
  padding: 8px 18px;
  border-radius: 8px;
  font-family: 'Prompt', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.chronicles-tab:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.chronicles-tab.active {
  background: linear-gradient(135deg, rgba(255, 179, 0, 0.25), rgba(224, 64, 251, 0.25));
  border-color: #ffb300;
  color: #ffeb3b;
  box-shadow: 0 0 12px rgba(255, 179, 0, 0.3);
}

.chronicles-body {
  overflow-y: auto;
  padding: 24px;
  flex: 1;
}

/* Chapter Cards inside Chronicles */
.chapter-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.chapter-card:hover {
  border-color: rgba(255, 179, 0, 0.4);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.5);
  transform: translateY(-2px);
}

.chapter-badge {
  font-size: 0.78rem;
  font-weight: 800;
  color: #ffb300;
  letter-spacing: 1px;
  margin-bottom: 6px;
  display: inline-block;
}

.chapter-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 10px;
  line-height: 1.35;
}

.chapter-summary {
  font-size: 0.9rem;
  color: #90a4ae;
  margin-bottom: 14px;
  font-style: italic;
  border-left: 3px solid #ffb300;
  padding-left: 12px;
}

.chapter-text {
  font-size: 0.95rem;
  color: #eceff1;
  line-height: 1.7;
  white-space: pre-line;
}

/* Factions Philosophy Grid */
.factions-philosophy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.faction-phil-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--phil-color, #00e5ff);
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  position: relative;
}

.faction-phil-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.faction-phil-icon {
  font-size: 2rem;
}

.faction-phil-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
}

.faction-phil-theme {
  font-size: 0.78rem;
  color: var(--phil-color, #00e5ff);
  font-weight: 600;
}

.faction-phil-desc {
  font-size: 0.88rem;
  color: #cfd8dc;
  line-height: 1.55;
  margin-bottom: 12px;
}

.faction-phil-mechanics {
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  color: #b0bec5;
}

/* Deck Modal Tab Navigation */
.deck-modal-nav-tabs {
  display: flex;
  gap: 8px;
  padding: 10px 24px 0 24px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.deck-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: #90a4ae;
  padding: 10px 16px;
  font-family: 'Prompt', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.deck-tab-btn:hover {
  color: #fff;
}

.deck-tab-btn.active {
  color: #00e5ff;
  border-bottom-color: #00e5ff;
}

/* Deck Lore Pane Layout */
.deck-lore-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 8px 0;
}

.deck-lore-hero {
  display: flex;
  gap: 20px;
  align-items: center;
  background: rgba(0, 0, 0, 0.35);
  padding: 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.deck-lore-hero-img {
  width: 110px;
  height: 110px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid var(--deck-accent-color, #00e5ff);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
}

.deck-lore-hero-info {
  flex: 1;
}

.deck-lore-commander-name {
  font-size: 1.3rem;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 4px;
}

.deck-lore-theme-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--deck-accent-color, #00e5ff);
  margin-bottom: 10px;
}

.deck-lore-quote {
  font-size: 0.92rem;
  color: #fff;
  font-style: italic;
  line-height: 1.45;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px 14px;
  border-radius: 8px;
  border-left: 4px solid var(--deck-accent-color, #00e5ff);
}

.deck-lore-story-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 16px 20px;
  font-size: 0.95rem;
  color: #eceff1;
  line-height: 1.7;
}

.deck-lore-meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.deck-lore-meta-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 16px;
}

.deck-lore-meta-label {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #90a4ae;
  margin-bottom: 6px;
}

.deck-lore-meta-val {
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
}

/* =========================================================
   CINEMATIC PRE-BATTLE CLASH DIALOGUE OVERLAY
========================================================= */
.clash-dialogue-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 7, 12, 0.88);
  backdrop-filter: blur(8px);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.clash-dialogue-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.clash-dialogue-banner {
  width: 90%;
  max-width: 1080px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
}

.clash-vs-emblem {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 5;
}

.clash-vs-circle {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(circle, #ff1744 0%, #b71c1c 100%);
  color: #fff;
  font-family: 'Cinzel', serif;
  font-size: 1.8rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 35px rgba(255, 23, 68, 0.9), 0 0 15px #fff;
  border: 3px solid #fff;
  animation: clash-vs-pulse 1s infinite alternate;
}

@keyframes clash-vs-pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 20px rgba(255, 23, 68, 0.6); }
  100% { transform: scale(1.05); box-shadow: 0 0 45px rgba(255, 23, 68, 1), 0 0 20px #fff; }
}

.clash-vs-sub {
  margin-top: 8px;
  font-size: 0.75rem;
  font-weight: 800;
  color: #ffb300;
  letter-spacing: 2px;
  text-shadow: 0 2px 4px #000;
}

.clash-commander-side {
  flex: 1;
  display: flex;
  gap: 16px;
  align-items: center;
  background: rgba(10, 16, 26, 0.85);
  border: 2px solid var(--side-color, #00e5ff);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.8), 0 0 20px var(--side-color, #00e5ff);
  padding: 18px 22px;
  border-radius: 16px;
  animation: slideInSide 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.clash-commander-side.opp {
  flex-direction: row-reverse;
  text-align: right;
}

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

.clash-avatar-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--side-color, #00e5ff);
  box-shadow: 0 0 16px var(--side-color, #00e5ff);
  flex-shrink: 0;
}

.clash-info {
  flex: 1;
}

.clash-commander-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--side-color, #00e5ff);
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.clash-commander-name {
  font-size: 1.25rem;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 8px;
}

.clash-quote-bubble {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.95rem;
  color: #eceff1;
  line-height: 1.45;
  font-style: italic;
  border-left: 3px solid var(--side-color, #00e5ff);
}

.clash-commander-side.opp .clash-quote-bubble {
  border-left: none;
  border-right: 3px solid var(--side-color, #00e5ff);
}

.clash-commander-side.speaking {
  box-shadow: 0 0 35px var(--side-color, #00e5ff), inset 0 0 15px var(--side-color, #00e5ff);
  transform: scale(1.02);
  transition: all 0.3s ease;
  border-color: #ffffff;
}

.clash-commander-side.speaking .clash-avatar-img {
  animation: speakingAvatarPulse 1.2s infinite ease-in-out;
}

@keyframes speakingAvatarPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 16px var(--side-color, #00e5ff); }
  50% { transform: scale(1.08); box-shadow: 0 0 30px var(--side-color, #00e5ff), 0 0 12px #fff; }
}

.clash-dismiss-hint {
  position: absolute;
  bottom: -48px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.85rem;
  color: #90a4ae;
}

.clash-skip-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  padding: 6px 18px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: all 0.25s ease;
  backdrop-filter: blur(6px);
}

.clash-skip-btn:hover {
  background: rgba(255, 23, 68, 0.75);
  border-color: #ff1744;
  box-shadow: 0 0 16px rgba(255, 23, 68, 0.9);
  transform: translateY(-1px);
}

/* =========================================================
   IN-COMBAT DYNAMIC SPEECH BUBBLES
========================================================= */
.combatant-avatar-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.commander-speech-bubble {
  position: absolute;
  background: linear-gradient(135deg, rgba(16, 28, 46, 0.95) 0%, rgba(8, 16, 26, 0.95) 100%);
  color: #ffffff;
  border: 2px solid #ffb300;
  padding: 8px 14px;
  border-radius: 12px;
  font-family: 'Prompt', sans-serif;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.35;
  max-width: 240px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.8), 0 0 15px rgba(255, 179, 0, 0.5);
  pointer-events: none;
  z-index: 150;
  opacity: 0;
  transform: scale(0.85);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: normal;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.commander-speech-bubble.active {
  opacity: 1;
  transform: scale(1);
}

/* Bubble Tail for Opponent (top-left) */
.opp-bubble {
  top: 60px;
  left: 10px;
}

.opp-bubble::before {
  content: '';
  position: absolute;
  top: -9px;
  left: 20px;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 9px solid #ffb300;
}

/* Bubble Tail for Player (bottom-left) */
.player-bubble {
  bottom: 60px;
  left: 10px;
}

.player-bubble::before {
  content: '';
  position: absolute;
  bottom: -9px;
  left: 20px;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 9px solid #ffb300;
}

.avatar-frame.speaking {
  animation: avatarSpeakingPulse 0.75s infinite alternate ease-in-out;
  border-color: #ffb300 !important;
  box-shadow: 0 0 25px rgba(255, 179, 0, 0.9), 0 0 12px #ffffff !important;
}

@keyframes avatarSpeakingPulse {
  0% { transform: scale(1); box-shadow: 0 0 12px rgba(255, 179, 0, 0.5); }
  100% { transform: scale(1.06); box-shadow: 0 0 30px rgba(255, 179, 0, 1), 0 0 15px #ffffff; }
}

/* =========================================================
   3D GYROSCOPIC CARD PHYSICS & HOLOGRAPHIC FOIL
========================================================= */
.player-hand {
  perspective: 1000px;
}

.hand-card {
  transform-style: preserve-3d;
  will-change: transform;
}

.card-foil-glare {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(var(--glare-angle, 125deg), 
    rgba(255, 255, 255, 0) 0%, 
    rgba(255, 255, 255, 0.08) 35%, 
    rgba(0, 229, 255, 0.3) 50%, 
    rgba(255, 179, 0, 0.3) 60%, 
    rgba(255, 255, 255, 0) 100%);
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 10;
  mix-blend-mode: screen;
}

.hand-card:hover .card-foil-glare {
  opacity: 1;
}

/* =========================================================
   SCREEN TRAUMA SHAKE (IMPACT JUICE)
========================================================= */
.screen-shake-light {
  animation: screenTraumaLight 0.22s ease-out;
}

.screen-shake-heavy {
  animation: screenTraumaHeavy 0.38s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.screen-shake-core {
  animation: screenTraumaCore 0.55s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes screenTraumaLight {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-3px, 2px); }
  50% { transform: translate(3px, -2px); }
  75% { transform: translate(-2px, 1px); }
  100% { transform: translate(0, 0); }
}

@keyframes screenTraumaHeavy {
  0% { transform: translate(0, 0); }
  15% { transform: translate(-8px, 6px) rotate(-0.6deg); }
  30% { transform: translate(7px, -7px) rotate(0.6deg); }
  50% { transform: translate(-5px, 4px); }
  70% { transform: translate(4px, -2px); }
  85% { transform: translate(-2px, 1px); }
  100% { transform: translate(0, 0); }
}

@keyframes screenTraumaCore {
  0% { transform: translate(0, 0) scale(1); filter: brightness(1); }
  10% { transform: translate(-14px, 10px) rotate(-1.2deg) scale(1.025); filter: brightness(1.7) contrast(1.2); }
  25% { transform: translate(12px, -12px) rotate(1.2deg) scale(0.985); filter: brightness(1.4); }
  40% { transform: translate(-9px, 7px) rotate(-0.6deg); filter: brightness(1.2); }
  60% { transform: translate(7px, -5px) rotate(0.6deg); }
  80% { transform: translate(-3px, 2px); }
  100% { transform: translate(0, 0) scale(1); filter: brightness(1); }
}

/* =========================================================
   COMMANDER ASCENSION & ULTIMATE SKILL BUTTON
========================================================= */
.combatant-avatar-wrap.ascended {
  position: relative;
}

.combatant-avatar-wrap.ascended .avatar-frame {
  border-color: #ffd700 !important;
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.9), 0 0 50px var(--ascended-color, #ffb300), inset 0 0 15px #ffd700 !important;
  animation: ascensionAuraPulse 1.5s infinite alternate ease-in-out;
}

@keyframes ascensionAuraPulse {
  0% { transform: scale(1); box-shadow: 0 0 20px rgba(255, 215, 0, 0.7); }
  100% { transform: scale(1.06); box-shadow: 0 0 45px rgba(255, 215, 0, 1), 0 0 20px #ffffff; }
}

.ascended-crown-badge {
  position: absolute;
  top: -12px;
  right: -8px;
  background: linear-gradient(135deg, #ffd700 0%, #ff8800 100%);
  color: #000;
  font-size: 0.95rem;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 12px;
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.95);
  z-index: 15;
  animation: crownBob 1.2s infinite alternate ease-in-out;
}

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

.btn-ultimate-skill {
  background: linear-gradient(135deg, #ffd700 0%, #ff6b00 100%);
  border: 2px solid #ffffff;
  color: #000;
  font-family: var(--font-title);
  font-size: 0.82rem;
  font-weight: 900;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  animation: ultGlow 1s infinite alternate ease-in-out;
  margin-top: 4px;
  user-select: none;
}

.btn-ultimate-skill:hover:not(:disabled) {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 0 30px rgba(255, 215, 0, 1), 0 0 15px #ffffff;
}

.btn-ultimate-skill:disabled, .btn-ultimate-skill.used {
  background: #374151 !important;
  border-color: #4b5563 !important;
  color: #9ca3af !important;
  box-shadow: none !important;
  cursor: not-allowed;
  animation: none !important;
  transform: none !important;
}

@keyframes ultGlow {
  0% { box-shadow: 0 0 12px rgba(255, 215, 0, 0.6); }
  100% { box-shadow: 0 0 28px rgba(255, 215, 0, 1), 0 0 10px #ffffff; }
}

/* =========================================================
   NEXUS SECTOR ANOMALY BADGE ON BATTLEFIELD
========================================================= */
.nexus-anomaly-banner {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(14, 20, 30, 0.92);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 6px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 80;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.6), 0 0 15px var(--anomaly-color, #00e5ff);
  cursor: help;
  transition: all 0.25s ease;
  user-select: none;
}

.nexus-anomaly-banner:hover {
  border-color: var(--anomaly-color, #00e5ff);
  box-shadow: 0 0 30px var(--anomaly-color, #00e5ff);
  transform: translateX(-50%) scale(1.04);
}

.anomaly-icon-badge {
  font-size: 1.3rem;
  filter: drop-shadow(0 0 6px var(--anomaly-color, #00e5ff));
}

.anomaly-text-group {
  display: flex;
  flex-direction: column;
}

.anomaly-name {
  font-size: 0.85rem;
  font-weight: 900;
  color: var(--anomaly-color, #00e5ff);
  letter-spacing: 0.5px;
}

.anomaly-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* =========================================================
   COMMANDER ASCENSION FULL-SCREEN CUT-IN
========================================================= */
.vfx-ascension-cutin {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  animation: cutInEntry 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.vfx-ascension-cutin.fade-out {
  animation: cutInExit 0.35s ease forwards;
}

.cutin-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.95) 100%);
  backdrop-filter: blur(8px);
}

.cutin-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  z-index: 2;
  text-align: center;
}

.cutin-avatar {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  border: 4px solid #ffd700;
  box-shadow: 0 0 40px #ffd700, 0 0 80px rgba(255, 215, 0, 0.6);
  object-fit: cover;
  animation: cutinAvatarPulse 1.2s infinite alternate ease-in-out;
}

.cutin-banner {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(14, 20, 30, 0.92);
  border: 2px solid #ffd700;
  padding: 14px 36px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 30px rgba(255, 215, 0, 0.5);
}

.cutin-title {
  color: #ffd700;
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 2px;
}

.cutin-name {
  color: #ffffff;
  font-size: 1.35rem;
  font-weight: 900;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
}

.cutin-ult-sub {
  color: #00e5ff;
  font-size: 0.95rem;
  font-weight: 700;
}

@keyframes cutInEntry {
  0% { opacity: 0; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes cutInExit {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.1); }
}

@keyframes cutinAvatarPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.08); }
}

/* ==========================================================
   USED CARDS PILE (DISCARD PILE / GRAVEYARD) MODAL & WIDGETS
   ========================================================== */
.hand-discard-pile-widget {
  background: rgba(26, 12, 44, 0.85);
  border: 1px solid rgba(168, 85, 247, 0.45);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  color: #e9d5ff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  user-select: none;
}

.hand-discard-pile-widget:hover {
  background: rgba(50, 20, 85, 0.95);
  border-color: #c084fc;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.45);
}

.hand-discard-pile-widget .discard-badge-icon {
  font-size: 1rem;
  filter: drop-shadow(0 0 5px rgba(168, 85, 247, 0.6));
}

.opp-discard-pile-widget {
  background: rgba(38, 14, 20, 0.85);
  border: 1px solid rgba(248, 113, 113, 0.45);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  color: #fecaca;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  user-select: none;
}

.opp-discard-pile-widget:hover {
  background: rgba(70, 20, 30, 0.95);
  border-color: #f87171;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.opp-discard-pile-widget .discard-badge-icon {
  font-size: 0.95rem;
}

/* Modal Content */
.discard-modal-content {
  width: 90vw;
  max-width: 980px;
  max-height: 88vh;
  background: linear-gradient(180deg, #110c1c 0%, #08060e 100%);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 18px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(168, 85, 247, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalScaleIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.discard-modal-nav-tabs {
  display: flex;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.discard-tab-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.discard-tab-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
}

.discard-tab-btn.active {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.3), rgba(126, 34, 206, 0.4));
  border-color: #c084fc;
  color: #ffffff;
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.35);
}

.discard-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-wrap: wrap;
}

.discard-filter-bar .filter-label {
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 600;
  margin-right: 4px;
}

.discard-filter-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.discard-filter-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.discard-filter-pill.active {
  background: rgba(168, 85, 247, 0.35);
  border-color: #a855f7;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

.discard-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  min-height: 280px;
  max-height: 55vh;
}

.discard-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  padding-bottom: 10px;
}

.discard-card-item {
  background: #131722;
  border: 2px solid var(--faction-card-color, #475569);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.discard-card-item:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.7), 0 0 16px var(--faction-card-color, rgba(168, 85, 247, 0.5));
}

.discard-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.discard-card-cost {
  width: 24px;
  height: 24px;
  background: #0284c7;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  box-shadow: 0 0 8px rgba(2, 132, 199, 0.6);
}

.discard-card-type {
  font-size: 0.68rem;
  font-weight: 700;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
}

.discard-card-art {
  width: 100%;
  height: 90px;
  border-radius: 8px;
  overflow: hidden;
  background: #0a0d14;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.discard-card-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.discard-card-desc {
  font-size: 0.7rem;
  color: #94a3b8;
  line-height: 1.3;
  height: 38px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.discard-card-stats {
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  font-weight: 800;
}

.discard-card-stats .stat-atk { color: #f87171; }
.discard-card-stats .stat-hp { color: #4ade80; }
.discard-card-stats .stat-armor { color: #38bdf8; }

.discard-empty-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 240px;
  color: #64748b;
  text-align: center;
}

.discard-empty-placeholder .empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.6;
}

.discard-empty-placeholder p {
  font-size: 1.1rem;
  font-weight: 700;
  color: #cbd5e1;
  margin: 0 0 6px 0;
}

.discard-empty-placeholder .empty-hint {
  font-size: 0.8rem;
  color: #64748b;
  max-width: 380px;
}

.discard-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(0, 0, 0, 0.35);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  gap: 16px;
}

.discard-hint-note {
  font-size: 0.78rem;
  color: #a855f7;
  display: flex;
  align-items: center;
  gap: 8px;
}

.discard-hint-note .hint-icon {
  font-size: 1.1rem;
}

/* Board Toy Particle Trajectories */
.vfx-toy-void-ripple {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid #bd00ff;
  box-shadow: 0 0 20px #bd00ff;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 500;
  animation: toyVoidRipple 0.65s ease-out forwards;
}

@keyframes toyVoidRipple {
  0% { width: 20px; height: 20px; opacity: 1; }
  100% { width: 140px; height: 140px; opacity: 0; }
}

.vfx-laser-tracer {
  position: absolute;
  height: 4px;
  background: linear-gradient(90deg, #ff1744, #ffffff, transparent);
  box-shadow: 0 0 12px #ff1744;
  transform-origin: left center;
  pointer-events: none;
  z-index: 500;
  animation: laserBolt 0.35s ease-out forwards;
}

@keyframes laserBolt {
  0% { opacity: 1; transform: scaleX(0.1); }
  50% { opacity: 1; transform: scaleX(1); }
  100% { opacity: 0; transform: scaleX(1.3); }
}

.vfx-toy-sun-pulse {
  position: absolute;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.8) 0%, rgba(255, 179, 0, 0) 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 500;
  animation: sunGongPulse 0.7s ease-out forwards;
}

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

/* ==========================================================
   BOSS SUMMONING CEREMONY (NEXUS OVERLORD ASCENSION)
   ========================================================== */
.vfx-boss-entrance {
  position: fixed;
  inset: 0;
  z-index: 8500;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  animation: bossEntranceFadeIn 0.3s ease-out forwards;
}

.vfx-boss-entrance.fade-out {
  animation: bossEntranceFadeOut 0.45s ease-in forwards;
}

.boss-entrance-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(10, 15, 25, 0.75) 0%, rgba(0, 0, 0, 0.95) 100%);
  backdrop-filter: blur(6px);
}

.boss-entrance-circle {
  position: absolute;
  width: 440px;
  height: 440px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 215, 0, 0.6);
  box-shadow: 0 0 50px rgba(255, 215, 0, 0.4), inset 0 0 40px rgba(255, 215, 0, 0.2);
  animation: runicRotate 6s linear infinite;
}

.boss-entrance-circle::before,
.boss-entrance-circle::after {
  content: '';
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.boss-entrance-card-wrap {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: bossSlamDown 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.boss-entrance-card {
  width: 220px;
  height: 310px;
  border-radius: 18px;
  background: linear-gradient(145deg, #162438, #0a111c);
  border: 3px solid #ffd700;
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.8), 0 20px 50px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.boss-entrance-card::after {
  content: '';
  position: absolute;
  inset: -100%;
  background: linear-gradient(135deg, transparent 40%, rgba(255, 255, 255, 0.4) 50%, transparent 60%);
  animation: bossFoilGleam 2s ease-in-out infinite;
}

.boss-cost-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #00e5ff;
  color: #000;
  font-weight: 900;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.8);
}

.boss-art-big {
  width: 140px;
  height: 140px;
  margin-top: 30px;
}

.boss-art-big svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.6));
}

.boss-name-banner {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 10px #ffd700;
  text-align: center;
}

.boss-legendary-tag {
  font-size: 0.75rem;
  font-weight: 800;
  color: #ffd700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

@keyframes bossEntranceFadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes bossEntranceFadeOut {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.1); }
}

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

@keyframes bossSlamDown {
  0% { transform: translateY(-120px) scale(0.6); opacity: 0; }
  70% { transform: translateY(15px) scale(1.1); opacity: 1; }
  100% { transform: translateY(0) scale(1); }
}

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

/* ==========================================================
   KEYWORD CODEX & GLOSSARY (INSPECTOR PANEL)
   ========================================================== */
.inspector-keywords-section {
  margin-top: 14px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(10, 20, 35, 0.7);
  border-left: 3px solid #00e5ff;
}

.keywords-header {
  font-size: 0.78rem;
  font-weight: 800;
  color: #00e5ff;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.keywords-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.keyword-chip {
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--kw-color, rgba(255, 255, 255, 0.2));
  transition: background 0.2s ease, transform 0.2s ease;
}

.keyword-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(3px);
}

.keyword-chip .kw-title {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--kw-color, #fff);
  display: flex;
  align-items: center;
  gap: 5px;
}

.keyword-chip .kw-desc {
  font-size: 0.68rem;
  color: #b0bec5;
  line-height: 1.35;
  margin-top: 2px;
}

/* ==========================================================
   LIFE CORE SHATTER DETONATION & CRYSTAL SHARDS
   ========================================================== */
.core-fracture-shake {
  animation: coreFractureVibe 0.85s cubic-bezier(0.36, 0.07, 0.19, 0.97) both !important;
  filter: brightness(2) contrast(1.5) !important;
}

@keyframes coreFractureVibe {
  0% { transform: translate(0, 0) rotate(0deg); }
  10% { transform: translate(-6px, 4px) rotate(-2deg); }
  20% { transform: translate(6px, -4px) rotate(2deg); }
  30% { transform: translate(-8px, 6px) rotate(-3deg); }
  40% { transform: translate(8px, -6px) rotate(3deg); }
  50% { transform: translate(-10px, 8px) rotate(-4deg); }
  60% { transform: translate(10px, -8px) rotate(4deg); }
  70% { transform: translate(-6px, 5px) rotate(-2deg); }
  80% { transform: translate(6px, -5px) rotate(2deg); }
  90% { transform: translate(-3px, 2px) rotate(-1deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

.vfx-fracture-overlay {
  position: fixed;
  pointer-events: none;
  z-index: 7000;
  border: 3px dashed #ff1744;
  box-shadow: 0 0 35px #ff1744, inset 0 0 25px #ff1744;
  border-radius: 16px;
  animation: fracturePulse 0.4s infinite alternate;
}

@keyframes fracturePulse {
  0% { opacity: 0.5; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.04); }
}

.vfx-supernova-flash {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, #00e5ff 40%, transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 7500;
  animation: supernovaPop 0.6s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}

@keyframes supernovaPop {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(8); opacity: 0; }
}

.vfx-crystal-shard {
  position: absolute;
  width: 10px;
  height: 10px;
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  pointer-events: none;
  z-index: 7500;
  animation: shardScatter 0.9s cubic-bezier(0.12, 0.8, 0.32, 1) forwards;
}

@keyframes shardScatter {
  0% {
    transform: translate(-50%, -50%) translate(0, 0) rotate(0deg) scale(1.4);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) translate(var(--vx), var(--vy)) rotate(var(--rot)) scale(0.2);
    opacity: 0;
  }
}

/* ==========================================================
   VICTORY CONFETTI SHOWER
   ========================================================== */
.vfx-confetti-piece {
  position: fixed;
  width: 12px;
  height: 18px;
  border-radius: 3px;
  z-index: 9000;
  pointer-events: none;
  opacity: 0.9;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(105vh) translateX(var(--drift)) rotate(var(--spin));
    opacity: 0;
  }
}

/* ==========================================================
   POST-MATCH PERFORMANCE DOSSIER & MVP SHOWCASE
   ========================================================== */
.dossier-container {
  margin: 16px 0 20px;
  background: rgba(10, 18, 30, 0.85);
  border-radius: 14px;
  border: 1px solid rgba(0, 229, 255, 0.25);
  padding: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
}

.dossier-headline {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 800;
  color: #00e5ff;
  letter-spacing: 1px;
  text-align: center;
  margin-bottom: 14px;
  text-transform: uppercase;
}

.dossier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (max-width: 600px) {
  .dossier-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.dossier-metric {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dossier-metric .d-label {
  font-size: 0.7rem;
  color: #90a4ae;
}

.dossier-metric .d-val {
  font-size: 0.92rem;
  font-weight: 800;
}

.text-cyan { color: #00e5ff; }
.text-gold { color: #ffd700; }
.text-crimson { color: #ff1744; }
.text-purple { color: #bd00ff; }
.text-white { color: #ffffff; }

.dossier-mvp-card {
  margin-top: 14px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.12), rgba(255, 179, 0, 0.04));
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 10px;
  padding: 10px 14px;
  text-align: center;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.15);
}

.dossier-mvp-card .mvp-badge {
  font-size: 0.72rem;
  font-weight: 900;
  color: #ffd700;
  letter-spacing: 1.5px;
}

.dossier-mvp-card .mvp-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  margin: 3px 0;
}

.dossier-mvp-card .mvp-impact {
  font-size: 0.76rem;
  color: #ffe082;
}

/* AI Active Turn Badge */
.turn-state-badge.opp-turn {
  background: linear-gradient(135deg, rgba(189, 0, 255, 0.25), rgba(255, 23, 68, 0.25)) !important;
  border-color: #bd00ff !important;
  color: #f3e8ff !important;
  box-shadow: 0 0 16px rgba(189, 0, 255, 0.5) !important;
  animation: oppTurnPulse 1.2s infinite alternate !important;
}

@keyframes oppTurnPulse {
  0% { box-shadow: 0 0 10px rgba(189, 0, 255, 0.4); }
  100% { box-shadow: 0 0 22px rgba(255, 23, 68, 0.7); }
}

/* ==========================================================================
   RPG World Map & Campaign Adventure Styling
   ========================================================================== */

/* Lobby Campaign Buttons */
.btn-rpg-campaign {
  background: linear-gradient(135deg, #00e5ff 0%, #7c4dff 50%, #e040fb 100%) !important;
  box-shadow: 0 0 25px rgba(0, 229, 255, 0.45) !important;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.btn-rpg-campaign:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 0 35px rgba(124, 77, 255, 0.7) !important;
}

.btn-resume-campaign {
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.2), rgba(0, 229, 255, 0.15)) !important;
  border: 1px solid #00e676 !important;
  color: #b9f6ca !important;
  font-weight: 700;
}

.btn-resume-campaign:hover {
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.35), rgba(0, 229, 255, 0.3)) !important;
  box-shadow: 0 0 20px rgba(0, 230, 118, 0.4);
  color: #ffffff !important;
}

/* World Map Screen Container */
#screen-world-map {
  display: none;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
  background: #06090e;
}

#screen-world-map.active {
  display: flex !important;
}

.rpg-world-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(0, 229, 255, 0.05) 0%, #030508 85%);
  pointer-events: none;
  z-index: 1;
}

/* RPG Top Navigation HUD */
.rpg-top-hud {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  background: rgba(10, 16, 26, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(0, 229, 255, 0.25);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  gap: 12px;
}

.rpg-hud-player-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rpg-hud-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.2), rgba(124, 77, 255, 0.3));
  border: 2px solid #00e5ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.4);
}

.rpg-hud-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rpg-hud-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rpg-hud-name {
  font-family: 'Outfit', sans-serif;
  font-size: 0.96rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.3px;
}

.rpg-hud-sector-badge {
  font-size: 0.74rem;
  font-weight: 700;
  color: #00e5ff;
  background: rgba(0, 229, 255, 0.12);
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid rgba(0, 229, 255, 0.3);
}

.rpg-hud-bars {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rpg-bar-wrap {
  position: relative;
  height: 16px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
}

.rpg-bar-wrap.hp-wrap {
  width: 140px;
}

.rpg-bar-wrap.exp-wrap {
  width: 110px;
}

.rpg-bar-fill.hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff1744 0%, #00e676 60%, #00e5ff 100%);
  transition: width 0.3s ease;
  box-shadow: 0 0 8px rgba(0, 230, 118, 0.5);
}

.rpg-bar-fill.exp-fill {
  height: 100%;
  background: linear-gradient(90deg, #7c4dff 0%, #e040fb 100%);
  transition: width 0.3s ease;
  box-shadow: 0 0 8px rgba(224, 64, 251, 0.5);
}

.rpg-bar-text {
  position: absolute;
  width: 100%;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.9);
}

/* Relics Panel Shelf */
.rpg-hud-relics-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.rpg-hud-relics-label {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 600;
}

.rpg-hud-relics-list {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 240px;
  overflow-x: auto;
}

.rpg-relic-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rpg-relic-badge:hover {
  transform: scale(1.18);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.6);
  border-color: #00e5ff;
}

.rpg-relic-badge.rarity-rare { border-color: #00e5ff; }
.rpg-relic-badge.rarity-epic { border-color: #bd00ff; }
.rpg-relic-badge.rarity-legendary { border-color: #ffd700; box-shadow: 0 0 10px rgba(255, 215, 0, 0.3); }

/* HUD Controls */
.rpg-hud-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.rpg-hud-gold {
  font-family: 'Outfit', sans-serif;
  font-size: 0.92rem;
  font-weight: 800;
  color: #ffd700;
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.3);
  padding: 6px 12px;
  border-radius: 16px;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.15);
  white-space: nowrap;
}

.btn-rpg-action {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(0, 229, 255, 0.3);
  color: #e2e8f0;
  padding: 6px 12px;
  border-radius: 10px;
  font-family: 'Prompt', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-rpg-action:hover {
  background: rgba(0, 229, 255, 0.2);
  border-color: #00e5ff;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.35);
  transform: translateY(-1px);
}

/* Modern Features Hub Button */
.btn-rpg-action.btn-features-hub {
  background: linear-gradient(135deg, rgba(124, 77, 255, 0.35), rgba(0, 229, 255, 0.35));
  border: 1.5px solid #00e5ff;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.3), 0 0 8px rgba(124, 77, 255, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 12px;
  font-weight: 800;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-rpg-action.btn-features-hub:hover {
  background: linear-gradient(135deg, rgba(124, 77, 255, 0.6), rgba(0, 229, 255, 0.6));
  border-color: #7df9ff;
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.6), 0 0 12px rgba(124, 77, 255, 0.5);
  transform: translateY(-2px) scale(1.03);
}

.btn-rpg-action.btn-features-hub .hub-icon {
  font-size: 1rem;
  animation: hubPulse 2s infinite ease-in-out;
}

@keyframes hubPulse {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(15deg) scale(1.15); filter: drop-shadow(0 0 6px #00e5ff); }
}

.btn-rpg-action.btn-features-hub .hub-burger {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-left: 2px;
}

.btn-rpg-action.btn-menu {
  border-color: rgba(255, 23, 68, 0.4);
  color: #ff8a80;
}

.btn-rpg-action.btn-menu:hover {
  background: rgba(255, 23, 68, 0.2);
  border-color: #ff1744;
  color: #ffffff;
}

/* Potion Fast Heal Button Styling */
#btn-rpg-potion {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.45));
  border-color: rgba(16, 185, 129, 0.5);
  color: #a7f3d0;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

#btn-rpg-potion:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.45), rgba(5, 150, 105, 0.7));
  border-color: #34d399;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(52, 211, 153, 0.5);
  transform: translateY(-2px);
}

#btn-rpg-potion.potion-depleted {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(148, 163, 184, 0.3);
  color: #94a3b8;
  box-shadow: none;
  opacity: 0.75;
}

/* Responsive HUD Optimization for Laptops, Tablets & Narrow Viewports (Zero Cutoff Guaranteed) */
@media (max-width: 1360px) {
  .rpg-top-hud {
    padding: 6px 14px;
    gap: 8px;
  }
  .rpg-hud-player-card {
    gap: 8px;
  }
  .rpg-hud-avatar {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }
  .rpg-hud-name {
    font-size: 0.88rem;
  }
  .rpg-hud-sector-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
  }
  .rpg-bar-wrap.hp-wrap {
    width: 95px;
    height: 14px;
  }
  .rpg-bar-wrap.exp-wrap {
    width: 75px;
    height: 14px;
  }
  .rpg-hud-relics-panel {
    padding: 2px 8px;
    gap: 4px;
  }
  .rpg-hud-relics-list {
    max-width: 120px;
  }
  .rpg-relic-badge {
    width: 26px;
    height: 26px;
    font-size: 14px;
  }
  .rpg-hud-online-badge {
    padding: 4px 8px;
    font-size: 0.75rem;
  }
  .rpg-hud-gold {
    padding: 4px 8px;
    font-size: 0.82rem;
  }
  .btn-rpg-action {
    padding: 5px 8px;
    font-size: 0.78rem;
  }
  .btn-rpg-action.btn-features-hub {
    padding: 5px 10px;
    font-size: 0.8rem;
  }
}

@media (max-width: 980px) {
  .rpg-top-hud {
    padding: 5px 10px;
    gap: 6px;
  }
  .rpg-hud-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .rpg-hud-sector-badge {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .rpg-hud-relics-label {
    display: none;
  }
  .rpg-hud-online-badge {
    font-size: 0.72rem;
  }
}

@media (max-width: 780px) {
  .rpg-hud-relics-panel {
    display: none;
  }
  .rpg-hud-sector-badge {
    display: none;
  }
}

/* Canvas Viewport */
.rpg-canvas-container {
  position: relative;
  flex: 1;
  width: 100%;
  height: calc(100vh - 70px);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#world-map-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

/* Virtual D-Pad for Touch & Easy Clicking (Anchored at Bottom-Right to Avoid MMO Chat Collision) */
.rpg-virtual-dpad {
  position: absolute;
  bottom: 24px;
  right: 24px;
  z-index: 55;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(10, 16, 26, 0.84);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 8px 10px;
  border-radius: 20px;
  border: 1px solid rgba(0, 229, 255, 0.28);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), 0 0 14px rgba(0, 229, 255, 0.15);
  user-select: none;
  transition: all 0.25s ease;
}

.dpad-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 4px 4px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dpad-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #00e5ff;
  letter-spacing: 0.3px;
}

.btn-dpad-toggle {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 800;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-dpad-toggle:hover {
  background: rgba(0, 229, 255, 0.2);
  color: #ffffff;
  border-color: #00e5ff;
}

.dpad-controls-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.dpad-mid-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dpad-btn {
  width: 44px;
  height: 44px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 10px;
  color: #00e5ff;
  font-size: 1.1rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.dpad-btn:hover, .dpad-btn:active {
  background: rgba(0, 229, 255, 0.35);
  border-color: #00e5ff;
  transform: scale(0.94);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.6);
}

.dpad-center {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.2);
  font-size: 10px;
}

/* =========================================================
   FEATURES HUB DRAWER MODAL (SYSTEM & LIFESTYLE HUB)
========================================================= */
.rpg-features-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 7, 15, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeInModal 0.25s ease forwards;
}

.rpg-features-modal-content {
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(8, 14, 28, 0.98));
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 229, 255, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: scaleInModal 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.rpg-features-header {
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.features-header-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.features-hub-badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #00e5ff;
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.3);
  padding: 2px 8px;
  border-radius: 10px;
  display: inline-block;
  width: fit-content;
}

#modal-features-title {
  font-family: 'Outfit', 'Prompt', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  margin: 2px 0 0 0;
}

.features-hub-subtitle {
  font-size: 0.82rem;
  color: #94a3b8;
  margin: 0;
}

.rpg-features-body {
  padding: 22px;
  overflow-y: auto;
  max-height: calc(90vh - 120px);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (max-width: 680px) {
  .features-grid {
    grid-template-columns: 1fr;
  }
}

.feature-card-btn {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  text-align: left;
  position: relative;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  font-family: inherit;
}

.feature-card-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.6), transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.feature-card-btn:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(0, 229, 255, 0.5);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 16px rgba(0, 229, 255, 0.2);
}

.feature-card-btn:hover::before {
  opacity: 1;
}

.feature-card-icon {
  font-size: 1.8rem;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease;
}

.feature-card-btn:hover .feature-card-icon {
  transform: scale(1.12);
  border-color: #00e5ff;
}

.feature-card-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.feature-card-title {
  font-family: 'Outfit', 'Prompt', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.2px;
}

.feature-card-desc {
  font-size: 0.76rem;
  color: #94a3b8;
  line-height: 1.35;
}

.feature-card-tag {
  align-self: flex-start;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(0, 229, 255, 0.1);
  color: #00e5ff;
  border: 1px solid rgba(0, 229, 255, 0.25);
  flex-shrink: 0;
}

.feature-card-tag.special {
  background: rgba(224, 64, 251, 0.15);
  color: #e040fb;
  border-color: rgba(224, 64, 251, 0.35);
}

.feature-card-tag.exit {
  background: rgba(255, 23, 68, 0.15);
  color: #ff5252;
  border-color: rgba(255, 23, 68, 0.35);
}

.feature-card-btn.btn-feature-menu:hover {
  border-color: rgba(255, 23, 68, 0.5);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 16px rgba(255, 23, 68, 0.25);
}

/* Screen Encounter Shatter Animation */
.encounter-shatter {
  animation: encounterScreenFlash 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes encounterScreenFlash {
  0% {
    filter: brightness(1) invert(0);
    transform: scale(1);
  }
  20% {
    filter: brightness(3.5) invert(0.3);
    transform: scale(1.05) rotate(1deg);
  }
  45% {
    filter: brightness(0.2) contrast(2);
    transform: scale(0.96) rotate(-1deg);
  }
  75% {
    filter: brightness(2) invert(0.8);
    transform: scale(1.08);
  }
  100% {
    filter: brightness(0);
    transform: scale(1);
  }
}

/* ==========================================================================
   RPG Modals Styling (Card Draft, Campfire, Merchant, Deck Manager)
   ========================================================================== */

/* 1. Card Draft Modal */
.rpg-draft-modal-content {
  max-width: 820px;
  background: rgba(10, 16, 26, 0.95);
  border: 1px solid rgba(255, 215, 0, 0.4);
  box-shadow: 0 0 45px rgba(255, 215, 0, 0.25);
  border-radius: 16px;
  padding: 24px;
}

.draft-header .draft-badge {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #ffd700;
}

.rpg-draft-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 20px 0;
}

.rpg-draft-card-wrapper {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.rpg-draft-card-wrapper:hover {
  transform: translateY(-8px) scale(1.03);
  border-color: #ffd700;
  box-shadow: 0 16px 36px rgba(255, 215, 0, 0.35);
}

.rpg-draft-card-wrapper.rarity-rare { border-color: #00e5ff; }
.rpg-draft-card-wrapper.rarity-epic { border-color: #bd00ff; }
.rpg-draft-card-wrapper.rarity-legendary { border-color: #ffd700; }

.draft-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.draft-card-cost {
  font-size: 0.95rem;
  font-weight: 900;
  color: #00e5ff;
  background: rgba(0, 229, 255, 0.15);
  padding: 2px 8px;
  border-radius: 10px;
}

.draft-card-type {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 600;
}

.draft-card-art {
  font-size: 40px;
  text-align: center;
  padding: 10px 0;
}

.draft-card-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: #ffffff;
  text-align: center;
}

.draft-card-desc {
  font-size: 0.78rem;
  color: #cbd5e1;
  line-height: 1.4;
  flex: 1;
  min-height: 48px;
}

.draft-card-stats {
  display: flex;
  justify-content: space-around;
  padding: 6px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.draft-stat.atk { color: #ff1744; font-weight: 800; }
.draft-stat.hp { color: #00e676; font-weight: 800; }

.draft-card-art svg {
  width: 100%;
  height: 80px;
  display: block;
  margin: 0 auto;
  border-radius: 6px;
}

.draft-card-subtitle {
  font-size: 0.74rem;
  color: #94a3b8;
  text-align: center;
}

/* 1.1 Dedicated Chest Modal */
.rpg-chest-modal-content {
  max-width: 860px;
  background: radial-gradient(circle at 50% 10%, rgba(255, 179, 0, 0.18) 0%, rgba(10, 16, 26, 0.98) 75%);
  border: 1.5px solid rgba(255, 179, 0, 0.5);
  box-shadow: 0 0 50px rgba(255, 179, 0, 0.3), inset 0 0 20px rgba(255, 179, 0, 0.08);
  border-radius: 18px;
  padding: 26px;
  animation: chestModalPop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes chestModalPop {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.chest-title-group .chest-badge {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #ffca28;
  display: inline-block;
  margin-bottom: 4px;
}

.chest-title-group h3 {
  font-family: var(--font-title);
  color: #fff9c4;
  font-size: 1.35rem;
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.chest-subtitle {
  color: #cbd5e1;
  font-size: 0.9rem;
  margin-top: 4px;
}

.chest-loot-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0;
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: 12px;
}

.chest-loot-badge {
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.chest-loot-badge.gold {
  background: rgba(255, 179, 0, 0.22);
  border: 1px solid #ffb300;
  color: #ffe082;
}

.chest-loot-badge.relic {
  background: rgba(189, 0, 255, 0.22);
  border: 1px solid #bd00ff;
  color: #f3e5f5;
}

.chest-loot-badge.quest {
  background: rgba(0, 229, 255, 0.22);
  border: 1px solid #00e5ff;
  color: #e0f7fa;
  animation: pulseGlow 1.5s infinite alternate;
}

.chest-card-prompt {
  font-size: 0.92rem;
  color: #e2e8f0;
  margin-bottom: 12px;
}

.chest-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 14px;
}

.btn-chest-claim {
  background: linear-gradient(135deg, #ffb300, #ff6f00);
  color: #000;
  font-weight: 800;
}

/* 3. Merchant Modal */
.rpg-merchant-modal-content {
  max-width: 780px;
  background: rgba(10, 16, 26, 0.96);
  border: 1px solid rgba(118, 255, 3, 0.4);
  box-shadow: 0 0 45px rgba(118, 255, 3, 0.2);
  border-radius: 16px;
  padding: 24px;
}

.merchant-header .merchant-badge {
  color: #76ff03;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.merchant-gold {
  font-size: 1rem;
  font-weight: 800;
  color: #ffd700;
}

.merchant-wares-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.merchant-item-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.merchant-item-card:hover {
  border-color: #76ff03;
  box-shadow: 0 6px 18px rgba(118, 255, 3, 0.25);
}

.merchant-item-icon {
  font-size: 32px;
}

.merchant-item-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #ffffff;
}

.merchant-item-desc {
  font-size: 0.74rem;
  color: #94a3b8;
  flex: 1;
}

.merchant-item-card.sold-out {
  opacity: 0.4;
  filter: grayscale(0.8);
  pointer-events: none;
}

/* 4. Deck Manager Modal */
.rpg-deck-modal-content {
  max-width: 900px;
  background: rgba(10, 16, 26, 0.96);
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-radius: 16px;
  padding: 24px;
}

.deck-count-badge {
  font-size: 0.85rem;
  color: #00e5ff;
  background: rgba(0, 229, 255, 0.12);
  padding: 2px 10px;
  border-radius: 12px;
}

.rpg-deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  max-height: 520px;
  overflow-y: auto;
  padding: 8px;
}

.rpg-deck-card-item {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

.rpg-deck-card-item:hover {
  transform: translateY(-3px);
  border-color: #00e5ff;
  box-shadow: 0 4px 14px rgba(0, 229, 255, 0.35);
}

.deck-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  color: #ffffff;
}

.deck-card-top .cost {
  color: #00e5ff;
}

.deck-card-art {
  font-size: 24px;
  text-align: center;
}

.deck-card-bot {
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 3px;
}

/* =========================================================
   RPG QUEST SYSTEM & TRACKER STYLING
========================================================= */
.rpg-quest-tracker {
  position: absolute;
  top: 80px;
  right: 20px;
  width: 280px;
  background: rgba(10, 16, 26, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 179, 0, 0.4);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 15px rgba(255, 179, 0, 0.2);
  z-index: 50;
  transition: all 0.3s ease;
  pointer-events: auto;
}

.rpg-quest-tracker:hover {
  border-color: #ffb300;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.7), 0 0 22px rgba(255, 179, 0, 0.35);
}

.tracker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tracker-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 6px;
}

.tracker-badge.main {
  background: linear-gradient(135deg, rgba(255, 179, 0, 0.3), rgba(255, 106, 0, 0.2));
  color: #ffca28;
  border: 1px solid rgba(255, 179, 0, 0.5);
}

.tracker-badge.side {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.25), rgba(0, 150, 255, 0.15));
  color: #80d8ff;
  border: 1px solid rgba(0, 229, 255, 0.4);
}

.btn-tracker-hint {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffd54f;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-tracker-hint:hover {
  background: rgba(255, 213, 79, 0.25);
  border-color: #ffd54f;
}

.tracker-actions-cluster {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-tracker-toggle {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 800;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-tracker-toggle:hover {
  background: rgba(0, 229, 255, 0.2);
  border-color: #00e5ff;
  color: #ffffff;
}

.tracker-collapsible-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tracker-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tracker-progress-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.tracker-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #ffb300, #ff6a00);
  border-radius: 4px;
  transition: width 0.4s ease;
  box-shadow: 0 0 8px rgba(255, 179, 0, 0.6);
}

.tracker-progress-text {
  font-size: 0.75rem;
  color: #b0bec5;
}

.tracker-ready-pulse {
  color: #69f0ae;
  font-weight: 700;
  animation: pulseGreenGlow 1.5s infinite alternate;
}

@keyframes pulseGreenGlow {
  0% { opacity: 0.8; text-shadow: 0 0 4px #00e676; }
  100% { opacity: 1; text-shadow: 0 0 12px #00e676; }
}

.tracker-hint-box {
  background: rgba(14, 20, 30, 0.95);
  border: 1px dashed rgba(255, 213, 79, 0.4);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.75rem;
  color: #ffe082;
  line-height: 1.4;
  margin-top: 4px;
}

/* Quest HUD Button & Glow */
.btn-quest-log.has-turnin {
  background: linear-gradient(135deg, rgba(255, 179, 0, 0.35), rgba(255, 106, 0, 0.4)) !important;
  border-color: #ffb300 !important;
  color: #fff9c4 !important;
  animation: questButtonPulse 1.2s infinite alternate ease-in-out;
  box-shadow: 0 0 14px rgba(255, 179, 0, 0.6) !important;
}

@keyframes questButtonPulse {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.05); filter: brightness(1.25); }
}

/* =========================================================
   RPG NPC DIALOGUE MODAL
========================================================= */
.rpg-dialogue-modal-content {
  max-width: 620px;
  width: 92%;
  background: linear-gradient(180deg, rgba(14, 22, 34, 0.97) 0%, rgba(8, 12, 20, 0.98) 100%);
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(0, 229, 255, 0.2);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dialogue-header {
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 14px;
  position: relative;
}

.dialogue-avatar-box {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.2), rgba(189, 0, 255, 0.15));
  border: 2px solid rgba(0, 229, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 28px;
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.3);
}

.dialogue-speaker-info {
  flex: 1;
}

.dialogue-speaker-role {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #00e5ff;
  letter-spacing: 0.5px;
}

.dialogue-speaker-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  font-family: var(--font-ui), var(--font-thai);
}

.dialogue-speech-bubble {
  background: rgba(22, 32, 48, 0.7);
  border-left: 4px solid #00e5ff;
  border-radius: 0 12px 12px 0;
  padding: 14px 18px;
  position: relative;
}

.dialogue-speech-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #e2e8f0;
  margin: 0;
}

/* Quest Card inside Dialogue */
.dialogue-quest-card {
  margin-top: 12px;
  background: rgba(16, 24, 38, 0.85);
  border: 1px solid rgba(255, 179, 0, 0.35);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quest-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quest-card-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
}

.quest-card-badge.main {
  background: rgba(255, 179, 0, 0.2);
  color: #ffca28;
  border: 1px solid rgba(255, 179, 0, 0.4);
}

.quest-card-badge.side {
  background: rgba(0, 229, 255, 0.2);
  color: #80d8ff;
  border: 1px solid rgba(0, 229, 255, 0.4);
}

.quest-card-status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
}

.status-available { background: rgba(0, 229, 255, 0.2); color: #00e5ff; }
.status-active { background: rgba(255, 179, 0, 0.2); color: #ffca28; }
.status-turnin { background: rgba(0, 230, 118, 0.25); color: #69f0ae; border: 1px solid #00e676; }
.status-completed { background: rgba(158, 158, 158, 0.2); color: #b0bec5; }

.quest-card-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: #ffffff;
}

.quest-card-desc {
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.5;
}

.quest-obj-heading, .quest-rew-heading {
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffd54f;
  margin-top: 4px;
}

.quest-card-objectives {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quest-obj-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #cbd5e1;
}

.quest-obj-item.done {
  color: #69f0ae;
  text-decoration: line-through;
  opacity: 0.85;
}

.quest-rew-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.reward-tag {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
}

.reward-tag.gold { background: rgba(255, 179, 0, 0.15); color: #ffca28; border-color: rgba(255, 179, 0, 0.3); }
.reward-tag.exp { background: rgba(0, 229, 255, 0.15); color: #80d8ff; border-color: rgba(0, 229, 255, 0.3); }
.reward-tag.relic { background: rgba(189, 0, 255, 0.15); color: #e040fb; border-color: rgba(189, 0, 255, 0.3); }
.reward-tag.potion { background: rgba(0, 230, 118, 0.15); color: #69f0ae; border-color: rgba(0, 230, 118, 0.3); }

/* Dialogue Action Buttons */
.dialogue-actions-list {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 6px;
}

.btn-dialogue {
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-dialogue-accept {
  background: linear-gradient(135deg, #ffb300, #ff6a00);
  color: #0b0f19;
  box-shadow: 0 4px 15px rgba(255, 179, 0, 0.4);
}

.btn-dialogue-accept:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 179, 0, 0.6);
}

.btn-dialogue-claim {
  background: linear-gradient(135deg, #00e676, #00b0ff);
  color: #05140d;
  box-shadow: 0 4px 18px rgba(0, 230, 118, 0.45);
  animation: pulseClaimBtn 1.3s infinite alternate;
}

@keyframes pulseClaimBtn {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.03); filter: brightness(1.2); box-shadow: 0 6px 24px rgba(0, 230, 118, 0.7); }
}

.btn-dialogue-hint {
  background: rgba(255, 213, 79, 0.15);
  color: #ffd54f;
  border-color: rgba(255, 213, 79, 0.4);
}

.btn-dialogue-hint:hover {
  background: rgba(255, 213, 79, 0.25);
  border-color: #ffd54f;
}

.btn-dialogue-decline, .btn-dialogue-back, .btn-dialogue-leave {
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  border-color: rgba(255, 255, 255, 0.12);
}

.btn-dialogue-decline:hover, .btn-dialogue-back:hover, .btn-dialogue-leave:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

/* =========================================================
   RPG QUEST LOG JOURNAL MODAL
========================================================= */
.rpg-quest-log-modal-content {
  max-width: 760px;
  width: 94%;
  max-height: 85vh;
  background: linear-gradient(180deg, rgba(12, 18, 28, 0.98) 0%, rgba(8, 12, 18, 0.99) 100%);
  border: 1px solid rgba(255, 179, 0, 0.35);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.85), 0 0 35px rgba(255, 179, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quest-log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 14px;
}

.quest-log-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quest-journal-icon {
  font-size: 26px;
}

.quest-log-tabs {
  display: flex;
  gap: 8px;
}

.quest-tab-btn {
  padding: 8px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quest-tab-btn.active {
  background: rgba(255, 179, 0, 0.18);
  border-color: #ffb300;
  color: #ffca28;
}

.quest-log-body {
  overflow-y: auto;
  max-height: 520px;
  padding-right: 6px;
}

.quest-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.quest-journal-card {
  background: rgba(18, 26, 40, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

.quest-journal-card:hover {
  border-color: rgba(255, 179, 0, 0.4);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.quest-journal-card.turnin-ready {
  border-color: #00e676;
  box-shadow: 0 0 16px rgba(0, 230, 118, 0.25);
}

.quest-journal-card.completed {
  opacity: 0.75;
  border-color: rgba(255, 255, 255, 0.08);
}

.journal-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.journal-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
}

.journal-card-giver {
  font-size: 0.78rem;
  color: #80d8ff;
}

.journal-card-desc {
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.5;
}

.journal-objectives {
  background: rgba(10, 15, 24, 0.6);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
}

.journal-obj-row {
  color: #cbd5e1;
}

.journal-obj-row.done {
  color: #69f0ae;
  text-decoration: line-through;
}

.journal-hint-card {
  background: rgba(255, 213, 79, 0.08);
  border-left: 3px solid #ffd54f;
  padding: 8px 12px;
  font-size: 0.78rem;
  color: #ffe082;
  border-radius: 0 6px 6px 0;
}

.journal-rewards {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.journal-rewards .rew-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: #ffd54f;
}

.quest-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: #64748b;
  gap: 8px;
  text-align: center;
}

.quest-empty-state .empty-icon {
  font-size: 42px;
  opacity: 0.6;
}

.quest-empty-state .empty-hint {
  font-size: 0.78rem;
  color: #94a3b8;
}

.quest-log-footer {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 12px;
}

/* =========================================================
   NPC THAI VOICE ACTING & DIALOGUE UX ENHANCEMENTS
========================================================= */

/* Speaking Avatar Indicator */
.dialogue-avatar-box {
  position: relative;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.dialogue-avatar-box.is-speaking {
  box-shadow: 0 0 25px rgba(0, 229, 255, 0.8), inset 0 0 15px rgba(0, 229, 255, 0.5) !important;
  border-color: #00e5ff !important;
  animation: avatarPulseSpeaking 1s infinite alternate ease-in-out;
}

@keyframes avatarPulseSpeaking {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.06); filter: brightness(1.3); }
}

.dialogue-avatar-box.is-speaking::after {
  content: '🔊 กำลังพูด';
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.68rem;
  font-weight: 800;
  color: #00e5ff;
  background: rgba(4, 16, 26, 0.9);
  border: 1px solid rgba(0, 229, 255, 0.6);
  border-radius: 10px;
  padding: 1px 6px;
  white-space: nowrap;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
  animation: pulseSpeakBadge 0.8s infinite alternate;
}

@keyframes pulseSpeakBadge {
  0% { opacity: 0.75; }
  100% { opacity: 1; }
}

/* Header Voice Replay Button */
.btn-voice-replay {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 14px;
  background: rgba(0, 229, 255, 0.12);
  color: #00e5ff;
  border: 1px solid rgba(0, 229, 255, 0.35);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: auto;
  margin-right: 8px;
}

.btn-voice-replay:hover {
  background: rgba(0, 229, 255, 0.25);
  border-color: #00e5ff;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
  transform: translateY(-1px);
}

/* Quest Acceptance Success Banner */
.quest-accept-success-banner {
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.18), rgba(0, 176, 255, 0.15));
  border: 1px solid rgba(0, 230, 118, 0.5);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: bannerSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 10px;
  box-shadow: 0 0 20px rgba(0, 230, 118, 0.25);
}

@keyframes bannerSlideIn {
  0% { opacity: 0; transform: translateY(-8px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.quest-accept-success-banner .banner-icon {
  font-size: 26px;
}

.quest-accept-success-banner .banner-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.quest-accept-success-banner strong {
  color: #69f0ae;
  font-size: 0.95rem;
}

.quest-accept-success-banner p {
  color: #e2e8f0;
  font-size: 0.8rem;
  margin: 0;
}

.quest-card-accepted {
  border-color: #00e676 !important;
  box-shadow: 0 0 22px rgba(0, 230, 118, 0.35) !important;
  animation: cardGlowPulse 1.5s infinite alternate ease-in-out;
}

@keyframes cardGlowPulse {
  0% { box-shadow: 0 0 14px rgba(0, 230, 118, 0.25); }
  100% { box-shadow: 0 0 26px rgba(0, 230, 118, 0.5); }
}

/* Quest Reward Showcase in Dialogue */
.quest-reward-showcase {
  background: linear-gradient(135deg, rgba(255, 179, 0, 0.15), rgba(189, 0, 255, 0.12));
  border: 1px solid rgba(255, 179, 0, 0.45);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: rewardPopIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 25px rgba(255, 179, 0, 0.25);
}

@keyframes rewardPopIn {
  0% { opacity: 0; transform: scale(0.92); }
  100% { opacity: 1; transform: scale(1); }
}

.reward-banner-title {
  font-size: 1.12rem;
  font-weight: 800;
  color: #ffd54f;
  text-align: center;
  text-shadow: 0 0 12px rgba(255, 179, 0, 0.5);
}

.reward-items-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.reward-badge {
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.reward-badge.gold-badge {
  background: rgba(255, 179, 0, 0.2);
  color: #ffca28;
  border: 1px solid #ffb300;
}

.reward-badge.exp-badge {
  background: rgba(0, 229, 255, 0.2);
  color: #80d8ff;
  border: 1px solid #00e5ff;
}

.reward-badge.relic-badge {
  background: rgba(189, 0, 255, 0.2);
  color: #e040fb;
  border: 1px solid #bd00ff;
}

.reward-badge.pot-badge {
  background: rgba(0, 230, 118, 0.2);
  color: #69f0ae;
  border: 1px solid #00e676;
}

.reward-levelup-banner {
  background: linear-gradient(90deg, rgba(255, 179, 0, 0.3), rgba(255, 23, 68, 0.25));
  border: 1px solid #ffd54f;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  color: #fff9c4;
  font-weight: 800;
  font-size: 0.92rem;
  box-shadow: 0 0 16px rgba(255, 179, 0, 0.35);
  animation: levelUpGlow 1s infinite alternate ease-in-out;
}

@keyframes levelUpGlow {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.02); filter: brightness(1.2); }
}

.btn-dialogue-embark {
  background: linear-gradient(135deg, #00e5ff, #0077ff);
  color: #030810;
  box-shadow: 0 4px 18px rgba(0, 229, 255, 0.5);
  font-weight: 800;
  border: none;
}

.btn-dialogue-embark:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 229, 255, 0.7);
  color: #000000;
}

/* =========================================================
   CHARACTER CREATOR & LIVE AVATAR CUSTOMIZATION STYLES
========================================================= */
.character-customizer-section {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 0 20px rgba(0, 229, 255, 0.05);
  backdrop-filter: blur(12px);
}

.character-customizer-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
  margin-top: 16px;
}

@media (max-width: 768px) {
  .character-customizer-grid {
    grid-template-columns: 1fr;
  }
}

/* Left Preview Card */
.customizer-preview-card {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 229, 255, 0.15);
}

.preview-badge {
  font-size: 0.82rem;
  font-weight: 700;
  color: #00e5ff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.6);
}

.preview-canvas-wrap {
  width: 180px;
  height: 180px;
  border-radius: 12px;
  background: radial-gradient(circle at center, rgba(30, 58, 138, 0.3), rgba(2, 6, 23, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#avatar-preview-canvas {
  width: 180px;
  height: 180px;
  display: block;
}

.btn-customizer-action {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  background: rgba(30, 41, 59, 0.8);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-customizer-action:hover {
  background: rgba(0, 229, 255, 0.15);
  border-color: #00e5ff;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.3);
  transform: translateY(-1px);
}

/* Right Controls Panel */
.customizer-controls-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.customizer-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.input-group-half {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.customizer-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: #cbd5e1;
  letter-spacing: 0.3px;
}

.input-with-btn {
  display: flex;
  gap: 6px;
}

.customizer-input {
  flex: 1;
  padding: 9px 12px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  outline: none;
  transition: all 0.2s ease;
}

.customizer-input:focus {
  border-color: #00e5ff;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
}

.btn-input-addon {
  padding: 0 12px;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-input-addon:hover {
  background: rgba(0, 229, 255, 0.25);
  border-color: #00e5ff;
  transform: scale(1.05);
}

.customizer-select {
  padding: 9px 12px;
  border-radius: 8px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffd700;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.customizer-select:focus {
  border-color: #ffd700;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
}

.customizer-select option {
  background: #0f172a;
  color: #f8fafc;
  padding: 6px;
}

/* Pills (Gender & Hair Style) */
.customizer-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill-btn {
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.pill-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

.pill-btn.active {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.25), rgba(0, 119, 255, 0.25));
  border-color: #00e5ff;
  color: #00e5ff;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.35);
  font-weight: 700;
}

/* Color Palette Picker */
.color-palette-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 38px;
}

.color-swatch-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  outline: none;
}

.color-swatch-btn:hover {
  transform: scale(1.2);
  border-color: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
  z-index: 2;
}

.color-swatch-btn.active {
  transform: scale(1.25);
  border-color: #ffffff;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.9);
  z-index: 3;
}

.color-swatch-btn.active::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 13px;
  font-weight: 900;
  color: #0f172a;
  text-shadow: 0 0 3px #fff;
}

/* ==========================================================================
   WORLD ATLAS & MULTI-CITY NAVIGATION STYLES
   ========================================================================== */

.btn-atlas {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.25) 0%, rgba(2, 136, 209, 0.35) 100%);
  border: 1px solid #00e5ff !important;
  color: #00e5ff !important;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
  font-weight: 700;
  transition: all 0.25s ease;
}

.btn-atlas:hover {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.45) 0%, rgba(2, 136, 209, 0.6) 100%);
  transform: translateY(-2px);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.6);
}

.rpg-atlas-modal-content {
  width: 94%;
  max-width: 960px;
  max-height: 90vh;
  background: linear-gradient(145deg, rgba(11, 19, 34, 0.98) 0%, rgba(5, 10, 18, 0.99) 100%);
  border: 1px solid rgba(0, 229, 255, 0.35);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 229, 255, 0.2);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-fade-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.atlas-header {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.8);
}

.atlas-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.atlas-journal-icon {
  font-size: 32px;
  filter: drop-shadow(0 0 8px #00e5ff);
}

.atlas-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.atlas-subtitle {
  margin: 2px 0 0 0;
  font-size: 12px;
  color: #94a3b8;
}

.atlas-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.atlas-current-loc-banner {
  margin-bottom: 20px;
}

.atlas-current-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 230, 118, 0.12);
  border: 1px solid #00e676;
  border-radius: 30px;
  padding: 8px 18px;
  font-size: 13px;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(0, 230, 118, 0.25);
}

.atlas-pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #00e676;
  box-shadow: 0 0 10px #00e676;
  animation: pulse-ring 1.5s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(0, 230, 118, 0); }
  100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(0, 230, 118, 0); }
}

.atlas-cur-label {
  color: #94a3b8;
  font-weight: 500;
}

.atlas-cur-sub {
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 400;
}

.atlas-section-title {
  margin: 0 0 12px 0;
  font-size: 15px;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.atlas-locations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.atlas-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.atlas-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.atlas-card.is-current {
  border-color: #00e676 !important;
  background: linear-gradient(145deg, rgba(16, 38, 26, 0.8) 0%, rgba(10, 22, 16, 0.9) 100%) !important;
  box-shadow: 0 0 20px rgba(0, 230, 118, 0.25);
}

.atlas-card.is-unlocked {
  border-color: rgba(0, 229, 255, 0.35);
}

.atlas-card.is-locked {
  opacity: 0.55;
  filter: grayscale(0.6);
  border-color: rgba(255, 255, 255, 0.06);
}

.atlas-card.faction-iron { border-left: 4px solid #00e5ff; }
.atlas-card.faction-verdant { border-left: 4px solid #00e676; }
.atlas-card.faction-solar { border-left: 4px solid #ffd700; }
.atlas-card.faction-chrono { border-left: 4px solid #ff2a85; }
.atlas-card.faction-verdant_solar { border-left: 4px solid #76ff03; }
.atlas-card.faction-void_chrono { border-left: 4px solid #bd00ff; }

.atlas-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.atlas-card-icon {
  font-size: 28px;
  line-height: 1;
}

.atlas-card-title-box {
  flex: 1;
}

.atlas-card-name {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
}

.atlas-card-subtitle {
  font-size: 11.5px;
  color: #94a3b8;
  display: block;
  margin-top: 2px;
}

.atlas-badge {
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.atlas-badge.current {
  background: rgba(0, 230, 118, 0.25);
  color: #00e676;
  border: 1px solid #00e676;
}

.atlas-badge.unlocked {
  background: rgba(0, 229, 255, 0.2);
  color: #00e5ff;
  border: 1px solid rgba(0, 229, 255, 0.6);
}

.atlas-badge.locked {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.atlas-card-desc {
  font-size: 12px;
  line-height: 1.5;
  color: #cbd5e1;
  margin: 0 0 14px 0;
  flex: 1;
}

.atlas-card-action {
  margin-top: auto;
}

.btn-atlas-warp {
  width: 100%;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 8px;
  background: linear-gradient(135deg, #0288d1 0%, #00e5ff 100%);
  color: #0a111e;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(0, 229, 255, 0.3);
}

.btn-atlas-warp:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 229, 255, 0.6);
}

.btn-atlas-action.disabled {
  width: 100%;
  padding: 7px 12px;
  font-size: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #64748b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: not-allowed;
}

.atlas-footer {
  padding: 14px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 23, 42, 0.8);
}

/* ==========================================================================
   NEXUS WARP GATEWAY & DIMENSIONAL TELEPORT SERVICE MODAL STYLES
   ========================================================================== */
.rpg-kafra-modal-content {
  max-width: 820px;
  width: 95%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #111a2e 0%, #0d1322 100%);
  border: 1px solid rgba(0, 229, 255, 0.35);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 229, 255, 0.15);
  border-radius: 16px;
  overflow: hidden;
  animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.kafra-header {
  padding: 16px 24px;
  background: linear-gradient(90deg, rgba(2, 136, 209, 0.25) 0%, rgba(15, 23, 42, 0.8) 100%);
  border-bottom: 1px solid rgba(0, 229, 255, 0.25);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kafra-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.kafra-avatar-badge {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.2), rgba(255, 171, 0, 0.2));
  border: 2px solid #00e5ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.4);
  animation: floatSubtle 3s ease-in-out infinite;
}

.kafra-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.kafra-subtitle {
  margin: 4px 0 0;
  font-size: 12px;
  color: #94a3b8;
}

.kafra-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.kafra-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 14px;
  gap: 12px;
}

.kafra-loc-station {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #cbd5e1;
}

.kafra-pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #00e5ff;
  box-shadow: 0 0 8px #00e5ff;
  animation: pulseBeacon 1.5s infinite;
}

.kafra-gold-wallet {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 215, 0, 0.12);
  border: 1px solid rgba(255, 215, 0, 0.35);
  padding: 6px 14px;
  border-radius: 20px;
}

.wallet-icon {
  font-size: 16px;
}

.wallet-label {
  font-size: 12px;
  color: #f1f5f9;
}

.wallet-amount {
  font-size: 15px;
  font-weight: 800;
  color: #ffd700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.wallet-unit {
  font-size: 12px;
  font-weight: 700;
  color: #fbbf24;
}

.kafra-tip-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.12) 0%, rgba(6, 78, 59, 0.08) 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 18px;
}

.kafra-tip-banner .tip-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.kafra-tip-banner .tip-text {
  font-size: 12.5px;
  color: #a7f3d0;
  line-height: 1.5;
}

.kafra-tip-banner .tip-text strong {
  color: #34d399;
}

.kafra-destinations-heading {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 700;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kafra-routes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

.kafra-route-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.kafra-route-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 229, 255, 0.4);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.kafra-route-card.is-current {
  background: rgba(2, 136, 209, 0.12);
  border-color: rgba(0, 229, 255, 0.5);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.15);
}

.kafra-route-card.faction-iron { border-left: 4px solid #00e5ff; }
.kafra-route-card.faction-verdant { border-left: 4px solid #00e676; }
.kafra-route-card.faction-solar { border-left: 4px solid #ffd700; }
.kafra-route-card.faction-chrono { border-left: 4px solid #ff2a85; }
.kafra-route-card.faction-crimson { border-left: 4px solid #ff3d00; }
.kafra-route-card.faction-void { border-left: 4px solid #bd00ff; }

.kafra-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.kafra-card-icon {
  font-size: 24px;
}

.kafra-card-title-box {
  flex: 1;
}

.kafra-dest-name {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}

.kafra-dest-sub {
  font-size: 11.5px;
  color: #94a3b8;
}

.kafra-fee-pill {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.kafra-fee-pill.affordable {
  background: rgba(255, 215, 0, 0.18);
  border: 1px solid rgba(255, 215, 0, 0.5);
  color: #ffd700;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.25);
}

.kafra-fee-pill.unaffordable {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.kafra-badge.current {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(0, 229, 255, 0.2);
  color: #00e5ff;
  border: 1px solid rgba(0, 229, 255, 0.4);
}

.kafra-card-desc {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.4;
  margin: 0 0 8px 0;
  flex: 1;
}

.kafra-free-route-tip {
  font-size: 11.5px;
  color: #34d399;
  background: rgba(16, 185, 129, 0.08);
  border-radius: 6px;
  padding: 5px 8px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.kafra-card-action {
  margin-top: auto;
}

.btn-kafra-warp {
  width: 100%;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 8px;
  background: linear-gradient(135deg, #0288d1 0%, #00e5ff 100%);
  color: #0a111e;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(0, 229, 255, 0.3);
}

.btn-kafra-warp:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 229, 255, 0.6);
}

.btn-kafra-action.current {
  width: 100%;
  padding: 7px 12px;
  font-size: 12px;
  border-radius: 8px;
  background: rgba(0, 229, 255, 0.08);
  color: #00e5ff;
  border: 1px solid rgba(0, 229, 255, 0.2);
  cursor: default;
}

.btn-kafra-action.insufficient {
  width: 100%;
  padding: 7px 12px;
  font-size: 12px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
  cursor: not-allowed;
}

.kafra-footer {
  padding: 14px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.85);
}

.kafra-footer-slogan {
  font-size: 12px;
  font-style: italic;
  color: #64748b;
}

/* ==========================================================================
   ONLINE MULTIPLAYER BADGE & PLAYER INTERACTION STYLES
   ========================================================================== */

.rpg-hud-online-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(0, 230, 118, 0.12);
  border: 1px solid rgba(0, 230, 118, 0.45);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 700;
  color: #00e676;
  box-shadow: 0 0 10px rgba(0, 230, 118, 0.2);
  cursor: default;
  user-select: none;
}

.online-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00e676;
  box-shadow: 0 0 8px #00e676;
  animation: pulse-ring 1.5s infinite;
}

.rpg-player-modal-content {
  width: 92%;
  max-width: 480px;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.98) 0%, rgba(9, 14, 24, 0.99) 100%);
  border: 1px solid rgba(0, 229, 255, 0.35);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(0, 229, 255, 0.2);
  border-radius: 16px;
  overflow: hidden;
  animation: modal-fade-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.player-modal-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.8);
}

.player-modal-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-modal-icon {
  font-size: 28px;
  filter: drop-shadow(0 0 8px #00e5ff);
}

.player-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
}

.player-modal-subtitle {
  font-size: 12px;
  color: #38bdf8;
  font-weight: 600;
}

.player-modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.player-profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(2, 6, 12, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px 16px;
}

.player-card-avatar-box {
  width: 58px;
  height: 58px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.9);
  border: 2px solid #00e5ff;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.3);
}

.player-card-avatar-icon {
  font-size: 30px;
}

.player-card-status-dot {
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #00e676;
  border: 2px solid #0f172a;
  box-shadow: 0 0 6px #00e676;
}

.player-card-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.player-detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.detail-label {
  color: #94a3b8;
}

.detail-val {
  color: #f1f5f9;
  font-weight: 600;
}

.player-action-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-player-action {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-player-action.btn-trade {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(16, 185, 129, 0.3);
}

.btn-player-action.btn-trade:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 18px rgba(16, 185, 129, 0.5);
}

.btn-player-action.btn-duel {
  background: linear-gradient(135deg, #b91c1c 0%, #ef4444 100%);
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(239, 68, 68, 0.3);
}

.btn-player-action.btn-duel:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 18px rgba(239, 68, 68, 0.5);
}

.player-modal-footer {
  padding: 12px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 23, 42, 0.8);
}

/* ==========================================================================
   MMO Real-Time Chat Dock & Interactive Card Linking Styling
   ========================================================================== */

.rpg-mmo-chat-dock {
  position: absolute;
  bottom: 20px;
  left: 20px;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 260px;
  background: rgba(10, 15, 29, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 15px rgba(0, 229, 255, 0.15);
  display: flex;
  flex-direction: column;
  z-index: 60;
  transition: height 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s ease;
  overflow: hidden;
}

.rpg-mmo-chat-dock.collapsed {
  height: 42px;
}

/* Chat Dock Header */
.chat-dock-header {
  height: 42px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  user-select: none;
  gap: 8px;
}

.chat-header-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #00e5ff;
}

.chat-unread-badge {
  background: #ef4444;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
  animation: pulse-unread 1.5s infinite;
}

@keyframes pulse-unread {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); box-shadow: 0 0 8px #ef4444; }
}

.chat-channel-tabs {
  display: flex;
  gap: 4px;
}

.chat-channel-tab {
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-channel-tab:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.06);
}

.chat-channel-tab.active {
  color: #00e5ff;
  background: rgba(0, 229, 255, 0.12);
  border-color: rgba(0, 229, 255, 0.4);
  font-weight: 700;
}

.btn-chat-toggle {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.btn-chat-toggle:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* Whisper Banner */
.mmo-chat-whisper-banner {
  background: rgba(236, 72, 153, 0.15);
  border-bottom: 1px solid rgba(236, 72, 153, 0.3);
  padding: 4px 12px;
  font-size: 11px;
  color: #f472b6;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-cancel-whisper {
  background: transparent;
  border: none;
  color: #f472b6;
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
}

/* Chat Messages Area */
.mmo-chat-messages {
  flex: 1;
  padding: 8px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  line-height: 1.4;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 229, 255, 0.3) transparent;
}

.mmo-chat-messages::-webkit-scrollbar {
  width: 5px;
}

.mmo-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.3);
  border-radius: 4px;
}

.chat-message-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.chat-message-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.chat-timestamp {
  color: #64748b;
  font-size: 10px;
  margin-right: 2px;
}

/* Channel Badges */
.chat-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chat-badge.global {
  background: rgba(255, 179, 0, 0.2);
  color: #ffb300;
  border: 1px solid rgba(255, 179, 0, 0.4);
}

.chat-badge.sector {
  background: rgba(0, 229, 255, 0.2);
  color: #00e5ff;
  border: 1px solid rgba(0, 229, 255, 0.4);
}

.chat-badge.whisper {
  background: rgba(236, 72, 153, 0.2);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.4);
}

.chat-badge.system {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

/* Sender Names */
.chat-sender-name {
  font-weight: 700;
  cursor: pointer;
}

.chat-sender-title {
  color: #cbd5e1;
  font-weight: 500;
  font-size: 11px;
}

.chat-sender-name.faction-iron { color: #38bdf8; }
.chat-sender-name.faction-solar { color: #f59e0b; }
.chat-sender-name.faction-verdant { color: #10b981; }
.chat-sender-name.faction-chrono { color: #ec4899; }
.chat-sender-name.faction-crimson { color: #ef4444; }
.chat-sender-name.faction-void { color: #a855f7; }

.chat-text-body {
  color: #e2e8f0;
  word-break: break-word;
}

.chat-message-row.channel-system .chat-text-body {
  color: #a7f3d0;
  font-style: italic;
}

.chat-message-row.channel-whisper .chat-text-body {
  color: #fbcfe8;
}

/* Interactive Clickable Card Link Chips in Chat */
.chat-card-link-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid #00e5ff;
  padding: 1px 6px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  font-family: inherit;
  margin: 0 2px;
  vertical-align: middle;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 6px rgba(0, 229, 255, 0.2);
}

.chat-card-link-badge:hover {
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.6);
  background: rgba(30, 41, 59, 0.95);
}

.card-link-icon {
  font-size: 11px;
}

/* Chat Input Bar */
.chat-dock-input-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-channel-select {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f1f5f9;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
}

.chat-channel-select:focus {
  border-color: #00e5ff;
}

.mmo-chat-input {
  flex: 1;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f1f5f9;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s ease;
}

.mmo-chat-input:focus {
  border-color: #00e5ff;
  background: rgba(30, 41, 59, 0.9);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.25);
}

.mmo-chat-input::placeholder {
  color: #64748b;
}

.btn-chat-link-card,
.btn-chat-send {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f1f5f9;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-chat-link-card:hover {
  background: rgba(0, 229, 255, 0.2);
  border-color: #00e5ff;
  transform: scale(1.05);
}

.btn-chat-send {
  background: linear-gradient(135deg, #0284c7 0%, #00e5ff 100%);
  color: #04101e;
  border: none;
  font-weight: 700;
}

.btn-chat-send:hover {
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
  transform: scale(1.05);
}

/* ==========================================================================
   Chat Card Picker Modal
   ========================================================================== */

.chat-card-picker-modal-content {
  width: 620px;
  max-width: 92vw;
  max-height: 80vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 229, 255, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.picker-modal-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.picker-modal-icon {
  font-size: 28px;
}

.picker-modal-subtitle {
  font-size: 11px;
  color: #94a3b8;
}

.chat-picker-modal-body {
  padding: 16px;
  overflow-y: auto;
  max-height: 60vh;
}

.chat-card-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.chat-picker-card-item {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}

.chat-picker-card-item:hover {
  transform: translateY(-3px);
  border-color: #00e5ff;
  box-shadow: 0 6px 16px rgba(0, 229, 255, 0.3);
  background: rgba(30, 41, 59, 0.8);
}

.picker-card-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #94a3b8;
}

.picker-card-cost {
  color: #00e5ff;
  font-weight: 700;
}

.picker-card-icon {
  font-size: 26px;
  margin: 4px 0;
}

.picker-card-title {
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.3;
}

.picker-card-faction {
  font-size: 10px;
  font-weight: 600;
}

.btn-picker-select {
  margin-top: 4px;
  width: 100%;
  background: rgba(0, 229, 255, 0.15);
  border: 1px solid rgba(0, 229, 255, 0.4);
  color: #00e5ff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-picker-select:hover {
  background: #00e5ff;
  color: #04101e;
}

/* ==========================================================================
   Interactive Card Inspection Preview Modal
   ========================================================================== */

.card-preview-modal-content {
  width: 380px;
  max-width: 90vw;
  background: linear-gradient(145deg, #090e17 0%, #151d2f 100%);
  border: 2px solid var(--faction-color, #00e5ff);
  border-radius: 16px;
  box-shadow: 0 12px 50px rgba(0, 0, 0, 0.9), 0 0 30px var(--faction-color, rgba(0, 229, 255, 0.3));
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-preview-modal-header {
  padding: 10px 16px;
  background: rgba(15, 23, 42, 0.9);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.preview-header-badge {
  font-size: 12px;
  font-weight: 700;
  color: #f1f5f9;
}

.card-preview-modal-body {
  padding: 18px;
}

.card-preview-frame {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-preview-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.preview-cost-badge {
  background: linear-gradient(135deg, #0284c7 0%, #00e5ff 100%);
  color: #04101e;
  font-size: 15px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 20px;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
}

.preview-title-group {
  flex: 1;
}

.preview-card-name {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #f8fafc;
}

.preview-card-subtitle {
  font-size: 11px;
  color: #94a3b8;
}

.preview-faction-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
}

.preview-card-art {
  width: 100%;
  height: 150px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-card-art svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-art-fallback {
  font-size: 56px;
}

.preview-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #94a3b8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}

.preview-card-desc {
  font-size: 13px;
  line-height: 1.5;
  color: #f1f5f9;
  background: rgba(15, 23, 42, 0.6);
  padding: 10px 12px;
  border-radius: 8px;
  border-left: 3px solid var(--faction-color, #00e5ff);
}

.preview-card-stats {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.preview-stat-pill {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 700;
}

.preview-stat-pill.atk {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.preview-stat-pill.hp {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #4ade80;
}

.stat-num {
  font-size: 18px;
}

.stat-label {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.8;
}

/* ==========================================================================
   P2P Card Trading System Styling
   ========================================================================== */

/* Trade Invite Modal */
.trade-invite-modal-content {
  width: 440px;
  max-width: 92vw;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(16, 185, 129, 0.25);
  border-radius: 14px;
  overflow: hidden;
}

.trade-invite-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.trade-invite-icon {
  font-size: 28px;
}

.trade-invite-subtitle {
  font-size: 11px;
  color: #94a3b8;
}

.trade-invite-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.trade-invite-prompt {
  font-size: 14px;
  line-height: 1.5;
  color: #f1f5f9;
}

.trade-invite-prompt b {
  color: #00e5ff;
}

.trade-invite-actions {
  display: flex;
  gap: 12px;
}

.btn-accept-trade {
  flex: 1;
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #ffffff;
}

.btn-decline-trade {
  flex: 1;
}

/* Main P2P Trade Modal */
.rpg-trade-modal-content {
  width: 820px;
  max-width: 95vw;
  max-height: 90vh;
  background: linear-gradient(135deg, #090e1a 0%, #111b2f 100%);
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-radius: 16px;
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(0, 229, 255, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.trade-modal-header {
  padding: 12px 20px;
  background: rgba(15, 23, 42, 0.95);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.trade-header-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.trade-header-icon {
  font-size: 26px;
}

.trade-header-subtitle {
  font-size: 11px;
  color: #94a3b8;
}

.trade-partner-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(30, 41, 59, 0.7);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.partner-faction-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(0, 229, 255, 0.1);
}

/* Trade Center Status Banner */
.trade-status-banner-wrap {
  padding: 8px 20px;
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.trade-status-badge {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  transition: all 0.3s ease;
}

.trade-status-badge.negotiating {
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.3);
  color: #38bdf8;
}

.trade-status-badge.waiting {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.trade-status-badge.ready {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #34d399;
  animation: pulse-ready 1.5s infinite alternate;
}

@keyframes pulse-ready {
  0% { box-shadow: 0 0 10px rgba(16, 185, 129, 0.3); }
  100% { box-shadow: 0 0 20px rgba(16, 185, 129, 0.6); }
}

/* Modal Body */
.trade-modal-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

/* Dual Offer Columns */
.trade-offers-container {
  display: flex;
  align-items: stretch;
  gap: 14px;
}

.trade-offer-box {
  flex: 1;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trade-offer-box.my-offer {
  border-color: rgba(0, 229, 255, 0.3);
}

.trade-offer-box.partner-offer {
  border-color: rgba(168, 85, 247, 0.3);
}

.trade-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}

.trade-box-title {
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
}

.trade-lock-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.trade-lock-badge.unlocked {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.trade-lock-badge.locked {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

/* Trade Slot Cards */
.trade-slots-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  min-height: 120px;
}

.trade-slot-card {
  height: 60px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  font-size: 12px;
  position: relative;
  transition: all 0.2s ease;
}

.trade-slot-card.empty {
  background: rgba(30, 41, 59, 0.3);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  color: #64748b;
  user-select: none;
}

.trade-slot-card.filled {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid #00e5ff;
  color: #f8fafc;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: space-between;
}

.trade-slot-card.filled:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 229, 255, 0.3);
}

.trade-slot-card.filled.partner {
  border-color: #a855f7;
  cursor: default;
}

.slot-card-cost {
  color: #00e5ff;
  font-weight: 700;
  margin-right: 6px;
}

.slot-card-name {
  font-weight: 600;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-card-remove {
  color: #ef4444;
  font-weight: 800;
  font-size: 16px;
  margin-left: 6px;
}

.trade-exchange-divider {
  display: flex;
  align-items: center;
  justify-content: center;
}

.exchange-arrow-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(0, 229, 255, 0.4);
  color: #00e5ff;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.2);
}

/* Trade Gold Bar */
.trade-gold-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(30, 41, 59, 0.5);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
}

.trade-gold-input {
  width: 75px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffd700;
  font-weight: 700;
  padding: 4px 6px;
  border-radius: 4px;
  outline: none;
}

.trade-gold-input:focus {
  border-color: #ffd700;
}

.trade-max-gold-hint {
  color: #94a3b8;
  font-size: 11px;
}

.partner-gold-text {
  color: #ffd700;
  font-weight: 700;
}

/* Bottom Inventory Selection Tray */
.trade-inventory-section {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trade-inv-title {
  font-size: 12px;
  font-weight: 700;
  color: #cbd5e1;
}

.trade-inventory-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.trade-inventory-empty {
  color: #64748b;
  font-size: 12px;
  padding: 12px;
}

.trade-inv-card-item {
  min-width: 130px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.trade-inv-card-item:hover {
  transform: translateY(-2px);
  border-color: #00e5ff;
  background: rgba(30, 41, 59, 0.95);
  box-shadow: 0 4px 12px rgba(0, 229, 255, 0.25);
}

.trade-inv-card-cost {
  color: #00e5ff;
  font-size: 11px;
  font-weight: 700;
}

.trade-inv-card-name {
  font-size: 11px;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trade-inv-card-type {
  font-size: 10px;
  color: #94a3b8;
}

/* Footer Action Buttons */
.trade-modal-footer {
  padding: 12px 20px;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-lock {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  color: #04101e;
}

.btn-unlock {
  background: rgba(148, 163, 184, 0.2);
  color: #f1f5f9;
  border: 1px solid #94a3b8;
}

.btn-trade-confirm.ready {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #ffffff;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
  cursor: pointer;
}

.btn-trade-confirm.disabled {
  background: rgba(51, 65, 85, 0.5);
  color: #64748b;
  cursor: not-allowed;
  border: none;
}

/* =========================================================
   PVP DUEL INVITE MODAL & EPIC INTRO BANNER
========================================================= */

.rpg-duel-invite-content {
  max-width: 480px;
  background: linear-gradient(135deg, rgba(20, 5, 10, 0.96) 0%, rgba(30, 10, 20, 0.98) 100%);
  border: 1.5px solid rgba(255, 23, 68, 0.4);
  box-shadow: 0 0 35px rgba(255, 23, 68, 0.35), 0 20px 50px rgba(0, 0, 0, 0.8);
  border-radius: 16px;
  overflow: hidden;
  text-align: center;
}

.duel-invite-header {
  padding: 24px 20px 16px;
  background: linear-gradient(180deg, rgba(255, 23, 68, 0.2) 0%, transparent 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.duel-invite-icon {
  font-size: 3rem;
  filter: drop-shadow(0 0 15px #ff1744);
  animation: sword-clash 1.2s infinite ease-in-out alternate;
}

@keyframes sword-clash {
  0% { transform: scale(1) rotate(-6deg); }
  100% { transform: scale(1.15) rotate(6deg); }
}

.duel-invite-header h3 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 800;
  color: #ff5252;
  text-shadow: 0 0 12px rgba(255, 82, 82, 0.5);
}

.duel-invite-body {
  padding: 16px 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.duel-invite-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: #cbd5e1;
}

.duel-invite-text strong {
  color: #f8fafc;
  font-size: 17px;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

.duel-invite-faction-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
}

.duel-invite-subtext {
  margin: 0;
  font-size: 13px;
  color: #fbbf24;
  font-style: italic;
}

.duel-invite-actions {
  padding: 16px 24px 24px;
  display: flex;
  justify-content: center;
  gap: 16px;
}

.btn-pvp-accept {
  background: linear-gradient(135deg, #e11d48 0%, #ff1744 50%, #f97316 100%);
  color: #ffffff;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 0 20px rgba(255, 23, 68, 0.5);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-pvp-accept:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 0 30px rgba(255, 23, 68, 0.8);
}

.btn-pvp-decline {
  background: rgba(51, 65, 85, 0.6);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-pvp-decline:hover {
  background: rgba(71, 85, 105, 0.8);
  color: #f1f5f9;
}

/* Epic PvP Intro Banner Overlay */
.pvp-intro-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.pvp-intro-overlay.active {
  display: flex;
  animation: pvp-banner-fade 2.2s forwards cubic-bezier(0.16, 1, 0.3, 1);
}

.pvp-intro-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  transform: scale(0.6);
  animation: pvp-content-zoom 2.2s forwards cubic-bezier(0.16, 1, 0.3, 1);
}

.pvp-intro-swords {
  font-size: 5rem;
  filter: drop-shadow(0 0 25px #ff1744);
}

.pvp-intro-title {
  font-family: var(--font-title), var(--font-thai);
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: 4px;
  background: linear-gradient(135deg, #ff1744 0%, #ff9100 50%, #ffea00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 20px rgba(255, 23, 68, 0.8));
}

.pvp-intro-matchup {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 1.8rem;
  font-weight: 800;
}

.pvp-player-self {
  color: #00e5ff;
  text-shadow: 0 0 15px rgba(0, 229, 255, 0.7);
}

.pvp-vs-text {
  color: #ffea00;
  font-style: italic;
  font-size: 2rem;
  text-shadow: 0 0 15px rgba(255, 234, 0, 0.9);
}

.pvp-banner-opponent-name {
  color: #ff1744;
  text-shadow: 0 0 15px rgba(255, 23, 68, 0.7);
}

.pvp-banner-opponent-faction {
  font-size: 1.1rem;
  font-weight: 700;
  padding: 6px 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
}

@keyframes pvp-banner-fade {
  0% { opacity: 0; }
  15% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes pvp-content-zoom {
  0% { transform: scale(0.6); }
  20% { transform: scale(1.05); }
  35% { transform: scale(1); }
  80% { transform: scale(1.02); }
  100% { transform: scale(1.2); }
}

/* ==========================================================================
   Co-Op World Boss & Raid Battles (Phase 7)
   ========================================================================== */

/* Raid Lobby Modal */
.rpg-raid-lobby-content {
  max-width: 580px;
  background: linear-gradient(145deg, rgba(22, 10, 30, 0.97) 0%, rgba(10, 5, 18, 0.98) 100%);
  border: 2px solid rgba(255, 23, 68, 0.45);
  box-shadow: 0 0 45px rgba(255, 23, 68, 0.3), inset 0 0 25px rgba(255, 23, 68, 0.1);
  border-radius: 16px;
  overflow: hidden;
}

.raid-lobby-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  background: linear-gradient(90deg, rgba(255, 23, 68, 0.25) 0%, rgba(0, 0, 0, 0.4) 100%);
  border-bottom: 1px solid rgba(255, 23, 68, 0.3);
}

.raid-lobby-icon {
  font-size: 2.4rem;
  filter: drop-shadow(0 0 12px #ff1744);
}

.raid-lobby-subtitle {
  font-size: 0.82rem;
  color: #ff8a80;
  margin-top: 4px;
}

.raid-lobby-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.raid-boss-preview-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: rgba(255, 23, 68, 0.08);
  border: 1px solid rgba(255, 23, 68, 0.3);
  border-radius: 12px;
  padding: 16px;
}

.boss-portrait {
  font-size: 3rem;
  background: rgba(0, 0, 0, 0.5);
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid #ff1744;
  box-shadow: 0 0 20px rgba(255, 23, 68, 0.5);
  animation: pulse-boss-icon 2s infinite alternate;
}

@keyframes pulse-boss-icon {
  0% { transform: scale(1); box-shadow: 0 0 15px rgba(255, 23, 68, 0.4); }
  100% { transform: scale(1.06); box-shadow: 0 0 28px rgba(255, 23, 68, 0.8); }
}

.boss-info {
  flex: 1;
}

.boss-title {
  font-family: var(--font-title, sans-serif);
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: 1px;
  color: #ff5252;
  text-shadow: 0 0 10px rgba(255, 23, 68, 0.5);
}

.boss-type-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  color: #ffd700;
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid #ffd700;
  border-radius: 6px;
  padding: 2px 8px;
  margin: 4px 0 6px 0;
}

.boss-desc {
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.4;
}

.raid-participants-section h4 {
  font-size: 0.92rem;
  color: #94a3b8;
  margin-bottom: 10px;
}

.raid-participants-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.raid-participant-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}

.raid-participant-chip.active-self {
  border-color: #00e5ff;
  background: rgba(0, 229, 255, 0.1);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.2);
}

.chip-avatar {
  font-size: 1.3rem;
}

.chip-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #f8fafc;
}

.chip-status {
  font-size: 0.72rem;
  color: #4ade80;
}

.raid-lobby-footer {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  justify-content: flex-end;
}

.btn-raid-enter {
  background: linear-gradient(135deg, #ff1744 0%, #d50000 50%, #ff6d00 100%);
  border: 1px solid #ff5252;
  box-shadow: 0 0 20px rgba(255, 23, 68, 0.5);
  font-weight: 800;
}

.btn-raid-enter:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(255, 23, 68, 0.8);
}

/* Colossal Raid Boss Combat HUD */
.rpg-raid-hud-container {
  display: none;
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 720px;
  max-width: 92vw;
  z-index: 120;
  pointer-events: none;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.rpg-raid-hud-container.active {
  display: flex;
}

.raid-hud-boss-bar-panel {
  width: 100%;
  background: rgba(10, 15, 28, 0.94);
  backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255, 23, 68, 0.6);
  box-shadow: 0 0 25px rgba(255, 23, 68, 0.35), 0 8px 30px rgba(0, 0, 0, 0.7);
  border-radius: 14px;
  padding: 10px 18px 12px 18px;
  pointer-events: auto;
}

.boss-hud-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.boss-hud-header .boss-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}

.raid-phase-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 12px;
  letter-spacing: 0.5px;
}

.raid-phase-badge.normal {
  background: rgba(0, 229, 255, 0.18);
  border: 1px solid #00e5ff;
  color: #00e5ff;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.raid-phase-badge.enraged {
  background: rgba(255, 23, 68, 0.35);
  border: 1px solid #ff1744;
  color: #ff5252;
  box-shadow: 0 0 18px rgba(255, 23, 68, 0.7);
  animation: flash-enrage 0.6s infinite alternate;
}

@keyframes flash-enrage {
  0% { transform: scale(1); opacity: 0.85; }
  100% { transform: scale(1.05); opacity: 1; }
}

.boss-hp-track {
  width: 100%;
  height: 20px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  position: relative;
}

.boss-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff1744 0%, #ff5252 60%, #ff9100 100%);
  border-radius: 10px;
  transition: width 0.35s ease-out;
  box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.4), 0 0 12px rgba(255, 23, 68, 0.7);
}

.boss-hp-fill.enraged {
  background: linear-gradient(90deg, #d50000 0%, #ff1744 40%, #ff007f 100%);
  animation: pulse-enraged 0.8s infinite alternate;
}

@keyframes pulse-enraged {
  0% { filter: brightness(1) drop-shadow(0 0 5px #ff1744); }
  100% { filter: brightness(1.3) drop-shadow(0 0 15px #ff007f); }
}

.boss-hp-text {
  text-align: center;
  font-family: var(--font-title, sans-serif);
  font-size: 0.78rem;
  font-weight: 800;
  color: #ffd700;
  margin-top: 4px;
  letter-spacing: 0.5px;
}

/* Live DPS Contribution Scoreboard */
.raid-dps-leaderboard {
  position: fixed;
  right: 20px;
  top: 130px;
  width: 220px;
  background: rgba(10, 15, 28, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 23, 68, 0.35);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  pointer-events: auto;
  z-index: 121;
}

.dps-header {
  font-size: 0.8rem;
  font-weight: 800;
  color: #ff8a80;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 4px;
}

.dps-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.raid-dps-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.raid-dps-item.rank-1 .dps-rank { color: #ffd700; font-weight: 900; }
.raid-dps-item.rank-2 .dps-rank { color: #c0c0c0; font-weight: 800; }
.raid-dps-item.rank-3 .dps-rank { color: #cd7f32; font-weight: 800; }

.dps-name {
  flex: 1;
  margin-left: 6px;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dps-value {
  font-family: monospace;
  font-weight: 700;
  color: #ff5252;
}

.arena-backdrop.enrage-flash {
  animation: enrage-screen-flash 1.5s ease-out;
}

@keyframes enrage-screen-flash {
  0% { box-shadow: inset 0 0 120px rgba(255, 23, 68, 0.9); }
  50% { box-shadow: inset 0 0 160px rgba(255, 23, 68, 0.7); }
  100% { box-shadow: inset 0 0 0px transparent; }
}

/* =========================================================
   PHASE 8: GUILD & CLAN SYSTEM, OUTPOSTS & SHARED VAULT
========================================================= */

/* Top HUD Guild Button */
.btn-rpg-action.btn-guild {
  background: linear-gradient(135deg, #78350f 0%, #b45309 50%, #d97706 100%);
  border: 1px solid #f59e0b;
  color: #fffbeb;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
  font-weight: 700;
  transition: all 0.2s ease;
}

.btn-rpg-action.btn-guild:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #92400e 0%, #d97706 50%, #f59e0b 100%);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
  border-color: #fde68a;
}

/* Guild Modal Dialog */
.rpg-guild-content {
  width: 900px;
  max-width: 95vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96) 0%, rgba(10, 15, 26, 0.98) 100%);
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(245, 158, 11, 0.2);
  border-radius: 16px;
  overflow: hidden;
}

.guild-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: linear-gradient(90deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.8) 100%);
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
}

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

.guild-title-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.6));
}

.guild-dialog-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fde68a;
  letter-spacing: 0.5px;
}

.guild-dialog-subtitle {
  margin: 4px 0 0 0;
  font-size: 0.8rem;
  color: #94a3b8;
}

/* Guild Tabs Navigation */
.guild-tabs-nav {
  display: flex;
  gap: 8px;
  padding: 10px 24px;
  background: rgba(10, 15, 26, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
}

.guild-tab-btn {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.guild-tab-btn:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fef3c7;
}

.guild-tab-btn.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3) 0%, rgba(217, 119, 6, 0.4) 100%);
  border-color: #f59e0b;
  color: #fef08a;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

/* Modal Body Content */
.guild-tab-content-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  color: #e2e8f0;
}

/* Overview Panel */
.guild-overview-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.guild-banner-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 14px;
  padding: 20px 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.guild-crest-big {
  font-size: 4rem;
  line-height: 1;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.25) 0%, transparent 70%);
  padding: 12px;
  border-radius: 50%;
  border: 2px solid rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.3);
}

.guild-hero-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.guild-tag-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0f172a;
  font-weight: 900;
  font-size: 0.95rem;
  padding: 3px 10px;
  border-radius: 6px;
  letter-spacing: 1px;
}

.guild-name {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: #f8fafc;
}

.guild-level-badge {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid #3b82f6;
  color: #60a5fa;
  font-weight: 800;
  font-size: 0.82rem;
  padding: 3px 8px;
  border-radius: 6px;
}

.guild-exp-wrap {
  position: relative;
  width: 100%;
  height: 18px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 4px;
}

.guild-exp-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #06b6d4 100%);
  transition: width 0.3s ease;
}

.guild-exp-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.guild-motd-text {
  margin: 4px 0 0 0;
  font-size: 0.85rem;
  color: #cbd5e1;
}

/* Stats Row */
.guild-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.guild-stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px 10px;
}

.guild-stat-box .stat-icon {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.guild-stat-box .stat-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fde68a;
}

.guild-stat-box .stat-lbl {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 2px;
}

/* Deposit Box */
.guild-deposit-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 12px;
  padding: 16px 20px;
}

.guild-deposit-box h4 {
  margin: 0 0 12px 0;
  font-size: 0.92rem;
  color: #fbbf24;
}

.deposit-inputs-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.deposit-gold-input {
  width: 130px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}

.btn-deposit {
  padding: 8px 16px;
  background: linear-gradient(135deg, #d97706, #b45309);
  border: 1px solid #f59e0b;
  border-radius: 8px;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-deposit:hover {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  transform: translateY(-1px);
}

.guild-action-links {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.btn-leave-guild {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-leave-guild:hover {
  background: rgba(239, 68, 68, 0.35);
  border-color: #ef4444;
  color: #fff;
}

/* Roster Table */
.guild-roster-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.roster-table-wrap {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
}

.guild-roster-table {
  width: 100%;
  border-collapse: collapse;
}

.guild-roster-table th,
.guild-roster-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.guild-roster-table th {
  background: rgba(30, 41, 59, 0.8);
  font-size: 0.78rem;
  color: #94a3b8;
  text-transform: uppercase;
}

.roster-rank-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
}

.roster-rank-badge.leader {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid #f59e0b;
  color: #fbbf24;
}

.roster-rank-badge.member {
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid #64748b;
  color: #cbd5e1;
}

.btn-kick-member {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid #ef4444;
  color: #fca5a5;
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}

/* Communal Vault */
.guild-vault-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.vault-summary-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: rgba(30, 41, 59, 0.6);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.vault-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  max-height: 280px;
  overflow-y: auto;
  padding: 6px;
}

.guild-vault-card-item {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s ease;
}

.guild-vault-card-item:hover {
  transform: translateY(-2px);
  border-color: #f59e0b;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.2);
}

.vault-card-thumb {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vault-card-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #f8fafc;
}

.vault-card-depositor {
  font-size: 0.68rem;
  color: #94a3b8;
}

.btn-withdraw-card {
  padding: 5px 10px;
  background: linear-gradient(135deg, #059669, #047857);
  border: 1px solid #10b981;
  color: #fff;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.vault-deposit-section {
  background: rgba(15, 23, 42, 0.7);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.inventory-deposit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  max-height: 200px;
  overflow-y: auto;
  margin-top: 10px;
  padding: 4px;
}

.btn-deposit-card {
  padding: 5px 10px;
  background: linear-gradient(135deg, #d97706, #b45309);
  border: 1px solid #f59e0b;
  color: #fff;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

/* Territory Panel */
.guild-territory-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.territory-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.territory-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.territory-card.claimed-by-me {
  border-color: #f59e0b;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.25);
}

.territory-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  align-self: flex-start;
}

.territory-badge.unclaimed {
  background: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  border: 1px solid #64748b;
}

.territory-badge.claimed {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid #ef4444;
}

.territory-badge.my-guild {
  background: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
  border: 1px solid #f59e0b;
}

.territory-perk-text {
  font-size: 0.78rem;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  padding: 6px 10px;
  border-radius: 6px;
  border-left: 3px solid #38bdf8;
}

.btn-claim-outpost {
  margin-top: auto;
  padding: 8px 14px;
  background: linear-gradient(135deg, #b45309, #78350f);
  border: 1px solid #f59e0b;
  border-radius: 8px;
  color: #fef3c7;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-claim-outpost:hover {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0f172a;
}

/* Create & Directory */
.guild-create-directory-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.create-guild-card,
.public-guild-directory {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.crest-picker-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.crest-option-btn {
  font-size: 1.4rem;
  padding: 6px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.crest-option-btn:hover,
.crest-option-btn.selected {
  background: rgba(245, 158, 11, 0.25);
  border-color: #f59e0b;
  transform: scale(1.1);
}

.btn-create-guild {
  padding: 10px 18px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border: 1px solid #fde68a;
  border-radius: 8px;
  color: #0f172a;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
  transition: all 0.2s ease;
}

.btn-create-guild:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
}

.public-guilds-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
}

.public-guild-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  transition: all 0.2s ease;
}

.public-guild-card:hover {
  border-color: rgba(245, 158, 11, 0.4);
}

.btn-join-guild {
  padding: 6px 12px;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid #3b82f6;
  border-radius: 6px;
  color: #93c5fd;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
}

.btn-join-guild:hover {
  background: #3b82f6;
  color: #fff;
}

/* Chat Guild Channel Styling */
.chat-channel-tab[data-channel="guild"] {
  border-color: rgba(245, 158, 11, 0.4);
}

.chat-channel-tab[data-channel="guild"].active {
  background: rgba(245, 158, 11, 0.25);
  color: #fde68a;
  border-color: #f59e0b;
}

.mmo-chat-msg.guild {
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid #f59e0b;
}

.mmo-chat-msg.guild .chat-channel-badge {
  background: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
}

/* ==========================================================================
   NEXUS STREET BAZAAR & CARD VENDING STALL SYSTEM
   ========================================================================== */

/* Top HUD Vending Action Button */
.btn-rpg-action.btn-vending {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(217, 119, 6, 0.28) 100%);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fde68a;
}

.btn-rpg-action.btn-vending:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.35) 0%, rgba(217, 119, 6, 0.5) 100%);
  border-color: #f59e0b;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.4);
  transform: translateY(-1px);
}

/* World Map Floating Active Vending Status Bar */
.rpg-vending-status-bar {
  position: absolute;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: rgba(18, 12, 5, 0.94);
  border: 1.5px solid #f59e0b;
  border-radius: 30px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7), 0 0 20px rgba(245, 158, 11, 0.35);
  backdrop-filter: blur(10px);
  animation: vendingBarPulse 3s infinite ease-in-out;
}

@keyframes vendingBarPulse {
  0%, 100% { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7), 0 0 16px rgba(245, 158, 11, 0.25); }
  50% { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7), 0 0 26px rgba(245, 158, 11, 0.55); }
}

.status-stall-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-stall-cart {
  font-size: 1.3rem;
}

.status-stall-title {
  color: #fff7ed;
  font-size: 0.92rem;
  font-weight: 700;
}

.status-stall-title b {
  color: #fbbf24;
}

.status-stall-earnings {
  color: #86efac;
  font-size: 0.85rem;
  font-weight: 700;
  background: rgba(34, 197, 94, 0.15);
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.btn-mini-close-stall {
  padding: 6px 14px;
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  border: 1px solid #f87171;
  border-radius: 16px;
  color: #fff;
  font-weight: 800;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-mini-close-stall:hover {
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
}

/* Vending Setup & Browse Modals */
.rpg-vending-setup-content,
.rpg-vending-browse-content {
  max-width: 780px;
  width: 92%;
  background: rgba(15, 17, 26, 0.97);
  border: 1.5px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(245, 158, 11, 0.15);
  border-radius: 16px;
}

.vending-modal-header,
.vending-browse-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
  background: rgba(245, 158, 11, 0.06);
}

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

.vending-title-icon {
  font-size: 2rem;
}

.vending-dialog-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fde68a;
  margin: 0;
}

.vending-dialog-subtitle {
  font-size: 0.82rem;
  color: #94a3b8;
  margin: 4px 0 0 0;
}

/* Vending Setup Body */
.vending-setup-body {
  padding: 20px 22px;
  max-height: 72vh;
  overflow-y: auto;
}

.vending-setup-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.vending-notice-badge {
  background: rgba(245, 158, 11, 0.12);
  border-left: 3px solid #f59e0b;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #fde68a;
}

.shop-title-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shop-title-group label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #cbd5e1;
}

.vending-title-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(30, 41, 59, 0.7);
  border: 1.5px solid rgba(245, 158, 11, 0.35);
  border-radius: 8px;
  color: #fff;
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.vending-title-input:focus {
  outline: none;
  border-color: #f59e0b;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
}

.vending-cards-selection-section h4 {
  font-size: 0.92rem;
  color: #e2e8f0;
  margin: 0 0 10px 0;
}

.vending-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.vending-card-slot {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

.vending-card-slot:hover {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(30, 41, 59, 0.85);
}

.vending-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.vending-card-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #f59e0b;
}

.vending-slot-card-preview {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.slot-cost {
  font-size: 0.75rem;
  font-weight: 800;
  color: #38bdf8;
}

.slot-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
}

.slot-stock {
  font-size: 0.75rem;
  color: #94a3b8;
}

.price-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 28px;
}

.vending-price-input {
  width: 90px;
  padding: 4px 8px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 6px;
  color: #fbbf24;
  font-weight: 800;
  font-size: 0.85rem;
}

.vending-setup-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.selected-summary {
  font-size: 0.9rem;
  font-weight: 700;
  color: #38bdf8;
}

.btn-vending-open {
  padding: 10px 22px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border: 1px solid #fde68a;
  border-radius: 8px;
  color: #0f172a;
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
  transition: all 0.2s ease;
}

.btn-vending-open:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
}

.btn-vending-open:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Vending Browse Modal Styling */
.vending-browse-body {
  padding: 20px 22px;
  max-height: 72vh;
  overflow-y: auto;
}

.vending-browse-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.vending-vendor-header {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(24, 18, 10, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 12px;
  padding: 14px 18px;
}

.vendor-avatar {
  font-size: 2.5rem;
}

.vendor-meta {
  flex: 1;
}

.vendor-shop-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fde68a;
  margin: 0 0 6px 0;
}

.vendor-details {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: #cbd5e1;
  flex-wrap: wrap;
}

.vendor-title-badge {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 0.78rem;
  font-weight: 700;
}

.vendor-gold-status {
  color: #ffd700;
  font-weight: 700;
}

.btn-stall-close {
  padding: 8px 16px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid #ef4444;
  border-radius: 8px;
  color: #fca5a5;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-stall-close:hover {
  background: #ef4444;
  color: #fff;
}

.vending-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.vending-item-card {
  background: rgba(30, 41, 59, 0.75);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
  position: relative;
}

.vending-item-card:hover {
  transform: translateY(-3px);
  border-color: #f59e0b;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 16px rgba(245, 158, 11, 0.2);
}

.vending-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vending-item-cost {
  font-size: 0.85rem;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
}

.vending-item-type {
  font-size: 0.75rem;
  color: #94a3b8;
  text-transform: uppercase;
  font-weight: 700;
}

.vending-item-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
}

.vending-item-desc {
  font-size: 0.78rem;
  color: #cbd5e1;
  line-height: 1.4;
  flex: 1;
}

.vending-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.vending-price-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #fbbf24;
  font-weight: 800;
  font-size: 0.9rem;
}

.btn-buy-vending-item {
  padding: 5px 12px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: 1px solid #6ee7b7;
  border-radius: 6px;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-buy-vending-item:hover:not(:disabled) {
  transform: scale(1.06);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
}

.btn-buy-vending-item.disabled,
.btn-buy-vending-item:disabled {
  background: rgba(100, 116, 139, 0.3);
  border-color: rgba(100, 116, 139, 0.4);
  color: #94a3b8;
  cursor: not-allowed;
}

.owner-item-badge {
  font-size: 0.75rem;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 700;
}

.vending-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
}

.vending-empty-state .empty-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 12px;
}

/* ==========================================================================
   FANTASY EQUIPMENT & WARDROBE SYSTEM (COSTUME & PAPERDOLL PREVIEW)
   ========================================================================== */

.btn-rpg-action.btn-wardrobe {
  background: linear-gradient(135deg, #d946ef 0%, #ec4899 50%, #f43f5e 100%);
  color: #ffffff;
  border: 1px solid rgba(244, 114, 182, 0.6);
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.4);
  font-weight: 700;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-rpg-action.btn-wardrobe:hover {
  background: linear-gradient(135deg, #e879f9 0%, #f472b6 50%, #fb7185 100%);
  box-shadow: 0 0 20px rgba(244, 114, 182, 0.7);
  transform: translateY(-2px) scale(1.04);
}

.rpg-wardrobe-content {
  max-width: 960px;
  width: 95%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96) 0%, rgba(26, 16, 48, 0.96) 100%);
  border: 1px solid rgba(217, 70, 239, 0.4);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(217, 70, 239, 0.25);
  border-radius: 16px;
  overflow: hidden;
}

.wardrobe-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: linear-gradient(90deg, rgba(30, 20, 56, 0.95), rgba(15, 23, 42, 0.95));
  border-bottom: 1px solid rgba(217, 70, 239, 0.3);
}

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

.wardrobe-title-icon {
  font-size: 2.2rem;
  filter: drop-shadow(0 0 10px rgba(236, 72, 153, 0.7));
}

.wardrobe-dialog-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 800;
  background: linear-gradient(90deg, #f472b6, #e879f9, #ffd700);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 15px rgba(244, 114, 182, 0.3);
}

.wardrobe-dialog-subtitle {
  margin: 2px 0 0 0;
  font-size: 0.85rem;
  color: #cbd5e1;
}

.wardrobe-modal-body {
  display: flex;
  flex-direction: row;
  gap: 20px;
  padding: 20px;
  overflow-y: auto;
  min-height: 520px;
}

/* Left: Avatar Paperdoll Preview Panel */
.wardrobe-preview-panel {
  flex: 0 0 290px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(10, 15, 30, 0.65);
  border: 1px solid rgba(217, 70, 239, 0.25);
  border-radius: 14px;
  padding: 16px;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.6);
}

.preview-stage-wrap {
  position: relative;
  width: 260px;
  height: 320px;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 60%, rgba(59, 20, 80, 0.6) 0%, rgba(10, 12, 24, 0.95) 75%);
  border: 1px solid rgba(244, 114, 182, 0.3);
  box-shadow: 0 0 25px rgba(217, 70, 239, 0.2), inset 0 0 20px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

#wardrobe-preview-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 260px;
  height: 320px;
  z-index: 1;
}

.preview-pedestal-label {
  position: relative;
  z-index: 2;
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
  letter-spacing: 1px;
  margin-bottom: 8px;
  padding: 3px 12px;
  background: rgba(15, 23, 42, 0.75);
  border-radius: 20px;
  border: 1px solid rgba(255, 215, 0, 0.4);
}

.wardrobe-equipped-summary {
  width: 100%;
  margin-top: 14px;
}

.equipped-slots-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.equipped-slot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(15, 23, 42, 0.8);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
}

.equipped-slot-label {
  color: #94a3b8;
  font-weight: 600;
}

.equipped-slot-val {
  color: #f1f5f9;
  font-weight: 700;
}

/* Right: Selection & Inventory Showcase Panel */
.wardrobe-selection-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.wardrobe-tabs-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

.wardrobe-tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wardrobe-tab-btn:hover {
  background: rgba(51, 65, 85, 0.8);
  color: #f8fafc;
  border-color: rgba(217, 70, 239, 0.5);
  transform: translateY(-1px);
}

.wardrobe-tab-btn.active {
  background: linear-gradient(135deg, rgba(217, 70, 239, 0.3) 0%, rgba(236, 72, 153, 0.25) 100%);
  border: 1px solid #ec4899;
  color: #ffffff;
  box-shadow: 0 0 15px rgba(236, 72, 153, 0.35);
}

.wardrobe-items-container {
  flex: 1;
  overflow-y: auto;
  max-height: 480px;
  padding-right: 6px;
}

.wardrobe-category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 4px 0;
}

.wardrobe-category-header h4 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #f1f5f9;
}

.wardrobe-category-header .category-count-badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  background: rgba(217, 70, 239, 0.25);
  border: 1px solid rgba(217, 70, 239, 0.5);
  border-radius: 12px;
  color: #f472b6;
  font-weight: 700;
}

.wardrobe-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

/* Individual Costume Item Card */
.wardrobe-card-item {
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 12px;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.wardrobe-card-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
  border-color: rgba(244, 114, 182, 0.5);
}

.wardrobe-card-item.is-equipped {
  border: 1px solid #00e676;
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.08) 0%, rgba(15, 23, 42, 0.9) 100%);
  box-shadow: 0 0 15px rgba(0, 230, 118, 0.25);
}

.wardrobe-card-item.rarity-divine {
  border-color: rgba(255, 215, 0, 0.6);
}
.wardrobe-card-item.rarity-divine:hover {
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.wardrobe-card-item.rarity-mythic {
  border-color: rgba(189, 0, 255, 0.6);
}
.wardrobe-card-item.rarity-mythic:hover {
  box-shadow: 0 0 20px rgba(189, 0, 255, 0.4);
}

.wardrobe-card-item.rarity-epic {
  border-color: rgba(0, 230, 118, 0.5);
}

.wardrobe-card-item.rarity-rare {
  border-color: rgba(0, 229, 255, 0.4);
}

.item-card-top {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.item-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.item-title-meta {
  flex: 1;
  min-width: 0;
}

.item-thai-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-sub-name {
  font-size: 0.72rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-rarity-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  margin-top: 3px;
}

.rarity-tag-divine {
  background: rgba(255, 215, 0, 0.2);
  color: #ffd700;
  border: 1px solid rgba(255, 215, 0, 0.6);
}

.rarity-tag-mythic {
  background: rgba(189, 0, 255, 0.2);
  color: #e040fb;
  border: 1px solid rgba(189, 0, 255, 0.6);
}

.rarity-tag-epic {
  background: rgba(0, 230, 118, 0.2);
  color: #69f0ae;
  border: 1px solid rgba(0, 230, 118, 0.6);
}

.rarity-tag-rare {
  background: rgba(0, 229, 255, 0.2);
  color: #80d8ff;
  border: 1px solid rgba(0, 229, 255, 0.6);
}

.item-card-desc {
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.35;
  margin-bottom: 10px;
  flex: 1;
}

.item-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.equipped-status-badge {
  font-size: 0.75rem;
  font-weight: 800;
  color: #00e676;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-item-equip {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: 1px solid #38bdf8;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-item-equip:hover {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.btn-item-unequip {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-item-unequip:hover {
  background: rgba(239, 68, 68, 0.4);
  color: #ffffff;
}

.btn-item-buy {
  background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
  color: #0f172a;
  border: 1px solid #fde047;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-item-buy:hover:not(:disabled) {
  background: linear-gradient(135deg, #facc15 0%, #eab308 100%);
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.5);
}

.btn-item-buy.disabled,
.btn-item-buy:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.7);
}

@media (max-width: 768px) {
  .wardrobe-modal-body {
    flex-direction: column;
    align-items: center;
  }
  .wardrobe-preview-panel {
    width: 100%;
    flex: none;
  }
}

/* ==========================================================================
   MMO LIFESTYLE: FANTASY FARM, CRAFTING, CARD FUSION & GACHA SYSTEM
   ========================================================================== */

/* HUD Action Buttons */
.btn-rpg-action.btn-farm {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: 1px solid rgba(52, 211, 153, 0.6);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
  font-weight: 700;
  transition: all 0.2s ease;
}
.btn-rpg-action.btn-farm:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  box-shadow: 0 0 16px rgba(52, 211, 153, 0.6);
  transform: translateY(-2px);
}

.btn-rpg-action.btn-craft {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0f172a;
  border: 1px solid rgba(251, 191, 36, 0.7);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
  font-weight: 800;
  transition: all 0.2s ease;
}
.btn-rpg-action.btn-craft:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.6);
  transform: translateY(-2px);
}

.btn-rpg-action.btn-gacha {
  background: linear-gradient(135deg, #8b5cf6 0%, #d946ef 50%, #ec4899 100%);
  color: #ffffff;
  border: 1px solid rgba(236, 72, 153, 0.7);
  box-shadow: 0 0 12px rgba(217, 70, 239, 0.45);
  font-weight: 800;
  transition: all 0.2s ease;
}
.btn-rpg-action.btn-gacha:hover {
  background: linear-gradient(135deg, #a78bfa 0%, #e879f9 50%, #f472b6 100%);
  box-shadow: 0 0 20px rgba(236, 72, 153, 0.75);
  transform: translateY(-2px) scale(1.04);
}

/* 1. Fantasy Farm Modal */
.rpg-farm-content {
  max-width: 920px;
  width: 95%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96) 0%, rgba(13, 35, 26, 0.96) 100%);
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(16, 185, 129, 0.25);
  border-radius: 16px;
  overflow: hidden;
}

.farm-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: linear-gradient(90deg, rgba(20, 48, 36, 0.95), rgba(15, 23, 42, 0.95));
  border-bottom: 1px solid rgba(16, 185, 129, 0.3);
}

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

.farm-title-icon {
  font-size: 2.2rem;
  filter: drop-shadow(0 0 10px rgba(52, 211, 153, 0.6));
}

.farm-dialog-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 800;
  background: linear-gradient(90deg, #34d399, #a7f3d0, #ffd700);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.farm-dialog-subtitle {
  margin: 2px 0 0 0;
  font-size: 0.85rem;
  color: #cbd5e1;
}

.farm-modal-body {
  display: flex;
  flex-direction: row;
  gap: 20px;
  padding: 20px;
  overflow-y: auto;
}

.farm-plots-container {
  flex: 1;
}

.farm-plots-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.farm-plots-header h4 {
  margin: 0;
  color: #f1f5f9;
  font-size: 1.1rem;
}

.farm-tip {
  font-size: 0.78rem;
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  padding: 3px 8px;
  border-radius: 6px;
}

.farm-plots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.farm-plot-card {
  background: rgba(20, 29, 47, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: all 0.25s ease;
}

.farm-plot-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.farm-plot-card.plot-ready {
  border-color: #00e676;
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.12) 0%, rgba(15, 23, 42, 0.9) 100%);
  box-shadow: 0 0 15px rgba(0, 230, 118, 0.25);
}

.plot-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.plot-name {
  font-weight: 700;
  color: #ffffff;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.plot-sub {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-bottom: 12px;
}

.plot-progress-wrap {
  width: 100%;
  height: 6px;
  background: rgba(15, 23, 42, 0.8);
  border-radius: 3px;
  overflow: hidden;
  margin: 6px 0;
}

.plot-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #34d399);
  transition: width 0.3s ease;
}

.plot-time-text {
  font-size: 0.75rem;
  color: #6ee7b7;
  margin-bottom: 10px;
}

.plot-status-badge.ready-badge {
  font-size: 0.8rem;
  font-weight: 800;
  color: #00e676;
  margin-bottom: 10px;
}

.btn-farm-action {
  width: 100%;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-plot-plant {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
}
.btn-plot-plant:hover {
  background: linear-gradient(135deg, #34d399, #10b981);
}

.btn-plot-water {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
}
.btn-plot-water:hover:not(:disabled) {
  background: linear-gradient(135deg, #38bdf8, #0284c7);
}
.btn-plot-water.disabled,
.btn-plot-water:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-plot-harvest {
  background: linear-gradient(135deg, #ffd700, #ff8f00);
  color: #0f172a;
  animation: harvestPulse 1.5s infinite ease-in-out;
}
@keyframes harvestPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 10px rgba(255, 215, 0, 0.4); }
  50% { transform: scale(1.03); box-shadow: 0 0 18px rgba(255, 215, 0, 0.8); }
}

.farm-seeds-drawer {
  flex: 0 0 250px;
  background: rgba(10, 16, 28, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px;
}

.seeds-header h4 {
  margin: 0 0 12px 0;
  font-size: 0.95rem;
  color: #cbd5e1;
}

.seed-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: rgba(20, 29, 47, 0.6);
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.seed-item-row.empty-seed {
  opacity: 0.4;
  filter: grayscale(0.8);
}

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

.seed-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #f1f5f9;
}

.seed-count {
  font-size: 0.75rem;
  color: #94a3b8;
}

/* 2. Crafting & Alchemy Workshop Modal */
.rpg-craft-content {
  max-width: 900px;
  width: 95%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96) 0%, rgba(36, 25, 16, 0.96) 100%);
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(245, 158, 11, 0.25);
  border-radius: 16px;
  overflow: hidden;
}

.craft-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: linear-gradient(90deg, rgba(48, 32, 16, 0.95), rgba(15, 23, 42, 0.95));
  border-bottom: 1px solid rgba(245, 158, 11, 0.3);
}

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

.craft-title-icon {
  font-size: 2.2rem;
  filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.6));
}

.craft-dialog-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 800;
  background: linear-gradient(90deg, #fbbf24, #f59e0b, #ffd700);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.craft-dialog-subtitle {
  margin: 2px 0 0 0;
  font-size: 0.85rem;
  color: #cbd5e1;
}

.craft-modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  overflow-y: auto;
}

.craft-tabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

.craft-tab-btn {
  padding: 8px 16px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.craft-tab-btn.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(217, 119, 6, 0.3) 100%);
  border-color: #f59e0b;
  color: #fbbf24;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.35);
}

.craft-recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.craft-recipe-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.craft-recipe-card.can-craft {
  border-color: rgba(245, 158, 11, 0.5);
}

.recipe-top {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.recipe-icon {
  font-size: 2rem;
}

.recipe-title {
  margin: 0;
  font-size: 0.95rem;
  color: #ffffff;
}

.recipe-desc {
  margin: 2px 0 0 0;
  font-size: 0.75rem;
  color: #94a3b8;
}

.recipe-cost-wrap {
  font-size: 0.78rem;
  background: rgba(0, 0, 0, 0.4);
  padding: 8px;
  border-radius: 6px;
  margin-bottom: 12px;
  line-height: 1.4;
}

.btn-craft-execute {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0f172a;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-craft-execute:hover:not(:disabled) {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
}

.btn-craft-execute.disabled,
.btn-craft-execute:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 3. Aether Card Gacha Portal Modal */
.rpg-gacha-content {
  max-width: 860px;
  width: 95%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 10, 48, 0.98) 100%);
  border: 1px solid rgba(217, 70, 239, 0.45);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 40px rgba(217, 70, 239, 0.3);
  border-radius: 16px;
  overflow: hidden;
}

.gacha-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: linear-gradient(90deg, rgba(40, 15, 60, 0.95), rgba(15, 23, 42, 0.95));
  border-bottom: 1px solid rgba(217, 70, 239, 0.3);
}

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

.gacha-title-icon {
  font-size: 2.2rem;
  filter: drop-shadow(0 0 12px rgba(236, 72, 153, 0.8));
}

.gacha-dialog-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 800;
  background: linear-gradient(90deg, #e879f9, #f472b6, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gacha-dialog-subtitle {
  margin: 2px 0 0 0;
  font-size: 0.85rem;
  color: #cbd5e1;
}

.gacha-modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  overflow-y: auto;
  gap: 20px;
}

.gacha-banner-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.gacha-portal-crystal {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 70, 239, 0.35) 0%, rgba(15, 23, 42, 0.8) 70%);
  border: 2px solid rgba(236, 72, 153, 0.5);
  box-shadow: 0 0 35px rgba(217, 70, 239, 0.4), inset 0 0 30px rgba(139, 92, 246, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  animation: crystalPulse 3s infinite ease-in-out;
}
@keyframes crystalPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 35px rgba(217, 70, 239, 0.4); }
  50% { transform: scale(1.05); box-shadow: 0 0 50px rgba(236, 72, 153, 0.7); }
}

.crystal-orb {
  font-size: 5rem;
  filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.8));
}

.gacha-rates-badge {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  font-size: 0.7rem;
  font-weight: 800;
}
.rate-divine { color: #ffd700; background: rgba(255, 215, 0, 0.2); padding: 2px 6px; border-radius: 4px; }
.rate-epic { color: #e040fb; background: rgba(189, 0, 255, 0.2); padding: 2px 6px; border-radius: 4px; }
.rate-rare { color: #38bdf8; background: rgba(56, 189, 248, 0.2); padding: 2px 6px; border-radius: 4px; }
.rate-common { color: #cbd5e1; background: rgba(255, 255, 255, 0.1); padding: 2px 6px; border-radius: 4px; }

.gacha-status-row {
  display: flex;
  gap: 14px;
}

.currency-pill {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.88rem;
  color: #ffd700;
}

.gacha-action-row {
  display: flex;
  gap: 16px;
}

.btn-gacha-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 24px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-pull-single {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  border: 1px solid #38bdf8;
}
.btn-pull-single:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.5);
}

.btn-pull-multi {
  background: linear-gradient(135deg, #d946ef, #ec4899);
  color: #ffffff;
  border: 1px solid #f472b6;
  box-shadow: 0 0 15px rgba(217, 70, 239, 0.4);
}
.btn-pull-multi:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 0 25px rgba(236, 72, 153, 0.7);
}

.btn-gacha-action span {
  font-size: 1rem;
  font-weight: 800;
}

.btn-gacha-action small {
  font-size: 0.75rem;
  opacity: 0.9;
  margin-top: 2px;
}

.gacha-cards-result {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  max-height: 280px;
  overflow-y: auto;
  padding: 10px;
}

.gacha-result-card {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: cardFlipReveal 0.4s ease forwards;
}

@keyframes cardFlipReveal {
  0% { transform: scale(0.6) rotateY(90deg); opacity: 0; }
  100% { transform: scale(1) rotateY(0deg); opacity: 1; }
}

.gacha-result-card.rarity-divine { border-color: #ffd700; box-shadow: 0 0 15px rgba(255, 215, 0, 0.5); }
.gacha-result-card.rarity-epic { border-color: #bd00ff; box-shadow: 0 0 15px rgba(189, 0, 255, 0.5); }
.gacha-result-card.rarity-rare { border-color: #00e5ff; box-shadow: 0 0 10px rgba(0, 229, 255, 0.4); }

/* ==========================================================================
   PixelLab AI Studio & Pixel Art Sprites Visual Styles
   ========================================================================== */
.btn-pixellab {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(56, 189, 248, 0.25)) !important;
  border: 1px solid #c084fc !important;
  color: #f3e8ff !important;
  box-shadow: 0 0 12px rgba(192, 132, 252, 0.35);
  font-weight: 700;
  transition: all 0.2s ease;
}
.btn-pixellab:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.45), rgba(56, 189, 248, 0.45)) !important;
  border-color: #e879f9 !important;
  color: #ffffff !important;
  box-shadow: 0 0 20px rgba(232, 121, 249, 0.6);
  transform: translateY(-2px);
}

.rpg-pixellab-content {
  max-width: 680px;
  width: 92%;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(8, 12, 20, 0.98));
  border: 1px solid rgba(192, 132, 252, 0.4);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 35px rgba(168, 85, 247, 0.25);
  border-radius: 16px;
}

.pixellab-modal-header {
  border-bottom: 1px solid rgba(192, 132, 252, 0.2);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.pixellab-title-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 0 10px #c084fc);
}

.pixellab-dialog-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: #f3e8ff;
  letter-spacing: 0.5px;
}

.pixellab-dialog-subtitle {
  margin: 4px 0 0 0;
  font-size: 0.78rem;
  color: #94a3b8;
}

.pixellab-modal-body {
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: 72vh;
  overflow-y: auto;
}

.pixellab-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

.pixellab-status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #4ade80;
}

.pixellab-credits-badge {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
  padding: 4px 10px;
  border-radius: 6px;
}

.pixellab-toggle-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #e2e8f0;
  cursor: pointer;
}

.pixellab-toggle-switch input {
  display: none;
}

.switch-slider {
  width: 36px;
  height: 20px;
  background: #334155;
  border-radius: 20px;
  position: relative;
  transition: background 0.3s;
}

.switch-slider::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.3s;
}

.pixellab-toggle-switch input:checked + .switch-slider {
  background: #a855f7;
}

.pixellab-toggle-switch input:checked + .switch-slider::before {
  transform: translateX(16px);
}

.pixellab-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pixellab-section-header h4 {
  margin: 0;
  font-size: 0.95rem;
  color: #f1f5f9;
  font-weight: 700;
}

.pixellab-section-sub {
  font-size: 0.75rem;
  color: #64748b;
}

.pixellab-sprites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.pixellab-sprite-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
}

.pixellab-sprite-card:hover {
  transform: translateY(-2px);
  border-color: #c084fc;
  box-shadow: 0 0 15px rgba(192, 132, 252, 0.3);
}

.pixellab-sprite-thumb-wrap {
  width: 64px;
  height: 64px;
  background: radial-gradient(circle, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.pixellab-sprite-thumb {
  width: 56px;
  height: 56px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.pixellab-sprite-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #f8fafc;
  word-break: break-all;
}

.pixellab-sprite-tag {
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(168, 85, 247, 0.15);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.pixellab-generator-section {
  background: rgba(30, 41, 59, 0.3);
  border: 1px solid rgba(192, 132, 252, 0.2);
  border-radius: 12px;
  padding: 14px;
}

.pixellab-gen-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pixellab-input-row {
  display: flex;
  gap: 10px;
}

.pixellab-prompt-input {
  flex: 1;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 10px 14px;
  color: #ffffff;
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pixellab-prompt-input:focus {
  border-color: #c084fc;
  box-shadow: 0 0 12px rgba(192, 132, 252, 0.4);
}

.btn-pixellab-generate {
  background: linear-gradient(135deg, #9333ea, #c026d3) !important;
  color: #ffffff !important;
  font-weight: 800;
  font-size: 0.85rem;
  border-radius: 8px;
  padding: 10px 18px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 0 16px rgba(147, 51, 234, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-pixellab-generate:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(192, 38, 211, 0.6);
}

.btn-pixellab-generate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pixellab-gen-result {
  padding: 10px;
  border-radius: 8px;
  font-size: 0.82rem;
}
.pixellab-gen-result.success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #86efac;
}
.pixellab-gen-result.error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.pixellab-modal-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 20px;
  display: flex;
  justify-content: flex-end;
}


/* =========================================================
   TACTICAL COMBAT ENGINE: CLICK & DRAG TARGETING & HP
========================================================= */

@keyframes attacker-pulse {
  0% {
    box-shadow: 0 0 0 3px #00e5ff, 0 0 15px rgba(0, 229, 255, 0.5);
  }
  50% {
    box-shadow: 0 0 0 4px #76ff03, 0 0 30px rgba(118, 255, 3, 0.8);
  }
  100% {
    box-shadow: 0 0 0 3px #00e5ff, 0 0 15px rgba(0, 229, 255, 0.5);
  }
}

@keyframes target-pulse {
  0% {
    box-shadow: 0 0 0 3px #ff1744, 0 0 16px rgba(255, 23, 68, 0.6);
  }
  50% {
    box-shadow: 0 0 0 5px #ff5252, 0 0 32px rgba(255, 82, 82, 0.9);
  }
  100% {
    box-shadow: 0 0 0 3px #ff1744, 0 0 16px rgba(255, 23, 68, 0.6);
  }
}

.card-unit.selected-attacker {
  animation: attacker-pulse 1.3s infinite ease-in-out !important;
  transform: translateY(-6px) scale(1.05) !important;
  z-index: 40 !important;
  border-color: #00e5ff !important;
}

.card-unit.valid-attack-target,
#opp-hero-target.valid-attack-target {
  animation: target-pulse 1.2s infinite ease-in-out !important;
  cursor: crosshair !important;
  border-color: #ff1744 !important;
}

.card-unit.is-taunt {
  border: 2px solid #ffd700 !important;
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.4);
}
.card-unit.is-taunt::before {
  content: '🛡️ TAUNT';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #b8860b, #ffd700);
  color: #000;
  font-size: 0.58rem;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  z-index: 10;
}

.stat-hp.hp-damaged {
  color: #ff4757 !important;
  font-weight: 900 !important;
  text-shadow: 0 0 8px rgba(255, 71, 87, 0.8) !important;
}

.stat-hp.hp-buffed {
  color: #2ed573 !important;
  font-weight: 900 !important;
  text-shadow: 0 0 8px rgba(46, 213, 115, 0.8) !important;
}

/* =========================================================
   CARD BINDER & STICKER BOOK MODAL (SECTION 10)
========================================================= */

.rpg-binder-content {
  width: 92vw;
  max-width: 980px;
  max-height: 88vh;
  background: radial-gradient(circle at top center, #131d2e, #0a0e17 80%);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 229, 255, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.binder-modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.25);
}

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

.binder-title-icon {
  font-size: 2rem;
}

.binder-dialog-title {
  font-family: var(--font-title);
  font-size: 1.25rem;
  color: #00e5ff;
  letter-spacing: 0.5px;
}

.binder-dialog-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.binder-progress-banner {
  background: rgba(14, 22, 34, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 12px 24px;
}

.binder-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  margin-bottom: 6px;
}

.binder-progress-count {
  font-weight: 800;
  color: #76ff03;
}

.binder-progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}

.binder-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #00e5ff, #76ff03);
  box-shadow: 0 0 10px rgba(118, 255, 3, 0.5);
  transition: width 0.4s ease;
}

.binder-badges-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.binder-badge-item {
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #8a99ad;
  transition: all 0.2s;
}

.binder-badge-item.unlocked {
  background: rgba(255, 215, 0, 0.12);
  border-color: rgba(255, 215, 0, 0.4);
  color: #ffd700;
  font-weight: 800;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.25);
}

.binder-tabs-nav {
  display: flex;
  gap: 8px;
  padding: 10px 24px;
  background: rgba(0, 0, 0, 0.3);
  overflow-x: auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.binder-tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.binder-tab-btn:hover {
  background: rgba(0, 229, 255, 0.1);
  color: #fff;
  border-color: rgba(0, 229, 255, 0.3);
}

.binder-tab-btn.active {
  background: rgba(0, 229, 255, 0.2);
  color: #00e5ff;
  border-color: #00e5ff;
  font-weight: 800;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.25);
}

.binder-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.binder-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 16px;
}

.binder-card-slot {
  background: rgba(18, 26, 38, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
  min-height: 180px;
}

.binder-card-slot.owned {
  border-color: var(--card-faction-color, rgba(0, 229, 255, 0.4));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

.binder-card-slot.owned:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6), 0 0 15px var(--card-faction-color, #00e5ff);
}

.binder-card-slot.unowned {
  opacity: 0.45;
  filter: grayscale(80%);
  border-style: dashed;
}

.binder-card-art {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 6px 0;
}

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

.binder-card-name {
  font-size: 0.78rem;
  font-weight: 700;
  margin-top: 4px;
  line-height: 1.2;
}

.binder-card-meta {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.binder-card-count-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #76ff03;
  color: #000;
  font-size: 0.65rem;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 10px;
}

/* =========================================================
   DAILY BOUNTY BOARD MODAL (SECTION 10 & 3)
========================================================= */

.rpg-bounty-content {
  width: 90vw;
  max-width: 820px;
  background: radial-gradient(circle at top center, #1c1524, #0d0a14 80%);
  border: 1px solid rgba(255, 179, 0, 0.35);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(255, 179, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bounty-modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.25);
}

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

.bounty-title-icon {
  font-size: 2rem;
}

.bounty-dialog-title {
  font-family: var(--font-title);
  font-size: 1.25rem;
  color: #ffb300;
  letter-spacing: 0.5px;
}

.bounty-dialog-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.bounty-daily-timer-strip {
  background: rgba(255, 179, 0, 0.08);
  border-bottom: 1px solid rgba(255, 179, 0, 0.15);
  padding: 10px 24px;
  font-size: 0.82rem;
  color: #ffe082;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bounty-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  max-height: 65vh;
}

.bounty-missions-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bounty-mission-card {
  background: rgba(24, 18, 34, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: all 0.2s;
}

.bounty-mission-card:hover {
  background: rgba(36, 26, 52, 0.7);
  border-color: rgba(255, 179, 0, 0.4);
  transform: translateX(4px);
}

.bounty-card-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.bounty-boss-avatar {
  font-size: 2.2rem;
  width: 54px;
  height: 54px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.bounty-mission-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bounty-target-name {
  font-size: 1rem;
  font-weight: 800;
  color: #f0f4f8;
}

.bounty-archetype-tag {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255, 179, 0, 0.15);
  color: #ffb300;
  display: inline-block;
  font-weight: 700;
  width: fit-content;
}

.bounty-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.bounty-reward-pill {
  font-size: 0.78rem;
  color: #81c784;
  font-weight: 700;
}

.btn-bounty-challenge {
  background: linear-gradient(135deg, #ff9100, #ff3d00) !important;
  color: #fff !important;
  font-weight: 800;
  font-size: 0.88rem;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 15px rgba(255, 61, 0, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-bounty-challenge:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 61, 0, 0.6);
}

.btn-bounty-challenge.completed {
  background: rgba(76, 175, 80, 0.2) !important;
  color: #81c784 !important;
  border: 1px solid rgba(76, 175, 80, 0.4) !important;
  box-shadow: none !important;
  cursor: default;
}

/* =========================================================
   LIVING WORLD WEATHER & DAY/NIGHT SYSTEM (Section 9)
   ========================================================= */
.rpg-hud-weather-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #f8fafc;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
}

.rpg-hud-weather-badge .weather-icon {
  font-size: 1.1rem;
}

.combat-weather-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 16px;
  padding: 4px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #00e5ff;
  box-shadow: 0 2px 10px rgba(0, 229, 255, 0.2);
  margin-right: 8px;
}

/* =========================================================
   ACTIVE PET COMPANION BATTLER & NUTRITION (Section 11)
   ========================================================= */
.combat-pet-widget {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 14px;
  padding: 2px 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.combat-pet-widget:hover {
  border-color: #ffd700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.combat-pet-widget .pet-icon {
  font-size: 1rem;
}

.combat-pet-widget .pet-gauge {
  font-size: 0.76rem;
  font-weight: 800;
  color: #cbd5e1;
}

.combat-pet-widget .pet-gauge.ready {
  color: #ffd700;
  text-shadow: 0 0 8px #ffd700;
  animation: pulse-ready 1.2s infinite alternate;
}

@keyframes pulse-ready {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.08); filter: brightness(1.3); }
}

/* Pet Companion & Nutrition Modal */
.rpg-pet-content {
  max-width: 520px;
  width: 90%;
  background: linear-gradient(135deg, #0d1522 0%, #151f30 100%);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(255, 215, 0, 0.15);
}

.pet-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 14px;
  margin-bottom: 18px;
}

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

.pet-title-icon {
  font-size: 2rem;
}

.pet-dialog-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: #ffd700;
}

.pet-dialog-subtitle {
  margin: 2px 0 0 0;
  font-size: 0.82rem;
  color: #94a3b8;
}

.pet-profile-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 16px;
}

.pet-avatar-big {
  font-size: 2.8rem;
  filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.5));
}

.pet-info-col {
  flex: 1;
}

.pet-lvl-tag {
  background: linear-gradient(135deg, #ffd700, #ff9100);
  color: #000;
  font-weight: 900;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 10px;
}

.pet-exp-wrap {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0 4px 0;
}

.pet-exp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #00e5ff);
  transition: width 0.3s ease;
}

.pet-exp-text {
  font-size: 0.78rem;
  color: #94a3b8;
}

.pet-assist-banner {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 18px;
}

.pet-feed-section {
  background: rgba(15, 23, 42, 0.5);
  border-radius: 10px;
  padding: 14px;
}

/* =========================================================
   ARCANE DUST DISENCHANTING & CRAFTING (Section 4)
   ========================================================= */
.binder-dust-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(124, 58, 237, 0.35);
  border-radius: 10px;
  padding: 8px 16px;
  margin: 10px 0;
}

.binder-dust-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #e2e8f0;
}

.binder-dust-icon {
  font-size: 1.2rem;
  filter: drop-shadow(0 0 6px #a855f7);
}

.binder-dust-val {
  color: #c084fc;
  font-size: 1.1rem;
}

.btn-binder-dust {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.35);
  transition: all 0.2s;
}

.btn-binder-dust:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.5);
}

/* Quick Card Disenchant/Craft Action Modal */
.binder-action-content {
  max-width: 360px;
  width: 90%;
  background: linear-gradient(135deg, #0d1522 0%, #151f30 100%);
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 16px;
  padding: 22px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.85), 0 0 25px rgba(168, 85, 247, 0.2);
}

.binder-action-preview {
  width: 120px;
  height: 120px;
  margin: 0 auto;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.binder-action-preview svg {
  width: 100%;
  height: 100%;
  display: block;
}

.binder-action-card-name {
  margin: 12px 0 4px 0;
  font-size: 1.15rem;
  font-weight: 800;
}

.binder-action-card-meta {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 12px;
}

.binder-action-card-desc {
  font-size: 0.86rem;
  color: #cbd5e1;
  background: rgba(0, 0, 0, 0.4);
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 18px;
  line-height: 1.4;
}

.binder-action-buttons-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 12px;
}

.binder-action-buttons-row .btn-disenchant {
  flex: 1;
  padding: 10px 12px;
  background: linear-gradient(135deg, #dc2626, #991b1b);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(220, 38, 38, 0.35);
  transition: all 0.2s;
}

.binder-action-buttons-row .btn-disenchant:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.5);
}

.binder-action-buttons-row .btn-craft {
  flex: 1;
  padding: 10px 12px;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.35);
  transition: all 0.2s;
}

.binder-action-buttons-row .btn-craft:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.5);
}

.btn-cancel-action {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #94a3b8;
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.2s;
}

.btn-cancel-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* =========================================================
   HOLOGRAPHIC RAINBOW FOIL SHADER (Section 2)
   ========================================================= */
.card-holo-foil {
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.4), 0 0 30px rgba(0, 229, 255, 0.3) !important;
}

.card-holo-foil::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    115deg,
    transparent 20%,
    rgba(255, 0, 128, 0.25) 35%,
    rgba(255, 255, 0, 0.3) 48%,
    rgba(0, 255, 255, 0.3) 55%,
    rgba(128, 0, 255, 0.25) 65%,
    transparent 80%
  );
  transform: rotate(25deg);
  pointer-events: none;
  animation: holo-shimmer 3.5s infinite linear;
}

@keyframes holo-shimmer {
  0% { transform: translateY(-30%) rotate(25deg); }
  100% { transform: translateY(30%) rotate(25deg); }
}

/* World Event & Red Zone Banners */
.rpg-world-event-banner {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, rgba(234, 88, 12, 0.95), rgba(220, 38, 38, 0.95));
  color: #fff;
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 800;
  box-shadow: 0 4px 15px rgba(220, 38, 38, 0.5);
  z-index: 100;
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.rpg-world-event-banner:hover {
  transform: translateX(-50%) scale(1.03);
  box-shadow: 0 6px 20px rgba(234, 88, 12, 0.7);
}

.rpg-world-event-banner.prime-live {
  background: linear-gradient(90deg, #d97706, #dc2626, #b91c1c);
  border-color: #fcd34d;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.8);
  animation: pulse-primetime 2s infinite alternate;
}

.rpg-world-event-banner.off-peak {
  background: linear-gradient(90deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

@keyframes pulse-primetime {
  0% { box-shadow: 0 0 12px rgba(245, 158, 11, 0.6); }
  100% { box-shadow: 0 0 22px rgba(239, 68, 68, 0.9); }
}

.btn-hud-schedule {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(239, 68, 68, 0.2));
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fef08a;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.82rem;
  transition: all 0.2s ease;
}

.btn-hud-schedule:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.4), rgba(239, 68, 68, 0.4));
  border-color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
  transform: translateY(-1px);
}

.redzone-danger-badge {
  position: absolute;
  top: 96px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(220, 38, 38, 0.95);
  color: #fff;
  padding: 4px 14px;
  border-radius: 16px;
  font-size: 0.78rem;
  font-weight: 900;
  box-shadow: 0 0 12px #ef4444;
  z-index: 100;
  animation: pulse-danger 1s infinite alternate;
}

@keyframes pulse-danger {
  0% { opacity: 0.85; transform: translateX(-50%) scale(1); }
  100% { opacity: 1; transform: translateX(-50%) scale(1.05); }
}

/* Modals for Spire, Caravan, Tournament, Tavern, Tag-Team */
.rpg-spire-content,
.rpg-caravan-content,
.rpg-tournament-content,
.rpg-tavern-content,
.rpg-tagteam-content {
  max-width: 580px;
  width: 92%;
  background: linear-gradient(135deg, #0a111a 0%, #15202e 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.85);
}

/* ==========================================================
   ACCOUNT IDENTITY BAR & ACCOUNT CENTER MODAL
   ========================================================== */
.account-identity-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.92) 0%, rgba(30, 41, 59, 0.85) 100%);
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 12px;
  padding: 10px 18px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.account-badge-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-status-dot {
  font-size: 0.75rem;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.account-label {
  font-size: 0.84rem;
  color: #94a3b8;
  font-weight: 600;
}

.account-id-badge {
  display: inline-block;
  font-family: 'Space Grotesk', 'Courier New', monospace;
  font-weight: 800;
  font-size: 0.95rem;
  color: #00e5ff;
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.4);
  padding: 3px 10px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.btn-account-copy {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-account-copy:hover {
  background: rgba(0, 229, 255, 0.2);
  border-color: #00e5ff;
  color: #fff;
}

.account-action-group {
  display: flex;
  gap: 8px;
}

.btn-account-action {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-account-login {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.btn-account-login:hover {
  background: rgba(56, 189, 248, 0.3);
  color: #fff;
}

.btn-account-create {
  background: linear-gradient(135deg, #00e5ff, #00b4d8);
  color: #0a111a;
  box-shadow: 0 2px 8px rgba(0, 229, 255, 0.3);
}

.btn-account-create:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

/* Modal Styling */
.account-modal-content {
  max-width: 480px;
  width: 92%;
  background: linear-gradient(135deg, #0b1322 0%, #162438 100%);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 16px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.85);
  padding: 0;
  overflow: hidden;
}

.account-modal-header {
  padding: 16px 20px;
  background: rgba(15, 23, 42, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.account-modal-body {
  padding: 20px;
}

.account-modal-tabs {
  display: flex;
  gap: 8px;
  background: rgba(15, 23, 42, 0.6);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.account-tab-btn {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #94a3b8;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.account-tab-btn.active {
  background: #00e5ff;
  color: #0a111a;
  box-shadow: 0 2px 8px rgba(0, 229, 255, 0.4);
}

.saved-accounts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  margin-top: 8px;
}

.saved-account-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.saved-account-item.active-account {
  border-color: #00e5ff;
  background: rgba(0, 229, 255, 0.08);
}

.saved-account-item:hover {
  border-color: rgba(0, 229, 255, 0.5);
  background: rgba(30, 41, 59, 0.8);
}

.account-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.account-item-id {
  font-family: monospace;
  font-weight: 800;
  color: #00e5ff;
  font-size: 0.88rem;
}

.account-item-name {
  font-size: 0.82rem;
  color: #cbd5e1;
}

.btn-select-account {
  padding: 5px 12px;
  background: rgba(0, 229, 255, 0.15);
  border: 1px solid #00e5ff;
  color: #00e5ff;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-select-account:hover {
  background: #00e5ff;
  color: #0a111a;
}

.account-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 16px 0;
  color: #64748b;
  font-size: 0.78rem;
}

.account-divider::before,
.account-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.account-divider span {
  padding: 0 10px;
}

.badge-active-account {
  font-size: 0.78rem;
  color: #4ade80;
  font-weight: 700;
  padding: 4px 10px;
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: 6px;
  letter-spacing: 0.3px;
}

.saved-accounts-empty {
  color: #64748b;
  font-size: 0.82rem;
  text-align: center;
  padding: 16px;
  font-style: italic;
}

/* ==========================================================
   SCREEN 0: GATEKEEPER AUTH PORTAL & CLOUDFLARE TURNSTILE
   ========================================================== */
#screen-auth {
  position: relative;
  min-height: 100vh;
  width: 100%;
  display: none;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at 50% 20%, #0d1a30 0%, #060b14 70%, #03060a 100%);
  overflow-y: auto;
  padding: 30px 16px;
  z-index: 10;
}

#screen-auth.active {
  display: flex;
}

.auth-celestial-backdrop {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(0, 229, 255, 0.08) 0%, transparent 60%),
              radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.auth-vortex-ring {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  height: 800px;
  border-radius: 50%;
  border: 1px dashed rgba(0, 229, 255, 0.12);
  pointer-events: none;
  animation: rotate-vortex 90s linear infinite;
  z-index: 0;
}

@keyframes rotate-vortex {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.auth-sound-toggle-btn {
  position: absolute;
  top: 18px;
  right: 20px;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #cbd5e1;
  font-size: 1.15rem;
  font-family: inherit;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.auth-sound-toggle-btn:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(0, 229, 255, 0.6);
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.35);
}

.auth-portal-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: auto;
}

/* Branding Row */
.auth-branding-row {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.auth-edge-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 20px;
  font-size: 0.76rem;
  color: #94a3b8;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.edge-shield-icon {
  color: #38bdf8;
  font-weight: 700;
}

.auth-game-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  color: #ffd700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 4px;
}

.auth-game-title {
  font-family: 'Cinzel', serif;
  font-size: 2.3rem;
  font-weight: 900;
  letter-spacing: 3px;
  background: linear-gradient(135deg, #ffffff 0%, #00e5ff 60%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
  text-shadow: 0 0 25px rgba(0, 229, 255, 0.4);
}

.auth-game-tagline {
  font-size: 0.84rem;
  color: #94a3b8;
  margin: 2px 0 0 0;
}

/* Auth Cards */
.auth-card {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.95) 0%, rgba(10, 17, 30, 0.98) 100%);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 229, 255, 0.08);
  backdrop-filter: blur(16px);
}

/* Welcome Back Card */
.welcome-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}

.welcome-avatar-wrap {
  position: relative;
  width: 76px;
  height: 76px;
  margin-top: 6px;
}

.welcome-avatar-icon {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 2px solid #00e5ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.4);
}

.welcome-pulse-glow {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px dashed rgba(0, 229, 255, 0.5);
  animation: pulse-avatar 3s infinite linear;
}

@keyframes pulse-avatar {
  0% { transform: rotate(0deg) scale(0.98); opacity: 0.5; }
  50% { transform: rotate(180deg) scale(1.05); opacity: 0.9; }
  100% { transform: rotate(360deg) scale(0.98); opacity: 0.5; }
}

.welcome-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.welcome-subtitle {
  font-size: 0.8rem;
  color: #94a3b8;
}

.welcome-username {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
}

.welcome-meta {
  display: flex;
  justify-content: center;
  gap: 10px;
  font-size: 0.78rem;
  margin-top: 4px;
}

.welcome-account-id {
  font-family: monospace;
  color: #00e5ff;
  background: rgba(0, 229, 255, 0.12);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
}

.welcome-auth-type {
  color: #4ade80;
}

.btn-enter-game {
  width: 100%;
  padding: 14px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #00e5ff 0%, #0284c7 100%);
  color: #0a111a;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 18px rgba(0, 229, 255, 0.35);
}

.btn-enter-game:hover {
  transform: translateY(-2px);
  filter: brightness(1.15);
  box-shadow: 0 6px 24px rgba(0, 229, 255, 0.5);
}

.btn-text-action {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s;
}

.btn-text-action:hover {
  color: #00e5ff;
  background: rgba(0, 229, 255, 0.08);
}

/* Credentials Form Card */
.auth-tab-bar {
  display: flex;
  gap: 8px;
  background: rgba(15, 23, 42, 0.8);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 18px;
}

.auth-tab-btn {
  flex: 1;
  padding: 9px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab-btn.active {
  background: #00e5ff;
  color: #0a111a;
  box-shadow: 0 2px 8px rgba(0, 229, 255, 0.4);
}

.auth-form-body {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.auth-input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
}

.auth-label {
  font-size: 0.82rem;
  color: #cbd5e1;
  font-weight: 600;
}

.auth-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-toggle-password {
  background: transparent;
  border: none;
  color: #38bdf8;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
}

.btn-toggle-password:hover {
  text-decoration: underline;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 12px;
  font-size: 0.95rem;
  color: #64748b;
  pointer-events: none;
}

.auth-input {
  width: 100%;
  padding: 10px 12px 10px 38px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #fff;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
}

.auth-input:focus {
  border-color: #00e5ff;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.25);
  background: rgba(15, 23, 42, 0.95);
}

/* Cloudflare Turnstile Container & Card */
.auth-turnstile-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.turnstile-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
}

.turnstile-guard-title {
  color: #94a3b8;
  font-weight: 600;
}

.turnstile-tag {
  color: #f97316;
  font-weight: 700;
  font-size: 0.72rem;
}

.turnstile-widget-slot {
  min-height: 64px;
  display: flex;
  justify-content: center;
}

.cf-turnstile-card {
  width: 100%;
  background: #111827;
  border: 1px solid #374151;
  border-radius: 6px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: all 0.25s;
}

.cf-turnstile-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cf-checkbox {
  position: relative;
  width: 26px;
  height: 26px;
  border: 2px solid #6b7280;
  border-radius: 4px;
  background: #1f2937;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.2s;
}

.cf-checkbox-spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: cf-spin 0.8s linear infinite;
}

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

.cf-checkbox-icon {
  display: none;
  color: #22c55e;
  font-weight: 900;
  font-size: 16px;
}

.cf-turnstile-card.verifying .cf-checkbox-spinner {
  display: block;
}

.cf-turnstile-card.verifying .cf-checkbox {
  border-color: #3b82f6;
}

.cf-turnstile-card.verified {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}

.cf-turnstile-card.verified .cf-checkbox {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.15);
}

.cf-turnstile-card.verified .cf-checkbox-icon {
  display: block;
}

.cf-turnstile-title {
  font-size: 0.82rem;
  color: #f3f4f6;
  font-weight: 600;
}

.cf-turnstile-desc {
  font-size: 0.7rem;
  color: #9ca3af;
}

.cf-turnstile-branding {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.cf-privacy-terms {
  font-size: 0.65rem;
  color: #6b7280;
}

/* Submit CTA Buttons */
.btn-auth-submit {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, #00e5ff 0%, #0284c7 100%);
  color: #0a111a;
  font-weight: 800;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 12px rgba(0, 229, 255, 0.3);
  margin-top: 4px;
}

.btn-auth-submit:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

/* Divider */
.auth-social-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 16px 0 12px 0;
  color: #64748b;
  font-size: 0.78rem;
}

/* Forgot Password Link Row */
.auth-extra-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

button.auth-forgot-link,
.auth-forgot-link {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #38bdf8 !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  padding: 2px 4px !important;
  border-radius: 4px !important;
  outline: none !important;
  transition: all 0.2s !important;
}

button.auth-forgot-link:hover,
.auth-forgot-link:hover {
  color: #00e5ff !important;
  text-decoration: underline !important;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.5) !important;
}

/* Google OAuth Divider & Container */
.auth-divider-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
}

.auth-divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

.auth-divider-text {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-google-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 44px;
}

.google-btn-slot {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

/* Forgot Password & OTP Modal */
.auth-modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(4, 7, 18, 0.88) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 100000 !important;
  padding: 16px !important;
  animation: fadeInModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-modal-overlay[style*="display: none"] {
  display: none !important;
}

@keyframes fadeInModal {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.auth-modal-content {
  background: linear-gradient(180deg, #101726 0%, #0c101c 100%);
  border: 1px solid rgba(0, 229, 255, 0.35);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 229, 255, 0.15);
  border-radius: 14px;
  width: 100%;
  max-width: 440px;
  padding: 24px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
}

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

.modal-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #00e5ff;
  letter-spacing: 0.5px;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.btn-close-modal:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.modal-desc {
  font-size: 0.85rem;
  color: #94a3b8;
  margin: 0 0 12px 0;
  line-height: 1.45;
}

.modal-actions-row {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
}

.btn-modal-action {
  width: 100%;
  padding: 11px;
  font-size: 0.92rem;
  font-weight: 700;
}

.otp-sent-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  padding: 10px 14px;
  border-radius: 8px;
  color: #4ade80;
  font-size: 0.84rem;
  margin-bottom: 12px;
}

.otp-code-input {
  font-size: 1.4rem !important;
  font-weight: 800;
  letter-spacing: 6px;
  text-align: center;
  color: #ffd700 !important;
}

.otp-resend-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  margin-top: 4px;
}

.otp-timer-text {
  color: #94a3b8;
}

.btn-resend-otp {
  background: transparent;
  border: none;
  color: #38bdf8;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.76rem;
  padding: 0;
  text-decoration: underline;
}

.btn-resend-otp:hover {
  color: #00e5ff;
}

.auth-portal-footer {
  text-align: center;
  font-size: 0.72rem;
  color: #64748b;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Logout Button in Lobby */
.btn-account-logout {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.btn-account-logout:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #fff;
}

/* Google Chooser Modal */
.google-chooser-overlay {
  z-index: 99999;
}

.google-chooser-dialog {
  background: #ffffff;
  color: #202124;
  border-radius: 12px;
  width: 92%;
  max-width: 420px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.google-dialog-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid #e8eaed;
}

.google-dialog-title-group {
  flex: 1;
}

.google-dialog-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  color: #202124;
}

.google-dialog-subtitle {
  font-size: 0.78rem;
  color: #5f6368;
  margin: 2px 0 0 0;
}

.btn-close-google {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: #5f6368;
  cursor: pointer;
}

.google-accounts-list {
  display: flex;
  flex-direction: column;
}

.google-account-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid #f1f3f4;
  cursor: pointer;
  transition: background 0.15s;
}

.google-account-row:hover {
  background: #f8f9fa;
}

.google-avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e8f0fe;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.google-user-info {
  flex: 1;
}

.google-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #202124;
}

.google-email {
  font-size: 0.78rem;
  color: #5f6368;
}

.google-arrow {
  color: #1a73e8;
  font-size: 0.85rem;
}

.google-custom-input-box {
  padding: 14px 18px;
  background: #f8f9fa;
  border-bottom: 1px solid #e8eaed;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.google-custom-label {
  font-size: 0.78rem;
  color: #5f6368;
}

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

.google-text-input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #dadce0;
  border-radius: 6px;
  font-size: 0.86rem;
  outline: none;
}

.google-text-input:focus {
  border-color: #1a73e8;
}

.btn-google-next {
  padding: 8px 14px;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

.google-dialog-footer {
  padding: 12px 18px;
  font-size: 0.68rem;
  color: #70757a;
  background: #fff;
}

/* Header Logout Button */
.btn-header-logout {
  background: rgba(239, 68, 68, 0.15) !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
  color: #fca5a5 !important;
  font-size: 0.85rem !important;
  padding: 6px 14px !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.btn-header-logout:hover {
  background: rgba(239, 68, 68, 0.3) !important;
  border-color: #ef4444 !important;
  color: #ffffff !important;
  transform: translateY(-1px);
}

/* Locked Starter Title Badge */
.starter-title-badge-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: 8px;
  padding: 8px 12px;
}

.starter-title-badge {
  color: #ffd700;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.starter-title-note {
  font-size: 0.72rem;
  color: #94a3b8;
}

.btn-feature-logout:hover {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: #ef4444 !important;
}

/* ==========================================================================
   Thailand Prime-Time Event Scheduler Modal (18:00 - 22:00 UTC+7)
   ========================================================================== */
.rpg-event-schedule-overlay {
  z-index: 1200;
  backdrop-filter: blur(8px);
}

.rpg-event-schedule-content {
  max-width: 780px;
  width: 94%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(24, 24, 58, 0.98));
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(245, 158, 11, 0.2);
  border-radius: 16px;
  overflow: hidden;
}

.event-schedule-header {
  padding: 16px 20px;
  background: linear-gradient(90deg, rgba(30, 41, 59, 0.9), rgba(51, 65, 85, 0.8));
  border-bottom: 1px solid rgba(245, 158, 11, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.event-schedule-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

#event-schedule-modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: #f8fafc;
  background: linear-gradient(90deg, #fef08a, #f59e0b, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.event-schedule-subtitle {
  margin: 4px 0 0 0;
  font-size: 0.78rem;
  color: #cbd5e1;
  line-height: 1.4;
}

.event-schedule-body {
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Clock Bar */
.event-schedule-clock-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 12px;
  padding: 12px 18px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.thai-clock-display {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.clock-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #94a3b8;
}

.clock-digits {
  font-family: 'Consolas', monospace;
  font-size: 1.5rem;
  font-weight: 900;
  color: #fbbf24;
  letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
}

.clock-tz {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 600;
}

.sim-tag {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid #ef4444;
  color: #fca5a5;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.prime-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 800;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #cbd5e1;
}

.prime-status-badge.active {
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.25), rgba(245, 158, 11, 0.25));
  border-color: #f59e0b;
  color: #fef08a;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
}

.prime-status-badge.active .pulse-dot {
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: pulse-green 1.5s infinite;
}

@keyframes pulse-green {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

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

@media (max-width: 640px) {
  .prime-perks-bar {
    grid-template-columns: repeat(2, 1fr);
  }
}

.perk-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 10px;
}

.perk-icon {
  font-size: 1.25rem;
}

.perk-info {
  display: flex;
  flex-direction: column;
}

.perk-label {
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 600;
}

.perk-val {
  font-size: 0.82rem;
  color: #38bdf8;
  font-weight: 800;
}

/* Section Headers */
.schedule-section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 4px;
  margin-top: 4px;
}

.schedule-section-header h4 {
  margin: 0;
  font-size: 0.95rem;
  color: #f1f5f9;
  font-weight: 800;
}

.section-subtext {
  font-size: 0.72rem;
  color: #94a3b8;
}

/* Prime Events Grid */
.prime-events-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (max-width: 640px) {
  .prime-events-grid {
    grid-template-columns: 1fr;
  }
}

.event-timeline-card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  transition: all 0.2s ease;
}

.event-timeline-card:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(245, 158, 11, 0.4);
}

.event-timeline-card.is-live {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(220, 38, 38, 0.15));
  border: 1.5px solid #f59e0b;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.3);
}

.event-timeline-card.is-today-active {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(16, 185, 129, 0.08));
  border: 1.5px solid rgba(34, 197, 94, 0.5);
  box-shadow: 0 0 14px rgba(34, 197, 94, 0.2);
}

.event-timeline-card.is-completed {
  opacity: 0.65;
  filter: grayscale(0.2);
}

.card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-timeslot {
  font-size: 0.75rem;
  font-weight: 800;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
}

.card-status-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
}

.card-status-badge.live {
  background: #dc2626;
  color: #fff;
  box-shadow: 0 0 8px #dc2626;
  animation: pulse-live 1.2s infinite;
}

@keyframes pulse-live {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.card-status-badge.upcoming {
  background: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
}

.card-status-badge.completed {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
}

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

.card-icon {
  font-size: 1.3rem;
}

.card-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: #f8fafc;
}

.card-location {
  font-size: 0.74rem;
  color: #94a3b8;
}

.card-buff-pill {
  font-size: 0.72rem;
  font-weight: 700;
  color: #fde047;
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.3);
  padding: 3px 8px;
  border-radius: 4px;
}

.card-countdown-tag {
  font-size: 0.72rem;
  color: #4ade80;
  font-weight: 800;
  margin-top: 2px;
}

/* Off-Peak Grid */
.offpeak-events-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

@media (max-width: 640px) {
  .offpeak-events-grid {
    grid-template-columns: 1fr;
  }
}

.offpeak-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.offpeak-timeslot {
  font-size: 0.7rem;
  color: #38bdf8;
  font-weight: 700;
}

.offpeak-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #e2e8f0;
}

.offpeak-buff {
  font-size: 0.68rem;
  color: #94a3b8;
}

/* Time Simulator Panel */
.time-simulator-panel {
  background: rgba(15, 23, 42, 0.9);
  border: 1px dashed rgba(148, 163, 184, 0.3);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.simulator-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.simulator-title span {
  font-size: 0.78rem;
  font-weight: 800;
  color: #e2e8f0;
}

.simulator-title small {
  font-size: 0.7rem;
  color: #64748b;
}

.simulator-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.btn-sim-quick {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-sim-quick:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
  color: #fef08a;
}

.btn-sim-reset {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-sim-reset:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #fff;
}

.event-schedule-footer {
  padding: 12px 20px;
  background: rgba(15, 23, 42, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: flex-end;
}



