:root {
  color-scheme: light;
  font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif;
  font-size: 100%;
  color: #2e182c;
  background: #fdf4ef;
  accent-color: #8e235b;
  scroll-padding-bottom: calc(var(--watchme-nav-height));
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 90% 0%, #f5d8ed, transparent 24rem),
              radial-gradient(ellipse at 0% 45%, #ffe0c6, transparent 27rem);
}
.topbar, main { width: min(100% - clamp(1.5rem, 5vw, 3.6rem), 56rem); margin-inline: auto; }
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;
  padding-block: max(0.8rem, env(safe-area-inset-top)) 0.65rem;
}
.back {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: #4b2443; font-size: 1.05rem; font-weight: 750; text-decoration: none;
}
.back span { font-size: 1.15rem; }
main { padding-bottom: calc(2rem + var(--watchme-nav-height)); }
.nummy-tabs {
  position: fixed;
  inset-inline: 0;
  inset-block-end: 0;
  z-index: 20;
}
.intro { margin: 0.9rem auto 1.4rem; text-align: center; }
.intro p { max-width: 38ch; margin-inline: auto; font-size: 1rem; }
#sound { font-size: 1rem; flex-shrink: 0; }
h1 {
  font-family: Georgia, serif;
  font-size: clamp(2.1rem, 8vw, 2.7rem);
  letter-spacing: -0.055em;
  line-height: 0.99;
  margin: 0 0 0.7rem;
  text-wrap: balance;
}
h1 em { color: #8e235b; font-weight: 400; }
h1 span { color: #a43b63; font-family: system-ui, sans-serif; font-size: 0.48em; margin-left: 0.25em; vertical-align: top; }
h2 { font-size: 1.3rem; line-height: 1.2; margin: 0 0 0.45rem; }
p { margin: 0.45rem 0 0.8rem; font-size: 1rem; line-height: 1.5; }
.intro p, .small { color: #58364f; }
.small { font-size: 0.95rem; }
.notice { text-align: center; font-size: 1rem; }
.notice:empty { display: none; }
.notice.error { color: #84234a; font-weight: 700; }
button, .back { min-height: 3rem; }
button {
  font: inherit; font-size: 1rem; font-weight: 750; cursor: pointer;
  border: 1px solid transparent; border-radius: 999px; padding: 0.55rem 1rem;
}
button:active { transform: scale(0.97); }
button:disabled { cursor: default; opacity: 0.55; }
:focus-visible { outline: 3px solid #7042a3; outline-offset: 4px; }
.quiet { background: #fffaf6; border-color: #dcbecb; color: #512747; }
.primary, .nummy { color: #fff; background: #8e235b; }
.danger { color: #84234a; }
.controls, .toolbar { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.toolbar { justify-content: center; margin: 0.85rem 0; }
.toolbar #filters { width: min(100%, 26rem); }
.photo-entry[data-onboarding] {
  max-width: 29rem; margin: 0 auto 1rem; padding: 1.5rem;
  background: #fffaf8; border: 1px solid #e9ccd9; border-radius: 1.6rem;
  box-shadow: 0 12px 36px #61274d18;
}
.photo-welcome { text-align: center; }
.photo-welcome h2 { font-size: clamp(1.55rem, 5vw, 2rem); }
.photo-welcome p { max-width: 29ch; margin: 0.55rem auto 1.2rem; color: #58364f; }
.photo-entry[data-onboarding] .toolbar { display: grid; gap: 0.65rem; margin: 0; }
.photo-entry[data-onboarding] .toolbar button { width: 100%; min-height: 3rem; font-size: 1.125rem; }
.photo-entry[data-onboarding] #camera {
  min-height: 3.5rem; color: #fff; background: #792052; border-color: #792052;
  box-shadow: 0 5px 14px #79205226;
}
.photo-art {
  position: relative; width: 6.5rem; height: 6rem; margin: 0 auto 0.8rem;
}
.photo-art::before, .photo-art-card {
  position: absolute; width: 4.25rem; height: 5.25rem; border-radius: 0.8rem;
}
.photo-art::before {
  content: ""; left: 0.65rem; top: 0.35rem; border: 1px solid #e2ae9a;
  background: #fbd9bf; transform: rotate(-14deg);
}
.photo-art-card {
  display: grid; place-items: center; right: 0.7rem; top: 0.25rem;
  border: 1px solid #d99fbe; background: #f3ccdf; transform: rotate(12deg);
}
.photo-art-camera {
  position: relative; display: grid; place-items: center; width: 2.25rem; height: 1.55rem;
  border-radius: 0.35rem; background: #792052;
}
.photo-art-camera::before {
  content: ""; width: 0.85rem; height: 0.35rem; border-radius: 0.2rem 0.2rem 0 0;
  position: absolute; top: -0.3rem; background: #792052;
}
.photo-art-camera::after {
  content: ""; width: 0.84rem; height: 0.84rem; border: 2px solid #ffeff7; border-radius: 50%;
}
.panel, dialog {
  background: #fffaf6; border: 1px solid #e7cfdc; border-radius: 1.25rem;
  padding: 1rem; box-shadow: 0 0.5rem 1.7rem #54274413; margin-bottom: 0.75rem;
}
fieldset { padding: 0; margin: 0 0 0.8rem; border: 0; }
legend { font-size: 1.2rem; font-weight: 750; margin-bottom: 0.55rem; }
fieldset label {
  display: inline-flex; align-items: center; min-height: 48px; margin: 0.2rem 0.3rem 0.2rem 0;
  padding: 0.35rem 0.65rem; font-size: 1.0625rem; color: #512747;
  border: 1px solid #e7cfdc; border-radius: 0.65rem;
}
input[type="checkbox"] { width: 1.2rem; height: 1.2rem; margin: 0 0.46rem 0 0; }
video, canvas {
  display: block; width: min(100%, clamp(12rem, 37svh, 21rem)); aspect-ratio: 3 / 4;
  object-fit: cover; border-radius: 0.8rem; margin: 0 auto 0.8rem; background: #321a34;
}
#deck { width: 100%; margin-inline: auto; }
#card, #votes, #safety { width: min(100%, 25rem); margin-inline: auto; }
.card {
  position: relative; display: block; aspect-ratio: 3 / 4; overflow: hidden;
  background: #3e2840; border: 3px solid #fffaf6; border-radius: 1.6rem;
  box-shadow: 0 0.6rem 2rem #54274431;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.card img, .card video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; -webkit-user-drag: none; }
#card-video-marker {
  position: absolute; inset: 16% 5% auto auto; pointer-events: none;
  font: 600 0.68rem monospace; color: #ffffffd6; padding: 0.18rem 0.35rem;
  background: #24112370; border-radius: 0.35rem;
}
.card strong {
  position: absolute; bottom: 0; inset-inline: 0; padding: 1rem 0.9rem 0.65rem;
  color: #fff; background: linear-gradient(transparent, #211027e8);
  overflow-wrap: anywhere;
}
.vote-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; margin-top: 0.75rem; }
.vote-buttons button { padding-inline: 0.3rem; min-height: 3.25rem; font-size: 1.125rem; }
.crummy { color: #62324d; background: #ffe3cc; border-color: #e7baa3; }
.safety { justify-content: center; }
.text-button { color: #734663; background: transparent; text-decoration: underline; text-underline-offset: 0.17em; }
.deck-prompt {
  max-width: 43rem; min-height: 13rem; margin: 0 auto 1.25rem; padding: clamp(1.15rem, 5vw, 2.15rem);
  text-align: center; border-color: #e1bbcd;
  background: radial-gradient(ellipse at 50% 0%, #fae3ef, transparent 72%), #fffaf8;
}
.deck-prompt h2 { font-size: clamp(1.3rem, 4.5vw, 1.65rem); }
.deck-prompt p { max-width: 33ch; margin: 0.65rem auto 1.25rem; color: #58364f; }
.deck-spark {
  display: grid; place-items: center; width: 2.6rem; height: 2.6rem; margin: 0 auto 0.7rem;
  border-radius: 50%; background: #f3d1e2; color: #792052; font-size: 1.6rem;
}
.wide-action { width: min(100%, 26rem); min-height: 3rem; font-size: 1rem; }
.deck-actions { display: grid; justify-items: center; gap: 0.7rem; margin-bottom: 0.65rem; }
.deck-actions a {
  display: grid; place-items: center; padding: 0.55rem 1rem; border: 1px solid #dcbecb;
  border-radius: 999px; font-weight: 750; text-decoration: none;
}
#refresh { background: transparent; border-color: transparent; text-decoration: underline; }
.replay-controls { text-align: center; margin-top: 0.8rem; }
.replay-controls p { color: #58364f; }
.photo-tools { width: min(100%, 26rem); margin: 0 auto 1rem; padding: 0 1rem; }
.photo-tools summary {
  min-height: 3rem; padding: 0.7rem 0; cursor: pointer;
  color: #512747; font-size: 1.04rem; font-weight: 750;
}
.photo-tools .controls { display: grid; padding: 0 0 1rem; }
.photo-tools .controls button { width: 100%; }
.matches { margin-top: 0.75rem; background: #fff1f8; }
.matches ul { list-style: none; padding: 0; margin: 0; }
.matches li { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; flex-wrap: wrap; padding-top: 0.65rem; }
.matches strong { overflow-wrap: anywhere; }
dialog { position: fixed; margin: auto; width: min(100% - 2rem, 25rem); }
dialog::backdrop { background: #321a34a8; }
dialog label { display: grid; margin-bottom: 0.8rem; gap: 0.3rem; font-weight: 650; }
select, textarea { min-height: 44px; padding: 0.55rem; border: 1px solid #bd9cae; border-radius: 0.55rem; font: inherit; background: #fff; color: #321a34; }
textarea { min-height: 6rem; resize: vertical; }
@media print { body { visibility: hidden !important; } }
@media (max-width: 42rem) {
  .photo-entry[data-onboarding] { padding: clamp(1rem, 5vw, 1.5rem); }
  .intro { margin-top: 0.8rem; }
}
@media (prefers-reduced-motion: no-preference) {
  button { transition: transform 120ms ease; }
  .card.vote-up { animation: swipe-up 190ms ease both; }
  .card.vote-down { animation: swipe-down 190ms ease both; }
  @keyframes swipe-up { to { transform: translateY(-16%) rotate(5deg); opacity: 0.1; } }
  @keyframes swipe-down { to { transform: translateY(16%) rotate(-5deg); opacity: 0.1; } }
}

/* Use the phone layout even when the browser exposes a desktop viewport. */
@media (max-width: 600px), (any-pointer: coarse) {
  .topbar, main { width: calc(100% - 24px); max-width: none; }
  .topbar { padding-block: 16px 12px; }
  .back, #sound { font-size: 16px; }
  .intro { margin: 20px auto 24px; }
  #card, #votes, #safety { width: 100%; }
  .intro p { font-size: 17px; line-height: 1.45; max-width: 36ch; }
  .deck-prompt { width: 100%; max-width: none; min-height: 0; padding: 28px 18px; border-radius: 22px; }
  .deck-prompt h2 { font-size: 25px; }
  .deck-prompt p { font-size: 17px; line-height: 1.45; }
  .deck-spark { width: 46px; height: 46px; font-size: 26px; }
  .deck-actions { gap: 12px; }
  .wide-action, .deck-actions a { width: min(100%, 440px); min-height: 52px; font-size: 17px; }
  .toolbar #filters, .photo-tools { width: min(100%, 440px); }
  .toolbar button, .photo-tools summary { min-height: 50px; font-size: 17px; }
}
