/* ------------------------------------------------------------------ */
/*  Base                                                               */
/* ------------------------------------------------------------------ */

:root {
  color-scheme: dark;
  --bg: #0b0e12;
  --bg-soft: #10151b;
  --surface: #141b23;
  --surface-2: #19222c;
  --border: #232d38;
  --border-strong: #33404f;
  --text: #eef2f6;
  --text-dim: #c8d2dc;
  --muted: #8c99a8;
  --muted-2: #6d7a89;
  --accent: #f6c453;
  --accent-deep: #d99a2b;
  --danger: #ff9b9b;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --page: min(1180px, calc(100% - 2 * clamp(20px, 4vw, 48px)));
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 620px at 12% -12%, rgba(246, 196, 83, 0.09), transparent 64%),
    radial-gradient(900px 520px at 96% -4%, rgba(96, 140, 210, 0.06), transparent 60%);
  background-repeat: no-repeat;
  color: var(--text);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.no-scroll {
  overflow: hidden;
}

::selection {
  background: rgba(246, 196, 83, 0.28);
  color: #fff;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 14px;
  z-index: 100;
  padding: 9px 15px;
  border-radius: 8px;
  background: var(--accent);
  color: #1a1206;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 14px;
}

.noscript {
  margin: 24px auto 0;
  width: var(--page);
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
}

/* ------------------------------------------------------------------ */
/*  Header                                                             */
/* ------------------------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 68px;
  padding: 0 clamp(20px, 4vw, 48px);
  background: rgba(11, 14, 18, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.wordmark-mark {
  position: relative;
  width: 15px;
  height: 15px;
  border: 2px solid var(--accent);
  border-radius: 50%;
}

.wordmark-mark::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--accent);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.topnav a {
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: color 0.15s ease;
}

.topnav a:hover {
  color: var(--text);
}

/* ------------------------------------------------------------------ */
/*  Hero                                                               */
/* ------------------------------------------------------------------ */

main {
  width: var(--page);
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.85fr);
  align-items: start;
  gap: clamp(28px, 4vw, 56px);
  padding-top: clamp(32px, 5vw, 64px);
}

.hero:focus {
  outline: none;
}

.photo-frame {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #080a0d;
  box-shadow:
    0 40px 90px -40px rgba(0, 0, 0, 0.9),
    inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.photo-frame.is-clickable {
  cursor: zoom-in;
}

.photo-frame img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 74vh;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.photo-frame img.is-loaded {
  opacity: 1;
}

.skeleton {
  width: 100%;
  aspect-ratio: 3 / 2;
  max-height: 74vh;
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0.02) 20%,
    rgba(255, 255, 255, 0.055) 38%,
    rgba(255, 255, 255, 0.02) 56%
  );
  background-size: 200% 100%;
  animation: shimmer 1.7s linear infinite;
}

@keyframes shimmer {
  from {
    background-position: 120% 0;
  }
  to {
    background-position: -80% 0;
  }
}

.hero-panel {
  padding-top: 6px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.display {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.015em;
}

h1.display {
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.03;
}

h2.display {
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.05;
}

.caption {
  margin: 18px 0 6px;
  color: #dfe6ee;
  font-family: var(--serif);
  font-size: clamp(19px, 1.7vw, 23px);
  line-height: 1.36;
}

.credit {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
}

.rating-block {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.rating {
  display: flex;
  gap: 5px;
  margin-left: -8px;
}

.rating.is-busy {
  opacity: 0.55;
  pointer-events: none;
}

.star {
  padding: 8px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: #3b4653;
  line-height: 0;
  cursor: pointer;
  transition: color 0.15s ease, transform 0.15s ease;
}

.star svg {
  display: block;
  width: 34px;
  height: 34px;
  fill: currentColor;
}

.star:hover {
  transform: translateY(-2px) scale(1.05);
}

.star.is-on {
  color: var(--accent);
  filter: drop-shadow(0 0 10px rgba(246, 196, 83, 0.24));
}

.rating-hint {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

.day-stats {
  margin-top: 24px;
}

.avg-wrap {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.avg {
  font-family: var(--serif);
  font-size: 44px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.avg-star {
  color: var(--accent);
  font-size: 20px;
}

.votes {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

.histogram {
  display: grid;
  gap: 7px;
  margin-top: 18px;
}

.hist-row {
  display: grid;
  grid-template-columns: 13px 13px 1fr 26px;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11.5px;
}

.hist-star {
  color: #5d6978;
  font-size: 10px;
}

.hist-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #1b222b;
}

.hist-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.hist-count {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.countdown {
  margin: 26px 0 0;
  color: var(--muted-2);
  font-size: 12px;
  letter-spacing: 0.04em;
}

/* ------------------------------------------------------------------ */
/*  Empty / error states                                               */
/* ------------------------------------------------------------------ */

.empty-photo {
  width: 100%;
  padding: clamp(48px, 8vw, 96px) 24px;
  text-align: center;
  color: var(--muted);
}

.empty-photo h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
}

.empty-photo p {
  margin: 0 auto;
  max-width: 420px;
  font-size: 14px;
}

.empty-photo .empty-admin {
  margin-top: 18px;
  font-size: 12.5px;
}

.empty-photo a {
  color: var(--accent);
}

/* ------------------------------------------------------------------ */
/*  Leaderboard                                                        */
/* ------------------------------------------------------------------ */

.leaderboard {
  padding-top: clamp(72px, 9vw, 120px);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.section-head .eyebrow {
  margin-bottom: 7px;
}

.section-note {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 13px;
}

.rank-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rank-row {
  display: grid;
  grid-template-columns: 46px 84px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  width: 100%;
  padding: 16px 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 12px;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease;
}

.rank-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.rank {
  color: #5d6a79;
  font-family: var(--serif);
  font-size: 26px;
  font-variant-numeric: tabular-nums;
}

.rank-list li:first-child .rank {
  color: var(--accent);
}

.rank-thumb {
  width: 84px;
  height: 60px;
  border-radius: 9px;
  background: #11161c;
  object-fit: cover;
}

.rank-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.rank-title {
  overflow: hidden;
  font-family: var(--serif);
  font-size: 19px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-sub {
  overflow: hidden;
  color: var(--muted);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-score {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-areas:
    "avg star"
    "votes votes";
  align-items: center;
  justify-items: end;
  column-gap: 4px;
}

.rank-avg {
  grid-area: avg;
  font-family: var(--serif);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.rank-star {
  grid-area: star;
  color: var(--accent);
  font-size: 13px;
}

.rank-votes {
  grid-area: votes;
  color: var(--muted);
  font-size: 11.5px;
}

.empty-note {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* ------------------------------------------------------------------ */
/*  Past picks                                                         */
/* ------------------------------------------------------------------ */

.past {
  padding-top: clamp(64px, 8vw, 104px);
}

.past-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  padding-top: 24px;
}

.past-card {
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.past-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
}

.past-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #0a0d10;
  object-fit: cover;
}

.past-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px 12px;
}

.past-date {
  color: var(--accent);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.past-title {
  overflow: hidden;
  font-family: var(--serif);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.past-score {
  color: var(--muted);
  font-size: 11.5px;
}

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

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  width: var(--page);
  margin: clamp(80px, 10vw, 130px) auto 0;
  padding: 26px 0 40px;
  border-top: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 12.5px;
}

.footer p {
  margin: 0;
}

.footer-meta {
  display: flex;
  gap: 18px;
}

.footer a {
  color: #8b97a4;
  text-decoration: none;
  border-bottom: 1px solid #2c3642;
}

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

/* ------------------------------------------------------------------ */
/*  Lightbox / toast                                                   */
/* ------------------------------------------------------------------ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 48px);
  background: rgba(5, 7, 9, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox-figure {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: min(1200px, 100%);
  max-height: 100%;
  margin: 0;
}

.lightbox-figure img {
  max-width: 100%;
  max-height: 78vh;
  border-radius: 12px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
  object-fit: contain;
}

.lightbox-figure figcaption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.lightbox-caption {
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(18, 23, 29, 0.92);
  color: var(--text);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover {
  background: #1b232c;
}

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  z-index: 70;
  padding: 11px 18px;
  border: 1px solid #2c3947;
  border-radius: 999px;
  background: #1a232d;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  color: var(--text);
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 20px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast[data-kind="error"] {
  border-color: #5a2b2b;
  background: #2a1717;
}

/* ------------------------------------------------------------------ */
/*  Admin                                                              */
/* ------------------------------------------------------------------ */

.admin-main {
  width: min(980px, calc(100% - 40px));
  margin: 44px auto 90px;
}

.admin-main h1 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 38px);
  font-weight: 500;
}

.admin-main > p,
.admin-lead {
  color: var(--muted);
  font-size: 14px;
}

.gate {
  max-width: 430px;
  margin: 70px auto;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.gate h1 {
  font-size: 30px;
}

.gate p {
  color: var(--muted);
  font-size: 13.5px;
}

.field {
  display: block;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12.5px;
}

.field span {
  display: block;
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0d1217;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease;
}

input[type="text"]:focus,
input[type="password"]:focus {
  border-color: var(--accent-deep);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 550;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.btn:hover {
  border-color: var(--border-strong);
  background: #202b36;
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn-primary {
  border-color: transparent;
  background: var(--accent);
  color: #1a1206;
}

.btn-primary:hover {
  border-color: transparent;
  background: #ffd16a;
}

.btn-ghost {
  background: none;
}

.btn-danger {
  border-color: #4a2727;
  background: #1f1414;
  color: var(--danger);
}

.btn-danger:hover {
  border-color: #6a3333;
  background: #2a1717;
}

.admin-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.admin-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.upload-card {
  display: grid;
  gap: 16px;
  margin: 24px 0 34px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.drop {
  position: relative;
  padding: 28px;
  border: 1.5px dashed #2c3947;
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.drop.is-drag {
  border-color: var(--accent);
  background: rgba(246, 196, 83, 0.05);
}

.drop input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.drop-title {
  display: block;
  color: var(--text-dim);
  font-size: 14px;
}

.drop-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
}

.upload-fields {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
  gap: 14px;
}

.form-error {
  min-height: 18px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.admin-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 13.5px;
}

.admin-table th {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 550;
  letter-spacing: 0.11em;
  text-align: left;
  text-transform: uppercase;
}

.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.admin-thumb {
  display: block;
  width: 72px;
  height: 52px;
  border-radius: 8px;
  background: #0a0d10;
  object-fit: cover;
}

.admin-photo-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.admin-photo-name {
  display: block;
  overflow: hidden;
  max-width: 260px;
  font-family: var(--serif);
  font-size: 15.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-photo-meta {
  display: block;
  color: var(--muted-2);
  font-size: 11.5px;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-on {
  background: rgba(110, 200, 140, 0.12);
  color: #8fd9a7;
}

.badge-off {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mini-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #131a21;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
}

.mini-btn:hover {
  background: #1a232c;
  border-color: var(--border-strong);
}

.mini-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.mini-btn.danger {
  border-color: #4a2727;
  color: var(--danger);
}

.mini-btn.danger:hover {
  background: #2a1717;
}

.admin-empty {
  padding: 40px 20px;
  color: var(--muted);
  text-align: center;
}

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

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

  .photo-frame img {
    max-height: 62vh;
  }

  .hero-panel {
    padding-top: 0;
  }

  .rank-row {
    grid-template-columns: 34px 64px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 12px 6px;
  }

  .rank-thumb {
    width: 64px;
    height: 48px;
  }

  .rank {
    font-size: 22px;
  }

  .rank-title {
    font-size: 17px;
  }

  .upload-fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar {
    height: 60px;
  }

  .topnav {
    gap: 16px;
  }

  .topnav a {
    font-size: 13px;
  }

  .rank-row {
    grid-template-columns: 28px 56px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .rank-thumb {
    width: 56px;
    height: 42px;
  }

  .rank-avg {
    font-size: 19px;
  }

  .rank-votes {
    display: none;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .section-note {
    margin: 0;
  }

  .footer {
    flex-direction: column;
  }

  .admin-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .lightbox-figure figcaption {
    flex-direction: column;
    gap: 4px;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ------------------------------------------------------------------ */
/*  Rating game additions                                              */
/* ------------------------------------------------------------------ */

.nav-upload {
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: #1a1206 !important;
  font-weight: 650;
}

.nav-upload:hover {
  background: #ffd16a;
  color: #1a1206 !important;
}

.rate-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.rate-topline .eyebrow {
  margin: 0;
}

.text-btn {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 0.15s ease;
}

.text-btn:hover {
  color: var(--text);
}

.text-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.rate-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.report {
  color: var(--muted-2);
}

.report:hover {
  color: var(--danger);
}

.report:disabled {
  opacity: 0.6;
  color: var(--muted-2);
}

.rate-note {
  min-height: 18px;
  margin: 12px 0 0;
  color: var(--muted-2);
  font-size: 12.5px;
}

.photo-frame.is-loading img {
  opacity: 0.45;
}

/* ------------------------------------------------------------------ */
/*  How it works                                                       */
/* ------------------------------------------------------------------ */

.how {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 4vw, 46px);
  margin-top: clamp(56px, 7vw, 88px);
  padding-top: 26px;
  border-top: 1px solid var(--border);
}

.how-step {
  padding-right: 12px;
}

.how-num {
  color: var(--accent);
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.1em;
}

.how-step h3 {
  margin: 6px 0 4px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
}

.how-step p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* ------------------------------------------------------------------ */
/*  Map                                                                */
/* ------------------------------------------------------------------ */

.map-section {
  padding-top: clamp(72px, 9vw, 120px);
}

.map-legend {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.map-scroll {
  margin-top: 22px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 42%),
    var(--surface);
}

.map-wrap {
  position: relative;
  min-width: 860px;
  padding: 12px;
}

.map-svg {
  display: block;
  width: 100%;
  height: auto;
}

.map-grid {
  stroke: #202a35;
  stroke-width: 1;
}

.map-axis {
  stroke: #364352;
  stroke-width: 1.2;
}

.map-tick {
  fill: #768494;
  font-family: var(--sans);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.map-axis-label {
  fill: #6d7a89;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.map-empty {
  fill: var(--muted);
  font-family: var(--sans);
  font-size: 14px;
}

.map-point {
  cursor: pointer;
  outline: none;
}

.map-point image {
  transition: filter 0.15s ease;
}

.map-halo {
  fill: transparent;
}

.map-ring {
  fill: none;
  stroke: rgba(255, 255, 255, 0.62);
  stroke-width: 2.5;
  transition: stroke 0.15s ease, stroke-width 0.15s ease;
}

.map-point:hover .map-ring,
.map-point:focus .map-ring {
  stroke: var(--accent);
  stroke-width: 3;
}

.map-point:hover image,
.map-point:focus image {
  filter: brightness(1.1);
}

.map-tooltip {
  position: fixed;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 240px;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: rgba(12, 16, 21, 0.97);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.map-tooltip strong {
  overflow: hidden;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-tooltip span {
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.map-hint {
  display: none;
  margin: 10px 0 0;
  color: var(--muted-2);
  font-size: 11.5px;
}

.fresh {
  margin-top: 34px;
}

.fresh-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}

.fresh-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
}

.fresh-head span {
  color: var(--muted);
  font-size: 12px;
}

.fresh-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
}

.fresh-card {
  flex: 0 0 152px;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: inherit;
  text-align: left;
  cursor: pointer;
  scroll-snap-align: start;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.fresh-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.fresh-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #0a0d10;
  object-fit: cover;
}

.fresh-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px 10px;
}

.fresh-title {
  overflow: hidden;
  font-family: var(--serif);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fresh-cta {
  color: var(--accent);
  font-size: 11.5px;
}

/* ------------------------------------------------------------------ */
/*  State cards                                                        */
/* ------------------------------------------------------------------ */

.state-links {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.state-link {
  display: inline-flex;
  align-items: center;
  padding: 9px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
}

.state-link:hover {
  border-color: var(--accent);
}

.state-link.primary {
  border-color: transparent;
  background: var(--accent);
  color: #1a1206;
  font-weight: 600;
}

.state-link.primary:hover {
  background: #ffd16a;
}

/* ------------------------------------------------------------------ */
/*  Upload page                                                        */
/* ------------------------------------------------------------------ */

.upload-main {
  width: min(820px, calc(100% - 40px));
  margin: clamp(40px, 6vw, 70px) auto 90px;
}

.upload-intro h1 {
  font-size: clamp(36px, 5vw, 54px);
}

.upload-intro .lead {
  max-width: 580px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.upload-main .upload-card {
  margin-top: 28px;
  padding: 24px;
}

.upload-fields.two {
  grid-template-columns: 1fr 1fr;
}

.upload-fields .field {
  margin-bottom: 0;
}

.upload-fields .field em {
  color: var(--muted-2);
  font-style: normal;
}

.upload-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.upload-note {
  max-width: 390px;
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.5;
}

.upload-back {
  margin-top: 26px;
}

.upload-back a {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.upload-back a:hover {
  color: var(--text);
}

.upload-card.is-busy {
  opacity: 0.75;
}

/* ------------------------------------------------------------------ */
/*  Admin additions                                                    */
/* ------------------------------------------------------------------ */

.badge-report {
  background: rgba(255, 100, 100, 0.14);
  color: #ffb3b3;
}

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

@media (max-width: 800px) {
  .how {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .how-step {
    padding-right: 0;
  }
}

@media (max-width: 900px) {
  .upload-fields.two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .map-hint {
    display: block;
  }
}

@media (max-width: 560px) {
  .topnav a[href="#rate"] {
    display: none;
  }

  .nav-upload {
    padding: 6px 11px;
    font-size: 12.5px;
  }

  .upload-main .upload-card {
    padding: 18px;
  }

  .upload-submit {
    align-items: stretch;
    flex-direction: column;
  }

  .upload-submit .btn {
    width: 100%;
  }
}
