@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --font-sans: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Fraunces', 'Space Grotesk', serif;
  --text: #1b1f2a;
  --text-muted: #667085;
  --bg: #f7f1e9;
  --bg-soft: #edf3f7;
  --card-bg: rgba(255, 255, 255, 0.92);
  --border: rgba(27, 31, 42, 0.12);
  --shadow: 0 18px 45px rgba(18, 24, 40, 0.12);
  --shadow-strong: 0 24px 55px rgba(18, 24, 40, 0.18);
  --primary: #0f172a;
  --secondary: #2a9d8f;
  --accent: #e76f51;
  --accent-2: #3a86a8;
  --accent-3: #f4a261;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #ef4444;
  --comparison-max-height: 70vh;
}

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

body {
  font-family: var(--font-sans);
  line-height: 1.6;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
  padding: clamp(14px, 2.5vw, 28px);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(231, 111, 81, 0.14), transparent 45%),
    radial-gradient(circle at 88% 12%, rgba(58, 134, 168, 0.14), transparent 45%),
    radial-gradient(circle at 50% 90%, rgba(42, 157, 143, 0.12), transparent 45%),
    repeating-linear-gradient(120deg, rgba(17, 24, 39, 0.03), rgba(17, 24, 39, 0.03) 1px, transparent 1px, transparent 16px);
  z-index: -1;
  pointer-events: none;
}

.container {
  width: min(1200px, 100%);
  margin: 0 auto;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.hero {
  position: relative;
  text-align: center;
  padding: 56px 24px 48px;
  border-radius: 24px;
  background: linear-gradient(135deg, #0b1220 0%, #1a2a4a 48%, #0a1a2f 100%);
  color: #f4f6fb;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: rise 0.6s ease both;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(231, 111, 81, 0.28), transparent 55%),
    radial-gradient(circle at 80% 30%, rgba(58, 134, 168, 0.22), transparent 50%);
  opacity: 0.9;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.08), transparent 55%);
  mix-blend-mode: screen;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  letter-spacing: 0.03em;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 1.1rem;
  opacity: 0.85;
}

.hero-compact {
  padding: 40px 24px 36px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
  gap: 14px;
  margin-top: 24px;
}

.stat-item {
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-weight: 500;
  font-size: 0.95rem;
  backdrop-filter: blur(6px);
}

.stat-item span {
  font-weight: 700;
  color: #fff;
}

/* ---- Gallery Controls ---- */

.gallery-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 16px;
  margin: 28px 0 8px;
  padding: 18px 22px;
  background: var(--card-bg);
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 20px rgba(18, 24, 40, 0.06);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.filter-group select,
.filter-group input[type="range"] {
  font-family: var(--font-sans);
  font-size: 0.85rem;
}

.filter-group select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.filter-group input[type="range"] {
  width: 120px;
  accent-color: var(--secondary);
}

.filter-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 12px;
  background: rgba(23, 26, 34, 0.05);
  border-radius: 999px;
  white-space: nowrap;
}

#filter-score-val {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--secondary);
  min-width: 2ch;
}

/* ---- Genre Badges ---- */

.genre-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(42, 157, 143, 0.12);
  color: var(--secondary);
  border: 1px solid rgba(42, 157, 143, 0.25);
}

.genre-landscape  { background: rgba(58, 134, 168, 0.12); color: var(--accent-2); border-color: rgba(58, 134, 168, 0.25); }
.genre-portrait   { background: rgba(231, 111, 81, 0.12); color: var(--accent); border-color: rgba(231, 111, 81, 0.25); }
.genre-street     { background: rgba(15, 23, 42, 0.10); color: var(--primary); border-color: rgba(15, 23, 42, 0.2); }
.genre-wildlife   { background: rgba(22, 163, 74, 0.12); color: var(--success); border-color: rgba(22, 163, 74, 0.25); }
.genre-macro      { background: rgba(244, 162, 97, 0.15); color: #b5751d; border-color: rgba(244, 162, 97, 0.3); }
.genre-architecture { background: rgba(107, 114, 128, 0.12); color: #4b5563; border-color: rgba(107, 114, 128, 0.25); }

/* ---- Gallery ---- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 26px;
  margin: 20px 0 60px;
}

.entry-card {
  background: var(--card-bg);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: fadeUp 0.5s ease both;
}

.entry-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-strong);
}

.entry-card::before {
  content: '';
  display: block;
  height: 6px;
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
}

.entry-card a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.entry-thumbnail {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.entry-content {
  padding: 20px 22px 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.98));
}

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

.entry-score {
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  font-weight: 700;
  color: #fff;
  background: linear-gradient(120deg, var(--secondary), var(--accent-2));
  padding: 6px 12px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}

.entry-date {
  font-size: clamp(0.72rem, 1.8vw, 0.8rem);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(23, 26, 34, 0.05);
}

.entry-improvements {
  margin: 14px 0;
}

.entry-improvements h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.entry-improvements ul {
  list-style: none;
}

.entry-improvements li {
  padding: 6px 0 6px 18px;
  position: relative;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.entry-improvements li::before {
  content: '\2192';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.entry-notes {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(23, 26, 34, 0.15);
  font-size: 0.95rem;
  color: var(--text-muted);
  font-style: italic;
  overflow-wrap: anywhere;
}

/* ---- Entry Detail ---- */

.entry-detail {
  background: var(--card-bg);
  border-radius: 22px;
  padding: clamp(20px, 3vw, 36px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow-wrap: anywhere;
}

.entry-hero {
  margin-bottom: clamp(18px, 3vw, 28px);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(23, 26, 34, 0.08);
  box-shadow: 0 12px 26px rgba(18, 24, 40, 0.12);
}

.entry-hero-image {
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  background: #0f172a;
}

.entry-hero-image.zoomable {
  cursor: zoom-in;
}

.entry-detail h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  margin-bottom: 18px;
  color: var(--primary);
}

.metadata {
  margin: 24px 0;
  padding: clamp(14px, 2.5vw, 18px);
  background: rgba(23, 26, 34, 0.04);
  border-radius: 12px;
  font-size: 0.95rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.metadata strong {
  color: var(--text);
}

.analysis {
  margin: 30px 0;
  padding: clamp(18px, 3vw, 28px);
  background: linear-gradient(135deg, rgba(241, 143, 59, 0.12), rgba(31, 111, 235, 0.08));
  border-radius: 16px;
  border: 1px solid rgba(23, 26, 34, 0.12);
}

.analysis h3 {
  font-size: 1.4rem;
  margin-bottom: 16px;
  color: var(--primary);
}

.score-display {
  display: inline-block;
  font-size: clamp(2.4rem, 4vw, 3.2rem);
  font-weight: 700;
  color: var(--primary);
  margin: 8px 0 4px;
  padding: clamp(10px, 2.5vw, 14px) clamp(18px, 4vw, 28px);
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(23, 26, 34, 0.1);
  box-shadow: 0 12px 30px rgba(18, 24, 40, 0.12);
}

.score-caption {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* Score comparison (before/after) */
.score-comparison {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin: 12px 0 24px;
  flex-wrap: wrap;
}

.score-before,
.score-after {
  text-align: center;
}

.score-display-sm {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  padding: 10px 22px;
}

.score-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
}

.score-delta {
  font-size: 1.4rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 12px;
  white-space: nowrap;
}

.score-delta-up {
  color: var(--success);
  background: rgba(22, 163, 74, 0.1);
  border: 1px solid rgba(22, 163, 74, 0.25);
}

.score-delta-down {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.score-delta-neutral {
  color: var(--text-muted);
  background: rgba(23, 26, 34, 0.05);
  border: 1px solid rgba(23, 26, 34, 0.12);
}

/* Review phase labels */
.review-phase {
  margin: 20px 0;
}

.review-phase-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(23, 26, 34, 0.1);
}

.review-phase-after {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 2px dashed rgba(22, 163, 74, 0.25);
}

/* Gallery card score delta badge */
.entry-score-delta {
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 4px;
  opacity: 0.9;
}

.llm-critiques {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.llm-critique {
  background: #fff;
  padding: 16px;
  border-radius: 12px;
  border-left: 4px solid var(--secondary);
  box-shadow: 0 10px 20px rgba(18, 24, 40, 0.08);
}

.llm-critique.llm-gemini {
  border-left-color: #4285f4;
}

.llm-critique.llm-openai {
  border-left-color: #10a37f;
}

.llm-critique.llm-anthropic {
  border-left-color: #d97706;
}

.llm-critique-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.llm-name {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.score-pill {
  padding: 4px 12px;
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
}

.score-good {
  background: var(--success);
}

.score-mid {
  background: var(--warning);
}

.score-low,
.score-fail {
  background: var(--danger);
}

.llm-notes {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.llm-improvements {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.improvements-list {
  margin: 20px 0;
}

.improvements-list h4 {
  font-size: 1.1rem;
  margin-bottom: 10px;
  color: var(--primary);
}

.improvements-list ul {
  list-style: none;
}

.improvements-list li {
  padding: 10px 0 10px 28px;
  position: relative;
  font-size: 1rem;
  border-bottom: 1px solid rgba(23, 26, 34, 0.08);
  overflow-wrap: anywhere;
}

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

.improvements-list li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
}

.notes-section {
  margin-top: 20px;
  padding: 20px;
  background: #fff;
  border-radius: 12px;
  font-style: italic;
  color: var(--text);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 30px 0;
  padding: 10px 18px;
  background: #fff;
  color: var(--primary);
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid rgba(23, 26, 34, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 20px rgba(18, 24, 40, 0.08);
}

.back-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 22px rgba(18, 24, 40, 0.12);
}

/* ---- Before/After Slider ---- */

.comparison-container {
  margin: 30px 0;
  padding: clamp(16px, 3vw, 24px);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 18px;
  border: 1px solid rgba(23, 26, 34, 0.12);
  box-shadow: 0 12px 28px rgba(18, 24, 40, 0.1);
}

.comparison-title {
  margin-bottom: 20px;
  text-align: center;
  font-family: var(--font-display);
}

.ba-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  cursor: col-resize;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  background: #0f172a;
}

.ba-image {
  width: 100%;
}

.ba-image img {
  width: 100%;
  max-height: var(--comparison-max-height);
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.ba-before {
  position: absolute;
  inset: 0;
  clip-path: inset(0 50% 0 0);
}

.ba-after {
  position: relative;
}

.ba-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transform: translateX(-50%);
  pointer-events: auto;
}

.ba-handle-line {
  flex: 1;
  width: 2px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
}

.ba-handle-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  border: 2px solid rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
  backdrop-filter: blur(4px);
}

.ba-label {
  position: absolute;
  bottom: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(15, 23, 42, 0.65);
  color: #fff;
  backdrop-filter: blur(4px);
  pointer-events: none;
  z-index: 5;
}

.ba-label-before {
  left: 12px;
}

.ba-label-after {
  right: 12px;
}

/* Legacy comparison (kept for backward compat with static images) */
.comparison-label {
  text-align: center;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

.comparison-full {
  margin-top: 30px;
}

.comparison-full-image {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(18, 24, 40, 0.14);
  max-height: var(--comparison-max-height);
  object-fit: contain;
}

/* ---- Image Zoom Overlay ---- */

.zoom-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.92);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  backdrop-filter: blur(8px);
  cursor: zoom-out;
}

.zoom-overlay.active {
  opacity: 1;
  visibility: visible;
}

.zoom-image {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.zoom-close {
  position: absolute;
  top: 20px;
  right: 24px;
  font-size: 2.5rem;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  line-height: 1;
  z-index: 1001;
  transition: color 0.15s ease;
}

.zoom-close:hover {
  color: #fff;
}

/* ---- Footer ---- */

footer {
  text-align: center;
  padding: 30px 20px 10px;
  color: var(--text-muted);
  margin-top: 40px;
}

footer p {
  margin: 5px 0;
}

.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.85);
  border-radius: 20px;
  border: 1px solid rgba(23, 26, 34, 0.12);
  box-shadow: var(--shadow);
  overflow-wrap: anywhere;
}

.empty-state h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin-bottom: 16px;
  color: var(--primary);
}

.empty-state p {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.empty-state code {
  background: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

/* ---- Animations ---- */

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

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

/* ---- Responsive ---- */

@media (max-width: 900px) {
  .entry-detail {
    padding: clamp(18px, 4vw, 24px);
  }

  .comparison-simple {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 38px 18px 32px;
  }

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

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

  .entry-thumbnail {
    aspect-ratio: 5 / 4;
  }

  .gallery-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .filter-group label {
    min-width: 70px;
  }

  .filter-group select,
  .filter-group input[type="range"] {
    flex: 1;
  }

  .ba-handle-circle {
    width: 34px;
    height: 34px;
  }

  .ba-handle-circle svg {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 560px) {
  .hero h1 {
    font-size: clamp(2rem, 8vw, 2.6rem);
  }

  .subtitle {
    font-size: 0.98rem;
  }

  .entry-content {
    padding: 18px;
  }

  .analysis h3 {
    font-size: 1.2rem;
  }

  .comparison-labels {
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Entry Navigation ---- */

.entry-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 30px 0;
  gap: 12px;
  flex-wrap: wrap;
}

.entry-nav-arrows {
  display: flex;
  gap: 10px;
}

.nav-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #fff;
  color: var(--primary);
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 500;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 6px 14px rgba(18, 24, 40, 0.06);
}

.nav-arrow:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(18, 24, 40, 0.1);
}

/* ---- EXIF Data ---- */

.exif-data {
  margin-top: 10px;
}

.exif-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: 6px;
}

.exif-tag {
  display: inline-block;
  padding: 2px 10px;
  background: rgba(42, 157, 143, 0.08);
  color: var(--secondary);
  border: 1px solid rgba(42, 157, 143, 0.2);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---- Critic Disagreement ---- */

.disagree-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
  cursor: help;
}

.disagree-banner {
  padding: 12px 18px;
  margin-bottom: 18px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 10px;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

/* ---- Stats Page ---- */

.stats-page {
  background: var(--card-bg);
  border-radius: 22px;
  padding: clamp(20px, 3vw, 36px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
  gap: 16px;
  margin-bottom: 36px;
}

.stat-card {
  text-align: center;
  padding: 24px 16px;
  background: linear-gradient(135deg, rgba(42, 157, 143, 0.06), rgba(58, 134, 168, 0.06));
  border-radius: 16px;
  border: 1px solid var(--border);
}

.stat-number {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  color: var(--primary);
  font-family: var(--font-display);
}

.stat-positive { color: var(--success); }
.stat-negative { color: var(--danger); }

.stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-top: 6px;
}

.stat-link {
  color: var(--secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
}

.stat-link:hover {
  text-decoration: underline;
}

.stats-section {
  margin: 30px 0;
}

.stats-section h3 {
  font-size: 1.3rem;
  margin-bottom: 18px;
  color: var(--primary);
}

.genre-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.genre-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.genre-bar-row .genre-badge {
  min-width: 90px;
  text-align: center;
}

.genre-bar-track {
  flex: 1;
  height: 10px;
  background: rgba(23, 26, 34, 0.06);
  border-radius: 999px;
  overflow: hidden;
}

.genre-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--secondary), var(--accent-2));
  border-radius: 999px;
  min-width: 4px;
}

.genre-bar-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 2ch;
  text-align: right;
}

.chart-container {
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.chart-container canvas {
  width: 100% !important;
}

/* ---- Footer Link ---- */

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px dashed var(--text-muted);
}

.footer-link:hover {
  color: var(--secondary);
  border-color: var(--secondary);
}

/* ---- Dark Mode ---- */

@media (prefers-color-scheme: dark) {
  :root {
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --bg: #0f172a;
    --bg-soft: #1e293b;
    --card-bg: rgba(30, 41, 59, 0.92);
    --border: rgba(226, 232, 240, 0.1);
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.3);
    --shadow-strong: 0 24px 55px rgba(0, 0, 0, 0.4);
    --primary: #e2e8f0;
  }

  body::before {
    background:
      radial-gradient(circle at 12% 18%, rgba(231, 111, 81, 0.08), transparent 45%),
      radial-gradient(circle at 88% 12%, rgba(58, 134, 168, 0.08), transparent 45%),
      radial-gradient(circle at 50% 90%, rgba(42, 157, 143, 0.06), transparent 45%),
      repeating-linear-gradient(120deg, rgba(226, 232, 240, 0.02), rgba(226, 232, 240, 0.02) 1px, transparent 1px, transparent 16px);
  }

  .hero {
    background: linear-gradient(135deg, #020617 0%, #0f172a 48%, #020617 100%);
  }

  .entry-content {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.95), rgba(30, 41, 59, 0.98));
  }

  .entry-hero-image {
    background: #020617;
  }

  .analysis {
    background: linear-gradient(135deg, rgba(241, 143, 59, 0.06), rgba(31, 111, 235, 0.04));
  }

  .llm-critique {
    background: rgba(15, 23, 42, 0.8);
  }

  .score-display {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(226, 232, 240, 0.08);
  }

  .gallery-controls {
    background: var(--card-bg);
  }

  .filter-group select {
    background: rgba(15, 23, 42, 0.8);
    color: var(--text);
    border-color: var(--border);
  }

  .back-link, .nav-arrow {
    background: rgba(30, 41, 59, 0.9);
    color: var(--text);
    border-color: var(--border);
  }

  .empty-state {
    background: rgba(30, 41, 59, 0.85);
  }

  .empty-state code {
    background: rgba(15, 23, 42, 0.8);
  }

  .chart-container {
    background: rgba(15, 23, 42, 0.6);
  }

  .stat-card {
    background: linear-gradient(135deg, rgba(42, 157, 143, 0.04), rgba(58, 134, 168, 0.04));
  }

  .comparison-container {
    background: rgba(30, 41, 59, 0.92);
  }

  .ba-slider {
    background: #020617;
  }

  .zoom-overlay {
    background: rgba(2, 6, 23, 0.95);
  }

  .metadata {
    background: rgba(226, 232, 240, 0.04);
  }

  .exif-tag {
    background: rgba(42, 157, 143, 0.12);
    border-color: rgba(42, 157, 143, 0.25);
  }

  .notes-section {
    background: rgba(15, 23, 42, 0.6);
  }

  .stat-item {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
  }
}
