/* ==========================================================================
   HEARTHSTONE ARENA MASTERY - CORE DESIGN SYSTEM & STYLES
   Authentic tavern wood textures, gold filigree, mana crystals & parchment
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;800;900&family=Marcellus&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Hearthstone Palette */
  --hs-wood-dark: #1e110a;
  --hs-wood-mid: #2b180d;
  --hs-wood-light: #3e2213;
  --hs-gold-light: #fae19c;
  --hs-gold-primary: #d4af37;
  --hs-gold-dark: #916f1a;
  --hs-parchment: #f4ecd8;
  --hs-parchment-dark: #e5d8b8;
  --hs-parchment-border: #bfa776;
  --hs-mana-blue: #0984e3;
  --hs-mana-glow: #00cec9;
  --hs-card-back: #181c24;

  /* Rarity Colors */
  --rarity-free: #95a5a6;
  --rarity-common: #bdc3c7;
  --rarity-rare: #0984e3;
  --rarity-epic: #a29bfe;
  --rarity-legendary: #ff9f43;

  /* Tier Colors */
  --tier-great: #f39c12;
  --tier-good: #2ecc71;
  --tier-above: #3498db;
  --tier-avg: #f1c40f;
  --tier-below: #e67e22;
  --tier-bad: #e74c3c;
  --tier-terrible: #7f8c8d;

  /* Shadows & Glows */
  --gold-glow: 0 0 16px rgba(212, 175, 55, 0.45);
  --gold-glow-lg: 0 0 25px rgba(245, 215, 127, 0.65);
  --mana-glow-filter: drop-shadow(0 0 8px #00d2d3);
  --wood-shadow: 0 10px 25px rgba(0, 0, 0, 0.7);

  /* Fonts */
  --font-hs-display: 'Cinzel', serif;
  --font-hs-body: 'Marcellus', Georgia, serif;
  --font-system: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ================= RESET & BASE ================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--hs-wood-dark);
  background-image: 
    radial-gradient(circle at 50% 30%, rgba(55, 30, 16, 0.85) 0%, rgba(15, 8, 5, 0.98) 100%),
    repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.05) 0px, rgba(0, 0, 0, 0.05) 2px, transparent 2px, transparent 4px);
  color: #f7f1e3;
  font-family: var(--font-hs-body);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
}

/* Background tavern vignette */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.85);
  pointer-events: none;
  z-index: 99;
}

/* ================= TYPOGRAPHY & HEADINGS ================= */
h1, h2, h3, h4, .hs-title {
  font-family: var(--font-hs-display);
  font-weight: 800;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.85), 0 0 10px rgba(212, 175, 55, 0.3);
}

.hs-section-title {
  color: var(--hs-gold-light);
  font-size: 1.6rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.title-rune {
  color: var(--hs-gold-primary);
  font-size: 1.2rem;
  animation: pulse-rune 2s infinite ease-in-out;
}

.section-subtitle {
  text-align: center;
  color: #d1ccc0;
  font-size: 0.95rem;
  margin-top: 4px;
}

/* ================= HEARTHSTONE BUTTONS ================= */
.hs-btn {
  font-family: var(--font-hs-display);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 12px 24px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  outline: none;
  border: none;
  user-select: none;
  touch-action: manipulation;
}

.hs-btn-gold {
  background: linear-gradient(180deg, #ffeaa7 0%, #d4af37 40%, #916f1a 100%);
  color: #1a0f05;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
  border: 2px solid #5a3d08;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.6);
}

.hs-btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: var(--gold-glow), 0 6px 14px rgba(0, 0, 0, 0.7);
  background: linear-gradient(180deg, #fff3c4 0%, #e6c34e 40%, #a68122 100%);
}

.hs-btn-gold:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
}

.hs-btn-secondary {
  background: linear-gradient(180deg, #4a2c1b 0%, #2f1b10 100%);
  color: var(--hs-gold-light);
  border: 2px solid var(--hs-gold-dark);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
}

.hs-btn-secondary:hover {
  background: linear-gradient(180deg, #5c3722 0%, #3e2416 100%);
  border-color: var(--hs-gold-primary);
  color: #fff;
  transform: translateY(-1px);
}

/* ================= PANELS & FRAMES ================= */
.hs-panel {
  background: linear-gradient(145deg, rgba(46, 26, 14, 0.92) 0%, rgba(26, 14, 8, 0.95) 100%);
  border: 2px solid var(--hs-gold-dark);
  border-radius: 8px;
  box-shadow: var(--wood-shadow), inset 0 0 15px rgba(0, 0, 0, 0.8);
  position: relative;
}

.hs-panel::after {
  content: '';
  position: absolute;
  inset: 2px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 6px;
  pointer-events: none;
}

/* ================= TOP APPLICATION HEADER ================= */
.tavern-header {
  background: linear-gradient(180deg, #1b0e06 0%, #2b170c 80%, #1e1008 100%);
  border-bottom: 3px solid var(--hs-gold-dark);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-key-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--hs-gold-light);
  box-shadow: 0 0 14px rgba(245, 215, 127, 0.5), 0 2px 8px rgba(0, 0, 0, 0.8);
  object-fit: cover;
  flex-shrink: 0;
}

.brand-text-col {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-hs-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--hs-gold-light);
  line-height: 1.1;
}

.brand-tagline {
  font-size: 0.75rem;
  color: #c8d6e5;
  letter-spacing: 0.5px;
}

.header-nav-tabs {
  display: flex;
  gap: 10px;
}

.nav-tab-btn {
  background: rgba(30, 16, 10, 0.85);
  border: 1.5px solid #6b4c1b;
  color: #dfd8ca;
  font-family: var(--font-hs-display);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.nav-tab-btn:hover {
  color: var(--hs-gold-light);
  border-color: var(--hs-gold-primary);
  background: rgba(55, 30, 16, 0.9);
}

.nav-tab-btn.active {
  background: linear-gradient(180deg, #d4af37 0%, #876211 100%);
  color: #170d04;
  border-color: #fff3c4;
  box-shadow: var(--gold-glow);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

.header-status-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.meta-status-chip {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid #4a2c1b;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.75rem;
  color: #2ecc71;
  font-family: var(--font-system);
}

.icon-control-btn {
  background: #2b170c;
  border: 1.5px solid var(--hs-gold-dark);
  color: var(--hs-gold-light);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.icon-control-btn:hover {
  box-shadow: var(--gold-glow);
  border-color: var(--hs-gold-primary);
}

/* ================= 1. LANDING PAGE ================= */
.landing-view-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 70px);
  padding: 40px 20px;
  position: relative;
  text-align: center;
}

.hero-tavern-stage {
  max-width: 820px;
  width: 100%;
  background: linear-gradient(180deg, rgba(38, 20, 11, 0.95) 0%, rgba(20, 10, 6, 0.98) 100%);
  border: 3px solid var(--hs-gold-primary);
  border-radius: 12px;
  padding: 48px 32px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.9), var(--gold-glow);
  position: relative;
  overflow: hidden;
}

.hero-tavern-stage::before {
  content: '';
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 100px;
  background: radial-gradient(ellipse, rgba(212, 175, 55, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.innkeeper-crest {
  width: 88px;
  height: 88px;
  margin: 0 auto 20px auto;
  background: radial-gradient(circle, #2d3436 0%, #1e110a 100%);
  border: 3px solid var(--hs-gold-light);
  border-radius: 50%;
  box-shadow: var(--gold-glow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
}

.landing-headline {
  font-size: 2.4rem;
  color: var(--hs-gold-light);
  margin-bottom: 12px;
  line-height: 1.2;
}

.landing-subhead {
  font-size: 1.1rem;
  color: #dfd8ca;
  max-width: 620px;
  margin: 0 auto 32px auto;
}

.cta-button-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 10px;
}

.hs-btn-grand {
  font-size: 1.35rem;
  padding: 18px 48px;
  border-radius: 8px;
  box-shadow: var(--gold-glow-lg), 0 8px 20px rgba(0, 0, 0, 0.8);
  border: 3px solid #ffeaa7;
  letter-spacing: 2px;
}

.hs-btn-grand:hover {
  transform: translateY(-3px) scale(1.03);
}

.scrape-options-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #a4b0be;
  font-family: var(--font-system);
}

.scrape-options-row input[type="checkbox"] {
  accent-color: var(--hs-gold-primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.tavern-feature-badges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid rgba(212, 175, 55, 0.2);
}

.feature-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid #4a2c1b;
  border-radius: 6px;
  padding: 10px 14px;
  text-align: left;
}

.feature-pill-icon {
  font-size: 1.5rem;
}

.feature-pill-text strong {
  display: block;
  font-size: 0.9rem;
  color: var(--hs-gold-light);
  font-family: var(--font-hs-display);
}

.feature-pill-text span {
  font-size: 0.75rem;
  color: #a4b0be;
  font-family: var(--font-system);
}

/* ================= ERROR BANNER ================= */
.tavern-error-banner {
  max-width: 820px;
  width: 100%;
  margin-bottom: 24px;
  background: linear-gradient(180deg, #441412 0%, #2b0b0a 100%);
  border: 2px solid #e74c3c;
  box-shadow: 0 0 20px rgba(231, 76, 60, 0.5);
  border-radius: 8px;
  padding: 16px 20px;
  animation: shake 0.5s ease;
}

.error-banner-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.error-icon {
  font-size: 2.2rem;
}

.error-text-block {
  flex: 1;
  text-align: left;
}

.error-title {
  color: #ff7675;
  font-size: 1.15rem;
  font-family: var(--font-hs-display);
  font-weight: 800;
}

.error-desc {
  color: #fab1a0;
  font-size: 0.85rem;
  font-family: var(--font-system);
}

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

/* ================= SCRAPING PROGRESS VIEW ================= */
.scraping-progress-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 70px);
  padding: 40px 20px;
}

.progress-wood-card {
  max-width: 580px;
  width: 100%;
  padding: 40px 32px;
  text-align: center;
}

.mana-crystallization-loader {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 0 auto 24px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-key-gem {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid var(--hs-gold-light);
  box-shadow: 0 0 20px rgba(245, 215, 127, 0.7), 0 0 10px #ffeaa7;
  object-fit: cover;
  animation: pulse-gem 1.8s infinite ease-in-out;
  z-index: 2;
}

.mana-orbit-ring {
  position: absolute;
  inset: 0;
  border: 2px dashed rgba(212, 175, 55, 0.5);
  border-radius: 50%;
  animation: spin 8s linear infinite;
}

.progress-header-title {
  color: var(--hs-gold-light);
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.progress-status-subtext {
  color: #c8d6e5;
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.hearthstone-progress-bar {
  background: #120a06;
  border: 2px solid var(--hs-gold-dark);
  border-radius: 12px;
  height: 22px;
  padding: 2px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
  position: relative;
  overflow: hidden;
  margin-bottom: 12px;
}

.hearthstone-progress-fill {
  background: linear-gradient(90deg, #0984e3 0%, #00cec9 50%, #ffeaa7 100%);
  height: 100%;
  border-radius: 8px;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px #00cec9;
}

.progress-percent-label {
  font-family: var(--font-system);
  font-size: 0.9rem;
  color: var(--hs-gold-primary);
  font-weight: 700;
}

/* ================= 2. MAIN APPLICATION VIEWS ================= */
.main-app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 20px 80px 20px;
}

.tab-content-panel {
  display: none;
}

.tab-content-panel.active {
  display: block;
}

/* ================= TAB 1: TIER LIST BROWSER ================= */
.class-picker-section {
  margin-bottom: 24px;
}

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

.class-btn {
  background: linear-gradient(180deg, #2e180d 0%, #1c0e07 100%);
  border: 2px solid #5a381a;
  border-radius: 8px;
  padding: 12px 8px;
  color: #e5d8b8;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.class-btn:hover {
  transform: translateY(-2px);
  border-color: var(--class-color, var(--hs-gold-primary));
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), 0 0 10px var(--class-color, rgba(212, 175, 55, 0.3));
}

.class-btn.active {
  border-color: var(--class-color, var(--hs-gold-light));
  background: linear-gradient(180deg, #3d2113 0%, #201008 100%);
  box-shadow: 0 0 16px var(--class-color, var(--hs-gold-primary)), inset 0 0 8px rgba(255, 255, 255, 0.15);
}

.class-crest-wrap {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
  border: 1.5px solid rgba(212, 175, 55, 0.3);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.class-icon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.class-btn:hover .class-crest-wrap {
  transform: scale(1.08);
  border-color: var(--hs-gold-light);
}

.class-info {
  text-align: center;
}

.class-name {
  display: block;
  font-family: var(--font-hs-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
}

.class-count {
  display: block;
  font-size: 0.7rem;
  color: #a4b0be;
  font-family: var(--font-system);
}

/* Toolbar */
.tierlist-toolbar {
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  color: #b2bec3;
}

.search-box input {
  width: 100%;
  background: #140b07;
  border: 1.5px solid #5a381a;
  border-radius: 6px;
  color: #fff;
  font-family: var(--font-system);
  font-size: 0.9rem;
  padding: 10px 36px 10px 36px;
  outline: none;
  transition: border-color 0.2s ease;
}

.search-box input:focus {
  border-color: var(--hs-gold-primary);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

.clear-search-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #b2bec3;
  cursor: pointer;
  font-size: 0.85rem;
}

.filter-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-system);
  font-size: 0.85rem;
  color: #d1ccc0;
}

.pill-group {
  display: flex;
  gap: 4px;
}

.filter-pill {
  background: #1a0f09;
  border: 1px solid #4a2c1b;
  color: #b2bec3;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: var(--font-system);
  transition: all 0.2s ease;
}

.filter-pill:hover {
  color: #fff;
  border-color: var(--hs-gold-dark);
}

.filter-pill.active {
  background: var(--hs-gold-primary);
  color: #120a05;
  border-color: #ffeaa7;
  font-weight: 700;
}

.hs-select {
  background: #140b07;
  border: 1.5px solid #5a381a;
  color: #fff;
  font-family: var(--font-system);
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

.hs-select:focus {
  border-color: var(--hs-gold-primary);
}

/* Tier Sections */
.tier-bracket-section {
  margin-bottom: 28px;
  border-left: 4px solid var(--tier-border, #f39c12);
  padding-left: 16px;
}

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

.tier-badge-pill {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tier-bracket-name {
  font-family: var(--font-hs-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--tier-color, #fff);
  text-shadow: 0 0 10px var(--tier-color);
}

.tier-score-range {
  background: var(--tier-bg, rgba(243, 156, 18, 0.2));
  color: var(--tier-color, #f39c12);
  border: 1px solid var(--tier-border, #f39c12);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-family: var(--font-system);
  font-weight: 700;
}

.tier-card-count {
  font-size: 0.85rem;
  color: #a4b0be;
  font-family: var(--font-system);
}

/* Cards Grid */
.card-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

/* Individual Card Tile */
.hs-card-tile {
  background: linear-gradient(180deg, #2b170c 0%, #1a0d06 100%);
  border: 2px solid #5a381a;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  flex-direction: column;
}

.hs-card-tile:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--hs-gold-light);
  box-shadow: var(--gold-glow), 0 12px 24px rgba(0, 0, 0, 0.8);
  z-index: 5;
}

.card-art-container {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: radial-gradient(circle, #2d3436 0%, #140b07 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-render-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.hs-card-tile:hover .card-render-img {
  transform: scale(1.06);
}

/* Mana Crystal Badge */
.mana-crystal-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 32px;
  height: 32px;
  background: radial-gradient(circle, #00d2d3 0%, #0984e3 80%);
  border: 2px solid #ffeaa7;
  transform: rotate(45deg);
  box-shadow: 0 0 10px #00d2d3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-hs-display);
  font-weight: 900;
  color: #fff;
  font-size: 1.05rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  z-index: 3;
}

.mana-crystal-badge::before {
  content: attr(data-mana);
  transform: rotate(-45deg);
}

/* Tier Score Badge */
.score-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1.5px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.score-num {
  font-family: var(--font-hs-display);
  font-size: 0.95rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

/* Card Metadata */
.card-meta {
  padding: 10px 12px;
  background: #170d06;
  border-top: 1px solid #4a2c1b;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
  width: 100%;
}

.card-name {
  font-family: var(--font-hs-display);
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: break-word;
}

.card-rarity-tag {
  font-size: 0.62rem;
  font-family: var(--font-system);
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.4px;
  flex-shrink: 0;
  white-space: nowrap;
  padding-left: 2px;
}

/* Glowing NEW badge */
.hs-new-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  color: #fff;
  font-size: 0.58rem;
  font-family: var(--font-system);
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid #ff7675;
  margin-left: 4px;
  letter-spacing: 0.5px;
  box-shadow: 0 0 8px rgba(231, 76, 60, 0.8), 0 0 3px #ff7675;
  animation: pulse-new 1.8s infinite ease-in-out;
  vertical-align: middle;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

@keyframes pulse-new {
  0%, 100% {
    box-shadow: 0 0 6px rgba(231, 76, 60, 0.6);
    transform: scale(0.96);
  }
  50% {
    box-shadow: 0 0 14px rgba(255, 71, 87, 0.95), 0 0 4px #fff;
    transform: scale(1.05);
  }
}

.rarity-text-legendary { color: var(--rarity-legendary); }
.rarity-text-epic { color: var(--rarity-epic); }
.rarity-text-rare { color: var(--rarity-rare); }
.rarity-text-common { color: var(--rarity-common); }

.card-tier-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-family: var(--font-system);
  font-weight: 700;
}

.tier-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* Fallback CSS Card Frame if image fails */
.card-render-css-fallback {
  width: 88%;
  height: 88%;
  background: linear-gradient(145deg, #3a2213 0%, #201107 100%);
  border: 3px solid var(--hs-gold-primary);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  text-align: center;
}

.css-card-title {
  font-family: var(--font-hs-display);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--hs-gold-light);
  margin-bottom: 4px;
}

.css-card-type {
  font-size: 0.75rem;
  color: #b2bec3;
  margin-bottom: 8px;
}

.css-card-stats {
  display: flex;
  gap: 16px;
  font-family: var(--font-hs-display);
  font-weight: 900;
  font-size: 1.1rem;
}

.css-stat-atk { color: #f1c40f; }
.css-stat-hp { color: #e74c3c; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

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

/* ================= CARD DETAIL MODAL ================= */
.hs-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.hs-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}

.hs-modal-dialog {
  position: relative;
  background: linear-gradient(160deg, #2f190e 0%, #1a0c06 100%);
  border: 3px solid var(--hs-gold-primary);
  border-radius: 12px;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.9), var(--gold-glow-lg);
  max-width: 760px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 2;
  padding: 32px;
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #3e2213;
  border: 1.5px solid var(--hs-gold-dark);
  color: var(--hs-gold-light);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: #e74c3c;
  border-color: #ff7675;
  color: #fff;
}

.card-detail-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  align-items: center;
}

.modal-card-render {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.8));
}

.card-detail-info {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail-rarity-pill {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--hs-gold-light);
  font-family: var(--font-system);
}

.detail-card-name {
  font-size: 1.7rem;
  color: #fff;
  line-height: 1.15;
}

.detail-class-tag {
  font-size: 0.85rem;
  color: #a4b0be;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.detail-score-banner {
  border: 2px solid var(--tier-color);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.detail-score-label {
  font-size: 0.75rem;
  color: #d1ccc0;
  display: block;
  font-family: var(--font-system);
}

.detail-score-value {
  font-family: var(--font-hs-display);
  font-size: 1.8rem;
  font-weight: 900;
}

.detail-tier-name {
  font-family: var(--font-hs-display);
  font-size: 1.1rem;
  font-weight: 800;
  display: block;
}

.detail-tier-desc {
  font-size: 0.75rem;
  color: #a4b0be;
  font-family: var(--font-system);
}

.detail-section-title {
  font-size: 0.85rem;
  color: var(--hs-gold-light);
  margin-bottom: 4px;
  font-family: var(--font-hs-display);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-card-text {
  font-size: 0.95rem;
  color: #dfe6e9;
  line-height: 1.4;
  background: rgba(0, 0, 0, 0.3);
  padding: 10px 12px;
  border-radius: 6px;
  border-left: 3px solid var(--hs-gold-primary);
}

.coaching-tip-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid #5a381a;
  border-radius: 6px;
  padding: 10px 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.88rem;
  color: #ffeaa7;
  font-family: var(--font-system);
}

.card-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.stat-pill {
  background: #190c06;
  border: 1px solid #4a2c1b;
  border-radius: 6px;
  padding: 8px 10px;
  text-align: center;
}

.stat-lbl {
  display: block;
  font-size: 0.7rem;
  color: #a4b0be;
  font-family: var(--font-system);
  text-transform: uppercase;
}

.stat-val {
  font-family: var(--font-hs-display);
  font-size: 1.15rem;
  font-weight: 900;
  color: #fff;
}

.mana-color { color: #00cec9; }
.atk-color { color: #f1c40f; }
.hp-color { color: #e74c3c; }

/* ================= TAVERN DIALOG & CONFIRM MODAL ================= */
.hs-confirm-dialog {
  max-width: 560px;
  width: 92%;
  padding: 36px 36px 30px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: radial-gradient(circle at 50% 15%, #3d2314 0%, #201008 70%, #120703 100%);
  border: 3px solid var(--hs-gold-primary);
  border-radius: 18px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.95), 0 0 35px rgba(212, 175, 55, 0.5);
}

.tavern-dialog-crest {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffeaa7 0%, #d4af37 65%, #634308 100%);
  border: 3px solid var(--hs-gold-light);
  box-shadow: 0 0 24px rgba(212, 175, 55, 0.8), 0 6px 14px rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  flex-shrink: 0;
  animation: pulse-gem 3s ease-in-out infinite;
}

.dialog-key-img {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #2b180d;
  display: block;
}

.tavern-dialog-title {
  font-family: var(--font-hs-display);
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--hs-gold-light);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9), 0 0 14px rgba(245, 215, 127, 0.6);
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}

.tavern-dialog-message {
  font-family: var(--font-hs-body);
  font-size: 1.1rem;
  line-height: 1.55;
  color: var(--hs-parchment);
  margin-bottom: 28px;
  max-width: 460px;
  white-space: pre-line;
}

.tavern-dialog-actions {
  display: flex;
  gap: 16px;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
}

.tavern-dialog-actions .hs-btn {
  flex: 1;
  min-width: 160px;
  padding: 13px 24px;
  font-size: 1rem;
  justify-content: center;
}

/* ================= TAVERN TOAST NOTIFICATION ================= */
.tavern-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  z-index: 9999;
  background: linear-gradient(135deg, #2f190e 0%, #170c06 100%);
  border: 2px solid var(--hs-gold-primary);
  border-radius: 28px;
  padding: 12px 26px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--hs-parchment);
  font-family: var(--font-hs-display);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.85), var(--gold-glow);
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tavern-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.tavern-toast .toast-icon {
  font-size: 1.25rem;
}

.tavern-toast .toast-text {
  font-weight: 700;
  color: var(--hs-gold-light);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* ================= TAB 2: ARENA DRAFT SIMULATION ================= */
.draft-hero-select-wrap {
  max-width: 1080px;
  margin: 0 auto;
}

.tavern-notice-box {
  background: linear-gradient(180deg, #3a2213 0%, #201008 100%);
  border: 2px solid var(--hs-gold-primary);
  border-radius: 8px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 32px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
}

.notice-icon {
  font-size: 2.5rem;
}

.hero-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.hero-selection-card {
  padding: 32px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  transition: all 0.25s ease;
  cursor: pointer;
}

.hero-selection-card:hover {
  transform: translateY(-6px);
  border-color: var(--hs-gold-light);
  box-shadow: var(--gold-glow), 0 10px 25px rgba(0, 0, 0, 0.8);
}

.hero-crest-large-wrap {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px solid var(--hs-gold-primary);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
  background: #000;
}

.hero-crest-img-lg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-class-name {
  font-size: 1.6rem;
  margin-bottom: 10px;
}

.hero-description {
  font-size: 0.92rem;
  color: #dfd8ca;
  margin-bottom: 20px;
  min-height: 48px;
}

.hero-stats-preview {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}

.preview-badge {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid #4a2c1b;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  color: #2ecc71;
  font-family: var(--font-system);
}

/* Drafting Workspace */
.draft-workspace {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
}

.draft-main-stage {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.draft-header-panel {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.draft-hero-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-crest-img-sm {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--hs-gold-light);
  object-fit: cover;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.7);
  flex-shrink: 0;
}

.hero-name-badge {
  font-family: var(--font-hs-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--class-color, var(--hs-gold-light));
  display: block;
}

.draft-progress-text {
  font-size: 0.85rem;
  color: #d1ccc0;
}

.draft-progress-wrapper {
  flex: 1;
  max-width: 320px;
  text-align: right;
}

.progress-bar-container {
  background: #140b07;
  border: 1.5px solid var(--hs-gold-dark);
  border-radius: 10px;
  height: 14px;
  padding: 1px;
  overflow: hidden;
  margin-bottom: 4px;
}

.progress-bar-fill {
  background: linear-gradient(90deg, #d4af37 0%, #2ecc71 100%);
  height: 100%;
  border-radius: 8px;
  transition: width 0.3s ease;
}

.progress-fraction {
  font-size: 0.75rem;
  color: #a4b0be;
  font-family: var(--font-system);
}

.draft-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.change-class-btn {
  font-size: 0.8rem;
  padding: 8px 14px;
}

.mobile-tracker-toggle-btn {
  display: none;
}

/* ================= DRAFT DIFFICULTY MODES ================= */
.hero-mode-toggle-wrap {
  display: flex;
  align-items: center;
}

.draft-mode-selector {
  display: inline-flex;
  align-items: center;
  background: rgba(18, 9, 5, 0.95);
  border: 1.5px solid var(--hs-gold-dark);
  border-radius: 24px;
  padding: 3px;
  gap: 3px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.mode-pill-btn {
  background: transparent;
  border: none;
  color: #a4b0be;
  padding: 6px 14px;
  border-radius: 18px;
  font-family: var(--font-hs-display);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.22s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
  white-space: nowrap;
}

.mode-pill-btn:hover:not(.active) {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.mode-pill-btn[data-mode="normal"].active {
  background: linear-gradient(135deg, #d4af37 0%, #8b6508 100%);
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.55);
}

.mode-pill-btn[data-mode="heroic"].active {
  background: linear-gradient(135deg, #3498db 0%, #1b4f72 100%);
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 12px rgba(52, 152, 219, 0.55);
}

.mode-pill-btn[data-mode="deadly"].active {
  background: linear-gradient(135deg, #e74c3c 0%, #7b241c 100%);
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 12px rgba(231, 76, 60, 0.65);
}

.mode-icon {
  font-size: 0.95rem;
}

.dead-mode-indicator {
  color: #a4b0be !important;
  font-style: italic;
  font-size: 0.78rem;
}

.heroic-dot {
  background: #3498db !important;
  box-shadow: 0 0 6px rgba(52, 152, 219, 0.7);
}

.dead-dot {
  background: #e74c3c !important;
  box-shadow: 0 0 6px rgba(231, 76, 60, 0.7);
}

.mode-revealed-banner {
  border-radius: 10px;
  padding: 18px 24px;
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  animation: fadeIn 0.4s ease-out;
}

.mode-revealed-banner.heroic {
  background: linear-gradient(135deg, rgba(20, 45, 75, 0.95) 0%, rgba(10, 20, 35, 0.98) 100%);
  border: 2px solid #3498db;
  box-shadow: 0 0 25px rgba(52, 152, 219, 0.35);
}

.mode-revealed-banner.heroic .mode-banner-title {
  color: #70a1ff;
}

.mode-revealed-banner.deadly {
  background: linear-gradient(135deg, rgba(60, 16, 16, 0.95) 0%, rgba(26, 10, 10, 0.98) 100%);
  border: 2px solid #e74c3c;
  box-shadow: 0 0 25px rgba(231, 76, 60, 0.35);
}

.mode-revealed-banner.deadly .mode-banner-title {
  color: #ff7675;
}

.mode-icon-lg {
  font-size: 2.8rem;
  flex-shrink: 0;
}

.mode-banner-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mode-banner-title {
  font-family: var(--font-hs-display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.mode-banner-desc {
  font-family: var(--font-hs-body);
  font-size: 0.95rem;
  color: #f5f6fa;
  line-height: 1.4;
}

/* Buckets View */
.card-buckets-container {
  background: linear-gradient(180deg, rgba(38, 20, 11, 0.75) 0%, rgba(20, 10, 6, 0.85) 100%);
  border: 2px solid var(--hs-gold-dark);
  border-radius: 10px;
  padding: 24px;
}

.bucket-prompt {
  font-size: 1.2rem;
  color: var(--hs-gold-light);
  margin-bottom: 20px;
  text-align: center;
}

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

.bucket-card-col {
  display: flex;
  flex-direction: column;
  position: relative;
}

.bucket-card-col.is-user-pick .bucket-card-card {
  border-color: #3498db;
  box-shadow: 0 0 20px rgba(52, 152, 219, 0.6);
}

.bucket-card-col.is-best-pick .bucket-card-card {
  border-color: #2ecc71;
  box-shadow: 0 0 20px rgba(46, 204, 113, 0.7);
}

.choice-status-badge {
  position: static;
  align-self: center;
  margin-bottom: 8px;
  padding: 5px 16px;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--font-hs-display);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.choice-status-placeholder {
  height: 28px;
  margin-bottom: 8px;
}

.choice-status-badge.optimal {
  background: #2ecc71;
  color: #0b2413;
  border: 1px solid #fff;
}

.choice-status-badge.picked {
  background: #3498db;
  color: #fff;
  border: 1px solid #74b9ff;
}

.choice-status-badge.recommended {
  background: #f39c12;
  color: #fff;
  border: 1px solid #ffeaa7;
}

.bucket-action-wrap {
  padding: 12px;
  background: #140b07;
  text-align: center;
  border-top: 1px solid #4a2c1b;
}

.pick-card-btn {
  width: 100%;
  padding: 10px 16px;
  font-size: 0.85rem;
}

.post-pick-eval-summary {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.eval-stat-chip {
  font-size: 0.75rem;
  color: #d1ccc0;
  font-family: var(--font-system);
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 8px;
  border-radius: 4px;
}

/* AI Coaching Drawer */
.ai-coaching-drawer {
  padding: 24px;
  border-color: var(--badge-color, #2ecc71);
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.8), 0 0 15px var(--badge-color, rgba(46, 204, 113, 0.4));
}

.coaching-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.coaching-score-pill {
  display: flex;
  align-items: center;
  gap: 16px;
}

.coaching-score-number {
  font-family: var(--font-hs-display);
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1;
}

.coaching-badge-label {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 800;
  color: #111;
  text-transform: uppercase;
  font-family: var(--font-hs-display);
  margin-bottom: 2px;
}

.coaching-decision-label {
  display: block;
  font-size: 0.75rem;
  color: #a4b0be;
  font-family: var(--font-system);
}

.advance-pick-btn {
  font-size: 1.05rem;
  padding: 14px 28px;
}

.coaching-feedback-content {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 20px;
  align-items: flex-start;
}

.coach-avatar-column {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.coach-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2.5px solid var(--hs-gold-primary);
  background: radial-gradient(circle at 50% 30%, #4a2712 0%, #1a0c06 100%);
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.45), 0 4px 10px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 6px;
  flex-shrink: 0;
}

.coach-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transform: scale(1.35) translateY(4px);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
  display: block;
}

.coach-title {
  font-size: 0.72rem;
  color: var(--hs-gold-light);
  font-family: var(--font-hs-display);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.coach-heading {
  font-size: 1.15rem;
  color: #fff;
  margin-bottom: 8px;
}

.coach-body {
  font-size: 0.92rem;
  color: #dfe6e9;
  line-height: 1.5;
  margin-bottom: 16px;
  font-family: var(--font-system);
}

.coach-factors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.factor-item {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid #4a2c1b;
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.factor-icon {
  font-size: 1.3rem;
}

.factor-title {
  display: block;
  font-size: 0.75rem;
  color: var(--hs-gold-light);
  font-family: var(--font-hs-display);
}

.factor-desc {
  display: block;
  font-size: 0.75rem;
  color: #b2bec3;
  font-family: var(--font-system);
}

/* Sidebar: Deck Tracker */
.draft-sidebar-tracker {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: 820px;
  overflow: hidden;
}

.tracker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1.5px solid var(--hs-gold-dark);
}

.deck-count-pill {
  background: var(--hs-gold-primary);
  color: #120a05;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
  font-family: var(--font-system);
}

.curve-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.curve-lbl {
  font-size: 0.85rem;
  color: var(--hs-gold-light);
  font-family: var(--font-hs-display);
}

.curve-stat {
  font-size: 0.7rem;
  color: #a4b0be;
  font-family: var(--font-system);
}

.curve-histogram {
  display: flex;
  align-items: flex-end;
  height: 90px;
  background: #140b07;
  border: 1px solid #4a2c1b;
  border-radius: 6px;
  padding: 8px;
  gap: 6px;
}

.curve-histogram.large {
  height: 140px;
}

.histogram-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.column-count {
  font-size: 0.7rem;
  color: var(--hs-gold-light);
  font-family: var(--font-system);
  margin-bottom: 2px;
  min-height: 14px;
}

.column-bar-track {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
}

.column-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, #00cec9 0%, #0984e3 100%);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  box-shadow: 0 0 6px rgba(0, 206, 201, 0.4);
}

.column-mana {
  font-size: 0.75rem;
  color: #d1ccc0;
  font-family: var(--font-hs-display);
  font-weight: 700;
  margin-top: 4px;
}

.drafted-cards-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 4px;
}

.deck-list-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid #4a2c1b;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 0.85rem;
  position: relative;
}

.row-mana-badge {
  width: 22px;
  height: 22px;
  background: #0984e3;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-family: var(--font-hs-display);
  font-weight: 800;
}

.row-card-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
  font-family: var(--font-system);
  font-size: 0.82rem;
}

.row-tier-score {
  font-family: var(--font-hs-display);
  font-weight: 700;
  font-size: 0.8rem;
}

.row-count-badge {
  background: #ffeaa7;
  color: #120a05;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 8px;
  font-family: var(--font-system);
}

.empty-deck-notice {
  text-align: center;
  color: #7f8c8d;
  font-size: 0.85rem;
  padding: 30px 10px;
  font-style: italic;
}

/* Completion View */
.draft-completion-wrap {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.completion-hero-banner {
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}

.completion-crest-large-wrap {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--hs-gold-primary);
  overflow: hidden;
  box-shadow: var(--gold-glow);
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.completion-crest-img-lg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hs-kw {
  color: var(--hs-gold-light);
  font-weight: 800;
}

.detail-class-icon-mini {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 6px;
  border: 1px solid var(--hs-gold-dark);
  object-fit: cover;
}

.completion-headings {
  flex: 1;
  min-width: 240px;
}

.arena-key-tag {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--hs-gold-light);
  letter-spacing: 1.5px;
  display: block;
  margin-bottom: 4px;
}

.completion-title {
  font-size: 2.2rem;
  color: #fff;
  margin-bottom: 4px;
}

.completion-tier-title {
  font-size: 1.1rem;
  color: #2ecc71;
  font-family: var(--font-hs-display);
  font-weight: 700;
}

.completion-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.completion-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.metric-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.metric-icon {
  font-size: 2rem;
}

.metric-number {
  font-family: var(--font-hs-display);
  font-size: 2.6rem;
  font-weight: 900;
  color: var(--hs-gold-light);
  line-height: 1;
}

.metric-number-text {
  font-family: var(--font-hs-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: #2ecc71;
  line-height: 1.1;
}

.metric-label {
  display: block;
  font-size: 0.85rem;
  color: #dfe6e9;
  font-family: var(--font-system);
}

.metric-footnote {
  font-size: 0.75rem;
  color: #7f8c8d;
  font-family: var(--font-system);
}

.completion-details-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 32px;
  margin-top: 32px;
}

.deck-analysis-col,
.deck-cards-col {
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
}

.panel-section-title {
  font-family: var(--font-hs-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--hs-gold-light);
  margin-top: 0;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid var(--hs-gold-dark);
  letter-spacing: 0.04em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.comp-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.comp-pill {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid #4a2c1b;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-family: var(--font-system);
  color: #d1ccc0;
}

.comp-pill.gold {
  border-color: var(--hs-gold-primary);
  color: var(--hs-gold-light);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.25);
}

/* ================= GLOBAL DIFFICULTY BREAKDOWN ================= */
.difficulty-distribution-card {
  padding: 18px 24px 20px;
  margin-bottom: 24px;
  background: linear-gradient(135deg, rgba(38, 20, 11, 0.95) 0%, rgba(20, 10, 5, 0.95) 100%);
  border: 2px solid var(--hs-gold-primary);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.diff-dist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.diff-dist-title-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.diff-dist-icon {
  font-size: 1.8rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.diff-dist-heading {
  font-family: var(--font-hs-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--hs-gold-light);
  letter-spacing: 0.03em;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.diff-dist-subtext {
  font-size: 0.82rem;
  color: var(--hs-parchment-muted);
  margin: 2px 0 0;
}

.diff-overall-tag {
  font-family: var(--font-hs-display);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 6px 14px;
  border-radius: 20px;
  background: radial-gradient(circle, #3d2412 0%, #1c0e06 100%);
  border: 1.5px solid var(--hs-gold-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 0 10px rgba(212, 175, 55, 0.25);
}

.diff-progress-bar {
  height: 14px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid #4a2c1b;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  margin-bottom: 14px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.7);
}

.diff-bar-segment {
  height: 100%;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.diff-bar-segment.normal {
  background: linear-gradient(90deg, #d4af37, #f1c40f);
  box-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
}

.diff-bar-segment.heroic {
  background: linear-gradient(90deg, #2980b9, #3498db);
  box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}

.diff-bar-segment.deadly {
  background: linear-gradient(90deg, #c0392b, #e74c3c);
  box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

.diff-stats-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.diff-stat-item {
  flex: 1;
  min-width: 170px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.diff-stat-item.normal {
  border-color: rgba(212, 175, 55, 0.35);
  background: rgba(212, 175, 55, 0.08);
}

.diff-stat-item.heroic {
  border-color: rgba(52, 152, 219, 0.35);
  background: rgba(52, 152, 219, 0.08);
}

.diff-stat-item.deadly {
  border-color: rgba(231, 76, 60, 0.35);
  background: rgba(231, 76, 60, 0.08);
}

.diff-stat-icon {
  font-size: 1.1rem;
}

.diff-stat-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--hs-parchment-muted);
}

.diff-stat-val {
  font-family: var(--font-hs-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
}

.diff-stat-item.normal .diff-stat-val {
  color: #ffd152;
}

.diff-stat-item.heroic .diff-stat-val {
  color: #74b9ff;
}

.diff-stat-item.deadly .diff-stat-val {
  color: #ff7675;
}

.diff-stat-count {
  font-size: 0.76rem;
  color: #888;
  margin-left: auto;
}

.final-decklist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 10px;
  max-height: 520px;
  overflow-y: auto;
  padding: 4px 8px 6px 2px;
}

.final-deck-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid #4a2c1b;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.86rem;
  transition: all 0.2s ease;
}

.final-deck-row:hover {
  background: rgba(212, 175, 55, 0.12);
  border-color: var(--hs-gold-primary);
  transform: translateY(-1px);
}

.final-row-mana {
  width: 24px;
  height: 24px;
  background: #0984e3;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  font-family: var(--font-hs-display);
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(9, 132, 227, 0.5);
}

.final-row-name {
  flex: 1;
  min-width: 0;
  color: #fff;
  font-family: var(--font-system);
  font-size: 0.84rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.final-row-mode {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 10px;
  flex-shrink: 0;
  white-space: nowrap;
}

.mode-tag-normal {
  background: rgba(212, 175, 55, 0.15);
  color: #ffd152;
  border: 1px solid rgba(212, 175, 55, 0.45);
}

.mode-tag-heroic {
  background: rgba(52, 152, 219, 0.18);
  color: #74b9ff;
  border: 1px solid rgba(52, 152, 219, 0.5);
}

.mode-tag-deadly {
  background: rgba(231, 76, 60, 0.2);
  color: #ff7675;
  border: 1px solid rgba(231, 76, 60, 0.55);
}

.final-row-rarity {
  font-size: 0.72rem;
  color: #a4b0be;
  font-family: var(--font-system);
  flex-shrink: 0;
  text-transform: capitalize;
}

.final-row-score {
  font-family: var(--font-hs-display);
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
  min-width: 28px;
  text-align: right;
}

/* ================= MOBILE BOTTOM NAVIGATION ================= */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, #201008 0%, #120904 100%);
  border-top: 2px solid var(--hs-gold-dark);
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.8);
  padding: 6px 16px;
  z-index: 90;
  justify-content: space-around;
}

.mobile-tab-btn {
  background: none;
  border: none;
  color: #b2bec3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 16px;
  font-family: var(--font-hs-display);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-tab-icon {
  font-size: 1.3rem;
}

.mobile-tab-btn.active {
  color: var(--hs-gold-light);
  transform: translateY(-2px);
}

.mobile-tab-btn.active .mobile-tab-icon {
  filter: drop-shadow(0 0 6px var(--hs-gold-primary));
}

/* ================= ANIMATIONS ================= */
@keyframes pulse-rune {
  0%, 100% { opacity: 0.6; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.15); filter: drop-shadow(0 0 6px var(--hs-gold-primary)); }
}

@keyframes pulse-gem {
  0%, 100% { transform: rotate(45deg) scale(0.95); box-shadow: 0 0 15px #00cec9; }
  50% { transform: rotate(45deg) scale(1.08); box-shadow: 0 0 30px #00d2d3, inset 0 0 15px #fff; }
}

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

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

.animate-fade-in {
  animation: fadeIn 0.35s ease-out;
}

.animate-scale-up {
  animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-slide-up {
  animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

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

/* ================= RESPONSIVE MEDIA QUERIES ================= */
@media (max-width: 1024px) {
  .draft-workspace {
    grid-template-columns: 1fr;
  }

  .draft-sidebar-tracker {
    display: none;
    position: fixed;
    bottom: 60px;
    right: 16px;
    width: 320px;
    z-index: 100;
    max-height: 70vh;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.9);
  }

  .draft-sidebar-tracker.mobile-open {
    display: flex;
  }

  .mobile-tracker-toggle-btn {
    display: inline-flex;
  }

  .completion-details-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header-nav-tabs {
    display: none;
  }

  .mobile-bottom-nav {
    display: flex;
  }

  .tavern-header {
    padding: 8px 16px;
  }

  .landing-headline {
    font-size: 1.8rem;
  }

  .buckets-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .card-detail-layout {
    grid-template-columns: 1fr;
  }

  .coaching-top-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .coaching-feedback-content {
    grid-template-columns: 1fr;
  }

  .coach-avatar-column {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  .coach-avatar {
    width: 52px;
    height: 52px;
    margin: 0;
  }

  .card-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}
