.rare-stack {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.rare-stack[hidden] {
  display: none !important;
}
/* TokenLordsRPG – Component & Effect Classes */

/* Glassmorphism card */
.glassmorphic-card {
  background: hsla(220, 10%, 12%, 0.7); /* var(--tl-bg-light) with alpha */
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--tl-border);
  border-radius: var(--radius);
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
  padding: 1rem 1.15rem;
  position: relative;
}

/* Text glow (primary accent) */
.text-glow-primary {
  text-shadow: 0 0 6px hsla(38,95%,55%,0.6), 0 0 12px hsla(38,95%,55%,0.4);
}

/* Static accent glow utility */
.shadow-accent-glow {
  box-shadow: 0 0 12px 2px hsla(38, 90%, 65%, 0.5), 0 0 24px 6px hsla(38, 95%, 55%, 0.25);
}

/* Pulsing animation for idle attention */
@keyframes accentPulse {
  0% { box-shadow: 0 0 0 0 hsla(38,90%,65%,0.7); }
  70% { box-shadow: 0 0 16px 6px hsla(38,90%,65%,0); }
  100% { box-shadow: 0 0 0 0 hsla(38,90%,65%,0); }
}
.animate-accent-glow-idle {
  animation: accentPulse 3s ease-in-out infinite;
}

/* Subtle entrance animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.animate-fade-in { animation: fadeIn .45s ease-out both; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-slide-up { animation: slideUp .5s cubic-bezier(.2,.8,.2,1) both; }

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.shine {
  background-image: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.25s linear infinite;
}

/* Primary button */
.btn-primary {
  background: var(--tl-primary);
  color: var(--tl-primary-foreground);
  border: 1px solid var(--tl-border);
  border-radius: var(--radius);
  padding: 0.65rem 1rem;
  font-weight: 600;
  font-family: 'Inter', system-ui, sans-serif;
  cursor: pointer;
  position: relative;
  transition: background 0.2s cubic-bezier(.2,.8,.2,1),
              box-shadow 0.2s cubic-bezier(.2,.8,.2,1),
              transform 0.2s cubic-bezier(.2,.8,.2,1);
}
.btn-primary:hover {
  background: var(--tl-accent);
  transform: translateY(-2px);
  box-shadow: 
    0 0 14px 3px hsla(38,90%,65%,0.45),
    0 6px 16px rgba(0,0,0,0.2);
}
.btn-primary:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 0 8px 2px hsla(38,90%,65%,0.35);
}
.btn-primary:focus-visible {
  outline: 2px solid var(--tl-accent);
  outline-offset: 2px;
}

/* Secondary button (muted) */
.btn-secondary {
  background: var(--tl-secondary);
  color: var(--tl-text);
  border: 1px solid var(--tl-border);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  font-weight: 500;
  font-family: 'Inter', system-ui, sans-serif;
  cursor: pointer;
  transition: background 0.2s cubic-bezier(.2,.8,.2,1),
              color 0.2s ease,
              transform 0.2s cubic-bezier(.2,.8,.2,1),
              box-shadow 0.2s ease;
}
.btn-secondary:hover {
  background: var(--tl-bg-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.btn-secondary:active {
  transform: translateY(0) scale(0.98);
}
.btn-secondary:focus-visible { outline: 2px solid var(--tl-border); outline-offset: 2px; }

/* Destructive button */
.btn-destructive {
  background: var(--tl-destructive);
  color: var(--tl-primary-foreground);
  border: 1px solid var(--tl-border);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  font-weight: 600;
  font-family: 'Inter', system-ui, sans-serif;
  cursor: pointer;
  transition: filter 0.2s ease,
              box-shadow 0.2s cubic-bezier(.2,.8,.2,1),
              transform 0.2s cubic-bezier(.2,.8,.2,1);
}
.btn-destructive:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 
    0 0 12px 3px hsla(0,70%,55%,0.4),
    0 6px 16px rgba(0,0,0,0.2);
}
.btn-destructive:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 0 8px 2px hsla(0,70%,55%,0.3);
}
.btn-destructive:focus-visible { outline: 2px solid var(--tl-destructive); outline-offset: 2px; }

/* Utility: subtle divider line */
.hr-subtle {
  border: 0;
  height: 1px;
  background: var(--tl-border);
  margin: 1.25rem 0;
}

/* Utility: muted text */
.text-muted { color: var(--tl-text-muted); }

/* Reduced motion respect */
@media (prefers-reduced-motion: reduce) {
  .animate-accent-glow-idle { animation: none; }
  .animate-fade-in, .animate-slide-up, .shine { animation: none; }
  .btn-primary, .btn-secondary, .btn-destructive { transition: none; }
}

/* Global status header */
.global-status-shell {
  width: 100%;
  margin-bottom: 1.25rem;
}

.global-status-bar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  background: rgba(8, 10, 16, 0.9);
  box-shadow: 0 12px 28px rgba(0,0,0,.45);
}

.sidebar-status {
  padding: 0 1.25rem 1.1rem;
}

.sidebar-status .global-status-bar {
  width: 100%;
  min-width: 0;
}

.global-status-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.status-commander h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.1rem;
}

/* VIP Tier Glowing Name Styles */
.status-commander h3.vip-f2p {
  color: rgba(255, 255, 255, 0.85);
}

.status-commander h3.vip-silver {
  color: #c0c0c0;
  text-shadow: 
    0 0 5px rgba(192, 192, 192, 0.6),
    0 0 10px rgba(192, 192, 192, 0.4),
    0 0 20px rgba(192, 192, 192, 0.3);
  animation: glow-silver 2s ease-in-out infinite alternate;
}

.status-commander h3.vip-gold {
  color: #ffd700;
  text-shadow: 
    0 0 5px rgba(255, 215, 0, 0.7),
    0 0 10px rgba(255, 215, 0, 0.5),
    0 0 20px rgba(255, 215, 0, 0.4),
    0 0 30px rgba(255, 215, 0, 0.2);
  animation: glow-gold 2s ease-in-out infinite alternate;
}

.status-commander h3.vip-diamond {
  color: #b9f2ff;
  text-shadow: 
    0 0 5px rgba(185, 242, 255, 0.8),
    0 0 10px rgba(185, 242, 255, 0.6),
    0 0 20px rgba(185, 242, 255, 0.5),
    0 0 30px rgba(185, 242, 255, 0.3),
    0 0 40px rgba(185, 242, 255, 0.2);
  animation: glow-diamond 2s ease-in-out infinite alternate;
}

.status-commander h3.vip-ruby {
  color: #ff4444;
  text-shadow: 
    0 0 5px rgba(255, 68, 68, 0.8),
    0 0 10px rgba(255, 68, 68, 0.6),
    0 0 20px rgba(255, 68, 68, 0.5),
    0 0 30px rgba(255, 68, 68, 0.3);
  animation: glow-ruby 2s ease-in-out infinite alternate;
}

.status-commander h3.vip-emerald {
  color: #50c878;
  text-shadow: 
    0 0 5px rgba(80, 200, 120, 0.8),
    0 0 10px rgba(80, 200, 120, 0.6),
    0 0 20px rgba(80, 200, 120, 0.5),
    0 0 30px rgba(80, 200, 120, 0.3);
  animation: glow-emerald 2s ease-in-out infinite alternate;
}

@keyframes glow-silver {
  from { text-shadow: 0 0 5px rgba(192, 192, 192, 0.4), 0 0 10px rgba(192, 192, 192, 0.2); }
  to { text-shadow: 0 0 8px rgba(192, 192, 192, 0.7), 0 0 15px rgba(192, 192, 192, 0.4), 0 0 25px rgba(192, 192, 192, 0.2); }
}

@keyframes glow-gold {
  from { text-shadow: 0 0 5px rgba(255, 215, 0, 0.5), 0 0 10px rgba(255, 215, 0, 0.3); }
  to { text-shadow: 0 0 10px rgba(255, 215, 0, 0.8), 0 0 20px rgba(255, 215, 0, 0.5), 0 0 35px rgba(255, 215, 0, 0.3); }
}

@keyframes glow-diamond {
  from { text-shadow: 0 0 5px rgba(185, 242, 255, 0.6), 0 0 10px rgba(185, 242, 255, 0.3); }
  to { text-shadow: 0 0 10px rgba(185, 242, 255, 0.9), 0 0 25px rgba(185, 242, 255, 0.6), 0 0 40px rgba(185, 242, 255, 0.3); }
}

@keyframes glow-ruby {
  from { text-shadow: 0 0 5px rgba(255, 68, 68, 0.5), 0 0 10px rgba(255, 68, 68, 0.3); }
  to { text-shadow: 0 0 10px rgba(255, 68, 68, 0.9), 0 0 20px rgba(255, 68, 68, 0.6), 0 0 35px rgba(255, 68, 68, 0.3); }
}

@keyframes glow-emerald {
  from { text-shadow: 0 0 5px rgba(80, 200, 120, 0.5), 0 0 10px rgba(80, 200, 120, 0.3); }
  to { text-shadow: 0 0 10px rgba(80, 200, 120, 0.9), 0 0 20px rgba(80, 200, 120, 0.6), 0 0 35px rgba(80, 200, 120, 0.3); }
}

.status-level-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

.status-level-chip,
.status-xp-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.22);
  font-size: 0.6rem;
  letter-spacing: 0.15rem;
  text-transform: uppercase;
}

.status-xp-chip {
  border-style: dashed;
  letter-spacing: 0.1rem;
}

.stat-label {
  font-size: .55rem;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: rgba(255,255,255,0.6);
  margin: 0;
}

.bronze-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  border-radius: 14px;
  border: 1px solid rgba(205, 127, 50, 0.35);
  background: rgba(205, 127, 50, 0.08);
}

.bronze-chip strong {
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  color: #cd7f32;
}

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

.tlrpg-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 215, 0, 0.35);
  background: rgba(255, 215, 0, 0.08);
  margin-top: 0.35rem;
}

.tlrpg-chip .stat-label {
  color: #ffd700;
}

.tlrpg-chip strong {
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  color: #ffd700;
}

.tlrpg-chip .tlrpg-value {
  font-size: 0.7rem;
  color: rgba(247, 160, 15, 0.7);
  margin-left: 0.25rem;
}

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

/* TLRPG token icon in sidebar */
.tlrpg-icon-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 50%;
}

.eur-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  border-radius: 14px;
  border: 1px solid rgba(0, 214, 143, 0.35);
  background: rgba(0, 214, 143, 0.08);
  margin-top: 0.35rem;
}

.eur-chip strong {
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  color: #00d68f;
}

.eur-chip .eur-pending {
  display: block;
  font-size: 0.65rem;
  color: #fbbf24;
  margin-top: 0.15rem;
}

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

.withdraw-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(0, 214, 143, 0.15);
  border: 1px solid rgba(0, 214, 143, 0.3);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.withdraw-btn:hover {
  background: rgba(0, 214, 143, 0.25);
  border-color: rgba(0, 214, 143, 0.5);
  transform: scale(1.05);
}

.realm-resource-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.rare-resource-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  border-top: 1px dashed rgba(255,255,255,0.08);
  padding-top: 0.45rem;
  margin-top: 0.35rem;
}

.rare-resource-grid .resource-mini {
  border-color: rgba(83, 180, 255, 0.35);
  background: rgba(83, 180, 255, 0.06);
}

.resource-mini.rare-empty {
  opacity: 0.5;
}

.resource-mini {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.45rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 0.65rem;
  background: rgba(255,255,255,0.02);
}

.resource-mini span {
  font-size: 0.85rem;
}

body.sidebar-collapsed .sidebar-status {
  padding: 0 0.75rem 0.9rem;
}

body.sidebar-collapsed .global-status-row {
  flex-direction: column;
  align-items: center;
  text-align: center;
}

body.sidebar-collapsed .status-commander h3 {
  font-size: 0.85rem;
}

body.sidebar-collapsed .status-level-stack {
  flex-direction: row;
  justify-content: center;
}

body.sidebar-collapsed .bronze-chip,
body.sidebar-collapsed .tlrpg-chip,
body.sidebar-collapsed .eur-chip {
  flex-direction: column;
  align-items: center;
  text-align: center;
}

body.sidebar-collapsed .eur-chip .withdraw-btn {
  margin-top: 0.25rem;
}

body.sidebar-collapsed .realm-resource-grid {
  display: none;
}

body.sidebar-collapsed .rare-resource-grid {
  display: none;
}

.global-header-loading {
  width: 100%;
  border: 1px dashed rgba(255,255,255,.2);
  border-radius: 1rem;
  padding: 0.8rem 1rem;
  text-align: center;
  color: var(--tl-text-muted);
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .global-status-bar {
    padding: 0.75rem;
  }
  .status-level-stack {
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
  }

  .sidebar-status {
    padding: 0 1rem 1rem;
    flex: 0 0 100%;
  }

  .sidebar-status .global-status-row,
  .sidebar-status .bronze-chip,
  .sidebar-status .tlrpg-chip {
    flex-wrap: wrap;
    width: 100%;
  }

  .realm-resource-grid,
  .rare-resource-grid {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding-bottom: 0.15rem;
  }

  .realm-resource-grid::-webkit-scrollbar,
  .rare-resource-grid::-webkit-scrollbar {
    display: none;
  }

  .resource-mini {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }
}

@media (max-width: 600px) {
  .sidebar-status {
    padding: 0 0.5rem 0.85rem;
  }

  .global-status-bar {
    border-radius: 16px;
  }

  .global-status-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
