:root {
  --bg: #0a0e1a;
  --bg-card: linear-gradient(145deg, rgba(20, 30, 50, 0.9), rgba(15, 20, 35, 0.95));
  --bg-solid: #0f1320;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.2);
  --text: #f0f2f5;
  --text-muted: rgba(255, 255, 255, 0.6);
  --text-dim: rgba(255, 255, 255, 0.4);
  --accent: #4ecdc4;
  --accent-hover: #3bb8ae;
  --accent-glow: rgba(78, 205, 196, 0.3);
  --gold: #ffd700;
  --silver: #c0c0c0;
  --bronze: #cd7f32;
  --green: #4ade80;
  --red: #f87171;
  --purple: #a78bfa;
  --radius: 16px;
  --radius-sm: 8px;
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.25);
  --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 80px var(--accent-glow);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Light Theme */
[data-theme="light"] {
  --bg: #f5f7fa;
  --bg-card: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(245, 248, 252, 0.95));
  --bg-solid: #ffffff;
  --border: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.15);
  --text: #1a1a2e;
  --text-muted: rgba(0, 0, 0, 0.6);
  --text-dim: rgba(0, 0, 0, 0.4);
  --accent: #0d9488;
  --accent-hover: #0a7a6f;
  --accent-glow: rgba(13, 148, 136, 0.2);
}

[data-theme="light"] .nav {
  background: rgba(255, 255, 255, 0.85);
}

[data-theme="light"] .card-image {
  background: linear-gradient(135deg, #e8ecf2, #d5dce6);
}

[data-theme="light"] .modal-content {
  background: #ffffff;
}

[data-theme="light"] .compare-panel {
  background: rgba(255, 255, 255, 0.95);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.header {
  padding: 48px 0 24px;
  text-align: center;
  background: 
    radial-gradient(ellipse at 50% 0%, rgba(78, 205, 196, 0.15) 0%, transparent 60%),
    linear-gradient(180deg, rgba(78, 205, 196, 0.05) 0%, transparent 100%);
  position: relative;
}

.header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%234ecdc4' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
  pointer-events: none;
}

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

.header-inner > div {
  text-align: left;
}

.logo {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--accent), #a78bfa, var(--accent));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

.logo a {
  text-decoration: none;
  color: inherit;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background: inherit;
  background-size: inherit;
  animation: inherit;
}

.tagline {
  color: var(--text-muted);
  margin-top: 8px;
  font-size: 1.1rem;
}

.tagline a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

.tagline a:hover {
  color: var(--purple);
  text-decoration: underline;
}

/* Theme Toggle */
.theme-toggle {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.theme-toggle:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.advanced-toggle {
  background: linear-gradient(135deg, var(--accent), #a78bfa, var(--accent));
  background-size: 200% auto;
  color: white;
  border: 1px solid transparent;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: 12px;
  animation: shimmer 3s linear infinite;
  text-align: right;
}

.advanced-toggle:hover {
  background: linear-gradient(135deg, #3bb8ae, #8b5cf6, #3bb8ae);
  border-color: var(--accent);
  animation: none;
}

.advanced-toggle.active {
  background: linear-gradient(135deg, var(--accent), #a78bfa, var(--accent));
  background-size: 200% auto;
  border-color: transparent;
  animation: shimmer 3s linear infinite;
}

.icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* Navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px;
  border-radius: var(--radius);
}

.tab {
  padding: 10px 24px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: calc(var(--radius) - 4px);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.tab.active {
  background: linear-gradient(135deg, var(--accent), #3db9b0);
  color: var(--bg);
  box-shadow: 0 4px 15px var(--accent-glow);
}

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

.nav-right {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn-compare {
  padding: 10px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-compare:hover, .btn-compare.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.select, .search {
  padding: 10px 16px;
  background: var(--bg-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.select option {
  background: var(--bg-solid);
  color: var(--text);
}

.select:focus, .search:focus {
  border-color: var(--accent);
}

.search {
  width: 180px;
}

.search::placeholder {
  color: var(--text-dim);
}

/* Main */
.main {
  padding: 40px 0 80px;
  min-height: 60vh;
}

.status {
  text-align: center;
  padding: 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.status.error {
  color: var(--red);
}

.section {
  display: block;
}

.section.hidden {
  display: none;
}

/* Card Grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

/* Card */
.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              border-color 0.3s, 
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  animation: fadeInUp 0.5s ease-out backwards;
  box-shadow: var(--shadow-card);
}

.card:nth-child(1) { animation-delay: 0.02s; }
.card:nth-child(2) { animation-delay: 0.04s; }
.card:nth-child(3) { animation-delay: 0.06s; }
.card:nth-child(4) { animation-delay: 0.08s; }
.card:nth-child(5) { animation-delay: 0.1s; }
.card:nth-child(6) { animation-delay: 0.12s; }
.card:nth-child(7) { animation-delay: 0.14s; }
.card:nth-child(8) { animation-delay: 0.16s; }
.card:nth-child(9) { animation-delay: 0.18s; }
.card:nth-child(10) { animation-delay: 0.2s; }
.card:nth-child(n+11) { animation-delay: 0.22s; }

.card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent), var(--shadow-card);
}

.card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover);
}

.card:hover .card-rank {
  transform: scale(1.1);
}

.card-rank {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  border-radius: 50%;
  font-weight: 700;
  font-size: 1rem;
  z-index: 2;
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-rank.rank-1 {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #000;
  border-color: #fff3;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.card-rank.rank-2 {
  background: linear-gradient(135deg, #e8e8e8, #b0b0b0);
  color: #000;
  border-color: #fff3;
  box-shadow: 0 0 15px rgba(200, 200, 200, 0.4);
}

.card-rank.rank-3 {
  background: linear-gradient(135deg, #cd7f32, #8b4513);
  color: #fff;
  border-color: #fff2;
  box-shadow: 0 0 15px rgba(205, 127, 50, 0.4);
}

.card-image {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(20, 25, 40, 1), rgba(10, 15, 25, 1));
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.4) 100%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.card:hover .card-image::after {
  opacity: 0;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover .card-image img {
  transform: scale(1.05);
}

.card-image img.rotated {
  transform: rotate(90deg) scale(1.35);
}

.card:hover .card-image img.rotated {
  transform: rotate(90deg) scale(1.4);
}

.card-info {
  padding: 16px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.2));
}

.card-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat {
  text-align: center;
  padding: 10px 8px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: background 0.2s, border-color 0.2s;
}

.card:hover .stat {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-hover);
}

.stat-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 20px var(--accent-glow);
}

.stat-value.highlight {
  color: var(--green);
  text-shadow: 0 0 20px rgba(74, 222, 128, 0.4);
}

.stat-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* Footer */
.footer {
  position: relative;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  background: linear-gradient(180deg, transparent, rgba(78, 205, 196, 0.03));
}

.footer a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

.footer a:hover {
  color: var(--purple);
  text-decoration: underline;
}

/* Responsive - Tablet */
@media (max-width: 900px) {
  .container {
    padding: 0 16px;
  }
  
  .nav .container {
    flex-direction: column;
    gap: 12px;
  }
  
  .tabs {
    width: 100%;
    justify-content: center;
  }
  
  .controls {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .search {
    width: 150px;
  }
}

/* Responsive - Mobile */
@media (max-width: 640px) {
  .header {
    padding: 32px 0 16px;
  }
  
  .logo {
    font-size: 1.8rem;
  }
  
  .tagline {
    font-size: 0.95rem;
  }
  
  .nav .container {
    flex-direction: column;
    gap: 12px;
  }
  
  .tabs {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  
  .tabs::-webkit-scrollbar {
    display: none;
  }
  
  .tab {
    padding: 10px 16px;
    font-size: 0.85rem;
    white-space: nowrap;
  }
  
  .controls {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .btn-compare {
    padding: 10px 12px;
    font-size: 0.85rem;
  }
  
  .select {
    padding: 10px 12px;
    font-size: 0.85rem;
    flex: 1;
    min-width: 120px;
  }
  
  .search {
    width: 100%;
    order: -1;
  }
  
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }
  
  .card-rank {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
    top: 8px;
    left: 8px;
  }
  
  .card-info {
    padding: 12px;
  }
  
  .card-name {
    font-size: 0.95rem;
    margin-bottom: 8px;
  }
  
  .card-stats {
    gap: 4px;
  }
  
  .stat {
    padding: 8px 4px;
  }
  
  .stat-value {
    font-size: 1rem;
  }
  
  .stat-label {
    font-size: 0.6rem;
  }
  
  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .compare-panel {
    top: 60px;
    padding: 16px 0;
  }
  
  .compare-slots {
    flex-direction: column;
    gap: 12px;
  }
  
  .compare-slot {
    min-width: auto;
    width: 100%;
  }
  
  .compare-vs {
    transform: rotate(90deg);
  }
  
  .modal-body {
    flex-direction: column;
    padding: 20px;
    gap: 20px;
  }
  
  .modal-image {
    max-width: 100%;
  }
  
  .modal-name {
    font-size: 1.4rem;
  }
  
  .modal-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  
  .modal-stats .stat {
    padding: 12px 8px;
  }
  
  .modal-stats .stat-value {
    font-size: 1.2rem;
  }
  
  .main {
    padding: 24px 0 60px;
  }
  
  .insight-card {
    padding: 16px;
  }
  
  .insight-title {
    font-size: 0.85rem;
  }
  
  .tier-list-container {
    padding: 16px;
  }
  
  .tier-row {
    min-height: 40px;
  }
  
  .tier-label {
    width: 32px;
    min-width: 32px;
    font-size: 0.9rem;
  }
  
  .tier-card {
    padding: 4px 8px;
    gap: 6px;
  }
  
  .tier-card-wr {
    font-size: 0.7rem;
  }
}

/* Responsive - Small Mobile */
@media (max-width: 400px) {
  .container {
    padding: 0 12px;
  }
  
  .logo {
    font-size: 1.5rem;
  }
  
  .tagline {
    font-size: 0.85rem;
  }
  
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .card-stats {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .stat-value {
    font-size: 0.9rem;
  }
  
  .stat-label {
    font-size: 0.55rem;
  }
  
  .modal-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .quick-stats {
    grid-template-columns: 1fr;
  }
}

/* Touch devices - disable hover animations that can cause sticky states */
@media (hover: none) and (pointer: coarse) {
  .card:hover {
    transform: none;
    box-shadow: var(--shadow-card);
  }
  
  .card:hover .card-rank {
    transform: none;
  }
  
  .card:hover .card-image img {
    transform: none;
  }
  
  .card:hover .card-image img.rotated {
    transform: rotate(90deg) scale(1.35);
  }
  
  .card:active {
    transform: scale(0.98);
  }
}

/* Compare Panel */
.compare-panel {
  position: sticky;
  top: 70px;
  z-index: 90;
  background: rgba(10, 14, 26, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}

.compare-panel.hidden {
  display: none;
}

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

.compare-header h3 {
  font-size: 1.1rem;
  color: var(--accent);
}

.btn-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-close:hover {
  border-color: var(--red);
  color: var(--red);
}

.compare-hint {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.compare-slots {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: center;
}

.compare-slot {
  flex: 1;
  max-width: 400px;
  min-height: 120px;
  padding: 16px;
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.compare-slot.empty {
  color: var(--text-dim);
}

.compare-slot.filled {
  border-style: solid;
  border-color: var(--accent);
}

.compare-slot .slot-card {
  display: flex;
  gap: 16px;
  align-items: center;
  width: 100%;
}

.compare-slot .slot-img {
  width: 80px;
  height: 100px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.compare-slot .slot-info {
  flex: 1;
}

.compare-slot .slot-name {
  font-weight: 600;
  margin-bottom: 8px;
}

.compare-slot .slot-stats {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
}

.compare-slot .slot-stat-value {
  color: var(--accent);
  font-weight: 600;
}

.compare-vs {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-dim);
}

/* Insights Panel */
.section-insights {
  margin-bottom: 24px;
}

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

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

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

/* Tier List */
.tier-list-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}

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

.tier-list-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.tier-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tier-row {
  display: flex;
  align-items: stretch;
  min-height: 44px;
  gap: 8px;
}

.tier-label {
  width: 40px;
  min-width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  color: #000;
}

.tier-label.tier-s {
  background: linear-gradient(135deg, #ffd700, #ffb800);
}

.tier-label.tier-a {
  background: linear-gradient(135deg, #4ecdc4, #3db8b0);
}

.tier-label.tier-b {
  background: linear-gradient(135deg, #a78bfa, #8b5cf6);
}

.tier-label.tier-c {
  background: linear-gradient(135deg, #f97316, #ea580c);
}

.tier-label.tier-d {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.tier-cards {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  align-items: center;
}

.tier-card {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, background 0.15s;
}

.tier-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  background: var(--accent-glow);
}

.tier-card-name {
  font-weight: 500;
  color: var(--text);
}

.tier-card-wr {
  font-size: 0.7rem;
  color: var(--text-dim);
}

@media (max-width: 600px) {
  .tier-card-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.insight-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.insight-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.insight-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

/* Help Button */
.help-btn {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.help-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.help-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  padding: 12px;
  background: var(--bg-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: left;
  white-space: pre-line;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.help-btn:hover::after {
  opacity: 1;
  visibility: visible;
}

.insight-subtitle {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 16px;
}

/* Quick Stats */
.quick-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 12px;
}

.quick-stat {
  text-align: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
}

.quick-stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.quick-stat-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Scatter Chart */
.scatter-chart {
  position: relative;
  margin-top: 8px;
}

.scatter-svg {
  width: 100%;
  height: auto;
}

.scatter-svg .axis-label {
  font-size: 10px;
  fill: var(--text-dim);
}

.scatter-svg .dot {
  cursor: pointer;
  transition: r 0.15s, opacity 0.15s;
}

.scatter-svg .dot:hover {
  r: 8;
}

.scatter-svg .dot.leader {
  fill: var(--accent);
}

.scatter-svg .dot.lore {
  fill: var(--purple);
}

.chart-legend {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-dot.leader {
  background: var(--accent);
}

.legend-dot.lore {
  background: var(--purple);
}

.scatter-tooltip {
  position: absolute;
  background: var(--bg-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.8rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 100;
  white-space: nowrap;
}

.scatter-tooltip.visible {
  opacity: 1;
}

/* Histogram Chart */
.histogram-chart {
  position: relative;
  margin-top: 8px;
}

.histogram-svg {
  width: 100%;
  height: auto;
}

.histogram-svg .axis-label {
  font-size: 9px;
  fill: var(--text-dim);
}

.histogram-svg .bar {
  cursor: pointer;
  transition: opacity 0.15s, filter 0.15s;
}

.histogram-svg .bar:hover {
  opacity: 0.8;
  filter: brightness(1.2);
}

.histogram-svg .bar.leader {
  fill: var(--accent);
}

.histogram-svg .bar.lore {
  fill: var(--purple);
}

.histogram-svg .bar.all {
  fill: var(--green);
}

.histogram-tooltip {
  position: absolute;
  background: var(--bg-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.8rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 100;
  max-width: 200px;
}

.histogram-tooltip.visible {
  opacity: 1;
}

.histogram-tooltip .tooltip-cards {
  font-size: 0.7rem;
  color: var(--text-dim);
  word-break: break-word;
  display: block;
  margin-top: 4px;
}

/* Card Analysis */
.card-analysis {
  margin-top: 8px;
}

.analysis-section {
  margin-bottom: 16px;
}

.analysis-section:last-child {
  margin-bottom: 0;
}

.analysis-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.analysis-desc {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.analysis-list {
  list-style: none;
  font-size: 0.85rem;
}

.analysis-list li {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: background 0.15s;
  margin: 0 -8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
}

.analysis-list li:hover {
  background: rgba(255, 255, 255, 0.05);
}

.analysis-list li:last-child {
  border-bottom: none;
}

.analysis-name {
  color: var(--text);
}

.analysis-stat {
  color: var(--accent);
  font-weight: 500;
}

/* Card Badges */
.card-badge {
  position: absolute;
  top: 40px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  z-index: 5;
  animation: fadeInUp 0.3s ease;
}

.badge-underrated {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: white;
}

.badge-overrated {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: white;
}

.badge-meta {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal.hidden {
  display: none;
}

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

.modal-content {
  position: relative;
  background: var(--bg-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 900px;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-solid);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s;
}

.modal-close:hover {
  border-color: var(--red);
  color: var(--red);
}

.modal-body {
  display: flex;
  gap: 32px;
  padding: 32px;
}

.modal-image {
  flex-shrink: 0;
  max-width: 320px;
}

.modal-image img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.modal-info {
  flex: 1;
  min-width: 0;
}

.modal-name {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.modal-stats .stat {
  padding: 16px;
}

.modal-stats .stat-value {
  font-size: 1.5rem;
}

.modal-text {
  color: var(--text-muted);
  line-height: 1.7;
  font-size: 0.95rem;
}

.modal-text:empty {
  display: none;
}

/* Checkbox styling */
input[type="checkbox"] {
  accent-color: var(--accent);
  transform: scale(1.1);
  margin-right: 5px;
}
