/* ═══════════════════════════════════════════════
   MyVT Gacha Collection — Main Stylesheet
   ═══════════════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
  /* Core palette */
  --bg-page: #0e0e0c;
  --bg-section: #161614;
  --bg-card: #1c1b18;
  --bg-card-hover: #252420;
  --bg-input: #222220;
  --bg-modal: #1a1a17;

  /* Borders & lines */
  --border: #333028;
  --border-light: #44403a;

  /* Accent colours */
  --accent: #896fd9;
  --accent-hover: #9b85e3;
  --accent-dim: rgba(137, 111, 217, 0.15);
  --accent2: #5dd499;
  --accent2-dim: rgba(93, 212, 153, 0.15);
  --gold: #e8c547;
  --gold-dim: rgba(232, 197, 71, 0.15);
  --silver: #b0b8c8;
  --silver-dim: rgba(176, 184, 200, 0.15);

  /* Text */
  --text-primary: #f1f1f0;
  --text-secondary: #c8c6c0;
  --text-muted: #908e87;
  --text-dim: #6a6860;

  /* Rarity colours */
  --rarity-r: #888880;
  --rarity-normal: #888880;
  --rarity-sr: #b0b8c8;
  --rarity-ssr: #e8c547;
  --rarity-ur: #e040fb;

  /* Semantic */
  --success: #7cb58f;
  --warning: #c19f5d;
  --error: #cc837c;

  /* Stamina */
  --stamina: #42a5f5;
  --stamina-dim: rgba(66, 165, 245, 0.15);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;

  /* Layout */
  --nav-height: 56px;
  --footer-height: 48px;
  --max-width: 1200px;
}

/* ── Reset & Base ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, 'Fira Sans', 'Helvetica Neue', sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-section);
}
::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ═══════════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════════ */

#top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--bg-section);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--space-md);
  gap: var(--space-md);
}

.nav-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.nav-tabs {
  display: flex;
  gap: var(--space-xs);
  flex: 1;
  justify-content: center;
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.nav-tab:hover {
  color: var(--text-secondary);
  background: var(--bg-card);
}
.nav-tab.active {
  color: var(--accent);
  background: var(--accent-dim);
}

.nav-resources {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.resource {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card);
  padding: 4px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.resource::before {
  font-size: 1rem;
}
#res-stars::before { content: '\2605'; color: var(--gold); }
#res-stardust::before { content: '\2726'; color: var(--accent); }
#res-fragments::before { content: '\25C6'; color: var(--accent2); }
#res-bonds::before { content: '\2665'; color: var(--error); }

/* Nav stamina resource */
#res-stamina {
  flex-direction: column;
  gap: 2px;
  padding: 3px 8px;
}
#res-stamina::before { display: none; }
.stamina-bar-mini {
  width: 100%;
  height: 3px;
  background: var(--bg-input);
  border-radius: 2px;
  overflow: hidden;
}
.stamina-bar-mini-fill {
  height: 100%;
  background: var(--stamina);
  border-radius: 2px;
  transition: width 0.5s ease;
  min-width: 0;
}
#res-stamina-val {
  font-size: 0.7rem;
  color: var(--stamina);
  font-weight: 700;
}

.nav-settings {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1.2rem;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-settings:hover {
  color: var(--text-primary);
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* ═══════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════ */

#main-content {
  margin-top: var(--nav-height);
  min-height: calc(100vh - var(--nav-height));
  padding: var(--space-lg) var(--space-md);
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

.tab-content {
  display: none;
  animation: fadeIn var(--transition-normal);
}
.tab-content.active {
  display: block;
}

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

/* ═══════════════════════════════════════════════
   HOME TAB
   ═══════════════════════════════════════════════ */

.home-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  padding-top: var(--space-lg);
}

.home-welcome {
  text-align: center;
}
.home-welcome h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: var(--space-sm);
}
.home-welcome .subtitle {
  color: var(--text-muted);
  font-size: 1rem;
}

.home-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  width: 100%;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  text-align: center;
  transition: border-color var(--transition-fast);
}
.stat-card:hover {
  border-color: var(--accent);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-xs);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.home-actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  justify-content: center;
}

.home-id {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
}
.id-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.id-value {
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  color: var(--accent);
  letter-spacing: 1px;
}
.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.btn-icon:hover {
  color: var(--accent);
  background: var(--accent-dim);
}

/* ═══════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(137, 111, 217, 0.3);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.btn-danger {
  background: transparent;
  color: var(--error);
  border: 1px solid var(--error);
  padding: 8px 16px;
  font-size: 0.85rem;
}
.btn-danger:hover {
  background: rgba(204, 131, 124, 0.15);
}

/* ═══════════════════════════════════════════════
   PULL TAB
   ═══════════════════════════════════════════════ */

.pull-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}

.pull-container h2 {
  color: var(--accent);
  font-size: 1.5rem;
}

.banner-select {
  display: flex;
  gap: var(--space-sm);
}
.banner-btn {
  background: var(--bg-card);
  border: 2px solid var(--border);
  color: var(--text-muted);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}
.banner-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}
.banner-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.banner-info {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  width: 100%;
  max-width: 500px;
}
.banner-name {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}
.banner-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: var(--space-md);
}
.banner-rates {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  margin-bottom: var(--space-sm);
}
.rate {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}
.rate-ssr { color: var(--rarity-ssr); background: var(--gold-dim); }
.rate-sr { color: var(--rarity-sr); background: var(--silver-dim); }
.rate-normal { color: var(--rarity-normal); background: rgba(136, 136, 128, 0.15); }
.rate-r { color: var(--rarity-r); background: rgba(136, 136, 128, 0.15); }
.rate-ur {
  color: var(--rarity-ur);
  background: rgba(224, 64, 251, 0.15);
  text-shadow: 0 0 8px rgba(224, 64, 251, 0.5);
}

.pity-info {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.pull-buttons {
  display: flex;
  gap: var(--space-md);
}
.btn-pull {
  flex-direction: column;
  gap: 4px;
  padding: var(--space-md) var(--space-xl);
  font-size: 1.1rem;
}
.btn-pull .cost {
  font-size: 0.8rem;
  color: var(--gold);
  font-weight: 500;
}
.btn-pull-10 {
  background: linear-gradient(135deg, var(--accent), #6b5acd);
}

.pull-results {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-md);
  width: 100%;
  max-width: 800px;
}

/* ═══════════════════════════════════════════════
   CHARACTER CARDS
   ═══════════════════════════════════════════════ */

.char-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-normal);
  aspect-ratio: 3/4;
  background: var(--bg-card);
  border: 2px solid var(--border);
}
.char-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.char-card.variant-normal { border-color: var(--rarity-normal); }
.char-card.variant-r { border-color: var(--rarity-r); }
.char-card.variant-sr {
  border-color: var(--rarity-sr);
  box-shadow: 0 0 12px rgba(176, 184, 200, 0.2);
}
.char-card.variant-ssr {
  border-color: var(--rarity-ssr);
  box-shadow: 0 0 16px rgba(232, 197, 71, 0.3);
  animation: ssrGlow 2s ease-in-out infinite alternate;
}
.char-card.variant-ur {
  border-color: var(--rarity-ur);
  box-shadow: 0 0 20px rgba(224, 64, 251, 0.4);
  animation: urRainbowGlow 2.5s ease-in-out infinite;
}

@keyframes ssrGlow {
  from { box-shadow: 0 0 12px rgba(232, 197, 71, 0.2); }
  to { box-shadow: 0 0 20px rgba(232, 197, 71, 0.4); }
}

@keyframes urRainbowGlow {
  0%   { box-shadow: 0 0 16px rgba(224, 64, 251, 0.3); border-color: #e040fb; }
  25%  { box-shadow: 0 0 20px rgba(255, 215, 0, 0.35); border-color: #ffd700; }
  50%  { box-shadow: 0 0 20px rgba(0, 229, 255, 0.35); border-color: #00e5ff; }
  75%  { box-shadow: 0 0 20px rgba(232, 197, 71, 0.35); border-color: #e8c547; }
  100% { box-shadow: 0 0 16px rgba(224, 64, 251, 0.3); border-color: #e040fb; }
}

.char-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.char-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  padding: var(--space-md) var(--space-sm) var(--space-sm);
}

.char-card-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.char-card-agency {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.char-card-badge {
  position: absolute;
  top: var(--space-xs);
  right: var(--space-xs);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-normal { background: rgba(136, 136, 128, 0.7); color: #fff; }
.badge-r { background: rgba(136, 136, 128, 0.7); color: #fff; }
.badge-sr { background: rgba(176, 184, 200, 0.85); color: #1a1a1a; }
.badge-ssr { background: rgba(232, 197, 71, 0.9); color: #1a1a1a; }
.badge-ur {
  background: linear-gradient(135deg, #e040fb, #ffd700, #00e5ff, #e040fb);
  background-size: 300% 300%;
  animation: badgeUrShimmer 2s ease infinite;
  color: #1a1a1a;
  font-weight: 800;
}
@keyframes badgeUrShimmer {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.char-card-new {
  position: absolute;
  top: var(--space-xs);
  left: var(--space-xs);
  background: var(--success);
  color: #fff;
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  font-size: 0.6rem;
  font-weight: 700;
}

.char-card-shard-indicator {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  background: #e53935;
  border: 2px solid var(--bg-card);
  border-radius: 50%;
  z-index: 4;
  box-shadow: 0 0 6px rgba(229, 57, 53, 0.6);
  animation: shardPulse 2s ease-in-out infinite;
}
@keyframes shardPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 6px rgba(229, 57, 53, 0.4); }
  50% { transform: scale(1.15); box-shadow: 0 0 12px rgba(229, 57, 53, 0.7); }
}

.char-card-lock {
  position: absolute;
  inset: 0;
  background: rgba(14, 14, 12, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-dim);
}

/* Echo badge (shows E0-E6 MAX on character cards) */
.char-card-echo {
  position: absolute;
  top: var(--space-xs);
  left: var(--space-xs);
  background: linear-gradient(135deg, #7c4dff, #e040fb);
  color: #fff;
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  z-index: 5;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* LiveCache indicator on pull cards */
.toast-livecache {
  background: linear-gradient(135deg, #66bb6a, #43a047) !important;
  color: #fff;
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  font-size: 0.5rem;
  font-weight: 700;
  z-index: 6;
}

/* UR glow ring behind the card (stronger than SSR) */
.ur-glow-ring {
  position: absolute;
  inset: -4px;
  border-radius: calc(var(--radius-md) + 4px);
  border: 2px solid rgba(224, 64, 251, 0.7);
  box-shadow: 0 0 18px rgba(224, 64, 251, 0.5),
              0 0 6px rgba(255, 215, 0, 0.3),
              inset 0 0 15px rgba(224, 64, 251, 0.15);
  animation: urGlowPulse 1.2s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 10;
}
@keyframes urGlowPulse {
  0%   { box-shadow: 0 0 12px rgba(224, 64, 251, 0.3), 0 0 4px rgba(255, 215, 0, 0.2), inset 0 0 10px rgba(224, 64, 251, 0.05); border-color: rgba(224, 64, 251, 0.5); }
  50%  { box-shadow: 0 0 22px rgba(255, 215, 0, 0.5), 0 0 8px rgba(224, 64, 251, 0.4), inset 0 0 18px rgba(255, 215, 0, 0.1); border-color: rgba(255, 215, 0, 0.7); }
  100% { box-shadow: 0 0 18px rgba(0, 229, 255, 0.5), 0 0 6px rgba(224, 64, 251, 0.3), inset 0 0 15px rgba(0, 229, 255, 0.1); border-color: rgba(0, 229, 255, 0.6); }
}

/* ═══════════════════════════════════════════════
   PULL ANIMATION — Sequential Slide-In + 3D Flip
   ═══════════════════════════════════════════════ */

.card-flip {
  perspective: 800px;
  width: 120px;
  height: 168px;
  opacity: 0;
  transform: translateY(80px) scale(0.7);
  transition: opacity 0.35s cubic-bezier(.23,1,.32,1),
              transform 0.35s cubic-bezier(.23,1,.32,1);
  cursor: pointer;
}
.card-flip.slide-in {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Single pull — larger card */
.pull-animation.single-pull .card-flip {
  width: 200px;
  height: 280px;
  transform: translateY(100px) scale(0.6);
}
.pull-animation.single-pull .card-flip.slide-in {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.card-flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(.4,.0,.2,1);
}
.card-flip-inner.flipped {
  transform: rotateY(180deg);
}

.card-flip-front,
.card-flip-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* Card back design (face-down side) */
.card-flip-front {
  background: linear-gradient(135deg, #2a2845 0%, #3d3872 50%, #2a2845 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 30px rgba(100, 80, 220, 0.15),
              0 2px 8px rgba(0,0,0,0.3);
}
.card-back-design {
  position: absolute;
  inset: 6px;
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: calc(var(--radius-md) - 2px);
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 8px,
    rgba(255,255,255,0.02) 8px,
    rgba(255,255,255,0.02) 16px
  );
}
.card-back-icon {
  font-size: 1.8rem;
  color: rgba(255,255,255,0.12);
  z-index: 1;
  text-shadow: 0 0 10px rgba(100, 80, 220, 0.3);
}

/* Revealed card face */
.card-flip-back {
  transform: rotateY(180deg);
}

/* SSR glow ring behind the card */
.ssr-glow-ring {
  position: absolute;
  inset: -4px;
  border-radius: calc(var(--radius-md) + 4px);
  border: 2px solid rgba(232, 197, 71, 0.6);
  box-shadow: 0 0 15px rgba(232, 197, 71, 0.4),
              inset 0 0 15px rgba(232, 197, 71, 0.1);
  animation: ssrGlowPulse 1.5s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 10;
}
@keyframes ssrGlowPulse {
  from { box-shadow: 0 0 10px rgba(232,197,71,0.3), inset 0 0 10px rgba(232,197,71,0.05); }
  to   { box-shadow: 0 0 20px rgba(232,197,71,0.6), inset 0 0 20px rgba(232,197,71,0.15); }
}

/* ═══════════════════════════════════════════════
   COLLECTION TAB
   ═══════════════════════════════════════════════ */

.collection-container h2 {
  color: var(--accent);
  font-size: 1.5rem;
  margin-bottom: var(--space-md);
}

.collection-filters {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}

.collection-filters select,
.collection-filters input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  outline: none;
  transition: border-color var(--transition-fast);
}
.collection-filters select:focus,
.collection-filters input:focus {
  border-color: var(--accent);
}
.collection-filters input {
  min-width: 200px;
}

.collection-progress {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-card);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 4px;
  transition: width var(--transition-normal);
}

.progress-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-md);
}

/* ═══════════════════════════════════════════════
   STUDIO TAB
   ═══════════════════════════════════════════════ */

.studio-container h2 {
  color: var(--accent);
  font-size: 1.5rem;
  margin-bottom: var(--space-lg);
}

.studio-level {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
.studio-lv-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.studio-lv-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}
.studio-exp-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
}
.studio-exp-fill {
  height: 100%;
  background: var(--accent2);
  border-radius: 4px;
  transition: width var(--transition-normal);
}
.studio-exp-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.stations-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.station {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--transition-fast);
}
.station:hover {
  border-color: var(--accent);
}
.station.locked {
  opacity: 0.4;
  pointer-events: none;
}

.station-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.station-name {
  font-size: 1rem;
  font-weight: 600;
}
.station-level {
  font-size: 0.8rem;
  color: var(--accent2);
  background: var(--accent2-dim);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.station-slot {
  aspect-ratio: 1;
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  overflow: hidden;
  position: relative;
  transition: all var(--transition-fast);
}
.station-slot:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.station-slot.assigned {
  border-style: solid;
  border-color: var(--accent);
}
.station-slot.assigned:hover {
  border-color: var(--warning);
}
.station-slot-empty-text {
  color: var(--text-dim);
  font-size: 0.85rem;
}
.station-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}
.station-slot-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  padding: 2rem var(--space-sm) var(--space-sm);
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 2;
}

/* Stamina bar inside station card portrait */
.station-stamina-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 22px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 3;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.station-stamina-fill {
  position: absolute;
  inset: 0;
  opacity: 0.55;
  transition: width 0.5s ease, background 0.5s ease;
}
.station-stamina-text {
  position: relative;
  z-index: 1;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  padding: 0 6px;
  letter-spacing: 0.3px;
}

.station-output {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}
.station-output-label {
  color: var(--text-muted);
}
.station-output-value {
  color: var(--accent2);
  font-weight: 600;
}

.station-upgrade {
  margin-top: var(--space-sm);
}

/* ═══════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  animation: fadeIn var(--transition-fast);
}

.modal {
  background: var(--bg-modal);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}
.modal h3 {
  color: var(--accent);
  margin-bottom: var(--space-lg);
  font-size: 1.3rem;
}

.modal-character {
  max-width: 400px;
}

.modal-close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.settings-group {
  margin-bottom: var(--space-lg);
}
.settings-group h4 {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-sm);
}
.settings-group .btn {
  width: 100%;
  margin-bottom: var(--space-sm);
  text-align: center;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.stat-row span:first-child {
  color: var(--text-muted);
}
.stat-row span:last-child {
  font-weight: 600;
  color: var(--text-primary);
}

.input-row {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}
.input-row input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  outline: none;
}
.input-row input:focus {
  border-color: var(--accent);
}

/* Character detail */
.char-detail {
  text-align: center;
}
.char-detail-img {
  width: 200px;
  height: 260px;
  border-radius: var(--radius-md);
  object-fit: cover;
  margin-bottom: var(--space-md);
}
.char-detail-name {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}
.char-detail-agency {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: var(--space-md);
}
.char-detail-variants {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  margin-bottom: var(--space-md);
}
.variant-badge {
  padding: 4px 12px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
}
.variant-badge.owned { opacity: 1; }
.variant-badge.not-owned { opacity: 0.3; }

.char-detail-stats {
  text-align: left;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}
.char-detail-stat {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.char-detail-stat:last-child {
  border-bottom: none;
}

.char-detail-actions {
  margin-top: var(--space-md);
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
}

/* ═══════════════════════════════════════════════
   PULL OVERLAY
   ═══════════════════════════════════════════════ */

.pull-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--space-lg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.pull-animation {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-md);
  max-width: 720px;
  padding: var(--space-lg) var(--space-md);
  justify-items: center;
  align-items: center;
}

/* ═══════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════ */

.toast-container {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  font-size: 0.85rem;
  color: var(--text-primary);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
  max-width: 320px;
}
.toast-success { border-left: 3px solid var(--success); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-error { border-left: 3px solid var(--error); }
.toast-info { border-left: 3px solid var(--accent); }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ═══════════════════════════════════════════════
   PULL ANIMATION ENHANCEMENTS
   ═══════════════════════════════════════════════ */

.pull-summary {
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  grid-column: 1 / -1;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.pull-summary.visible {
  opacity: 1;
  transform: translateY(0);
}
.pull-summary .sum-sr { color: var(--rarity-sr); }
.pull-summary .sum-ssr { color: var(--rarity-ssr); }
.pull-summary .sum-ur {
  color: var(--rarity-ur);
  text-shadow: 0 0 8px rgba(224, 64, 251, 0.6);
}

.pull-tap-hint {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-top: var(--space-md);
  animation: pulse 1.5s ease-in-out infinite;
  grid-column: 1 / -1;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* Screen flash effects */
@keyframes flashSR {
  0% { background: rgba(176, 184, 200, 0); }
  15% { background: rgba(176, 184, 200, 0.3); }
  100% { background: rgba(0, 0, 0, 0.9); }
}
@keyframes flashSSR {
  0% { background: rgba(232, 197, 71, 0); }
  15% { background: rgba(232, 197, 71, 0.4); }
  100% { background: rgba(0, 0, 0, 0.9); }
}
@keyframes flashUR {
  0% { background: rgba(224, 64, 251, 0); }
  10% { background: rgba(224, 64, 251, 0.6); }
  30% { background: rgba(255, 215, 0, 0.4); }
  50% { background: rgba(0, 229, 255, 0.3); }
  100% { background: rgba(0, 0, 0, 0.9); }
}
.pull-overlay.flash-sr { animation: flashSR 0.6s ease; }
.pull-overlay.flash-ssr { animation: flashSSR 0.6s ease; }
.pull-overlay.flash-ur { animation: flashUR 0.8s ease; }

/* ═══════════════════════════════════════════════
   ASSIGN MODAL
   ═══════════════════════════════════════════════ */

.assign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: var(--space-sm);
  max-height: 50vh;
  overflow-y: auto;
  padding: var(--space-sm);
}
.assign-char {
  cursor: pointer;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--border);
  transition: all var(--transition-fast);
  aspect-ratio: 3/4;
  position: relative;
}
.assign-char:hover {
  border-color: var(--accent);
  transform: scale(1.05);
}
.assign-char img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.assign-char-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  padding: 2px 4px;
  font-size: 0.55rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.assign-char-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  padding: 1px 4px;
  border-radius: 2px;
  font-size: 0.5rem;
  font-weight: 700;
}
.assign-search {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  outline: none;
  margin-bottom: var(--space-sm);
}
.assign-search:focus {
  border-color: var(--accent);
}

/* ST/PS stats bar inside assign character cards */
.assign-char-stats {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 4px;
  background: linear-gradient(rgba(0,0,0,0.75), rgba(0,0,0,0.9));
  padding: 1px 3px;
  z-index: 2;
  font-size: 0.45rem;
  font-weight: 700;
}
.assign-char-stats .acs-st {
  color: #4dd0e1;
}
.assign-char-stats .acs-ps {
  color: #ffab40;
}
.assign-char-stats .acs-depleted {
  color: #ef5350;
}
/* Push assign-char-info up to avoid overlapping stats bar */
.assign-char-info {
  bottom: 14px !important;
}

/* Collection variant stats */
.collection-variant-stats {
  display: flex;
  gap: var(--space-md);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}
.collection-variant-stats .vs-normal { color: var(--rarity-normal); }
.collection-variant-stats .vs-r { color: var(--rarity-r); }
.collection-variant-stats .vs-sr { color: var(--rarity-sr); }
.collection-variant-stats .vs-ssr { color: var(--rarity-ssr); }
.collection-variant-stats .vs-ur {
  color: var(--rarity-ur);
  text-shadow: 0 0 6px rgba(224, 64, 251, 0.4);
}

/* ═══════════════════════════════════════════════
   COLLECTION — PAGINATION (Sprint 3)
   ═══════════════════════════════════════════════ */

.collection-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) 0;
  flex-wrap: wrap;
}

.page-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-right: var(--space-sm);
}

.page-buttons {
  display: flex;
  gap: var(--space-xs);
  align-items: center;
}

.page-btn {
  padding: 6px 12px !important;
  font-size: 0.8rem !important;
  min-width: 36px;
}

.page-btn.active {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
}

.page-ellipsis {
  color: var(--text-dim);
  font-size: 0.85rem;
  padding: 0 4px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* ═══════════════════════════════════════════════
   COLLECTION — MILESTONES (Sprint 3)
   ═══════════════════════════════════════════════ */

.milestone-tracker {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-top: var(--space-lg);
}

.milestone-tracker h3 {
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: var(--space-md);
}

.milestone-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.milestone-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  background: var(--bg-section);
  border: 1px solid var(--border);
  transition: all var(--transition-fast);
}

.milestone-item.claimed {
  opacity: 0.6;
  border-color: var(--success);
  background: rgba(124, 181, 143, 0.05);
}

.milestone-item.reached:not(.claimed) {
  border-color: var(--gold);
  background: var(--gold-dim);
}

.milestone-icon {
  font-size: 1.2rem;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.milestone-item.claimed .milestone-icon { color: var(--success); }
.milestone-item.reached:not(.claimed) .milestone-icon { color: var(--gold); }
.milestone-item:not(.reached):not(.claimed) .milestone-icon { color: var(--text-dim); }

.milestone-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.milestone-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.milestone-reward {
  font-size: 0.75rem;
  color: var(--gold);
}

.milestone-status {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.milestone-item.claimed .milestone-status { color: var(--success); }
.milestone-item.reached:not(.claimed) .milestone-status { color: var(--gold); }

/* ═══════════════════════════════════════════════
   CHARACTER DETAIL — PANEL LAYOUT
   ═══════════════════════════════════════════════ */

.modal-character {
  max-width: 600px;
}

.shard-convert-section {
  margin-top: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}

.shard-convert-section h4 {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.shard-buttons {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.shard-buttons .btn {
  flex: 1;
  min-width: 80px;
  font-size: 0.75rem;
  padding: 6px 8px;
}

/* ST/PS stats bar on collection cards */
.char-card-stats-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(rgba(0,0,0,0.75), rgba(0,0,0,0.9));
  padding: 2px 4px;
  z-index: 3;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.char-card-stats-bar .stats-st {
  color: #4dd0e1;
  text-shadow: 0 0 4px rgba(77, 208, 225, 0.5);
}
.char-card-stats-bar .stats-ps {
  color: #ffab40;
  text-shadow: 0 0 4px rgba(255, 171, 64, 0.5);
}
.char-card-stats-bar .stats-depleted {
  color: #ef5350;
  text-shadow: 0 0 4px rgba(239, 83, 80, 0.5);
}

/* Station working badge on collection cards */
.char-card-station-badge {
  position: absolute;
  bottom: calc(var(--space-sm) + 30px);
  left: var(--space-xs);
  background: var(--accent2);
  color: #1a1a1a;
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════
   STUDIO — INCOME DASHBOARD (Sprint 4)
   ═══════════════════════════════════════════════ */

.studio-income-dashboard {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.studio-income-dashboard h3 {
  font-size: 1rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-sm);
}

.income-total {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent2);
  margin-bottom: var(--space-md);
}

.income-breakdown {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.income-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.income-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  min-width: 90px;
}

.income-bar-track {
  flex: 1;
  height: 10px;
  background: var(--bg-input);
  border-radius: 5px;
  overflow: hidden;
}

.income-bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width var(--transition-normal);
  min-width: 4px;
}

.income-value {
  font-size: 0.85rem;
  font-weight: 700;
  min-width: 50px;
  text-align: right;
}

.income-empty {
  color: var(--text-dim);
  font-size: 0.85rem;
  text-align: center;
  padding: var(--space-sm);
}

/* ═══════════════════════════════════════════════
   STUDIO — UNLOCK ROADMAP (Sprint 4)
   ═══════════════════════════════════════════════ */

.studio-unlock-roadmap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.studio-unlock-roadmap h3 {
  font-size: 1rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-sm);
}

.unlock-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.unlock-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px var(--space-sm);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.unlock-item.unlocked {
  opacity: 0.5;
}

.unlock-item.current {
  background: var(--accent-dim);
  border-color: var(--accent);
}

.unlock-item.next-up {
  background: var(--gold-dim);
  border-color: var(--gold);
}

.unlock-lv {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 32px;
}

.unlock-what {
  flex: 1;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.unlock-status {
  font-size: 0.85rem;
  width: 20px;
  text-align: center;
}

.unlock-unlocked { color: var(--success); }
.unlock-next { color: var(--gold); }
.unlock-locked { color: var(--text-dim); }

/* ═══════════════════════════════════════════════
   MINIGAME — SUPER CHAT TOSS
   ═══════════════════════════════════════════════ */

.sc-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}
.sc-container h2 {
  color: var(--accent);
  font-size: 1.5rem;
}
.sc-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  max-width: 500px;
}

/* Start Screen */
.sc-start-screen {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}
.sc-lead-select {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  width: 100%;
}
.sc-lead-preview {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  min-height: 48px;
}
.sc-lead-preview img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}
.sc-lead-preview-name {
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.sc-info-row {
  display: flex;
  gap: var(--space-lg);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.sc-info-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Stamina display in minigame start screen */
.sc-stamina-display {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
}
.sc-stamina-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  min-width: 52px;
}
.sc-stamina-bar-track {
  flex: 1;
  height: 10px;
  background: var(--bg-input);
  border-radius: 5px;
  overflow: hidden;
}
.sc-stamina-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--stamina), #64b5f6);
  border-radius: 5px;
  transition: width 0.5s ease;
  min-width: 0;
}
.sc-stamina-val {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--stamina);
  min-width: 64px;
  text-align: right;
}
.sc-stamina-timer {
  font-size: 0.7rem;
  color: var(--text-dim);
  min-width: 64px;
  text-align: right;
}
.sc-high-score-display {
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 600;
}
.sc-start-btn {
  width: 100%;
  max-width: 300px;
  font-size: 1.1rem;
  padding: var(--space-md) var(--space-xl);
}
.sc-bubble-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
  margin-top: var(--space-sm);
}
.sc-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.sc-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Stat Preview Grid — Pre-Round display of lead character's stat bonuses */
.sc-stat-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 100%;
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
}
.sc-sp-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: rgba(255,255,255,0.02);
  border-radius: 6px;
  padding: 6px 4px;
  border: 1px solid rgba(255,255,255,0.04);
}
.sc-sp-stat {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.sc-sp-stat-name {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sc-sp-stat-val {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-primary);
}
.sc-sp-arrow {
  font-size: 0.6rem;
  color: var(--text-dim);
  line-height: 1;
}
.sc-sp-effect {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.sc-sp-value {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: -0.3px;
}

/* Game Area */
.sc-game-area {
  position: relative;
  width: 100%;
  max-width: 500px;
  height: 500px;
  background: var(--bg-section);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

/* HUD */
.sc-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  background: linear-gradient(rgba(14,14,12,0.9), transparent);
  pointer-events: none;
}
.sc-hud-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}
.sc-hud-icon {
  font-size: 0.85rem;
}

/* Streamer Zone */
.sc-streamer-zone {
  position: absolute;
  bottom: 40px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  pointer-events: none;
  z-index: 5;
}
.sc-streamer-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  opacity: 0.6;
}
.sc-streamer-name {
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.6;
}

/* Boost Meter Bar */
.sc-boost-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--bg-input);
  z-index: 10;
}
.sc-boost-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  border-radius: 0 3px 3px 0;
  transition: width 0.15s ease;
}
.sc-boost-bar.sc-boost-full .sc-boost-fill {
  background: linear-gradient(90deg, var(--gold), #ffeb3b);
  animation: boostPulse 0.5s ease infinite alternate;
}
@keyframes boostPulse {
  from { opacity: 0.8; }
  to { opacity: 1; }
}

/* Super Chat Mode Overlay */
.sc-super-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 8;
  pointer-events: none;
  font-size: 2rem;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(232,197,71,0.8), 0 0 40px rgba(232,197,71,0.4);
  animation: superPulse 0.6s ease infinite alternate;
}
.sc-game-area.sc-super-mode {
  border-color: var(--gold);
  box-shadow: 0 0 30px rgba(232,197,71,0.3), inset 0 0 60px rgba(232,197,71,0.05);
}
@keyframes superPulse {
  from { transform: scale(1); opacity: 0.8; }
  to { transform: scale(1.05); opacity: 1; }
}
.sc-super-splash {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 30px rgba(232,197,71,0.9);
  z-index: 12;
  pointer-events: none;
  animation: splashIn 1.2s ease forwards;
}
@keyframes splashIn {
  0% { transform: translate(-50%, -50%) scale(0.3); opacity: 0; }
  20% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* Bubbles */
.sc-bubble {
  position: absolute;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 6;
  transition: transform 0.05s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.sc-bubble:active {
  transform: scale(0.9);
}
.sc-bubble-label {
  font-size: 0.7rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  pointer-events: none;
}

/* Bubble types */
.sc-bubble-coin {
  background: radial-gradient(circle at 35% 35%, #66bb6a, #388e3c);
  border: 2px solid #81c784;
}
.sc-bubble-premium {
  background: radial-gradient(circle at 35% 35%, #64b5f6, #1976d2);
  border: 2px solid #90caf9;
  font-size: 0.85rem;
}
.sc-bubble-gem {
  background: radial-gradient(circle at 35% 35%, #ce93d8, #7b1fa2);
  border: 2px solid #e1bee7;
  animation: gemGlow 1s ease infinite alternate;
}
@keyframes gemGlow {
  from { box-shadow: 0 0 8px rgba(171,71,188,0.4), 0 2px 8px rgba(0,0,0,0.3); }
  to { box-shadow: 0 0 16px rgba(171,71,188,0.6), 0 2px 8px rgba(0,0,0,0.3); }
}
.sc-bubble-landmine {
  background: radial-gradient(circle at 35% 35%, #ef5350, #c62828);
  border: 2px solid #ff8a80;
}
.sc-bubble-landmine .sc-bubble-label {
  font-size: 1rem;
  font-weight: 900;
}
.sc-bubble-gift {
  background: radial-gradient(circle at 35% 35%, #ffd54f, #f9a825);
  border: 2px solid #fff176;
}
.sc-bubble-gift .sc-bubble-label {
  font-weight: 900;
  font-size: 0.65rem;
}

/* Bubble pop animations */
.sc-bubble-pop-good {
  animation: popGood 0.25s ease forwards;
  pointer-events: none;
}
@keyframes popGood {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
  100% { transform: scale(0); opacity: 0; }
}
.sc-bubble-pop-bad {
  animation: popBad 0.25s ease forwards;
  pointer-events: none;
}
@keyframes popBad {
  0% { transform: scale(1); opacity: 1; }
  25% { transform: scale(0.8) rotate(5deg); }
  50% { transform: scale(1.2) rotate(-5deg); opacity: 0.5; }
  100% { transform: scale(0); opacity: 0; }
}

/* Floating score text */
.sc-float {
  position: absolute;
  z-index: 15;
  pointer-events: none;
  font-size: 0.85rem;
  font-weight: 800;
  animation: floatUp 0.8s ease forwards;
}
@keyframes floatUp {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-50px); opacity: 0; }
}
.sc-float-good { color: var(--success); }
.sc-float-bad { color: var(--error); }
.sc-float-gem { color: #ce93d8; font-size: 1rem; }
.sc-float-gift { color: var(--gold); font-size: 0.95rem; }

/* Screen shake */
.sc-shake {
  animation: screenShake 0.3s ease;
}
@keyframes screenShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

/* Results Screen */
.sc-results-screen {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}
.sc-results-title {
  color: var(--gold);
  font-size: 1.3rem;
}
.sc-results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  width: 100%;
}
.sc-reward-card {
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-sm);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sc-reward-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sc-reward-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent2);
}
.sc-results-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Results extras: top stat + ST remaining */
.sc-results-extras {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
  font-size: 0.78rem;
  color: var(--accent);
  width: 100%;
  max-width: 500px;
}
.sc-results-extras span {
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
}

/* Weekly Challenge results display */
.sc-results-challenge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 100%;
  max-width: 500px;
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  font-size: 0.8rem;
}
.sc-challenge-label {
  font-weight: 700;
  color: var(--gold);
}
.sc-challenge-desc {
  color: var(--text-muted);
  font-size: 0.75rem;
}
.sc-challenge-complete {
  color: var(--success);
  font-weight: 600;
  animation: sc-challenge-pop 0.5s ease-out;
}
.sc-challenge-hint {
  color: var(--text-dim);
  font-size: 0.72rem;
}
.sc-challenge-done {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-style: italic;
}
@keyframes sc-challenge-pop {
  0% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

/* Landmine dormant/warning state (CH-based) */
.sc-bubble-dormant {
  opacity: 0.3;
  animation: sc-dormant-pulse 0.8s ease-in-out infinite;
}
.sc-bubble-dormant .sc-bubble-label {
  opacity: 0.6;
}
@keyframes sc-dormant-pulse {
  0%, 100% { opacity: 0.2; transform: scale(0.92); }
  50% { opacity: 0.5; transform: scale(1.08); }
}

/* ═══════════════════════════════════════════════
   MOBILE FOOTER (Resource Bar)
   ═══════════════════════════════════════════════ */

#mobile-footer {
  display: none;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */

@media (max-width: 768px) {
  /* Hide brand logo on mobile — give tabs full width */
  .nav-brand {
    display: none;
  }

  /* Hide resources from top nav on mobile (moved to footer by JS) */
  #top-nav .nav-resources {
    display: none;
  }

  /* Mobile footer: persistent resource bar at bottom */
  #mobile-footer {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--footer-height);
    background: var(--bg-section);
    border-top: 1px solid var(--border);
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0 var(--space-sm);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  #mobile-footer .nav-resources {
    display: flex;
    gap: var(--space-xs);
    align-items: center;
    justify-content: center;
  }
  #mobile-footer .resource {
    font-size: 0.75rem;
    padding: 3px 8px;
  }
  #mobile-footer .resource::before {
    display: none;
  }
  #mobile-footer .stamina-bar-mini {
    min-width: 30px;
  }

  #top-nav {
    padding: 0 var(--space-sm);
    gap: var(--space-sm);
  }
  .nav-tab {
    font-size: 0.8rem;
    padding: var(--space-xs) var(--space-sm);
  }

  /* Account for footer in main content */
  #main-content {
    padding: var(--space-md) var(--space-sm) calc(var(--footer-height) + var(--space-md));
  }

  /* Pull overlay: scrollable on mobile */
  .pull-overlay {
    align-items: flex-start;
    padding: var(--space-lg) var(--space-sm);
  }


  .home-welcome h1 {
    font-size: 1.4rem;
  }
  .home-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  .pull-results {
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-sm);
  }

  .collection-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: var(--space-sm);
  }

  .stations-grid {
    grid-template-columns: 1fr;
  }

  /* Sprint 4: Income dashboard responsive */
  .income-label {
    min-width: 70px;
    font-size: 0.75rem;
  }
  .income-value {
    min-width: 40px;
    font-size: 0.8rem;
  }

  .collection-filters {
    flex-direction: column;
  }
  .collection-filters input {
    min-width: auto;
    width: 100%;
  }

  .pull-animation {
    grid-template-columns: repeat(auto-fill, 90px);
    gap: var(--space-sm);
    padding: var(--space-sm);
    max-width: 100%;
    justify-content: center;
  }
  .pull-animation .card-flip {
    width: 90px;
    height: 126px;
  }

  /* Sprint 8: Minigame responsive */
  .sc-game-area {
    height: 400px;
  }
  .sc-bubble {
    transform: scale(0.85);
  }
  .sc-hud-item {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  /* Footer resource tweaks for very small screens */
  #mobile-footer .nav-resources {
    gap: 2px;
  }
  #mobile-footer .resource {
    min-width: 28px;
    justify-content: center;
    padding: 3px 5px;
    font-size: 0.7rem;
  }
  #mobile-footer .resource span {
    display: none;
  }
  /* Hide text nav stamina on very small screens, keep bar only */
  #res-stamina-val {
    display: none;
  }
  #res-stamina {
    min-width: 32px;
    padding: 4px 6px;
  }
  .stamina-bar-mini {
    min-width: 20px;
  }

  /* Minigame stamina responsive */
  .sc-stamina-display {
    flex-wrap: wrap;
  }
  .sc-stamina-timer {
    min-width: auto;
    width: 100%;
    text-align: center;
  }

  /* Stat preview: 2 columns on mobile */
  .sc-stat-preview {
    grid-template-columns: repeat(2, 1fr);
  }

  .home-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat-value {
    font-size: 1.2rem;
  }

  .pull-results {
    grid-template-columns: repeat(3, 1fr);
  }

  .pull-animation {
    grid-template-columns: repeat(auto-fill, 80px);
    gap: var(--space-xs);
    max-width: 100%;
    padding: var(--space-xs);
    justify-content: center;
  }
  .pull-animation .card-flip {
    width: 80px;
    height: 112px;
  }
  .pull-animation.single-pull .card-flip {
    width: 160px;
    height: 224px;
  }
  /* Make overlay fit content with safe scrolling */
  .pull-overlay {
    align-items: flex-start;
    padding: var(--space-lg) var(--space-sm) var(--space-xl);
    gap: var(--space-md);
  }
  .pull-summary {
    font-size: 0.9rem;
  }
}

/* ═══════════════════════════════════════════════
   CHARACTER DETAIL V2 — Stats, Echo, Rarity Display
   ═══════════════════════════════════════════════ */

.modal-character {
  max-width: 600px;
}

/* ── Character Detail Layout ── */
.cd-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  align-items: start;
}

/* LEFT: Portrait panel */
.cd-portrait-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.cd-portrait-frame {
  position: relative;
  width: 170px;
  height: 220px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-card);
  border: 2px solid var(--border);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03),
    0 8px 24px rgba(0,0,0,0.4),
    0 0 20px color-mix(in srgb, var(--rarity-glow, #888) 30%, transparent);
  transition: box-shadow 0.3s ease;
}

.cd-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cd-portrait-badges {
  display: flex;
  gap: 6px;
  margin-top: -12px;
  z-index: 2;
  position: relative;
}

/* RIGHT: Info panel */
.cd-info-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 60%);
  border-radius: 12px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.04);
}

/* Row styles */
.cd-row {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.cd-row:last-child {
  border-bottom: none;
}

/* Row 1: Name + Rarity badge */
.cd-row-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 4px;
}
.cd-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.2;
}
.cd-row-name .rarity-badge {
  flex-shrink: 0;
}

/* Row 2: Agency + Echo */
.cd-row-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0;
}
.cd-agency {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

/* Row 3: Level bar */
.detail-level-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.detail-level-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 75px;
  white-space: nowrap;
}
.detail-level-cap {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}
.detail-level-bar-track {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}
.detail-level-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* Row 4: Power */
.cd-row-power {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.cd-power-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}
.cd-power-value {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.5px;
}

/* Row 5: Quick stats (ST | PS) */
.cd-row-quick-stats {
  display: flex;
  gap: 12px;
}
.cd-quick-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.03);
  padding: 6px 14px;
  border-radius: 8px;
  flex: 1;
  border: 1px solid rgba(255,255,255,0.04);
}
.cd-qs-label {
  font-size: 0.85rem;
  font-weight: 800;
}
.cd-qs-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-left: auto;
}

/* Row 6: Stats section */
.cd-row-stats {
  background: rgba(0,0,0,0.15);
  border-radius: 8px;
  padding: 8px 10px !important;
  margin: 2px -4px;
}
.cd-row-stats .stats-section-title {
  margin-bottom: 6px;
  font-size: 0.65rem;
}

/* Row 7: Dates */
.cd-row-dates {
  display: flex;
  gap: 16px;
  padding-top: 4px;
}
.cd-date-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.cd-date-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
}
.cd-date-value {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Bond Section (character detail) */
.cd-row-bond {
  padding-top: 4px;
}
.bond-section-title {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.bond-info-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.bond-level-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}
.bond-level-none {
  background: rgba(107, 114, 128, 0.2);
  color: #6b7280;
  border: 1px solid rgba(107, 114, 128, 0.3);
}
.bond-level-active {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(168, 85, 247, 0.15));
  color: #e879f9;
  border: 1px solid rgba(236, 72, 153, 0.3);
}
.bond-level-max {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(251, 146, 60, 0.2));
  color: #fbbf24;
  border: 1px solid rgba(255, 215, 0, 0.4);
  animation: bond-glow 2s ease-in-out infinite;
}
@keyframes bond-glow {
  0%, 100% { box-shadow: 0 0 4px rgba(255, 215, 0, 0.2); }
  50% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.4); }
}
.bond-bar-container {
  flex: 1;
  min-width: 0;
}
.bond-bar-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.bond-bar-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}
.bond-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #e879f9, #c084fc);
  border-radius: 3px;
  transition: width 0.3s ease;
}
.bond-bar-max {
  background: linear-gradient(90deg, #fbbf24, #f59e0b) !important;
}
.bond-stat-bonus {
  font-size: 0.65rem;
  font-weight: 700;
  color: #34d399;
  white-space: nowrap;
  flex-shrink: 0;
}
.bond-cooldown-hint {
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-top: 4px;
  font-style: italic;
}

/* Row 8: Actions */
.cd-row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
  border-bottom: none !important;
}
.cd-btn-lvup {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #5dd499, #34d399);
  color: #0a1a14;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(93, 212, 153, 0.25);
}
.cd-btn-lvup:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(93, 212, 153, 0.35);
}
.cd-btn-assign {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #42a5f5, #1e88e5);
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(66, 165, 245, 0.3);
}
.cd-btn-assign:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(66, 165, 245, 0.45);
}
.cd-btn-cost {
  font-size: 0.7rem;
  font-weight: 600;
  opacity: 0.75;
}
.cd-assigned-badge {
  font-size: 0.65rem;
  color: var(--accent2);
  background: var(--accent2-dim);
  padding: 4px 10px;
  border-radius: 12px;
  white-space: nowrap;
  font-weight: 600;
}
.cd-unowned-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
  border: 1px dashed var(--border);
  width: 100%;
}

/* Header with badges overlay */
.char-detail-header {
  position: relative;
  display: inline-block;
  margin: 0 auto var(--space-sm);
}
.char-detail-header .char-detail-img {
  display: block;
  margin-bottom: 0;
}
.char-detail-badges {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--space-xs);
  z-index: 2;
}

/* Detail modal image rarity borders */
.char-detail-img.card-r {
  border: 2px solid var(--rarity-r);
  box-shadow: 0 0 8px rgba(136, 136, 128, 0.3);
}
.char-detail-img.card-sr {
  border: 2px solid var(--rarity-sr);
  box-shadow: 0 0 8px rgba(176, 184, 200, 0.3);
}
.char-detail-img.card-ssr {
  border: 2px solid var(--rarity-ssr);
  box-shadow: 0 0 12px rgba(232, 197, 71, 0.4);
}
.char-detail-img.card-ur {
  border: 2px solid var(--rarity-ur);
  box-shadow: 0 0 16px rgba(224, 64, 251, 0.5);
  animation: urDetailGlow 2s ease-in-out infinite alternate;
}
@keyframes urDetailGlow {
  0% { box-shadow: 0 0 12px rgba(224, 64, 251, 0.4); }
  33% { box-shadow: 0 0 16px rgba(232, 197, 71, 0.4); }
  66% { box-shadow: 0 0 16px rgba(96, 165, 250, 0.4); }
  100% { box-shadow: 0 0 20px rgba(224, 64, 251, 0.5); }
}

/* Rarity badge in detail modal */
.rarity-badge {
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 800;
  border: 2px solid;
  background: var(--bg-modal);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Echo badges in detail modal */
.echo-badge {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.echo-badge-active {
  background: linear-gradient(135deg, #7c4dff, #e040fb);
  border-color: transparent;
  color: #fff;
}
.echo-badge-max {
  background: linear-gradient(135deg, #ffd700, #ff6b9d);
  border-color: transparent;
  color: #1a1a1a;
  font-weight: 800;
  text-shadow: 0 0 4px rgba(255,255,255,0.3);
}

/* Power display */
.power-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin: var(--space-sm) 0;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.power-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.power-value {
  font-size: 1.3rem;
  font-weight: 800;
}

/* Stats section V2 with bar visualization */
.char-detail-stats-v2 {
  text-align: left;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
}
.stats-section-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border);
}

/* Individual stat bar row */
.stat-bar-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 4px 0;
}
.stat-bar-label-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.stat-bar-name {
  font-size: 0.8rem;
  font-weight: 800;
  min-width: 24px;
}
.stat-bar-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  flex: 1;
}
.stat-bar-val {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}
.stat-bar-gain {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--success);
  margin-left: 2px;
}
.stat-bar-track {
  width: 100%;
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
}
.stat-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
  min-width: 2px;
}

/* Rarity info section (debut, status, subscribers) */
.rarity-info {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
}
.rarity-info-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.rarity-info-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.rarity-info-value {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.status-active { color: var(--success) !important; }
.status-inactive { color: var(--error) !important; }

/* ═══════════════════════════════════════════════
   CHARACTER DETAIL — Mobile Responsive
   ═══════════════════════════════════════════════ */
@media (max-width: 500px) {
  .cd-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .cd-portrait-panel {
    flex-direction: row;
    gap: 12px;
  }
  .cd-portrait-frame {
    width: 90px;
    height: 120px;
    flex-shrink: 0;
  }
  .cd-info-panel {
    padding: 10px;
  }
  .cd-btn-lvup:hover {
    transform: translateY(-1px);
  }
  .modal-character {
    max-width: 95vw;
  }
}

/* ═══════════════════════════════════════════════
   OSHI COLLECTION (Phase 7 — Collection Polish)
   ═══════════════════════════════════════════════ */

/* Star badge on collection cards */
.char-card-oshi-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  color: #1c1b18;
  font-size: 0.7rem;
  font-weight: 900;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.6), 0 0 16px rgba(255, 170, 0, 0.3);
  animation: oshi-star-pulse 2s ease-in-out infinite;
}

@keyframes oshi-star-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 215, 0, 0.6), 0 0 16px rgba(255, 170, 0, 0.3); }
  50% { box-shadow: 0 0 12px rgba(255, 215, 0, 0.8), 0 0 24px rgba(255, 170, 0, 0.5); }
}

/* Regal ornate border on Oshi cards in collection grid */
.char-card .char-card-oshi-badge ~ .char-card-overlay,
.char-card:has(.char-card-oshi-badge) {
  border: 2px solid #ffd700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.25), inset 0 0 10px rgba(255, 215, 0, 0.08);
}
.char-card:has(.char-card-oshi-badge) .char-card-img {
  /* Slight brightness boost for Oshi cards */
}

/* Portrait frame glow for Oshi in detail popup */
.cd-portrait-oshi {
  border: 2px solid #ffd700;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.4), 0 0 30px rgba(255, 170, 0, 0.15), inset 0 0 8px rgba(255, 215, 0, 0.1);
  animation: oshi-frame-glow 3s ease-in-out infinite;
}

@keyframes oshi-frame-glow {
  0%, 100% { box-shadow: 0 0 15px rgba(255, 215, 0, 0.4), 0 0 30px rgba(255, 170, 0, 0.15), inset 0 0 8px rgba(255, 215, 0, 0.1); }
  50% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.6), 0 0 40px rgba(255, 170, 0, 0.25), inset 0 0 12px rgba(255, 215, 0, 0.15); }
}

/* Extra portrait panel glow when character is Oshi */
.cd-portrait-panel[style*="--oshi-glow:1"] {
  /* Layered radial glow behind the portrait */
}

/* Oshi toggle button — inactive state */
.btn-oshi {
  background: linear-gradient(135deg, #2a2520, #1c1b18);
  border: 1px solid #ffd700;
  color: #ffd700;
  font-size: 0.75rem;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-oshi:hover:not([disabled]) {
  background: linear-gradient(135deg, #3a3530, #2a2520);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

/* Oshi button — active state (character IS Oshi) */
.btn-oshi-active {
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  border: 1px solid #ffd700;
  color: #1c1b18;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
  animation: oshi-btn-glow 2s ease-in-out infinite;
}
.btn-oshi-active:hover {
  background: linear-gradient(135deg, #ffe44d, #ffc233);
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.6);
}

@keyframes oshi-btn-glow {
  0%, 100% { box-shadow: 0 0 12px rgba(255, 215, 0, 0.4); }
  50% { box-shadow: 0 0 18px rgba(255, 215, 0, 0.6); }
}

/* Oshi badge position adjustment — ensure it doesn't overlap rarity badge */
.char-card-oshi-badge {
  /* Already positioned top-right */
}
/* Make sure rarity badge shifts down when Oshi badge is present */
.char-card:has(.char-card-oshi-badge) .char-card-badge {
  top: 28px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .cd-row-actions {
    flex-wrap: wrap;
    gap: 6px;
  }
  .btn-oshi, .btn-oshi-active {
    font-size: 0.7rem;
    padding: 5px 10px;
  }
}

/* ═══════════════════════════════════════════════
   CHARACTER DETAIL V3 — Light Theme (Reference Redesign)
   ═══════════════════════════════════════════════ */

/* Modal override — wider for new layout */
.modal-character {
  max-width: 640px !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
}

/* Main card — light background with rounded corners */
.cdv-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0;
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 40%, #fdf2f8 100%);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
  position: relative;
}

/* LEFT: Portrait column */
.cdv-portrait-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px 16px;
  gap: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.5) 0%, rgba(255,255,255,0.2) 100%);
}

.cdv-portrait-frame {
  width: 168px;
  height: 220px;
  border-radius: 14px;
  overflow: hidden;
  border: 3px solid #ccc;
  background: #f0eef8;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  transition: box-shadow 0.3s ease;
}

.cdv-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Portrait badges */
.cdv-portrait-badges {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.cdv-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.cdv-badge-rarity {
  text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.cdv-badge-echo {
  background: #5c6bc0 !important;
}

.cdv-badge-oshi {
  background: linear-gradient(135deg, #ffd700, #ffab00) !important;
  color: #1a1a1a !important;
  animation: cdv-oshi-pulse 2s ease-in-out infinite;
}

@keyframes cdv-oshi-pulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(255,215,0,0.3); }
  50% { box-shadow: 0 2px 14px rgba(255,215,0,0.6); }
}

/* Portrait meta info (First Obtained, Debut, Total Pulls) */
.cdv-portrait-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  padding: 0 4px;
}

.cdv-meta-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.cdv-meta-item:last-child {
  border-bottom: none;
}

.cdv-meta-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
  font-weight: 600;
}

.cdv-meta-value {
  font-size: 0.7rem;
  color: #444;
  font-weight: 600;
}

/* RIGHT: Info column */
.cdv-info-col {
  display: flex;
  flex-direction: column;
  padding: 20px 20px 16px 12px;
  gap: 12px;
  overflow-y: auto;
  max-height: 78vh;
}

/* Name */
.cdv-name-row {
  line-height: 1;
}

.cdv-name {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.3px;
  color: #2d2b55;
  margin: 0;
}

.cdv-subtitle {
  font-size: 0.78rem;
  color: #888;
  font-weight: 500;
  margin: 0;
  letter-spacing: 0.3px;
}

/* Top stat cards (Level | Power | Oshi) */
.cdv-top-cards {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.cdv-top-card {
  background: rgba(255,255,255,0.7);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.8);
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.cdv-top-card-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #999;
  font-weight: 700;
  margin-bottom: 4px;
}

.cdv-top-card-value {
  font-size: 1.3rem;
  font-weight: 900;
  line-height: 1.2;
}

.cdv-top-card-bar {
  height: 4px;
  background: rgba(0,0,0,0.06);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}

.cdv-top-card-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* Stats section */
.cdv-section-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #999;
  font-weight: 800;
  margin-bottom: 8px;
}

.cdv-stats-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cdv-stat-row {
  display: grid;
  grid-template-columns: 20px 28px 60px 1fr;
  align-items: center;
  gap: 6px;
}

.cdv-stat-icon {
  font-size: 0.85rem;
  text-align: center;
}

.cdv-stat-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #555;
  letter-spacing: 0.3px;
}

.cdv-stat-val {
  font-size: 0.75rem;
  font-weight: 700;
  color: #333;
  text-align: right;
}

.cdv-stat-bar-track {
  height: 7px;
  background: rgba(0,0,0,0.06);
  border-radius: 4px;
  overflow: hidden;
}

.cdv-stat-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
  opacity: 0.85;
}

/* Bond section */
.cdv-bond-section {
  background: rgba(255,255,255,0.5);
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,0.04);
}

.cdv-bond-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.cdv-bond-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #999;
  font-weight: 800;
}

.cdv-bond-level {
  font-size: 0.72rem;
  font-weight: 700;
  color: #ab47bc;
}

.cdv-bond-max {
  color: #ff9800 !important;
}

.cdv-bond-bar-track {
  height: 8px;
  background: rgba(0,0,0,0.06);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}

.cdv-bond-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ab47bc, #e040fb);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.cdv-bond-bar-max {
  background: linear-gradient(90deg, #ff9800, #ffd54f) !important;
}

.cdv-bond-text {
  font-size: 0.65rem;
  color: #888;
  font-weight: 600;
}

.cdv-bond-hint {
  font-size: 0.6rem;
  color: #aaa;
  font-style: italic;
  margin-top: 4px;
}

/* Action buttons */
.cdv-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: auto;
  padding-top: 4px;
}

.cdv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  flex: 1;
  color: #fff;
}

.cdv-btn:hover {
  transform: translateY(-1px);
}

.cdv-btn:active {
  transform: translateY(0);
}

.cdv-btn-oshi {
  background: linear-gradient(135deg, #ffd54f, #ffb300);
  color: #3e2723 !important;
  box-shadow: 0 3px 10px rgba(255,179,0,0.3);
}

.cdv-btn-oshi:hover {
  box-shadow: 0 5px 16px rgba(255,179,0,0.45);
}

.cdv-btn-oshi-active {
  background: linear-gradient(135deg, #ffab00, #ff8f00);
  color: #3e2723 !important;
  box-shadow: 0 3px 12px rgba(255,143,0,0.4);
}

.cdv-btn-lvup {
  background: linear-gradient(135deg, #42a5f5, #1e88e5);
  box-shadow: 0 3px 10px rgba(30,136,229,0.3);
}

.cdv-btn-lvup:hover {
  box-shadow: 0 5px 16px rgba(30,136,229,0.45);
}

.cdv-btn-assign {
  background: linear-gradient(135deg, #66bb6a, #43a047);
  box-shadow: 0 3px 10px rgba(67,160,71,0.3);
}

.cdv-btn-assign:hover {
  box-shadow: 0 5px 16px rgba(67,160,71,0.45);
}

.cdv-btn-sub {
  font-size: 0.65rem;
  font-weight: 600;
  opacity: 0.8;
}

.cdv-working-badge {
  font-size: 0.65rem;
  color: #66bb6a;
  background: rgba(67,160,71,0.1);
  padding: 4px 10px;
  border-radius: 12px;
  white-space: nowrap;
  font-weight: 700;
  border: 1px solid rgba(67,160,71,0.2);
}

.cdv-unowned-hint {
  width: 100%;
  text-align: center;
  font-size: 0.8rem;
  color: #999;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.5);
  border: 1px dashed rgba(0,0,0,0.1);
}

/* ═══════════════════════════════════════════════
   CHARACTER DETAIL V3 — Mobile Responsive
   ═══════════════════════════════════════════════ */
@media (max-width: 520px) {
  .modal-character {
    max-width: 96vw !important;
  }

  .cdv-card {
    grid-template-columns: 1fr;
    border-radius: 16px;
  }

  .cdv-portrait-col {
    flex-direction: row;
    padding: 14px 14px 10px;
    gap: 12px;
  }

  .cdv-portrait-frame {
    width: 80px;
    height: 105px;
    flex-shrink: 0;
  }

  .cdv-portrait-badges {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .cdv-portrait-meta {
    display: none;
  }

  .cdv-info-col {
    padding: 12px 14px 14px;
    gap: 10px;
    max-height: none;
  }

  .cdv-name {
    font-size: 1.1rem;
  }

  .cdv-top-cards {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
  }

  .cdv-top-card {
    padding: 8px 6px;
  }

  .cdv-top-card-value {
    font-size: 1.1rem;
  }

  .cdv-stat-row {
    grid-template-columns: 18px 26px 52px 1fr;
    gap: 4px;
  }

  .cdv-actions {
    flex-direction: column;
  }

  .cdv-btn {
    padding: 10px 12px;
  }
}
