/* ratemyfur — 1970s shag-carpet palette, one loud moment (the score stamp). */

@font-face {
  font-family: "Shrikhand";
  src: url("/vendor/fonts/shrikhand-latin-400-normal.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Recursive";
  src: url("/vendor/fonts/recursive-latin-casl-normal.woff2") format("woff2-variations");
  font-weight: 300 1000;
  font-display: swap;
}

:root {
  --shag: #2b1b12;
  --shag-2: #3a2619;
  --tan: #6b4a33;
  --cream: #f6e7c8;
  --cream-dim: #c9b391;
  --gold: #f0b232;
  --avocado: #9aa53a;
  --rust: #c4532a;
  --radius-photo: 22px;
  --radius-control: 999px;
  --column: 520px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--shag);
  /* A faint shag texture: two offset stripes of slightly lighter brown. */
  background-image:
    repeating-linear-gradient(115deg, transparent 0 7px, rgb(255 220 170 / 0.025) 7px 9px),
    repeating-linear-gradient(65deg, transparent 0 11px, rgb(0 0 0 / 0.08) 11px 13px);
  color: var(--cream);
  font-family: "Recursive", system-ui, sans-serif;
  font-variation-settings: "CASL" 0.6;
  font-size: 1rem;
  line-height: 1.5;
}

a { color: var(--gold); }
a:hover { color: var(--cream); }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: var(--column);
  margin: 0 auto;
  padding: 0 16px;
}

/* ---- header ------------------------------------------------------------ */

.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  padding-bottom: 10px;
}

.logo {
  font-family: "Shrikhand", Georgia, serif;
  font-size: 1.9rem;
  line-height: 1;
  color: var(--gold);
  text-decoration: none;
  text-shadow: 3px 3px 0 var(--tan);
  letter-spacing: -0.01em;
}
.logo:hover { color: var(--gold); }

.nav {
  display: flex;
  gap: 4px;
}
.nav a {
  white-space: nowrap;
  padding: 8px 12px;
  border-radius: var(--radius-control);
  color: var(--cream);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}
.nav a[aria-current="page"] { background: var(--shag-2); color: var(--gold); }
.nav a.nav-cta { background: var(--gold); color: var(--shag); }

/* ---- buttons & chips ------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--gold);
  color: var(--shag);
  font: inherit;
  font-weight: 750;
  font-size: 1.05rem;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { color: var(--shag); filter: brightness(1.07); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--cream); box-shadow: inset 0 0 0 2px var(--tan); }
.btn.ghost:hover { color: var(--gold); }
.btn.danger { background: var(--rust); color: var(--cream); }

.chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 10px;
  scrollbar-width: none;
}
.chip {
  flex: none;
  padding: 7px 14px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--shag-2);
  color: var(--cream-dim);
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--avocado); color: var(--shag); }

/* ---- the photo card -------------------------------------------------------- */

.stage { position: relative; }

.photo {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-photo);
  overflow: hidden;
  background: var(--shag-2);
  box-shadow: 0 0 0 4px var(--tan), 8px 10px 0 4px rgb(0 0 0 / 0.35);
  touch-action: pan-y;
  user-select: none;
}
.photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
  transition: transform 220ms ease, opacity 220ms ease;
}
.photo.leaving img { transform: translateX(-30%) rotate(-6deg); opacity: 0; }

.badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 6px;
}
.badge {
  padding: 3px 10px;
  border-radius: var(--radius-control);
  background: rgb(43 27 18 / 0.8);
  color: var(--cream);
  font-size: 0.8rem;
  font-weight: 650;
  backdrop-filter: blur(6px);
}
.badge.fur { color: var(--avocado); }

.flag {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgb(43 27 18 / 0.75);
  color: var(--cream);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

/* The one loud moment: the crowd's score stamped onto the photo. */
.reveal {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 4px;
  background: radial-gradient(circle at 50% 45%, rgb(43 27 18 / 0.55), rgb(43 27 18 / 0.85));
  text-align: center;
  padding: 16px;
}
.reveal[hidden] { display: none; }
.stamp {
  font-family: "Shrikhand", Georgia, serif;
  font-size: clamp(5rem, 30vw, 9rem);
  line-height: 0.9;
  color: var(--gold);
  text-shadow: 5px 5px 0 var(--rust), 10px 10px 0 var(--shag);
  transform: rotate(-7deg);
  animation: stamp 420ms cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
.stamp-label { font-weight: 700; font-size: 1.05rem; }
.stamp-quip {
  font-family: "Shrikhand", Georgia, serif;
  font-size: 1.35rem;
  color: var(--cream);
  margin-top: 6px;
}
.stamp-meta { color: var(--cream-dim); font-size: 0.9rem; }

@keyframes stamp {
  from { transform: rotate(-20deg) scale(2.4); opacity: 0; }
  to { transform: rotate(-7deg) scale(1); opacity: 1; }
}

/* ---- rating row ------------------------------------------------------------ */

.rate {
  margin-top: 22px;
}
.rate-q {
  margin: 0 0 10px;
  font-weight: 700;
  font-size: 1.05rem;
  text-align: center;
}
.scores {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 5px;
}
.score {
  aspect-ratio: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  /* Low scores lean avocado, high scores lean gold. */
  background: color-mix(in oklab, var(--avocado), var(--gold) calc(var(--i) * 11%));
  color: var(--shag);
  font: inherit;
  font-weight: 800;
  font-size: clamp(0.9rem, 3.8vw, 1.15rem);
  cursor: pointer;
  transition: transform 120ms ease;
}
.score:hover { transform: translateY(-2px); }
.score:active { transform: scale(0.92); }
.score:disabled { opacity: 0.45; cursor: wait; transform: none; }
.score.picked { box-shadow: 0 0 0 3px var(--cream); }
.scale-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: var(--cream-dim);
  font-size: 0.8rem;
}
.after {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 14px;
}

/* ---- general content ------------------------------------------------------ */

h1, h2 {
  font-family: "Shrikhand", Georgia, serif;
  font-weight: 400;
  line-height: 1.1;
  color: var(--gold);
}
h1 { font-size: 2.2rem; margin: 18px 0 8px; }
h2 { font-size: 1.45rem; margin: 30px 0 8px; }
h3 { font-size: 1.05rem; margin: 22px 0 4px; }
.lede { color: var(--cream-dim); margin-top: 0; }
.prose { max-width: 62ch; }
.prose p, .prose li { color: var(--cream); }
.prose li + li { margin-top: 6px; }
.muted { color: var(--cream-dim); }

.empty {
  display: grid;
  place-content: center;
  gap: 14px;
  justify-items: center;
  min-height: 300px;
  text-align: center;
  padding: 24px;
}

.ad {
  margin: 30px 0 0;
  padding: 16px 18px;
  border: 2px dashed var(--tan);
  border-radius: 14px;
  color: var(--cream-dim);
  font-size: 0.9rem;
  text-align: center;
}
.ad strong { color: var(--cream); }

.site-foot {
  margin-top: 40px;
  padding-top: 18px;
  padding-bottom: 30px;
  border-top: 1px solid var(--shag-2);
  color: var(--cream-dim);
  font-size: 0.85rem;
}
.site-foot nav { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 8px; }
.site-foot a { color: var(--cream-dim); }

.toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--cream);
  color: var(--shag);
  font-weight: 650;
  box-shadow: 0 8px 30px rgb(0 0 0 / 0.4);
  z-index: 50;
}

/* ---- dialogs & forms ---------------------------------------------------- */

dialog {
  width: min(460px, calc(100% - 32px));
  border: 0;
  border-radius: 20px;
  padding: 22px;
  background: var(--shag-2);
  color: var(--cream);
  box-shadow: 0 0 0 3px var(--tan);
}
dialog::backdrop { background: rgb(20 12 8 / 0.7); }
dialog h2 { margin-top: 0; }

.options { display: grid; gap: 8px; margin: 12px 0; }
.option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--shag);
  cursor: pointer;
}
.option input { margin-top: 4px; accent-color: var(--gold); }
.option small { display: block; color: var(--cream-dim); }

.check { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--gold); flex: none; }

.turnstile-slot { min-height: 0; margin: 10px 0; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* ---- upload editor ------------------------------------------------------- */

.editor {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-photo);
  overflow: hidden;
  background: var(--shag-2);
  box-shadow: 0 0 0 4px var(--tan);
  touch-action: none;
}
.editor canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.editor.blurring canvas { cursor: crosshair; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.zoom { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.zoom input { flex: 1; accent-color: var(--gold); }
.note {
  margin: 12px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--shag-2);
  font-size: 0.92rem;
}
.note.warn { box-shadow: inset 4px 0 0 var(--rust); }
.note.good { box-shadow: inset 4px 0 0 var(--avocado); }
.reasons { margin: 8px 0 0; padding-left: 20px; }

.picker {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  aspect-ratio: 1;
  border: 3px dashed var(--tan);
  border-radius: var(--radius-photo);
  text-align: center;
  padding: 24px;
  cursor: pointer;
}
.picker input { position: absolute; opacity: 0; pointer-events: none; }
.picker .big { font-family: "Shrikhand", Georgia, serif; font-size: 1.6rem; color: var(--gold); }

.copyrow { display: flex; gap: 8px; margin-top: 8px; }
.copyrow input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: var(--shag);
  color: var(--cream);
  font: inherit;
  font-size: 0.85rem;
}

/* ---- leaderboard & my photos ---------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 8px;
}
.tile {
  position: relative;
  display: block;
  border-radius: 16px;
  overflow: hidden;
  background: var(--shag-2);
  color: var(--cream);
  text-decoration: none;
  box-shadow: 0 0 0 3px var(--tan);
}
.tile img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.tile .rank {
  position: absolute;
  top: 6px;
  left: 10px;
  font-family: "Shrikhand", Georgia, serif;
  font-size: 1.8rem;
  color: var(--gold);
  text-shadow: 2px 2px 0 var(--shag);
}
.tile .info { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 10px; font-size: 0.85rem; }
.tile .avg { font-family: "Shrikhand", Georgia, serif; font-size: 1.3rem; color: var(--gold); }
.tile .tile-actions { display: flex; gap: 6px; padding: 0 10px 10px; }
.tile .tile-actions .btn { min-height: 38px; padding: 0 12px; font-size: 0.85rem; flex: 1; }

@media (max-width: 400px) {
  .logo { font-size: 1.6rem; }
  .nav a { padding: 8px 10px; font-size: 0.9rem; }
}

@media (min-width: 760px) {
  :root { --column: 560px; }
  .grid { grid-template-columns: repeat(3, 1fr); }
  .grid-wrap, .site-head, .site-foot { max-width: 860px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.after-skip { text-align: center; margin-top: 10px; }
.after-skip .btn { min-height: 40px; }
.after:not([hidden]) + .after-skip { display: none; }
