/* ==========================================================================
   Waidrn v3: the wish page (#683)
   --------------------------------------------------------------------------
   Loaded by the v3 shell document next to v3-shell.css, whose tokens it uses.
   Markup: crates/waidrn-web/src/templates/v3/wish.rs.

   One address shows everything, with as few words as it can:
   centre  the presentation (picture, title, short text, steps, buttons, the
           teams as a row of faces), the wish in full, the discussion;
   left    what the wisher and the teams' leads last said, and the threads;
   right   the contract as a strip of picture circles.
   A face or a circle opens its card on hover, on keyboard focus and on tap.
   There is no script.

   Rules kept: no inline styles (CSP `style-src 'self'`); the only motion is the
   scene's pointer drift, switched off below for reduced motion.
   ========================================================================== */

/* ---- the scene behind a detail page ----------------------------------------
   Operator decision (2026-11-12): the frame's two shade layers were too much
   here. A detail page uses the scene of the old item pages instead: the
   seasonal tree, at the same opacity, filter and dim as `scenes.css` gives it,
   drifting with the pointer (`scene.js` sets --parallax-x/-y). The two fixed
   elements the frame already has carry it: .v3-page-art is the picture,
   .v3-page-mask is the picture's own dim. The frame's middle panel shade is
   removed; the content brings its own windows.
   ------------------------------------------------------------------------- */
/* The colour under the picture, as on the old pages (`--void` in scenes.css). */
html[data-shell="v3"][data-mode="detail"] { background: #07080a; }
html[data-shell="v3"][data-mode="detail"][data-theme="light"] { background: var(--bg); }
html[data-shell="v3"] body[data-mode="detail"] {
  --scene-image: url("/static/scenes/tree-summer-desktop.webp");
  --scene-position: center 30%;
}
html[data-shell="v3"] body[data-mode="detail"][data-season="spring"] { --scene-image: url("/static/scenes/tree-spring-desktop.webp"); }
html[data-shell="v3"] body[data-mode="detail"][data-season="summer"] { --scene-image: url("/static/scenes/tree-summer-desktop.webp"); }
html[data-shell="v3"] body[data-mode="detail"][data-season="autumn"] { --scene-image: url("/static/scenes/tree-autumn-desktop.webp"); }
html[data-shell="v3"] body[data-mode="detail"][data-season="winter"] { --scene-image: url("/static/scenes/tree-winter-desktop.webp"); }

html[data-shell="v3"]:not([data-theme="light"]) body[data-mode="detail"] .v3-page-art,
html[data-shell="v3"] body[data-mode="detail"] .v3-page-art {
  inset: -3%;
  z-index: -2;
  background-image:
    var(--scene-image),
    radial-gradient(820px 620px at 50% 8%, rgba(232, 201, 135, 0.18), transparent 60%),
    linear-gradient(180deg, #0b0f0c 0%, #05070a 100%);
  background-size: cover;
  background-position: var(--scene-position);
  background-repeat: no-repeat;
  opacity: 0.64;
  filter: saturate(0.72) brightness(0.66) contrast(1.02);
  transform: translate3d(var(--parallax-x, 0px), var(--parallax-y, 0px), 0) scale(1.04);
  will-change: transform;
  transition: transform 0.5s ease-out;
}
html[data-shell="v3"] body[data-mode="detail"] .v3-page-mask {
  background:
    radial-gradient(120% 90% at 50% 42%, transparent 38%, rgba(0, 0, 0, 0.5) 100%),
    linear-gradient(180deg, rgba(5, 8, 7, 0.52) 0%, rgba(5, 8, 7, 0.72) 60%, rgba(4, 6, 5, 0.82) 100%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 3px);
}
html[data-shell="v3"]:not([data-theme="light"]) body[data-mode="detail"] .v3-shell > .v3-body,
html[data-shell="v3"] body[data-mode="detail"] .v3-shell > .v3-body { background: transparent; }

/* Light theme: the same picture, washed out under a paper veil. */
html[data-shell="v3"][data-theme="light"] body[data-mode="detail"] .v3-page-art {
  opacity: 0.3;
  filter: saturate(0.8) brightness(1.12);
}
html[data-shell="v3"][data-theme="light"] body[data-mode="detail"] .v3-page-mask {
  background: linear-gradient(180deg, rgba(245, 243, 238, 0.62), rgba(245, 243, 238, 0.84));
}

@media (max-width: 720px) {
  html[data-shell="v3"] body[data-mode="detail"] { --scene-image: url("/static/scenes/tree-summer-phone.webp"); --scene-position: center 26%; }
  html[data-shell="v3"] body[data-mode="detail"][data-season="spring"] { --scene-image: url("/static/scenes/tree-spring-phone.webp"); }
  html[data-shell="v3"] body[data-mode="detail"][data-season="summer"] { --scene-image: url("/static/scenes/tree-summer-phone.webp"); }
  html[data-shell="v3"] body[data-mode="detail"][data-season="autumn"] { --scene-image: url("/static/scenes/tree-autumn-phone.webp"); }
  html[data-shell="v3"] body[data-mode="detail"][data-season="winter"] { --scene-image: url("/static/scenes/tree-winter-phone.webp"); }
}
@media (prefers-reduced-motion: reduce) {
  html[data-shell="v3"] body[data-mode="detail"] .v3-page-art { transform: none; transition: none; will-change: auto; }
}
@media (prefers-contrast: more), (forced-colors: active) {
  html[data-shell="v3"] body[data-mode="detail"] .v3-page-mask { display: none; }
}

/* ---- the page: a centre column with a side at each edge ---------------------- */
html[data-shell="v3"] body[data-mode="detail"] #v3-content { max-width: 1380px; }

.v3-wish {
  /* Glass, as on the old item pages (scenes.css). */
  --w-glass: rgba(16, 20, 26, 0.64);
  --w-inner: rgba(8, 11, 15, 0.46);
  --w-solid: #0e1217;
  --w-line: rgba(232, 201, 135, 0.26);
  --w-hair: rgba(255, 255, 255, 0.09);
  --w-sheen: linear-gradient(150deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0) 42%);
  --w-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 18px 60px rgba(0, 0, 0, 0.55);
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 72px;
  grid-template-areas:
    "news hero rules"
    "news full rules"
    "news talk rules";
  gap: 14px;
  align-items: start;
  padding: 20px 0 56px;
}
.v3-wish--no-news {
  grid-template-columns: minmax(0, 1fr) 72px;
  grid-template-areas:
    "hero rules"
    "full rules"
    "talk rules";
}
html[data-theme="light"] .v3-wish {
  --w-glass: rgba(255, 255, 255, 0.78);
  --w-inner: rgba(245, 243, 238, 0.7);
  --w-solid: #ffffff;
  --w-line: var(--line-2);
  --w-hair: var(--line);
  --w-sheen: linear-gradient(150deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 42%);
  --w-shadow: 0 12px 40px rgba(60, 50, 30, 0.16);
}
.v3-wish-hero { grid-area: hero; }
.v3-wish-full { grid-area: full; }
.v3-wish-talk { grid-area: talk; }
.v3-wish-news { grid-area: news; }
.v3-wish-rules { grid-area: rules; }

.v3-wish-window {
  position: relative;
  min-width: 0;
  background: var(--w-sheen), var(--w-glass);
  border: 1px solid var(--w-line);
  border-radius: 14px;
  box-shadow: var(--w-shadow);
  -webkit-backdrop-filter: blur(14px) saturate(1.05);
  backdrop-filter: blur(14px) saturate(1.05);
}
/* Without backdrop blur the picture would show through the text. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .v3-wish { --w-glass: rgba(14, 17, 22, 0.9); }
  html[data-theme="light"] .v3-wish { --w-glass: rgba(255, 255, 255, 0.94); }
}
/* Text that is read out but not shown. */
.v3-wish-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.v3-wish .identicon { display: block; border-radius: 50%; }

/* ---- centre 1: the presentation ----------------------------------------------- */
/* Above the windows that follow it, so a team's card can hang below its edge. */
.v3-wish-hero {
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1fr);
  grid-template-areas:
    "cover pitch"
    "teams teams";
  gap: 16px 22px;
  align-items: center;
  padding: 16px;
}
.v3-wish-cover {
  --v3-wish-accent: var(--line-3);
  grid-area: cover;
  position: relative;
  margin: 0;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 10px;
  background: var(--bg-deep);
  box-shadow: 0 0 0 1px var(--v3-wish-accent), 0 10px 30px rgba(0, 0, 0, 0.45);
}
.v3-wish-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Same eight accents as the realm tiles (v3-tiles.css). */
.v3-wish-cover[data-hue="0"] { --v3-wish-accent: #8fc9bf; }
.v3-wish-cover[data-hue="1"] { --v3-wish-accent: #e8c987; }
.v3-wish-cover[data-hue="2"] { --v3-wish-accent: #e08d61; }
.v3-wish-cover[data-hue="3"] { --v3-wish-accent: #a9b8ff; }
.v3-wish-cover[data-hue="4"] { --v3-wish-accent: #86c9a9; }
.v3-wish-cover[data-hue="5"] { --v3-wish-accent: #9fd6b8; }
.v3-wish-cover[data-hue="6"] { --v3-wish-accent: #9fb4c8; }
.v3-wish-cover[data-hue="7"] { --v3-wish-accent: #c49a55; }

.v3-wish-pitch { grid-area: pitch; min-width: 0; }
.v3-wish-eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
}
.v3-wish-kind { color: var(--gold); }
.v3-wish-eyebrow a { color: var(--ink-2); }
.v3-wish-eyebrow a:hover { color: var(--gold-bright); text-decoration: none; }
.v3-wish-state {
  padding: 2px 9px;
  border: 1px solid var(--gold-dim);
  border-radius: 999px;
  background: var(--gold-bg);
  color: var(--gold);
  letter-spacing: .08em;
}
.v3-wish-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(24px, 2.4vw, 34px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -.012em;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.v3-wish-summary { margin: 0 0 10px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
/* Who is behind the wish: the wisher and, on a derivative wish, the place of
   the original work's owner. */
.v3-wish-people {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin: 0 0 14px;
  font-size: var(--fs-meta);
  color: var(--ink-2);
}
.v3-wish-wisher,
.v3-wish-owner { display: inline-flex; align-items: center; gap: 7px; }
.v3-wish-when { color: var(--ink-3); }
.v3-wish-owner { position: relative; }
/* Awaited: an empty, dashed place with an hourglass. */
.v3-wish-owner--awaited { cursor: help; color: var(--ink-2); }
.v3-wish-owner--awaited:focus { outline: none; }
.v3-wish-owner-pic {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 24px;
  height: 24px;
  border: 1px dashed var(--rose);
  border-radius: 50%;
  color: var(--rose);
}
.v3-wish-owner-name {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.v3-wish-owner--awaited:hover .v3-wish-owner-pic,
.v3-wish-owner--awaited:focus .v3-wish-owner-pic { border-style: solid; box-shadow: 0 0 0 2px var(--gold-bg); }
.v3-wish-person { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 600; vertical-align: middle; }
.v3-wish-person:hover { color: var(--gold-bright); text-decoration: none; }

/* The life of the wish: five dots on a line. */
.v3-wish-steps {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  max-width: 440px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}
.v3-wish-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
/* The line from the step before. */
.v3-wish-step + .v3-wish-step::before {
  content: "";
  position: absolute;
  top: 6px;
  right: calc(50% + 9px);
  width: calc(100% - 18px);
  height: 2px;
  background: var(--w-hair);
}
.v3-wish-step--done + .v3-wish-step::before { background: var(--gold-dim); }
.v3-wish-step-dot {
  box-sizing: border-box;
  width: 14px;
  height: 14px;
  border: 2px solid var(--line-3);
  border-radius: 50%;
  background: transparent;
}
.v3-wish-step--done { color: var(--ink-2); }
.v3-wish-step--done .v3-wish-step-dot { border-color: var(--gold); background: var(--gold); }
.v3-wish-step--next { color: var(--gold); }
.v3-wish-step--next .v3-wish-step-dot { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-bg); }

/* ---- buttons, counts ----------------------------------------------------------- */
.v3-wish-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.v3-wish-actions form { margin: 0; }
.v3-wish-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 38px;
  padding: 7px 18px;
  border: 1px solid var(--control-line);
  border-radius: 999px;
  background: var(--w-inner);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.v3-wish-btn:hover { border-color: var(--gold); color: var(--gold-bright); text-decoration: none; }
.v3-wish-btn--primary { border-color: var(--gold); background: var(--gold); color: #17130A; }
.v3-wish-btn--primary:hover { border-color: var(--gold-bright); background: var(--gold-bright); color: #17130A; }
html[data-theme="light"] .v3-wish-btn--primary,
html[data-theme="light"] .v3-wish-btn--primary:hover { color: #FFFFFF; }
.v3-wish-btn--on { border-color: var(--gold-dim); background: var(--gold-bg); color: var(--gold); }
.v3-wish-btn--on::before { content: "✓"; }
.v3-wish-btn--small { min-height: 0; padding: 5px 14px; font-size: var(--fs-meta); }
.v3-wish-btn-count {
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  font-weight: 500;
}
.v3-wish-btn--on .v3-wish-btn-count { background: transparent; border: 1px solid var(--gold-dim); }
.v3-wish-tally { font-size: var(--fs-meta); color: var(--ink-2); }
.v3-wish-tally-num { font-family: var(--font-display); font-size: 18px; color: var(--ink); }
.v3-wish-tally--pool { margin-left: auto; }
.v3-wish-tally--pool .v3-wish-tally-num { color: var(--money); }

/* ---- cards: what a face or a rule shows when pointed at ---------------------------
   Hidden until its owner is hovered, focused, or holds the focus (a link inside
   it). The card touches its owner with no gap, so the pointer can travel from
   one into the other; the visible panel is inset by the card's own padding. */
.v3-wish-card {
  display: none;
  position: absolute;
  z-index: 5;
  box-sizing: border-box;
}
.v3-wish-card > *,
.v3-wish-card--rule { margin: 0; }
.v3-wish-face:hover > .v3-wish-card,
.v3-wish-face:focus > .v3-wish-card,
.v3-wish-face:focus-within > .v3-wish-card,
.v3-wish-rule:hover > .v3-wish-card,
.v3-wish-rule:focus > .v3-wish-card,
.v3-wish-rule:focus-within > .v3-wish-card,
.v3-wish-owner:hover > .v3-wish-card,
.v3-wish-owner:focus > .v3-wish-card { display: block; }
.v3-wish-card-tag {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid var(--gold-dim);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---- the teams: a row of faces --------------------------------------------------- */
.v3-wish-teams {
  grid-area: teams;
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 50px;
  padding-top: 12px;
  border-top: 1px solid var(--w-hair);
  scroll-margin-top: calc(var(--topbar-h) + 12px);
}
.v3-wish-teams-label {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--ink-2);
}
.v3-wish-faces { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.v3-wish-face,
.v3-wish-face-more { display: block; border-radius: 50%; }
.v3-wish-face { cursor: pointer; }
.v3-wish-face-pic {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 50px;
  height: 50px;
  border: 2px solid var(--line-3);
  border-radius: 50%;
  background: var(--w-inner);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
}
a.v3-wish-face-pic:hover { border-color: var(--gold); color: var(--gold-bright); text-decoration: none; }
.v3-wish-face--chosen .v3-wish-face-pic { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-bg); }
.v3-wish-face--making .v3-wish-face-pic { border-color: var(--green); }
.v3-wish-face--gone .v3-wish-face-pic { border-style: dashed; }
.v3-wish-face--gone .identicon { opacity: .4; }
.v3-wish-face:hover .v3-wish-face-pic,
.v3-wish-face:focus .v3-wish-face-pic { box-shadow: 0 0 0 2px var(--gold); }
.v3-wish-face:focus { outline: none; }
/* How many people are in the team. */
.v3-wish-face-size {
  position: absolute;
  right: -4px;
  bottom: -4px;
  min-width: 18px;
  height: 18px;
  box-sizing: border-box;
  padding: 0 4px;
  border: 1px solid var(--w-line);
  border-radius: 999px;
  background: var(--w-solid);
  font-size: var(--fs-micro);
  line-height: 16px;
  text-align: center;
  color: var(--ink);
}
/* A team's card opens under the row, always in the same place. */
.v3-wish-face > .v3-wish-card {
  left: 0;
  top: 100%;
  width: min(440px, 100%);
  padding-top: 8px;
  cursor: auto;
}
.v3-wish-face > .v3-wish-card::before,
.v3-wish-card--owner::before,
.v3-wish-card--rule::before {
  content: "";
  position: absolute;
  inset: 8px 0 0;
  z-index: -1;
  border: 1px solid var(--w-line);
  border-radius: 12px;
  background: var(--w-solid);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
}
.v3-wish-face > .v3-wish-card > * { padding: 0 16px; }
.v3-wish-face > .v3-wish-card > :first-child { padding-top: 14px; }
.v3-wish-face > .v3-wish-card > :last-child { padding-bottom: 14px; }
.v3-wish-card-state { font-size: var(--fs-meta); color: var(--ink-2); }
.v3-wish-card-title { margin-top: 8px; font-family: var(--font-display); font-size: 18px; line-height: 1.3; }
.v3-wish-card-title a { color: var(--ink); }
.v3-wish-card-title a:hover { color: var(--gold); text-decoration: none; }
.v3-wish-card-who { margin-top: 2px; font-size: var(--fs-meta); color: var(--ink-2); }
.v3-wish-card-who a { color: var(--ink); }
.v3-wish-card-who a:hover { color: var(--gold-bright); }
.v3-wish-card-pitch { margin-top: 8px; font-size: var(--fs-body); line-height: 1.55; color: var(--ink-2); }

/* ---- right side: the contract as picture circles -------------------------------- */
.v3-wish-rules {
  position: sticky;
  top: calc(var(--topbar-h) + 14px);
  z-index: 3;
  padding: 12px 0 14px;
  /* The cards hang out to the left, over the centre. */
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: var(--w-sheen), rgba(14, 17, 22, 0.86);
}
html[data-theme="light"] .v3-wish-rules { background: rgba(255, 255, 255, 0.92); }
.v3-wish-side-h {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.v3-wish-rules .v3-wish-side-h { text-align: center; }
.v3-wish-rule-list { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 0; padding: 0; list-style: none; }
.v3-wish-rule { position: relative; display: block; border-radius: 50%; cursor: help; }
.v3-wish-rule:focus { outline: none; }
.v3-wish-rule-pic {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 46px;
  height: 46px;
  border: 1px solid var(--control-line);
  border-radius: 50%;
  background: var(--w-inner);
  color: var(--ink);
}
.v3-wish-rule:hover .v3-wish-rule-pic,
.v3-wish-rule:focus .v3-wish-rule-pic { border-color: var(--gold); color: var(--gold-bright); box-shadow: 0 0 0 2px var(--gold-bg); }
.v3-wish-rule--held .v3-wish-rule-pic { border-color: var(--rose); color: var(--rose); }
.v3-wish-rule-num { font-family: var(--font-mono); font-size: var(--fs-meta); font-weight: 500; }
/* A rule's card opens to the left of its circle. */
.v3-wish-card--rule {
  right: 100%;
  top: 50%;
  width: 300px;
  padding: 8px 18px 8px 0;
  transform: translateY(-50%);
  cursor: auto;
}
.v3-wish-card--rule::before { inset: 0 10px 0 0; }
.v3-wish-card--rule > * { display: block; margin: 0 26px 0 16px; }
.v3-wish-card--rule > :first-child { display: inline-block; margin-top: 12px; }
.v3-wish-card--rule > :last-child { margin-bottom: 12px; }
.v3-wish-card-rule { margin-top: 8px; font-size: var(--fs-body); line-height: 1.5; color: var(--ink); }
.v3-wish-card-link { margin-top: 6px; font-size: var(--fs-meta); color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ---- left side: announcements and threads ----------------------------------------- */
.v3-wish-news {
  position: sticky;
  top: calc(var(--topbar-h) + 14px);
  padding: 14px 14px 12px;
}
.v3-wish-news-list { display: flex; flex-direction: column; gap: 4px; margin: 0 -6px 10px; padding: 0; list-style: none; }
.v3-wish-news-item { display: block; padding: 8px 6px; border-radius: 8px; color: var(--ink-2); }
.v3-wish-news-item:hover { background: var(--w-inner); text-decoration: none; }
.v3-wish-news-who { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: var(--fs-meta); }
.v3-wish-news-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-weight: 600; }
.v3-wish-news-when { margin-left: auto; flex: 0 0 auto; color: var(--ink-3); }
.v3-wish-news-text {
  display: -webkit-box;
  margin-top: 4px;
  overflow: hidden;
  font-size: var(--fs-body);
  line-height: 1.45;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.v3-wish-mark {
  flex: 0 0 auto;
  padding: 0 6px;
  border: 1px solid var(--line-3);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.v3-wish-mark--wisher { border-color: var(--gold-dim); color: var(--gold); }
/* The recognised owner of the work: a gold tag with a crown. */
.v3-wish-mark--owner {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-color: var(--gold);
  background: var(--gold-bg);
  color: var(--gold-bright);
}
.v3-wish-mark--owner .v3-wish-rule-svg { flex: 0 0 auto; }
/* The awaited owner's card opens under their place. */
.v3-wish-card--owner {
  left: 0;
  top: 100%;
  width: 300px;
  padding-top: 8px;
  font-family: var(--font-ui);
  letter-spacing: 0;
  text-transform: none;
  cursor: auto;
}
.v3-wish-card--owner > * { display: block; margin: 0 16px; }
.v3-wish-card--owner > :first-child { display: inline-block; margin-top: 20px; }
.v3-wish-card--owner > :last-child { margin-bottom: 12px; }
.v3-wish-threads { display: flex; flex-direction: column; gap: 2px; margin: 0 -6px; padding: 8px 0 0; border-top: 1px solid var(--w-hair); list-style: none; }
.v3-wish-thread { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 8px; color: var(--ink-2); font-size: var(--fs-meta); }
.v3-wish-thread:hover { background: var(--w-inner); color: var(--gold-bright); text-decoration: none; }
.v3-wish-thread--main { color: var(--ink); font-weight: 600; }
.v3-wish-thread-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v3-wish-thread-count { flex: 0 0 auto; font-family: var(--font-mono); color: var(--ink-3); }

/* ---- centre 2: the wish in full ----------------------------------------------------- */
.v3-wish-full { padding: 18px 22px; }
.v3-wish-body { max-width: 76ch; font-size: 15px; color: var(--ink); }
.v3-wish-body > :last-child { margin-bottom: 0; }
.v3-wish-terms { scroll-margin-top: calc(var(--topbar-h) + 12px); }
.v3-wish-body + .v3-wish-terms { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--w-hair); }
.v3-wish-sub { margin: 0 0 8px; font-family: var(--font-mono); font-size: var(--fs-label); font-weight: 500; letter-spacing: var(--ls-caps); text-transform: uppercase; color: var(--ink-2); }
.v3-wish-terms .v3-prose > :last-child { margin-bottom: 0; }
.v3-wish-empty { margin: 0; font-size: var(--fs-body); color: var(--ink-2); }

/* ---- centre 3: discussion -------------------------------------------------------------- */
.v3-wish-talk { padding: 16px 22px 20px; scroll-margin-top: calc(var(--topbar-h) + 12px); }
.v3-wish-talk-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.v3-wish-h { display: flex; align-items: baseline; gap: 10px; margin: 0; font-family: var(--font-display); font-size: 20px; font-weight: 500; color: var(--ink); }
.v3-wish-h-count { font-family: var(--font-mono); font-size: var(--fs-meta); color: var(--ink-3); }
.v3-wish-posts { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.v3-wish-post { padding: 12px 16px; background: var(--w-inner); border: 1px solid var(--w-hair); border-radius: var(--radius); }
.v3-wish-post-head { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: var(--fs-meta); color: var(--ink-2); }
.v3-wish-post-when { margin-left: auto; color: var(--ink-3); }
.v3-wish-post-body { max-width: 76ch; color: var(--ink); }
.v3-wish-post-body > :last-child { margin-bottom: 0; }

/* ---- narrower screens --------------------------------------------------------------------
   Under 1180px the two sides come into the column, in source order: the
   presentation, the contract as a strip of circles, the announcements, the
   wish in full, the discussion. Cards open under what they belong to. */
@media (max-width: 1180px) {
  .v3-wish,
  .v3-wish--no-news { display: flex; flex-direction: column; gap: 12px; padding-top: 14px; }
  .v3-wish-rules,
  .v3-wish-news { position: relative; top: auto; }
  .v3-wish-rules { display: flex; align-items: center; gap: 14px; padding: 10px 14px; }
  .v3-wish-rules .v3-wish-side-h { margin: 0; }
  .v3-wish-rule-list { flex-direction: row; flex-wrap: wrap; }
  .v3-wish-rule { position: static; }
  .v3-wish-card--rule {
    left: 0;
    right: 0;
    top: 100%;
    width: auto;
    padding: 8px 0 0;
    transform: none;
  }
  .v3-wish-card--rule::before { inset: 8px 0 0; }
  .v3-wish-card--rule > * { margin: 0 16px; }
  .v3-wish-card--rule > :first-child { margin-top: 20px; }
}
@media (max-width: 720px) {
  .v3-wish-hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "cover"
      "pitch"
      "teams";
    gap: 14px;
    padding: 12px;
  }
  .v3-wish-tally--pool { margin-left: 0; }
  .v3-wish-full { padding: 14px; }
  .v3-wish-talk { padding: 14px; }
  .v3-wish-face-pic { width: 46px; height: 46px; }
}

/* ==========================================================================
   Making a wish (/make-a-wish): one form on the wish page's glass, no account
   needed. Every field has a label; a problem is said beside its field and once
   more at the top, with a link to the field.
   ========================================================================== */
.v3-makewish {
  --w-glass: rgba(16, 20, 26, 0.72);
  --w-inner: rgba(8, 11, 15, 0.55);
  width: min(720px, 100%);
  margin: 28px auto 56px;
  padding: 28px 30px 30px;
  border: 1px solid rgba(232, 201, 135, 0.26);
  border-radius: 18px;
  background: var(--w-glass);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 18px 60px rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
html[data-theme="light"] .v3-makewish {
  --w-glass: rgba(255, 255, 255, 0.92);
  --w-inner: rgba(255, 255, 255, 0.96);
  border-color: var(--line-2);
  box-shadow: 0 12px 40px rgba(20, 16, 8, 0.12);
}
.v3-makewish-head { margin-bottom: 22px; }
.v3-makewish-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
}
.v3-makewish-lead { margin: 8px 0 0; font-size: 14px; color: var(--ink-2); }
.v3-makewish-form { display: flex; flex-direction: column; gap: 18px; }
.v3-makewish-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.v3-makewish-field > label,
.v3-makewish-field > legend {
  padding: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.v3-makewish-field > legend { margin-bottom: 6px; }
.v3-makewish-optional { font-weight: 400; color: var(--ink-3); }
.v3-makewish-field input[type="text"],
.v3-makewish-field input[type="email"],
.v3-makewish-field input[type="password"],
.v3-makewish-field textarea,
.v3-makewish-field select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--control-line);
  border-radius: 10px;
  background: var(--w-inner);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
}
.v3-makewish-field textarea { resize: vertical; min-height: 110px; }
.v3-makewish-field select { appearance: auto; }
.v3-makewish-field input[type="text"]::placeholder,
.v3-makewish-field textarea::placeholder { color: var(--ink-3); opacity: 1; }
.v3-makewish-field input:focus-visible,
.v3-makewish-field textarea:focus-visible,
.v3-makewish-field select:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--gold);
}
.v3-makewish-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  font-size: 13.5px;
  color: var(--ink);
  cursor: pointer;
}
.v3-makewish-check input { width: 18px; height: 18px; accent-color: var(--gold); }
/* The drawn covers to choose from: each is a radio button that lies over its picture,
   so the picture is what is pressed, by a finger, a pointer or the space bar. */
.v3-makewish-pick {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line-3);
  border-radius: 6px;
  aspect-ratio: 4 / 3;
  cursor: pointer;
}
.v3-makewish-pick input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.v3-makewish-pick img { display: block; width: 100%; height: 100%; object-fit: cover; }
.v3-makewish-pick:has(input:checked) { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.v3-makewish-pick:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 3px; }
.v3-makewish-choice:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }
.v3-makewish-based > label[for] { margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--ink); }
.v3-makewish-hint { margin: 0; font-size: 12px; line-height: 1.5; color: var(--ink-3); }
.v3-makewish-problem { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--rose); }
.v3-makewish-field.has-problem input,
.v3-makewish-field.has-problem textarea,
.v3-makewish-field.has-problem select { border-color: var(--rose); }
.v3-makewish-alert {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--rose);
  border-radius: 10px;
  background: rgba(232, 122, 148, 0.08);
  font-size: 13px;
  color: var(--ink);
}
.v3-makewish-alert p { margin: 0 0 4px; font-weight: 600; }
.v3-makewish-alert ul { margin: 0; padding-left: 18px; }
.v3-makewish-alert a { color: var(--ink); text-decoration: underline; }
.v3-makewish-send { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
.v3-makewish-send .v3-wish-btn { min-height: 44px; padding: 9px 24px; font-size: 15px; }
.v3-makewish-send .v3-makewish-hint { flex: 1 1 240px; }
.v3-makewish-closed {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--gold-line);
  border-radius: 10px;
  background: var(--gold-bg);
  font-size: 14px;
  color: var(--ink);
}
.v3-makewish-closed-more { margin: 14px 0 0; font-size: 14px; }
.v3-makewish-closed-more a { color: var(--gold); }
/* The honeypot: a field people never see and robots fill in. */
.v3-makewish-hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
@media (max-width: 640px) {
  .v3-makewish { margin: 14px 10px 40px; width: auto; padding: 20px 16px 22px; border-radius: 14px; }
  .v3-makewish-title { font-size: 25px; }
}

/* ==========================================================================
   The pages of an account (/register, /login, /confirm-email, /forgot-password,
   /reset-password): the same form on the same glass, narrower. A form a password
   is typed into is hidden until the page's script shows it (static/sign-in.js).
   ========================================================================== */
.v3-account { width: min(460px, 100%); }
.v3-makewish-form[hidden] { display: none; }
.v3-account-status { margin: 0; min-height: 20px; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.v3-account-status.is-problem { font-weight: 600; color: var(--rose); }
.v3-account-more { margin: 20px 0 0; font-size: 14px; color: var(--ink-2); }
.v3-account-more a,
.v3-account .v3-makewish-hint a { color: var(--gold); }
.v3-account .v3-makewish-closed + .v3-account-more { margin-top: 16px; }

/* /settings: the account of whoever is logged in, on the same glass. */
.v3-settings { width: min(560px, 100%); }
.v3-settings .v3-makewish-closed { margin-bottom: 20px; }
.v3-settings-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 18px;
  margin: 0 0 6px;
  font-size: 14px;
}
.v3-settings-facts dt { color: var(--ink-2); }
.v3-settings-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; color: var(--ink); font-weight: 600; }
.v3-settings-part { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line-2); }
.v3-settings-part h2 { margin: 0 0 6px; font-size: 16px; font-weight: 700; color: var(--ink); }
.v3-settings-part .v3-makewish-hint { margin-bottom: 14px; font-size: 13px; }
.v3-settings-part .v3-wish-btn { min-height: 44px; }

/* The profiles of an account, in the settings: each with who sees it and the button
   that changes that, then the form that adds one. */
.v3-settings-profiles { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 10px; }
.v3-settings-profiles li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
}
.v3-settings-profile { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.v3-settings-profile a { color: var(--ink); font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.v3-settings-profile a:hover { color: var(--gold-bright); text-decoration: none; }
.v3-settings-kind { font-size: 13px; color: var(--ink-2); }
.v3-settings-add { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.v3-settings-add .v3-makewish-field { width: 100%; }
.v3-settings-add .v3-makewish-hint { margin-bottom: 0; }
.v3-settings-add fieldset { margin: 0; padding: 0; border: 0; }
.v3-makewish-check input[type="radio"] { width: 18px; height: 18px; accent-color: var(--gold); }

/* The form to make a wish, for someone who is logged in: which profile makes it. */
.v3-makewish-as { margin: 0; padding: 0; border: 0; }
.v3-makewish-as .v3-makewish-hint { font-size: 13px; }
.v3-makewish-as .v3-makewish-hint b { color: var(--ink); font-weight: 600; }
.v3-makewish-as .v3-makewish-check { align-items: flex-start; min-height: 0; margin-top: 6px; }
.v3-makewish-as .v3-makewish-check input { flex: none; margin-top: 2px; }

/* A wish shown without a name, and the line only its maker sees. */
.v3-wish-person--unnamed { color: var(--ink-2); font-weight: 500; }
.v3-wish-own { flex-basis: 100%; margin: 6px 0 0; font-size: 13px; color: var(--ink-2); }
.v3-wish-own a { color: var(--gold); }

/* A profile's page: its name over the wishes made as it. */
.v3-profile { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.v3-profile-head {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--panel);
}
.v3-profile-face { flex: none; display: inline-flex; border-radius: 12px; overflow: hidden; }
.v3-profile-who { min-width: 0; }
.v3-profile-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.v3-profile-note { margin: 8px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.v3-profile-note a { color: var(--gold); }
@media (max-width: 700px) {
  .v3-profile-head { padding: 16px; gap: 14px; }
  .v3-profile-name { font-size: 22px; }
}

/* Per-profile watchlists (/watchlist, /cr/<handle>, and the wish page Watch picker). */
.v3-watchlist-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.v3-watchlist-subtabs { margin-top: -4px; padding-bottom: 4px; }
.v3-watched-cards { display: grid; gap: 12px; }
.v3-watched-card {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 18px;
  padding: 14px 16px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--panel);
}
.v3-watched-main { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1 1 260px; }
.v3-watched-meta { margin: 0; font-size: 12.5px; color: var(--ink-2); }
.v3-watched-meta a { color: var(--gold); }
.v3-watched-badge {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 600;
}
.v3-watched-lists { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-2); }
.v3-watched-lists a { color: var(--gold); }
.v3-watched-remove { flex: none; }
.v3-watchlist-row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.v3-watch-picker { position: relative; display: inline-block; }
.v3-watch-picker > summary { list-style: none; cursor: pointer; }
.v3-watch-picker > summary::-webkit-details-marker { display: none; }
.v3-watch-picker-panel {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 20;
  min-width: 220px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.v3-watch-picker-panel form,
.v3-watch-picker-panel .v3-wish-btn { width: 100%; justify-content: flex-start; }
.v3-watch-picker-manage { font-size: 12.5px; color: var(--gold); padding: 4px 2px 0; }
