/* Bunk Through the Years — Styles */

/* ── Light Theme (default) ── */

:root,
[data-theme="light"] {
  --bg: #F5EFE6;
  --bg-alt: #F0EAE0;
  --bg-milestone: #FAF3E6;
  --text-primary: #2C1810;
  --text-secondary: #5C4033;
  --text-muted: #8B7355;
  --card-bg: #FDFCF8;
  --card-shadow: 0 1px 4px rgba(44, 24, 16, 0.06), 0 4px 16px rgba(44, 24, 16, 0.05);
  --card-shadow-hover: 0 6px 20px rgba(44, 24, 16, 0.10), 0 12px 32px rgba(44, 24, 16, 0.06);
  --card-glow: transparent;
  --gold: #B8860B;
  --gold-light: #D4A843;
  --gold-pale: #F0E0C0;
  --divider: rgba(44, 24, 16, 0.1);
  --nav-bg: rgba(245, 239, 230, 0.92);
  --nav-border: rgba(44, 24, 16, 0.08);
  --toggle-bg: rgba(44, 24, 16, 0.05);
  --grain-opacity: 0.035;
  --grain-blend: multiply;

  /* Typography */
  --font-display: 'Crimson Pro', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-caption: 'Caveat', cursive;

  /* Layout */
  --nav-height: 60px;
  --section-pad: clamp(1.25rem, 4vw, 2.5rem);
  --content-max: 940px;
}

/* ── Dark Theme ── */

[data-theme="dark"] {
  --bg: #1A1410;
  --bg-alt: #1E1812;
  --bg-milestone: #221C14;
  --text-primary: #E8DFD0;
  --text-secondary: #BBA98F;
  --text-muted: #8B7A64;
  --card-bg: #252018;
  --card-shadow: 0 1px 4px rgba(0, 0, 0, 0.2), 0 4px 16px rgba(0, 0, 0, 0.15);
  --card-shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.3), 0 0 40px rgba(184, 134, 11, 0.06);
  --card-glow: 0 0 30px rgba(184, 134, 11, 0.04);
  --gold: #D4A843;
  --gold-light: #B8860B;
  --gold-pale: #3A3020;
  --divider: rgba(232, 223, 208, 0.08);
  --nav-bg: rgba(26, 20, 16, 0.92);
  --nav-border: rgba(232, 223, 208, 0.06);
  --toggle-bg: rgba(232, 223, 208, 0.06);
  --grain-opacity: 0.05;
  --grain-blend: soft-light;
}

/* ── Reset ── */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.6;
  transition: background 0.4s ease, color 0.4s ease;
}

/* ── Navigation Bar ── */

.year-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--nav-border);
  display: flex;
  align-items: center;
  padding: 0 var(--section-pad);
  z-index: 100;
  gap: 0.75rem;
  transition: background 0.4s ease, border-color 0.4s ease;
}

.year-nav__current {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-primary);
  min-width: 4ch;
}

.year-nav__label {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--gold);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.year-nav__label--visible {
  opacity: 1;
  transform: translateY(0);
}

.year-nav__progress {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.year-nav__track {
  display: flex;
  align-items: center;
  position: relative;
}

.year-nav__track::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 14px;
  right: 14px;
  height: 1px;
  background: var(--divider);
  transform: translateY(-50%);
}

.year-nav__dot {
  width: 28px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  background: none;
  border: none;
  padding: 0;
  z-index: 1;
}

.year-nav__dot::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--divider);
  transition: all 0.3s ease;
}

.year-nav__dot:hover::before {
  background: var(--gold);
  transform: scale(1.3);
}

.year-nav__dot--active::before {
  background: var(--gold);
  transform: scale(1.4);
  box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.2);
}

.year-nav__dot--milestone::after {
  content: '';
  position: absolute;
  bottom: 2px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold);
}

/* ── Theme Toggle ── */

.theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--toggle-bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 0.5rem;
  transition: background 0.3s ease;
}

.theme-toggle:hover {
  background: var(--divider);
}

.theme-toggle__icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Light mode: sun (outlined circle) */
[data-theme="light"] .theme-toggle__icon {
  border: 2px solid var(--text-muted);
  background: transparent;
  box-shadow: none;
}

/* Dark mode: moon (crescent via inset shadow) */
[data-theme="dark"] .theme-toggle__icon {
  border: 2px solid transparent;
  background: transparent;
  box-shadow: inset -7px 3px 0 1px var(--text-muted);
}

/* ── Timeline Container ── */

.timeline {
  padding-top: var(--nav-height);
}

/* ── Year Sections ── */

.year-section {
  padding: clamp(3rem, 8vh, 5rem) var(--section-pad) clamp(2rem, 5vh, 3rem);
  background: var(--bg);
  transition: background 0.4s ease;
}

.year-section:first-child {
  padding-top: clamp(3.5rem, 10vh, 6rem);
}

.year-section:nth-child(even) {
  background: var(--bg-alt);
}

.year-section--milestone {
  background: var(--bg-milestone);
}

/* ── Year Header ── */

.year-header {
  text-align: center;
  margin-bottom: clamp(1.5rem, 4vh, 2.5rem);
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
}

.year-header__number {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3rem, 10vw, 5.5rem);
  line-height: 1;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  display: inline-block;
  position: relative;
}

/* Flanking decorative lines */
.year-header__number::before,
.year-header__number::after {
  content: '';
  position: absolute;
  top: 50%;
  width: clamp(24px, 6vw, 60px);
  height: 1px;
  background: var(--divider);
}

.year-header__number::before {
  right: calc(100% + 0.75rem);
}

.year-header__number::after {
  left: calc(100% + 0.75rem);
}

.year-section--milestone .year-header__number {
  color: var(--gold);
}

.year-section--milestone .year-header__number::before,
.year-section--milestone .year-header__number::after {
  background: var(--gold-light);
}

.year-header__subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--gold);
  margin-top: 0.4rem;
}

.year-header__age {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 0.5rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.rank-link {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--divider);
  padding-bottom: 1px;
  margin-top: 0.5rem;
  display: inline-block;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.rank-link:hover {
  color: var(--gold);
  border-color: var(--gold-light);
}

/* ── Photo Grid ── */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  max-width: var(--content-max);
  margin: 0 auto;
}

/* ── Polaroid Cards ── */

.photo-card {
  background: var(--card-bg);
  padding: 10px 10px 0;
  box-shadow: var(--card-shadow), var(--card-glow);
  cursor: pointer;
  position: relative;
  transition: box-shadow 0.3s ease;
}

.photo-card:hover {
  box-shadow: var(--card-shadow-hover), var(--card-glow);
}


.photo-card__image {
  width: 100%;
  aspect-ratio: var(--card-aspect, 4/3);
  background: linear-gradient(
    135deg,
    hsl(var(--card-hue, 30), 25%, 78%),
    hsl(var(--card-hue, 30), 20%, 68%)
  );
  position: relative;
  overflow: hidden;
  filter: contrast(1.02) saturate(1.04) sepia(0.03);
}

/* Film grain overlay */
.photo-card__image::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: var(--grain-opacity);
  mix-blend-mode: var(--grain-blend);
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Real photo image */
.photo-card__figure {
  margin: 0;
  width: 100%;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, hsl(30, 20%, 80%), hsl(30, 15%, 70%));
}

.photo-card__img {
  width: 100%;
  display: block;
  opacity: 0;
  transition: opacity 0.5s ease;
  filter: contrast(1.02) saturate(1.04) sepia(0.03);
}

.photo-card__img--loaded {
  opacity: 1;
}

/* Film grain on real photos */
.photo-card__figure::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: var(--grain-opacity);
  mix-blend-mode: var(--grain-blend);
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.photo-card__caption {
  font-family: var(--font-caption);
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  color: var(--text-secondary);
  padding: 10px 4px 6px;
  line-height: 1.3;
}

.photo-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 4px 12px;
}

.photo-card__tag {
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-alt);
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: 0.02em;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.photo-card__tag:hover {
  color: var(--text-primary);
  background: var(--divider);
}

.photo-card__tag--active {
  color: var(--card-bg);
  background: var(--gold);
}

.photo-card__tag--jimmy {
  color: var(--gold);
}

.photo-card__tag--jimmy.photo-card__tag--active {
  color: var(--card-bg);
  background: var(--gold);
}

/* ── Filter Bar ── */

.filter-bar {
  position: sticky;
  top: var(--nav-height);
  z-index: 90;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--nav-border);
  padding: 0.5rem var(--section-pad);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: background 0.4s ease;
}

.filter-bar__label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

.filter-bar__pills {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex: 1;
}

.filter-bar__pills::-webkit-scrollbar { display: none; }

.filter-bar__pill {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--toggle-bg);
  border: 1px solid transparent;
  padding: 3px 8px;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.filter-bar__pill:hover {
  color: var(--text-primary);
  border-color: var(--divider);
}

.filter-bar__pill--active {
  color: var(--card-bg);
  background: var(--gold);
  border-color: var(--gold);
}

.filter-bar__pill--jimmy {
  color: var(--gold);
}

.filter-bar__pill--jimmy.filter-bar__pill--active {
  color: var(--card-bg);
  background: var(--gold);
}

.filter-bar__count {
  font-size: 0.55rem;
  opacity: 0.6;
  margin-left: 2px;
}

.filter-bar__clear {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px 6px;
  flex-shrink: 0;
  transition: color 0.2s;
}

.filter-bar__clear:hover { color: var(--text-primary); }

/* ── Filter States ── */

.photo-card--filtered-out {
  display: none;
}

.year-section--empty {
  display: none;
}

/* ── Milestone Card Treatment ── */

.photo-card--milestone {
  box-shadow: 0 0 0 1.5px var(--gold-light), var(--card-shadow), var(--card-glow);
}

.photo-card--milestone:hover {
  box-shadow: 0 0 0 1px var(--gold-light), var(--card-shadow-hover), var(--card-glow);
}

/* Small gold dot badge */
.photo-card--milestone::before {
  content: '';
  position: absolute;
  top: 16px;
  right: 16px;
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(184, 134, 11, 0.5);
  z-index: 3;
}

.photo-card--milestone .photo-card__caption {
  color: var(--gold);
}

/* ── Scroll Fade-in Animations ── */

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.fade-in--visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in--delay-1 { transition-delay: 0.06s; }
.fade-in--delay-2 { transition-delay: 0.12s; }
.fade-in--delay-3 { transition-delay: 0.18s; }
.fade-in--delay-4 { transition-delay: 0.24s; }

/* Year headers fade in too */
.year-header {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.year-header--visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Reduced Motion ── */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .fade-in,
  .year-header {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .photo-card {
    transform: none !important;
    transition: none;
  }

  .year-nav__dot::before,
  .year-nav__label,
  .theme-toggle__icon {
    transition: none;
  }

  body {
    transition: none;
  }
}

/* ── Responsive ── */

@media (max-width: 768px) {
  :root,
  [data-theme="light"],
  [data-theme="dark"] {
    --nav-height: 50px;
  }

  .year-nav__current {
    font-size: 1.25rem;
  }

  .year-nav__label {
    display: none;
  }

  .year-nav__dot {
    width: 22px;
    height: 32px;
  }

  .year-nav__dot::before {
    width: 5px;
    height: 5px;
  }

  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
  }

}

@media (max-width: 480px) {
  .year-nav__progress {
    display: none;
  }

  .photo-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .photo-card {
    padding: 8px 8px 0;
  }

  .photo-card__caption {
    font-size: 0.9rem;
    padding: 8px 2px 12px;
  }

  .year-section {
    padding-top: clamp(2rem, 6vh, 3rem);
    padding-bottom: clamp(1.5rem, 4vh, 2rem);
  }
}

/* ── Lightbox (full-screen) ── */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.lightbox--open {
  pointer-events: auto;
  opacity: 1;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 8, 4, 0.96);
}

[data-theme="dark"] .lightbox__backdrop {
  background: rgba(6, 4, 2, 0.97);
}

.lightbox__content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 72px 20px;
  min-height: 0;
}

.lightbox__card {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  animation: lightbox-enter 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes lightbox-enter {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.lightbox__image-wrap {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 2px;
  min-height: 0;
}

.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 2px;
  display: block;
}

.lightbox__placeholder {
  width: 100%;
  flex: 1;
  background: linear-gradient(
    135deg,
    hsl(var(--card-hue, 30), 25%, 78%),
    hsl(var(--card-hue, 30), 20%, 68%)
  );
  border-radius: 2px;
}

.lightbox__info {
  padding: 14px 4px 20px;
  flex-shrink: 0;
}

.lightbox__caption {
  font-family: var(--font-caption);
  font-size: 1.35rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.3;
}

.lightbox__meta {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 0.3rem;
  letter-spacing: 0.04em;
}

/* Navigation buttons */

.lightbox__close,
.lightbox__prev,
.lightbox__next {
  position: absolute;
  z-index: 2;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.2s ease, transform 0.2s ease;
}

.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover {
  color: rgba(255, 255, 255, 1);
}

.lightbox__close {
  top: 14px;
  right: 18px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
}

.lightbox__close::before,
.lightbox__close::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

.lightbox__close::before { transform: rotate(45deg); }
.lightbox__close::after { transform: rotate(-45deg); }

.lightbox__close:hover {
  transform: scale(1.1);
}

.lightbox__prev,
.lightbox__next {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
}

.lightbox__prev { left: 14px; }
.lightbox__next { right: 14px; }

.lightbox__prev::before,
.lightbox__next::before {
  content: '';
  width: 16px;
  height: 16px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  border-radius: 1px;
}

.lightbox__prev::before {
  transform: rotate(-135deg);
  margin-left: 4px;
}

.lightbox__next::before {
  transform: rotate(45deg);
  margin-right: 4px;
}

.lightbox__prev:hover,
.lightbox__next:hover {
  transform: translateY(-50%) scale(1.1);
}

/* Lightbox responsive */

@media (max-width: 768px) {
  .lightbox__content {
    padding: 52px 16px 20px;
  }

  .lightbox__prev,
  .lightbox__next {
    top: auto;
    bottom: 20px;
    transform: none;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
  }

  .lightbox__prev { left: calc(50% - 56px); }
  .lightbox__next { right: calc(50% - 56px); }

  .lightbox__prev:hover,
  .lightbox__next:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.2);
  }

  .lightbox__info {
    padding: 10px 4px 16px;
  }
}

@media (max-width: 480px) {
  .lightbox__content {
    padding: 48px 10px 20px;
  }
}

/* Lightbox reduced motion */

@media (prefers-reduced-motion: reduce) {
  .lightbox {
    transition: none;
  }

  .lightbox__card {
    animation: none;
  }

  .lightbox__close,
  .lightbox__prev,
  .lightbox__next {
    transition: none;
  }
}

/* ── Rank Page ── */

.rank-nav {
  position: sticky;
  top: 0;
  height: var(--nav-height);
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--nav-border);
  display: flex;
  align-items: center;
  padding: 0 var(--section-pad);
  z-index: 100;
  gap: 0.75rem;
  transition: background 0.4s ease, border-color 0.4s ease;
}

.rank-back-link {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.rank-back-link:hover {
  color: var(--gold);
}

.rank-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 auto;
}

.rank-main {
  min-height: calc(100vh - var(--nav-height));
  background: var(--bg);
  padding: var(--section-pad);
  transition: background 0.4s ease;
}

.rank-year-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.rank-year-btn {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--divider);
  background: var(--card-bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.rank-year-btn:hover {
  border-color: var(--gold-light);
  color: var(--gold);
}

.rank-year-btn--active {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
}

.rank-arena-header {
  text-align: center;
  margin-bottom: 2rem;
}

.rank-arena-year {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.25rem;
}

.rank-arena-progress {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.rank-vs-layout {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: clamp(0.75rem, 3vw, 2rem);
  align-items: center;
  max-width: var(--content-max);
  margin: 0 auto 2rem;
}

.rank-vs-label {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--text-muted);
  text-align: center;
}

.rank-photo-btn {
  background: var(--card-bg);
  border: 2px solid transparent;
  border-radius: 2px;
  padding: 10px 10px 0;
  cursor: pointer;
  box-shadow: var(--card-shadow);
  transition: border-color 0.2s ease;
  text-align: left;
  width: 100%;
}

.rank-photo-btn:hover,
.rank-photo-btn:focus-visible {
  border-color: var(--gold);
  outline: none;
}

.rank-photo-btn .photo-card__figure {
  margin: 0;
  position: relative;
  overflow: hidden;
  border-radius: 1px;
}

.rank-photo-btn .photo-card__img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 1px;
}

.rank-photo-btn .photo-card__caption {
  font-family: var(--font-caption);
  font-size: 1rem;
  color: var(--text-secondary);
  padding: 0.5rem 0;
  margin: 0;
}

.rank-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.rank-skip-btn,
.rank-done-btn,
.rank-continue-btn {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rank-skip-btn {
  background: var(--toggle-bg);
  border: 1px solid var(--divider);
  color: var(--text-muted);
}

.rank-skip-btn:hover {
  color: var(--text-secondary);
  border-color: var(--text-muted);
}

.rank-done-btn {
  background: none;
  border: 1px solid var(--divider);
  color: var(--text-muted);
}

.rank-done-btn:hover {
  border-color: var(--text-muted);
  color: var(--text-secondary);
}

.rank-continue-btn {
  background: var(--gold);
  border: 1px solid var(--gold);
  color: #fff;
}

.rank-continue-btn:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
}

.rank-back-btn {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  border: 1px solid var(--divider);
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s ease;
}

.rank-back-btn:hover {
  border-color: var(--text-muted);
  color: var(--text-secondary);
}

.rank-prompt,
.rank-empty {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 3rem;
}

/* ── Rank Results ── */

.rank-results {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 600px;
}

.rank-results__item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--divider);
}

.rank-results__rank {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-muted);
  min-width: 2ch;
  text-align: center;
}

.rank-results__item:first-child .rank-results__rank {
  color: var(--gold);
}

.rank-results__thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: var(--card-shadow);
}

.rank-results__info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.rank-results__caption {
  font-family: var(--font-caption);
  font-size: 1rem;
  color: var(--text-primary);
}

.rank-results__stats {
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ── Rank Page Mobile ── */

@media (max-width: 600px) {
  .rank-vs-layout {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .rank-vs-label {
    font-size: 0.9rem;
  }

  .rank-title {
    font-size: 1rem;
  }

  .rank-actions {
    flex-direction: column;
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rank-photo-btn {
    transition: none;
  }
}
