/* ============================================================================
   TankHub — Modern Cyber-Armor & Obsidian Gold Design System
   High-contrast, eye-friendly, esports dark aesthetic.
   0 System Emojis · Metallic Sheen on Steel · Clean Typography & Gradients
   ============================================================================ */

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

html[data-th-theme="unified"],
:root {
  /* ── Deep Obsidian Palette ── */
  --th-bg-canvas: #090b10;
  --th-bg-surface: #0f131c;
  --th-bg-card: #131722;
  --th-bg-card-elevated: #181e2c;
  --th-bg-well: #0c0e15;
  --th-bg-glass: rgba(15, 19, 28, 0.85);

  /* ── Clean Borders & Dividers ── */
  --th-border-subtle: rgba(255, 255, 255, 0.07);
  --th-border-medium: rgba(255, 255, 255, 0.12);
  --th-border-card: rgba(255, 255, 255, 0.08);
  --th-border-gold: rgba(245, 158, 11, 0.4);
  --th-border-gold-soft: rgba(245, 158, 11, 0.2);

  /* ── Cyber-Gold Brand Accent ── */
  --th-gold: #fbbf24;
  --th-gold-dark: #d97706;
  --th-gold-soft: rgba(245, 158, 11, 0.12);
  --th-gold-glow: rgba(245, 158, 11, 0.25);
  --th-gold-gradient: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
  --th-gold-gradient-hover: linear-gradient(135deg, #fde047 0%, #fbbf24 50%, #ea580c 100%);

  /* ── Tactical Semantic Accents ── */
  --th-emerald: #10b981;
  --th-emerald-soft: rgba(16, 185, 129, 0.12);
  --th-ruby: #f43f5e;
  --th-ruby-soft: rgba(244, 63, 94, 0.12);
  --th-cyan: #06b6d4;
  --th-cyan-soft: rgba(6, 182, 212, 0.12);

  /* ── Typography & Neutrals ── */
  --th-text-primary: #f8fafc;
  --th-text-secondary: #cbd5e1;
  --th-text-muted: #8492a6;
  --th-text-subtle: #4b5563;
  --th-text-gold: #fbbf24;

  /* ── Re-map legacy tokens ── */
  --bg-dark: var(--th-bg-canvas);
  --bg-primary: var(--th-bg-canvas);
  --bg-surface: var(--th-bg-surface);
  --bg-card: var(--th-bg-card);
  --bg-card-elevated: var(--th-bg-card-elevated);
  --border-card: var(--th-border-card);
  --border-subtle: var(--th-border-subtle);
  --border-fire: var(--th-border-gold);
  --border-gold: var(--th-border-gold);
  --fire-500: var(--th-gold);
  --gold: var(--th-gold);
  --accent: var(--th-gold);
  --accentHover: #f59e0b;
}

/* ── 1. Base Canvas & Typography ── */
html[data-th-theme="unified"] body,
body {
  background: radial-gradient(1200px 700px at 50% -10%, #151a27 0%, #090b10 65%) fixed, #090b10 !important;
  color: var(--th-text-primary) !important;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif !important;
  letter-spacing: -0.01em;
}

/* Scrollbars */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: #090b10; }
::-webkit-scrollbar-thumb { background: #1e2433; border-radius: 4px; border: 1px solid rgba(255,255,255,0.05); }
::-webkit-scrollbar-thumb:hover { background: #2d3748; }

/* ── 2. Cards & Containers (Structured, Tactical, Sleek) ── */
html[data-th-theme="unified"] .card,
html[data-th-theme="unified"] .panel,
html[data-th-theme="unified"] .stat-card,
html[data-th-theme="unified"] .box,
html[data-th-theme="unified"] [class*="card--"] {
  background: linear-gradient(180deg, #131722 0%, #0f121a 100%) !important;
  border: 1px solid var(--th-border-card) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 14px !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45) !important;
}

/* Card Header Accent Line */
html[data-th-theme="unified"] .card__header,
html[data-th-theme="unified"] .panel__header {
  border-bottom: 1px solid var(--th-border-subtle) !important;
  background: rgba(255, 255, 255, 0.02) !important;
}

/* ── 3. High-Performance CTAs & Buttons ── */
html[data-th-theme="unified"] .btn--primary,
html[data-th-theme="unified"] .btn-primary,
html[data-th-theme="unified"] button.primary,
html[data-th-theme="unified"] #btnWotConnect,
html[data-th-theme="unified"] .action-btn {
  background: var(--th-gold-gradient) !important;
  color: #090b10 !important;
  font-weight: 800 !important;
  letter-spacing: 0.02em !important;
  border: none !important;
  border-radius: 10px !important;
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.28) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  text-shadow: none !important;
  cursor: pointer !important;
}

html[data-th-theme="unified"] .btn--primary:hover,
html[data-th-theme="unified"] .btn-primary:hover,
html[data-th-theme="unified"] button.primary:hover {
  background: var(--th-gold-gradient-hover) !important;
  transform: translateY(-1.5px) !important;
  box-shadow: 0 6px 24px rgba(245, 158, 11, 0.42) !important;
}

html[data-th-theme="unified"] .btn--ghost,
html[data-th-theme="unified"] .btn-ghost {
  background: rgba(255, 255, 255, 0.035) !important;
  border: 1px solid var(--th-border-medium) !important;
  color: var(--th-text-secondary) !important;
  border-radius: 10px !important;
  transition: all 0.2s ease !important;
}
html[data-th-theme="unified"] .btn--ghost:hover {
  background: rgba(255, 255, 255, 0.07) !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  color: #fff !important;
}

/* ── 4. Clean Tabs & Pills (No Aggressive Yellow Blocks!) ── */
html[data-th-theme="unified"] .pill-btn,
html[data-th-theme="unified"] .arena-tab,
html[data-th-theme="unified"] .sub-tab,
html[data-th-theme="unified"] .wtab {
  background: #11151f !important;
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  color: var(--th-text-muted) !important;
  font-weight: 700 !important;
  border-radius: 9px !important;
  padding: 8px 16px !important;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
  box-shadow: none !important;
}

html[data-th-theme="unified"] .pill-btn:hover,
html[data-th-theme="unified"] .arena-tab:hover,
html[data-th-theme="unified"] .sub-tab:hover,
html[data-th-theme="unified"] .wtab:hover {
  background: #161b28 !important;
  color: #f1f5f9 !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
}

/* Active State: Clean Dark Elevated Pill with Amber Border & Glow, not flat yellow paint! */
html[data-th-theme="unified"] .pill-btn.pill--active,
html[data-th-theme="unified"] .pill-btn.active,
html[data-th-theme="unified"] .arena-tab.arena-tab--active,
html[data-th-theme="unified"] .arena-tab.active,
html[data-th-theme="unified"] .sub-tab.sub-tab--active,
html[data-th-theme="unified"] .sub-tab.active,
html[data-th-theme="unified"] .wtab.wtab--active {
  background: rgba(245, 158, 11, 0.12) !important;
  border: 1px solid rgba(245, 158, 11, 0.5) !important;
  color: #fbbf24 !important;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.16), inset 0 1px 0 rgba(251, 191, 36, 0.25) !important;
  text-shadow: 0 0 12px rgba(245, 158, 11, 0.35) !important;
}

/* ── 5. Metallic Steel Component with Animated Sheen (Блик на Стали) ── */
.premium-steel-badge,
.th-steel-pill,
#steelBadge,
#steelBalance {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  background: linear-gradient(135deg, #181d2a 0%, #0d1017 100%) !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
  border-radius: 12px !important;
  padding: 6px 14px !important;
  font-family: 'JetBrains Mono', 'Manrope', monospace !important;
  font-size: 15px !important;
  color: #fbbf24 !important;
  font-weight: 800 !important;
  overflow: hidden !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  cursor: pointer !important;
}

.premium-steel-badge:hover,
.th-steel-pill:hover {
  border-color: rgba(245, 158, 11, 0.7) !important;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  transform: translateY(-1px) !important;
}

/* Metallic Glare / Sheen Sweep Animation */
.premium-steel-badge::after,
.th-steel-pill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.04) 20%,
    rgba(255, 255, 255, 0.4) 50%,
    rgba(251, 191, 36, 0.5) 60%,
    transparent 100%
  );
  transform: skewX(-25deg);
  animation: thSteelSheen 4.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  pointer-events: none;
}

@keyframes thSteelSheen {
  0%, 70% { left: -120%; }
  100% { left: 220%; }
}

/* Rotating Gear Icon */
.premium-steel-badge .steel-icon,
.th-steel-icon {
  color: #fbbf24 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 18px !important;
  height: 18px !important;
  flex-shrink: 0 !important;
  transition: transform 0.6s ease;
}

.premium-steel-badge:hover .steel-icon {
  transform: rotate(90deg);
}

/* ── 6. Gold Currency Badge (Lesta Gold) ── */
.th-gold-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 8px;
  padding: 3px 8px;
  color: #fbbf24;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 13px;
}

.th-gold-coin {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fef08a 0%, #eab308 50%, #ca8a04 100%);
  border: 1px solid #fef08a;
  box-shadow: 0 0 8px rgba(234, 179, 8, 0.4);
  flex-shrink: 0;
  vertical-align: middle;
}

/* ── 7. Input Fields & Search Bars ── */
html[data-th-theme="unified"] input:not([type=checkbox]):not([type=radio]),
html[data-th-theme="unified"] select,
html[data-th-theme="unified"] textarea {
  background: #0b0e14 !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  color: #f8fafc !important;
  border-radius: 10px !important;
  padding: 10px 14px !important;
  font-size: 14px !important;
  transition: all 0.2s ease !important;
}

html[data-th-theme="unified"] input:focus,
html[data-th-theme="unified"] select:focus,
html[data-th-theme="unified"] textarea:focus {
  border-color: rgba(245, 158, 11, 0.5) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12) !important;
  background: #0f121a !important;
}

/* ── 8. Status & Beacon Indicators ── */
.th-beacon-online {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  position: relative;
  flex-shrink: 0;
}

.th-beacon-online::after {
  content: '';
  position: absolute;
  top: -2px; left: -2px; right: -2px; bottom: -2px;
  border-radius: 50%;
  border: 1px solid rgba(16, 185, 129, 0.6);
  animation: thPulse 2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

@keyframes thPulse {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* ── 9. Leaderboard Podium Styles ── */
.th-podium-1 {
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.12) 0%, rgba(19, 23, 34, 0.9) 100%) !important;
  border: 1px solid rgba(251, 191, 36, 0.45) !important;
  box-shadow: 0 8px 30px rgba(245, 158, 11, 0.18) !important;
}
.th-podium-2 {
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.12) 0%, rgba(19, 23, 34, 0.9) 100%) !important;
  border: 1px solid rgba(148, 163, 184, 0.35) !important;
}
.th-podium-3 {
  background: linear-gradient(180deg, rgba(217, 119, 6, 0.12) 0%, rgba(19, 23, 34, 0.9) 100%) !important;
  border: 1px solid rgba(217, 119, 6, 0.35) !important;
}

/* ── 10. Step Numbers in Arena (1, 2, 3, 4, 5) ── */
.th-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-size: 12px;
  font-weight: 800;
  margin-right: 8px;
  flex-shrink: 0;
}

/* ── 11. Vector Icon Color Helpers ── */
.th-ico-gold   { color: #fbbf24; display: inline-flex; vertical-align: middle; }
.th-ico-amber  { color: #f59e0b; display: inline-flex; vertical-align: middle; }
.th-ico-orange { color: #f97316; display: inline-flex; vertical-align: middle; }
.th-ico-cyan   { color: #06b6d4; display: inline-flex; vertical-align: middle; }
.th-ico-green  { color: #10b981; display: inline-flex; vertical-align: middle; }
.th-ico-red    { color: #f43f5e; display: inline-flex; vertical-align: middle; }
.th-ico-purple { color: #a855f7; display: inline-flex; vertical-align: middle; }
.th-ico-silver { color: #94a3b8; display: inline-flex; vertical-align: middle; }

.th-inline-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  margin: 0 3px;
  line-height: 1;
}
.th-inline-ico svg {
  display: inline-block;
  vertical-align: middle;
}
.th-emoji-sanitized {
  display: inline;
}

/* ── Modern Obsidian Tables ── */
html[data-th-theme="unified"] table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
}
html[data-th-theme="unified"] thead th {
  background: rgba(15, 19, 28, 0.8) !important;
  color: var(--th-text-muted) !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  font-size: 11px !important;
  letter-spacing: 0.05em !important;
  padding: 12px 16px !important;
  border-bottom: 1px solid var(--th-border-card) !important;
}
html[data-th-theme="unified"] tbody tr {
  transition: background 0.15s ease, transform 0.15s ease !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
}
html[data-th-theme="unified"] tbody tr:hover {
  background: rgba(255, 255, 255, 0.035) !important;
}
html[data-th-theme="unified"] tbody td {
  padding: 12px 16px !important;
  color: var(--th-text-secondary) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
}

/* ── 12. Arena & Duel Creation Custom Polish ── */
.opp-tabs {
  display: flex !important;
  gap: 4px !important;
  background: #0b0e15 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 10px !important;
  padding: 4px !important;
  margin-bottom: 12px !important;
}

.opp-tab {
  flex: 1 !important;
  padding: 8px 12px !important;
  border: none !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  background: transparent !important;
  color: var(--th-text-muted) !important;
  transition: all 0.2s ease !important;
  text-align: center !important;
}

.opp-tab:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.04) !important;
}

.opp-tab.opp-tab--active {
  background: rgba(245, 158, 11, 0.14) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(245, 158, 11, 0.45) !important;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.12) !important;
}

.step {
  background: #11151f !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 14px !important;
  padding: 16px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
  transition: border-color 0.2s ease !important;
}

.step:focus-within {
  border-color: rgba(245, 158, 11, 0.35) !important;
}

.step__head {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  margin-bottom: 12px !important;
}

.step__num {
  width: 26px !important;
  height: 26px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  color: #fbbf24 !important;
  background: rgba(245, 158, 11, 0.15) !important;
  border: 1px solid rgba(245, 158, 11, 0.4) !important;
}

.step__title {
  font-size: 15px !important;
  font-weight: 800 !important;
  color: #f8fafc !important;
  letter-spacing: 0.3px !important;
}

.cond-btn {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 14px 10px !important;
  background: #0d1017 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  color: var(--th-text-muted) !important;
  width: 100% !important;
  text-align: center !important;
}

.cond-btn:hover {
  border-color: rgba(245, 158, 11, 0.4) !important;
  background: #141824 !important;
  color: #f8fafc !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4) !important;
}

.cond-btn.cond-btn--active {
  border: 1.5px solid rgba(245, 158, 11, 0.6) !important;
  background: rgba(245, 158, 11, 0.12) !important;
  color: #fbbf24 !important;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.18) !important;
}

.cond-btn__label {
  font-weight: 800 !important;
  font-size: 13px !important;
  letter-spacing: 0.3px !important;
}

.cond-btn__desc {
  font-size: 11px !important;
  color: var(--th-text-muted) !important;
  line-height: 1.3 !important;
}

.submit-btn,
#submitPvp {
  width: 100% !important;
  padding: 16px !important;
  border: none !important;
  border-radius: 12px !important;
  font-size: 15px !important;
  font-weight: 900 !important;
  cursor: pointer !important;
  background: var(--th-gold-gradient) !important;
  color: #090b10 !important;
  letter-spacing: 0.05em !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: 0 4px 22px rgba(245, 158, 11, 0.32) !important;
  text-transform: uppercase !important;
}

.submit-btn:hover:not(:disabled),
#submitPvp:hover:not(:disabled) {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 30px rgba(245, 158, 11, 0.48) !important;
  filter: brightness(1.06) !important;
}

.submit-btn:disabled,
#submitPvp:disabled {
  opacity: 0.35 !important;
  filter: grayscale(0.8) !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
}

.wager-display {
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 32px !important;
  font-weight: 900 !important;
  color: #fbbf24 !important;
  text-shadow: 0 0 24px rgba(245, 158, 11, 0.35) !important;
  text-align: center !important;
  margin-bottom: 8px !important;
}
