@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* =========================================================
   Sleek / Minimal Pass
   - softer shadows, consistent radii, fewer loud fills
   - accent used more intentionally
   - better dark mode surfaces + borders
========================================================= */

:root {
  --accent: #dc2626;
  --accent-2: #b91c1c;
  --accent-glow: rgba(220, 38, 38, 0.4);

  --bg-a: #f0f4f8;
  --bg-b: #e1e8f0;
  --bg-pattern: radial-gradient(circle at 20% 50%, rgba(220, 38, 38, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.03) 0%, transparent 50%);

  --text: #0f172a;
  --muted: #64748b;

  --card: #ffffff;
  --card-hover: rgba(255, 255, 255, 0.95);
  --border: rgba(15, 23, 42, 0.12);
  --border-light: rgba(15, 23, 42, 0.06);

  --radius-sm: 14px;
  --radius-md: 18px;
  --radius-lg: 22px;
  --pill: 999px;

  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04),
              0 4px 16px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08),
              0 8px 32px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.10),
              0 16px 48px rgba(15, 23, 42, 0.15);
  --shadow-xl: 0 12px 32px rgba(15, 23, 42, 0.12),
              0 24px 64px rgba(15, 23, 42, 0.18);

  --ease: cubic-bezier(.2, .8, .2, 1);
  --t-fast: 160ms;
  --t-med: 220ms;

  --focus: 0 0 0 3px rgba(220, 38, 38, 0.25);
}

body.dark-mode {
  --bg-a: #0a0e1a;
  --bg-b: #0f1729;
  --bg-pattern: radial-gradient(circle at 20% 50%, rgba(220, 38, 38, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.05) 0%, transparent 50%);

  --text: #e5e7eb;
  --muted: #9aa4b2;

  --card: rgba(15, 23, 42, 0.95);
  --card-hover: rgba(20, 28, 47, 0.95);
  --border: rgba(226, 232, 240, 0.12);
  --border-light: rgba(226, 232, 240, 0.06);

  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.3),
              0 4px 24px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.35),
              0 8px 40px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.4),
              0 16px 56px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 12px 36px rgba(0, 0, 0, 0.45),
              0 24px 72px rgba(0, 0, 0, 0.35);
}

/* Base Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background:
    var(--bg-pattern),
    linear-gradient(135deg, var(--bg-a) 0%, var(--bg-b) 100%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px 16px;
  transition: background var(--t-med) var(--ease), color var(--t-med) var(--ease);
  position: relative;
}

.container {
  width: 100%;
  max-width: 1100px;
  text-align: center;
}

/* Header with Logo */
header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 8px;
}

.site-logo {
  height: 60px;
  width: auto;
  transition: transform var(--t-med) var(--ease), opacity var(--t-med) var(--ease);
}

.site-logo:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

body.dark-mode .site-logo {
  filter: brightness(0.95);
}

@media (max-width: 768px) {
  .site-logo {
    height: 50px;
  }
}

/* =========================================================
   Nav
========================================================= */

.nav-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 16px 0 18px;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--pill);
  box-shadow: var(--shadow-md);
  transition: background var(--t-med) var(--ease),
    box-shadow var(--t-med) var(--ease),
    border-color var(--t-med) var(--ease),
    transform var(--t-med) var(--ease);
  width: 100%;
  max-width: 1200px;
  flex-wrap: wrap;
  min-height: 48px;
  backdrop-filter: blur(10px);
  position: relative;
}

.navbar::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--pill);
  padding: 1px;
  background: linear-gradient(135deg,
    rgba(220, 38, 38, 0.1) 0%,
    rgba(59, 130, 246, 0.05) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--t-med) var(--ease);
  pointer-events: none;
}

.navbar:hover::before {
  opacity: 1;
}

.nav-left ul {
  list-style: none;
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  align-items: center;
  flex-wrap: wrap;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.nav-right::before {
  content: '';
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 2px;
  flex-shrink: 0;
}

.navbar li a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--muted);
  padding: 7px 10px;
  border-radius: var(--pill);
  transition: background var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease);
  display: inline-block;
  white-space: nowrap;
}

/* Minimal active: subtle surface + accent text (instead of always orange fill) */
.navbar li a:hover {
  background: rgba(100, 116, 139, 0.10);
  color: var(--text);
  transform: translateY(-1px);
}

.navbar li a.active {
  background: rgba(220, 38, 38, 0.14);
  color: var(--accent);
  font-weight: 700;
}

/* Dark mode hover surface */
body.dark-mode .navbar li a:hover {
  background: rgba(226, 232, 240, 0.08);
}

/* Dark Mode Toggle */
.dark-mode-toggle {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 5px 7px;
  border-radius: var(--pill);
  transition: transform var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
  flex-shrink: 0;
}

.dark-mode-toggle:hover {
  transform: scale(1.08);
  opacity: 0.9;
  background: rgba(100, 116, 139, 0.10);
}

.toggle-icon {
  transition: transform 420ms var(--ease);
}

body.dark-mode .toggle-icon {
  transform: rotate(360deg);
}

/* =========================================================
   Category Switch (less “pill overload”)
========================================================= */

.category-switch {
  margin: 18px 0 26px;
}

.category-btn {
  display: inline-block;
  padding: 10px 22px;
  font-size: 1.02rem;
  font-weight: 600;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--pill);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease);
  margin: 0 8px;
  text-decoration: none;
  color: var(--text);
}

.category-btn:hover:not(.active) {
  border-color: rgba(220, 38, 38, 0.45);
  color: var(--accent);
  transform: translateY(-1px);
}

.category-btn.active {
  background: rgba(220, 38, 38, 0.14);
  border-color: rgba(220, 38, 38, 0.35);
  color: var(--accent);
}

/* Remove hyperlink styling from category buttons */
.category-btn,
.category-btn:hover,
.category-btn:visited,
.category-btn:active {
  text-decoration: none !important;
}

/* =========================================================
   Week Info
========================================================= */

#week-info {
  font-size: clamp(1.35rem, 4.5vw, 1.75rem);
  color: var(--accent);
  font-weight: 650;
  margin-bottom: 7px;
  position: relative;
  top: 3px;
  line-height: 1.15;
}

/* =========================================================
   Chart Section (clean card)
========================================================= */

.chart-section {
  position: relative;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: clamp(22px, 5.5vw, 46px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transition: background var(--t-med) var(--ease),
    box-shadow var(--t-med) var(--ease),
    border-color var(--t-med) var(--ease);
}

canvas {
  height: clamp(340px, 58vh, 540px) !important;
  width: 100% !important;
}

/* Hover note */
.hover-note {
  margin-top: 28px;
  color: var(--muted);
  font-size: clamp(1rem, 3.6vw, 1.15rem);
  font-style: italic;
}

/* =========================================================
   Top 3 Spotlight (more minimal cards, less extreme hover)
========================================================= */

.top3-spotlight {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 34px auto 52px;
  max-width: 1200px;
  padding: 0 20px;
}

.top3-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transition: transform var(--t-med) var(--ease),
    box-shadow var(--t-med) var(--ease),
    border-color var(--t-med) var(--ease);
  text-align: center;
  position: relative;
}

.top3-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
  opacity: 0;
  transition: opacity var(--t-med) var(--ease);
}

/* subtle "rank glow" with enhanced borders */
.top3-card:nth-child(1) {
  border-color: rgba(255, 215, 0, 0.4);
  box-shadow: var(--shadow-lg),
    0 0 0 1px rgba(255, 215, 0, 0.1) inset,
    0 4px 20px rgba(255, 215, 0, 0.15);
}

.top3-card:nth-child(2) {
  border-color: rgba(192, 192, 192, 0.4);
  box-shadow: var(--shadow-lg),
    0 0 0 1px rgba(192, 192, 192, 0.1) inset,
    0 4px 20px rgba(192, 192, 192, 0.12);
}

.top3-card:nth-child(3) {
  border-color: rgba(205, 127, 50, 0.4);
  box-shadow: var(--shadow-lg),
    0 0 0 1px rgba(205, 127, 50, 0.1) inset,
    0 4px 20px rgba(205, 127, 50, 0.12);
}

.top3-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-xl);
}

.top3-card:hover::before {
  opacity: 1;
}

.top3-image {
  width: 100%;
  height: 320px;
  object-fit: cover;
}

.top3-info {
  padding: 18px 18px 20px;
}

.top3-rank {
  font-size: 3.4rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 6px;
}

.top3-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.25;
}

.top3-author {
  font-size: 0.98rem;
  color: var(--muted);
  margin-bottom: 14px;
}

.top3-sales {
  font-size: 1.05rem;
  margin-bottom: 16px;
}

.top3-sales strong {
  color: var(--accent);
}

.top3-amazon {
  display: inline-block;
  padding: 10px 18px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: white;
  border-radius: var(--pill);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3),
    0 8px 24px rgba(220, 38, 38, 0.2);
  position: relative;
  overflow: hidden;
}

.top3-amazon::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent);
  transition: left var(--t-med) var(--ease);
}

.top3-amazon:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.4),
    0 12px 32px rgba(220, 38, 38, 0.25);
}

.top3-amazon:hover::before {
  left: 100%;
}

/* =========================================================
   #4-10 (UPDATED ONLY)
   Goal: match Top 3 width (1200px) + stretch full width
========================================================= */

/* This is the container in index.html: <div class="nice-rankings-grid"></div> */
.nice-rankings-grid {
  max-width: 1200px;
  /* match top3-spotlight */
  margin: 16px auto 32px;
  padding: 0 20px;

  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  /* ✅ ensures children expand full width */
  gap: 14px;
}

/* If you still render old .nice-card rows anywhere */
.nice-card {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 14px 18px;
}

.nice-card-info {
  text-align: left;
  padding-left: 14px;
}

.nice-card-image {
  width: 56px;
  height: auto;
  border-radius: 8px;
}

.nice-card-rank {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.nice-card-title {
  font-size: 1.02rem;
  font-weight: 650;
  margin-bottom: 6px;
  line-height: 1.3;
}

.nice-card-author {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.nice-card-sales {
  font-size: 0.95rem;
  margin: 4px 0;
}

.nice-card-sales strong {
  color: var(--accent);
}

/* Shelf wrapper (if your JS uses it) */
.shelf-wrap {
  width: 100%;
  max-width: 1200px;
  /* ✅ same as Top 3 */
  margin: 0 auto 18px;
  padding: 0;
  /* nice-rankings-grid already provides side padding */
  display: grid;
  gap: 12px;
  justify-items: stretch;
  /* ✅ stretch items */
}

/* Each shelf item container */
.shelf-item {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: box-shadow var(--t-med) var(--ease),
    transform var(--t-med) var(--ease),
    border-color var(--t-med) var(--ease),
    background var(--t-med) var(--ease);
  position: relative;
}

.shelf-item::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg,
    rgba(220, 38, 38, 0.02) 0%,
    transparent 50%);
  opacity: 0;
  transition: opacity var(--t-med) var(--ease);
  pointer-events: none;
}

.shelf-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-light);
  background: var(--card-hover);
}

.shelf-item:hover::after {
  opacity: 1;
}

/* Clickable row */
.shelf-row {
  width: 100%;
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
}

/* cover image */
.shelf-cover {
  width: 64px;
  height: 88px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.6);
}

/* main text */
.shelf-main {
  min-width: 0;
}

.shelf-topline {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.shelf-rank {
  font-weight: 800;
  color: var(--accent);
  flex: 0 0 auto;
}

.shelf-title {
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shelf-subline {
  margin-top: 2px;
  font-size: 0.9rem;
  color: var(--muted);
  opacity: 0.9;
}

/* caret */
.shelf-caret {
  font-size: 1.15rem;
  color: var(--muted);
  opacity: 0.9;
  transition: transform var(--t-med) var(--ease);
}

/* Open state */
.shelf-item.open {
  border-color: rgba(220, 38, 38, 0.35);
}

.shelf-item.open .shelf-caret {
  transform: rotate(180deg);
}

/* Expand panel */
.shelf-panel {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding: 12px 14px 14px;
  background: rgba(220, 38, 38, 0.05);
}

/* panel content layout */
.shelf-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 10px;
}

.shelf-stat {
  font-size: 0.95rem;
  color: var(--text);
}

.shelf-stat strong {
  color: var(--accent);
}

/* Actions row */
.shelf-actions {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
}

/* Make amazon button fit the shelf panel */
.shelf-actions .amazon-btn {
  margin-top: 0;
}

/* Dark mode refinements */
body.dark-mode .shelf-cover {
  border-color: rgba(226, 232, 240, 0.12);
  background: rgba(0, 0, 0, 0.20);
}

body.dark-mode .shelf-panel {
  border-top-color: rgba(226, 232, 240, 0.10);
  background: rgba(220, 38, 38, 0.08);
}

/* Mobile: stack a bit tighter */
@media (max-width: 520px) {
  .shelf-row {
    grid-template-columns: 56px 1fr auto;
    gap: 12px;
    padding: 10px 12px;
  }

  .shelf-cover {
    width: 56px;
    height: 78px;
  }
}

/* =========================================================
   Buttons / shared
========================================================= */

.amazon-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 14px;
  background: rgba(220, 38, 38, 0.14);
  /* minimal */
  color: var(--accent);
  border: 1px solid rgba(220, 38, 38, 0.22);
  border-radius: var(--pill);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  transition: background var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease);
}

.amazon-btn:hover {
  background: rgba(220, 38, 38, 0.20);
  border-color: rgba(220, 38, 38, 0.35);
  transform: translateY(-1px);
}

/* =========================================================
   Footer bits
========================================================= */

.bottom-logo {
  margin-top: 64px;
  width: 92px;
  height: auto;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.10));
  opacity: 0.78;
}

.bottom-disclaimer {
  margin-top: 18px;
  font-size: 0.92rem;
  opacity: 0.85;
  color: var(--muted);
}

/* =========================================================
   About / Support pages (kept, made consistent)
========================================================= */

.about-content,
.support-content {
  max-width: 820px;
  margin: 0 auto;
  line-height: 1.75;
  font-size: 1.08rem;
}

.about-content h2,
.support-content h2 {
  font-size: 2.2rem;
  margin-bottom: 32px;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.intro-text {
  font-size: 1.22rem;
  margin-bottom: 30px;
  font-weight: 500;
  color: var(--text);
}

.about-content p,
.support-content p {
  margin-bottom: 22px;
  color: var(--text);
}

.feature-list {
  text-align: left;
  max-width: 640px;
  margin: 30px auto;
  padding-left: 22px;
  font-size: 1.08rem;
}

.feature-list li {
  margin-bottom: 14px;
}

.feature-list li::marker {
  color: var(--accent);
  font-weight: 800;
}

.closing-text {
  font-size: 1.15rem;
  font-style: italic;
  margin: 42px 0 34px;
  color: var(--muted);
}

.footer-note {
  font-size: 0.95rem;
  opacity: 0.75;
  margin-top: 46px;
  color: var(--muted);
}

/* Support buttons */
.support-buttons {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 40px 0;
  flex-wrap: wrap;
}

.support-btn {
  display: inline-block;
  padding: 14px 26px;
  font-size: 1.05rem;
  font-weight: 800;
  border-radius: var(--pill);
  text-decoration: none;
  transition: transform var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease),
    filter var(--t-fast) var(--ease);
  box-shadow: var(--shadow-sm);
}

.support-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  filter: saturate(1.05);
}

.support-btn.kofi {
  background: #ff5e5b;
  color: white;
}

.support-btn.paypal {
  background: #0070ba;
  color: white;
}

/* Small logos above titles */
.support-logo-wrapper,
.about-logo-wrapper {
  text-align: center;
  margin-bottom: -6px;
}

.support-logo,
.about-logo {
  width: 92px;
  height: auto;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.10));
}

/* =========================================================
   Auth Bar + Modal (more minimal + better dark inputs)
========================================================= */

.auth-bar {
  display: none; /* Hidden - now integrated into navbar */
}

.auth-container {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.user-email {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-btn {
  padding: 6px 12px;
  background: rgba(220, 38, 38, 0.14);
  color: var(--accent);
  border: 1px solid rgba(220, 38, 38, 0.22);
  border-radius: var(--pill);
  font-weight: 800;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.1);
  position: relative;
}

.auth-btn:hover {
  background: rgba(220, 38, 38, 0.22);
  border-color: rgba(220, 38, 38, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.auth-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(220, 38, 38, 0.15);
}

/* Modal */
.auth-modal {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9999;
}

.auth-modal-content {
  background: var(--card);
  padding: 34px;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  position: relative;
}

.auth-modal input {
  width: 100%;
  padding: 13px 14px;
  margin-bottom: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  transition: box-shadow var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease);
}

.auth-modal input:focus {
  outline: none;
  box-shadow: var(--focus);
  border-color: rgba(220, 38, 38, 0.45);
}

/* Close */
.close-btn {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--muted);
  padding: 6px 8px;
  border-radius: var(--pill);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.close-btn:hover {
  background: rgba(100, 116, 139, 0.12);
  color: var(--text);
}

/* Tabs */
.auth-tabs {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 22px;
}

.tab-btn {
  background: none;
  border: none;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  padding-bottom: 6px;
  color: var(--muted);
  transition: color var(--t-fast) var(--ease);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom: 2px solid rgba(220, 38, 38, 0.65);
}

.auth-hint {
  font-size: 0.82rem;
  opacity: 0.75;
  margin-top: 8px;
  text-align: center;
  color: var(--muted);
}

/* =========================================================
   Responsive
========================================================= */

@media (max-width: 900px) {
  .top3-spotlight {
    grid-template-columns: 1fr;
  }

  .top3-image {
    height: 310px;
  }

  .top3-rank {
    font-size: 3.2rem;
  }

  .top3-title {
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  .top3-image {
    height: 270px;
  }

  .nice-card-image {
    height: 210px;
  }

  .bottom-logo {
    width: 78px;
  }
}

/* ===============================
   Comments UI
================================ */
#commentsSection h3 {
  font-size: 1.05rem;
  letter-spacing: 0.2px;
}

#commentComposer {
  display: grid;
  gap: 10px;
}

#commentBody {
  width: 100%;
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.7);
  outline: none;
  font-size: 0.95rem;
  line-height: 1.35;
}

#commentBody:focus {
  border-color: rgba(0, 0, 0, 0.22);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

/* ===============================
   Reddit-style comments
================================ */

/* ===============================
   Comments: force Reddit-style alignment
================================ */

.comments-wrap {
  /* Your content-box may be centered; keep the box but control text flow inside */
}

/* =========================================================
   Comments Section - Clean Modern Design
========================================================= */

.comments-title {
  text-align: center;
  margin-bottom: 18px;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

/* Force left aligned thread even though .container is centered */
.comments-thread {
  text-align: left !important;
  max-width: 1100px;
  margin: 0 auto;
}

/* Composer - bigger and more spacious */
#commentComposer {
  display: grid;
  gap: 14px;
  margin-bottom: 32px;
  padding: 20px 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

#commentBody {
  width: 100%;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.75);
  outline: none;
  font-size: 1rem;
  line-height: 1.6;
  resize: vertical;
  color: var(--text);
  font-family: inherit;
  min-height: 80px;
}

#commentBody:focus {
  box-shadow: var(--focus);
  border-color: rgba(220, 38, 38, 0.45);
}

/* Each comment - bigger cards with more space */
.comment-item {
  padding: 0;
  margin-bottom: 14px;
  border-bottom: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}

.comment-item:hover {
  border-color: rgba(220, 38, 38, 0.25);
  box-shadow: var(--shadow-md);
}

/* Highlight flash animation when clicking @mention */
.comment-item.highlight-flash {
  animation: highlightPulse 2s ease-out;
}

@keyframes highlightPulse {
  0% {
    background: rgba(220, 38, 38, 0.25);
    border-color: rgba(220, 38, 38, 0.60);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15);
  }
  50% {
    background: rgba(220, 38, 38, 0.18);
    border-color: rgba(220, 38, 38, 0.45);
  }
  100% {
    background: var(--card);
    border-color: var(--border);
    box-shadow: none;
  }
}

/* Header: username • 🍡count • time */
.comment-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.comment-user {
  font-weight: 700;
  color: var(--text);
  font-size: 0.95rem;
}

/* Meta chunk holds the separators + inline like + time */
.comment-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

/* Body directly under header - bigger text */
.comment-body {
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 12px;
  white-space: pre-wrap;
  color: var(--text);
  word-wrap: break-word;
}

/* @mention tag for replies */
.replying-to {
  display: inline-block;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 2px 6px;
  background: rgba(220, 38, 38, 0.10);
  border-radius: 6px;
  margin-right: 6px;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
  position: relative;
}

.replying-to:hover {
  background: rgba(220, 38, 38, 0.18);
  transform: translateY(-1px);
}

.replying-to:active {
  transform: scale(0.95);
}

/* Custom tooltip for @mention - shows on hover */
.replying-to::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 400;
  white-space: normal;
  max-width: 300px;
  width: max-content;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  line-height: 1.4;
}

.replying-to:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-12px);
}

/* Dark mode tooltip */
body.dark-mode .replying-to::after {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(226, 232, 240, 0.20);
}

/* Inline Takoyaki like button - bigger and more clickable */
.like-btn.inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: var(--pill);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  transition: background var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease);
  color: var(--muted);
}

.like-btn.inline .tako {
  font-size: 1rem;
  transform: translateY(1px);
}

.like-btn.inline .like-count {
  font-weight: 700;
  font-size: 0.85rem;
}

/* hover */
.like-btn.inline:hover {
  background: rgba(100, 116, 139, 0.12);
  transform: translateY(-1px);
}

/* liked = pink highlight */
.like-btn.inline.liked {
  color: rgb(255, 105, 180);
  background: rgba(255, 105, 180, 0.08);
}

/* bounce */
@keyframes takoBounce {
  0% {
    transform: translateY(1px) scale(1);
  }

  30% {
    transform: translateY(-2px) scale(1.15);
  }

  60% {
    transform: translateY(1px) scale(0.95);
  }

  100% {
    transform: translateY(1px) scale(1);
  }
}

.like-btn.bounce .tako {
  animation: takoBounce 300ms ease;
}

/* Dark mode support (your class is dark-mode) */
body.dark-mode #commentBody {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(226, 232, 240, 0.12);
  color: var(--text);
}

body.dark-mode .comment-item {
  border-bottom-color: rgba(226, 232, 240, 0.10);
}

body.dark-mode .comment-meta {
  color: rgba(154, 164, 178, 0.95);
}

body.dark-mode .like-btn.inline:hover {
  background: rgba(226, 232, 240, 0.08);
}

body.dark-mode .like-btn.inline.liked {
  color: rgb(255, 155, 210);
}

/* =========================================================
   Comments: Roles + Replies + Register popout
========================================================= */

/* Role badges */
.role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-left: 8px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(15, 23, 42, 0.06);
  color: rgba(15, 23, 42, 0.82);
}

.role-badge.role-mod {
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.10);
  color: rgba(239, 68, 68, 0.95);
}

.role-badge.role-donator {
  border-color: rgba(255, 105, 180, 0.28);
  background: rgba(255, 105, 180, 0.12);
  color: rgba(236, 72, 153, 0.98);
}

/* Reply link */
.reply-link {
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0;
  margin: 0;
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}

.reply-link:hover {
  color: var(--text);
  text-decoration: underline;
}

/* One-level reply indentation */
.comment-item.comment-reply{
  position: relative;
  padding-left: 18px;   /* small, constant */
}

.comment-item.comment-reply::before{
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: rgba(100,116,139,0.18);
  border-radius: 999px;
}


/* Reply composer - more spacious */
.reply-composer {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  margin-bottom: 10px;
  padding: 14px;
  background: rgba(220, 38, 38, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.reply-textarea {
  width: 100%;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  outline: none;
  font-size: 0.95rem;
  line-height: 1.5;
  resize: vertical;
  color: var(--text);
  font-family: inherit;
  min-height: 70px;
}

.reply-textarea:focus {
  box-shadow: var(--focus);
  border-color: rgba(220, 38, 38, 0.45);
}

.reply-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.reply-cancel {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.10);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--muted);
  transition: transform var(--t-fast) var(--ease),
    background var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease);
}

.reply-cancel:hover {
  background: rgba(100, 116, 139, 0.10);
  border-color: rgba(100, 116, 139, 0.18);
  transform: translateY(-1px);
}

/* Replies container spacing */
.replies {
  margin-top: 10px;
}

/* =========================================================
   Register popout (logged out CTA)
========================================================= */
.register-popout {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 99999;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 180ms var(--ease), transform 180ms var(--ease);
}

.register-popout.show {
  opacity: 1;
  transform: translateY(0);
}

.register-popout-card {
  pointer-events: auto;
  width: min(360px, calc(100vw - 32px));
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 14px 14px 12px;
}

.register-popout-title {
  font-weight: 900;
  font-size: 0.98rem;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.register-popout-sub {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.register-popout-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.register-popout-close {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.10);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--muted);
  transition: transform var(--t-fast) var(--ease),
    background var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease);
}

.register-popout-close:hover {
  background: rgba(100, 116, 139, 0.10);
  border-color: rgba(100, 116, 139, 0.18);
  transform: translateY(-1px);
}

/* Dark mode compatibility */
body.dark-mode .comment-item.comment-reply {
  border-left-color: rgba(226, 232, 240, 0.12);
}

body.dark-mode .role-badge {
  border-color: rgba(226, 232, 240, 0.14);
  background: rgba(226, 232, 240, 0.08);
  color: rgba(226, 232, 240, 0.88);
}

body.dark-mode .role-badge.role-mod {
  border-color: rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.14);
  color: rgba(252, 165, 165, 0.95);
}

body.dark-mode .role-badge.role-donator {
  border-color: rgba(255, 105, 180, 0.30);
  background: rgba(255, 105, 180, 0.16);
  color: rgba(255, 183, 213, 0.98);
}

body.dark-mode .reply-textarea {
  background: rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.92);
}

body.dark-mode .reply-cancel,
body.dark-mode .register-popout-close {
  border-color: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.78);
}

body.dark-mode .reply-cancel:hover,
body.dark-mode .register-popout-close:hover {
  background: rgba(226, 232, 240, 0.08);
}

.week-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.join-discussion-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid rgba(220, 38, 38, 0.22);
  background: rgba(220, 38, 38, 0.14);
  color: var(--accent);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.join-discussion-btn:hover {
  background: rgba(220, 38, 38, 0.22);
  border-color: rgba(220, 38, 38, 0.35);
  transform: translateY(-1px);
}

#graphView .view-toggle {
  margin-top: 18px;
  margin-bottom: 8px;
}

/* Nested reply indentation - more spacious */
.comment-item.comment-reply {
  margin-left: 32px;
  margin-top: 12px;
}

/* Content wrapper with generous padding */
.comment-content {
  padding: 18px 20px;
  flex: 1 1 auto;
  min-width: 0;
}

/* Collapse button - bigger and easier to click */
.comment-gutter {
  position: absolute;
  left: -22px;
  top: 18px;
  width: 18px;
  height: 18px;
  border: none;
  background: rgba(100, 116, 139, 0.20);
  cursor: pointer;
  border-radius: 4px;
  opacity: 0.7;
  transition: all var(--t-fast) var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text);
  flex-shrink: 0;
}

.comment-gutter:hover {
  opacity: 1;
  background: rgba(220, 38, 38, 0.35);
  transform: scale(1.15);
}

.comment-gutter:disabled {
  opacity: 0;
  cursor: default;
  pointer-events: none;
}

.comment-item[data-collapsed="1"] .comment-gutter {
  background: rgba(220, 38, 38, 0.30);
  opacity: 0.95;
}

.comment-item[data-collapsed="1"] .comment-gutter::before {
  content: "▸";
}

.comment-gutter::before {
  content: "▾";
}

/* Replies container */
.replies {
  margin-top: 14px;
}

/* "N replies hidden" button - bigger */
.replies-hidden-line {
  margin: 12px 0 10px 0;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(220, 38, 38, 0.08);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: center;
  transition: all var(--t-fast) var(--ease);
  width: 100%;
  display: block;
}

.replies-hidden-line:hover {
  background: rgba(220, 38, 38, 0.14);
  border-color: rgba(220, 38, 38, 0.35);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.replies-children {
  margin-top: 12px;
}

/* Dark mode improvements */
body.dark-mode #commentComposer {
  background: rgba(15, 23, 42, 0.50);
  border-color: rgba(226, 232, 240, 0.12);
}

body.dark-mode .comment-item {
  background: rgba(15, 23, 42, 0.50);
  border-color: rgba(226, 232, 240, 0.10);
}

body.dark-mode .comment-item:hover {
  border-color: rgba(220, 38, 38, 0.35);
}

body.dark-mode .comment-item.highlight-flash {
  animation: highlightPulseDark 2s ease-out;
}

@keyframes highlightPulseDark {
  0% {
    background: rgba(220, 38, 38, 0.30);
    border-color: rgba(220, 38, 38, 0.70);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.20);
  }
  50% {
    background: rgba(220, 38, 38, 0.20);
    border-color: rgba(220, 38, 38, 0.50);
  }
  100% {
    background: rgba(15, 23, 42, 0.50);
    border-color: rgba(226, 232, 240, 0.10);
    box-shadow: none;
  }
}

body.dark-mode .comment-gutter {
  background: rgba(226, 232, 240, 0.15);
}

body.dark-mode .comment-gutter:hover {
  background: rgba(220, 38, 38, 0.35);
}

body.dark-mode .replies-hidden-line {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.25);
}

body.dark-mode .replies-hidden-line:hover {
  background: rgba(220, 38, 38, 0.18);
}

/* Mobile responsiveness */
@media (max-width: 600px) {
  .comments-thread {
    max-width: 100%;
    padding: 0 8px;
  }

  #commentComposer {
    padding: 12px;
  }

  .comment-item.comment-reply {
    margin-left: 16px;
  }

  .comment-content {
    padding: 10px 12px;
  }

  .comment-header {
    flex-wrap: wrap;
    gap: 6px;
  }

  .comment-meta {
    font-size: 0.78rem;
  }

  .comment-body {
    font-size: 0.92rem;
    line-height: 1.5;
  }

  .comment-gutter {
    left: -14px;
    width: 12px;
    height: 12px;
    font-size: 8px;
  }
}
/* Bell button styling */
.notif-bell {
  height: 34px;
  min-width: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--pill);
  border: 1px solid rgba(220, 38, 38, 0.22);
  background: rgba(220, 38, 38, 0.08);
  cursor: pointer;
  line-height: 1;
  padding: 0 8px;
  font-size: 0.95rem;
  transition: background var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease);
}

.notif-bell:hover {
  background: rgba(220, 38, 38, 0.20);
  border-color: rgba(220, 38, 38, 0.35);
  transform: translateY(-1px);
}

/* Responsive navbar for mobile */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    gap: 16px;
    padding: 16px;
  }

  .nav-left ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
  }

  .nav-right {
    width: 100%;
    justify-content: center;
  }

  .nav-right::before {
    display: none;
  }

  .navbar li a {
    padding: 8px 12px;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .navbar li a {
    padding: 7px 10px;
    font-size: 0.85rem;
  }

  .auth-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
  }

  .notif-bell {
    height: 34px;
    min-width: 34px;
  }
}

/* =========================================================
   Weekly Shonen Jump ToC Page
========================================================= */

/* Meta badges container */
.wsj-meta-badges {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 0 auto 28px;
  max-width: 900px;
}

/* Individual badge styling */
.wsj-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--pill);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease);
}

.wsj-badge:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.wsj-badge-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wsj-badge-value {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
}

/* Badge color variants */
.wsj-badge-primary {
  border-color: rgba(220, 38, 38, 0.25);
  background: linear-gradient(135deg,
    rgba(220, 38, 38, 0.08) 0%,
    rgba(220, 38, 38, 0.04) 100%);
}

.wsj-badge-primary .wsj-badge-value {
  color: var(--accent);
}

.wsj-badge-secondary {
  border-color: rgba(59, 130, 246, 0.25);
  background: linear-gradient(135deg,
    rgba(59, 130, 246, 0.08) 0%,
    rgba(59, 130, 246, 0.04) 100%);
}

.wsj-badge-secondary .wsj-badge-value {
  color: rgb(59, 130, 246);
}

.wsj-badge-accent {
  border-color: rgba(168, 85, 247, 0.25);
  background: linear-gradient(135deg,
    rgba(168, 85, 247, 0.08) 0%,
    rgba(168, 85, 247, 0.04) 100%);
}

.wsj-badge-accent .wsj-badge-value {
  color: rgb(168, 85, 247);
}

/* ToC section container */
.wsj-toc-section {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ToC list container */
.wsj-toc-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

/* Loading state */
.wsj-loading {
  text-align: center;
  padding: 40px 20px;
  font-size: 1.1rem;
  color: var(--muted);
  font-style: italic;
}

/* Disclaimer text */
.wsj-disclaimer {
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
  margin: 24px 0 12px;
  font-style: italic;
  opacity: 0.85;
}

/* WSJ Top 3 cards - with image support */
.wsj-top3-card {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.wsj-top3-card .top3-image {
  width: 100%;
  height: 320px;
  object-fit: cover;
}

.wsj-top3-card .top3-info {
  padding: 32px 24px;
  text-align: center;
  width: 100%;
}

.wsj-top3-note {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
  margin-top: 14px;
  padding: 12px 16px;
  background: rgba(220, 38, 38, 0.06);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

/* WSJ shelf images for #4+ items */
.wsj-shelf-image {
  width: 64px;
  height: 88px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.6);
}

.wsj-shelf-row {
  display: grid;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  width: 100%;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: default;
}

body.dark-mode .wsj-shelf-image {
  border-color: rgba(226, 232, 240, 0.12);
  background: rgba(0, 0, 0, 0.20);
}

/* Dark mode enhancements */
body.dark-mode .wsj-badge {
  background: rgba(15, 23, 42, 0.50);
  border-color: rgba(226, 232, 240, 0.12);
}

body.dark-mode .wsj-badge-primary {
  background: linear-gradient(135deg,
    rgba(220, 38, 38, 0.14) 0%,
    rgba(220, 38, 38, 0.08) 100%);
  border-color: rgba(220, 38, 38, 0.30);
}

body.dark-mode .wsj-badge-secondary {
  background: linear-gradient(135deg,
    rgba(59, 130, 246, 0.14) 0%,
    rgba(59, 130, 246, 0.08) 100%);
  border-color: rgba(59, 130, 246, 0.30);
}

body.dark-mode .wsj-badge-accent {
  background: linear-gradient(135deg,
    rgba(168, 85, 247, 0.14) 0%,
    rgba(168, 85, 247, 0.08) 100%);
  border-color: rgba(168, 85, 247, 0.30);
}

body.dark-mode .wsj-top3-note {
  background: rgba(220, 38, 38, 0.10);
  border-color: rgba(220, 38, 38, 0.20);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .wsj-meta-badges {
    gap: 10px;
    margin-bottom: 20px;
  }

  .wsj-badge {
    padding: 8px 14px;
    font-size: 0.9rem;
  }

  .wsj-badge-label {
    font-size: 0.75rem;
  }

  .wsj-badge-value {
    font-size: 0.85rem;
  }

  .wsj-top3-card {
    min-height: 240px;
  }

  .wsj-top3-card .top3-info {
    padding: 24px 18px;
  }
}

@media (max-width: 480px) {
  .wsj-meta-badges {
    flex-direction: column;
    width: 100%;
  }

  .wsj-badge {
    width: 100%;
    justify-content: center;
  }

  .wsj-top3-card {
    min-height: 220px;
  }

  .wsj-top3-note {
    font-size: 0.88rem;
    padding: 10px 12px;
  }
}
