/**
 * Component styles.
 *
 * Numbers come from designAI/README.md, which is authoritative for 籤堂, 擲筊, 籤詩 and 籤筒鋪.
 * Everything is expressed through the tokens in tokens.css — no literal colours, no raw spacing.
 *
 * The phone chrome in the screenshots is presentation only. The app is the 428-wide area inside.
 */

.screen {
  max-width: 428px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: var(--screen-pad);
  display: flex;
  flex-direction: column;
}

/* ---------------------------------------------------------------- almanac + plaque */

.almanac {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-16);
  padding-bottom: var(--s-9);
  border-bottom: 1px solid var(--hair-35);
  font-size: 11px;
}
.almanac__no {
  font-weight: 600;
  letter-spacing: var(--ls-poem);
  text-transform: uppercase;
  color: var(--gold);
}
.almanac__date {
  color: var(--ink-3);
}

.plaque {
  margin-top: var(--s-22);
  border: 1px solid var(--gold);
  border-radius: var(--r);
  background: var(--fill-10);
  padding: var(--s-20) var(--s-18);
  display: flex;
  align-items: center;
  gap: var(--s-16);
}
.plaque__side {
  writing-mode: vertical-rl;
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: var(--ls-plaque-side);
  color: var(--gold-lt);
}
.plaque__title {
  flex: 1;
  text-align: center;
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 46px;
  line-height: 1.05;
  letter-spacing: var(--ls-plaque);
  color: var(--ink);
}
.plaque__seal {
  text-decoration: none;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 1px solid var(--gold);
  border-radius: var(--r-seal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 19px;
  color: var(--gold-lt);
}
/* The seal is the door to 側殿, and nothing else on 籤堂 is tappable-but-unlabelled — so it
   carries the ember. Only the link form glows: a decorative seal (a shared poem's landing
   page, say) must not promise a tap it cannot honour. */
a.plaque__seal {
  border-color: var(--gold-lt);
  box-shadow: var(--shadow-ember);
}
a.plaque__seal:hover {
  background: var(--fill-12);
}

.subhead {
  text-align: center;
  color: var(--gold);
  font-size: 13px;
  line-height: 1.5;
  margin: var(--s-13) 0 0;
}

/* ---------------------------------------------------------------- entry cards */

.entries {
  display: grid;
  gap: var(--s-11);
  margin-top: var(--s-22);
}
.entry {
  display: block;
  /* These read as outlined buttons, not as prose links. An underline fights the gold hairline
     border and makes the Chinese noticeably harder to read at 13px. */
  text-decoration: none;
  text-align: left;
  padding: var(--s-20);
  border-radius: var(--r);
  background: transparent;
  border: 1px solid var(--hair-40);
  color: var(--ink);
  font-family: inherit;
  cursor: pointer;
}
.entry:hover {
  background: var(--fill-12);
}
.entry--primary {
  border-color: var(--gold-lt);
  color: var(--gold-lt);
}
.entry--primary:hover {
  background: var(--hover-gold-lt);
}
.entry__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-9);
}
.entry__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: 28px;
  line-height: 1;
}
.entry__kicker {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: var(--ls-kicker-sm);
  text-transform: uppercase;
}
.entry:not(.entry--primary) .entry__kicker {
  color: var(--gold);
}
.entry__body {
  font-size: 13px;
  margin: var(--s-6) 0 0;
  opacity: 0.85;
}
.entry:not(.entry--primary) .entry__body {
  color: var(--ink-2);
  opacity: 1;
}

/* Phases 2 and 4. A card that navigates to a 404 is worse than a card that says it is not
   open yet, so these are rendered as plain divs — not disabled links, which still take focus
   and still look clickable. Same box, no hover, no cursor. */
.entry--soon,
.shoprow--soon {
  cursor: default;
  opacity: 0.55;
}
.entry--soon:hover,
.shoprow--soon:hover {
  background: transparent;
}
.entry--soon .entry__kicker,
.shoprow--soon .shoprow__more {
  color: var(--ink-2);
}

.shoprow {
  text-decoration: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: var(--s-18);
  padding: var(--s-13) var(--s-18);
  border-radius: var(--r);
  background: var(--fill-14);
  border: 1px solid var(--hair-35);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.shoprow:hover {
  background: var(--fill-24);
}
.shoprow__more {
  font-size: 11px;
  letter-spacing: var(--ls-kicker-xs);
  text-transform: uppercase;
  color: var(--gold);
}

.footnote {
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-4);
  margin: var(--s-16) 0 0;
}

/* ---------------------------------------------------------------- ritual */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-9);
}
.ghostbtn {
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: var(--ls-kicker);
  text-transform: uppercase;
  color: var(--ink-3);
  cursor: pointer;
}
.stagechip {
  padding: 5px var(--s-11);
  border-radius: var(--r);
  background: var(--fill-18);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: var(--ls-kicker);
  text-transform: uppercase;
  color: var(--gold-lt);
}

/* The altar. `.niche` is the element the player measures: its height is 1000‰h, so every
   manifest renders correctly at any screen size without knowing anything about pixels. */
.altar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-16);
  position: relative;
  overflow: hidden;
}
.altar__halo {
  position: absolute;
  width: 320px;
  height: 320px;
  left: 50%;
  top: 150px;
  margin-left: -160px;
  border-radius: 50%;
  background: var(--fill-14);
  opacity: 0.45;
  pointer-events: none;
}

.shrine {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-6);
  flex: 0 0 auto;
}
.niche {
  width: 104px;
  height: 104px;
  padding: var(--s-11) 0 var(--s-13);
  border-radius: var(--r);
  background: var(--fill-08);
  border: 1px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
/* The keeper's parts are absolutely positioned inside the niche; the player writes transforms
   onto them. A glyph keeper has exactly one. */
.part {
  position: absolute;
  will-change: transform;
}
.glyph {
  width: 56px;
  height: 56px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 28px;
  color: var(--gold-lt);
}
.shrine__name {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: var(--ls-kicker-xs);
  color: var(--gold-lt);
}
.shrine__step {
  width: 126px;
  height: 7px;
  background: var(--gold);
  opacity: 0.55;
}

/* ---------------------------------------------------------------- the stage

   One stage, three props, one rule: the beat's own prop stands in the middle at full size and
   the other two shrink to their corner — 香爐 上, 筊 左, 籤筒 右. All three are always
   present, so nothing on this screen appears or vanishes; it takes its turn.

   Everything is absolute on one ground line and moves by transform alone. That is what lets
   all three move at once: nothing reflows, so no move can shove another sideways, and a
   transform is the only thing that could have been transitioned in the first place. */
.stage {
  position: relative;
  width: 100%;
  /* Tall enough for the tallest thing that ever stands here: the tube at its own beat is
     130px of box plus 10px of stick poking out of the top, scaled 1.3 — 182px — and the
     censer has to park clear above that. See the arithmetic on .tube below. */
  height: 288px;
  z-index: 1;
}
.stage > * {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform-origin: bottom center;
  transition:
    transform var(--t-shake) var(--ease-overshoot),
    opacity var(--t-shake) linear;
}

/* Measured, never drawn — see the note in ritual.html. */
.unitrod {
  position: absolute;
  width: 0;
  height: 104px;
  pointer-events: none;
}

/* --- the three parking spaces. Same scale for all of them, so a prop that has stepped aside
       always reads as the same distance away whichever one it is. --- */
.censer {
  width: 190px;
  margin-left: -95px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-16);
}
.blocks {
  width: 130px;
  margin-left: -65px;
  display: flex;
  gap: var(--s-22);
  height: 76px;
  align-items: flex-end;
  perspective: 620px;
}
.tube {
  width: 88px;
  height: 130px;
  margin-left: -44px;
}

/* 一 · 上香 — the censer has the middle. */
[data-stage="incense"] .blocks {
  transform: translateX(-128px) scale(0.42);
  opacity: 0.55;
}
[data-stage="incense"] .tube {
  transform: translateX(128px) scale(0.42);
  opacity: 0.55;
}

/* 二 · 擲筊 — the blocks have it. */
[data-stage="cast"] .censer {
  transform: translateY(-198px) scale(0.46);
  opacity: 0.65;
}
[data-stage="cast"] .tube {
  transform: translateX(128px) scale(0.42);
  opacity: 0.55;
}

/* 三 · 搖籤 — the tube has it, and grows past full size because it is the smallest of the
   three and would otherwise take the middle looking like it had lost an argument.

   The scale is not free to choose. The tube's sticks overflow its own box by 10px, so it is
   really 140px tall, and at 1.3 that is 182px — which is why the censer parks at 198px and
   the stage is 288px. Raise this number and the incense ends up growing out of the tube. */
[data-stage="draw"] .censer {
  transform: translateY(-198px) scale(0.46);
  opacity: 0.65;
}
[data-stage="draw"] .blocks {
  transform: translateX(-128px) scale(0.42);
  opacity: 0.55;
}
[data-stage="draw"] .tube {
  transform: scale(1.3);
}

.incense {
  display: flex;
  gap: var(--s-16);
  align-items: flex-end;
  margin-bottom: -6px;
  z-index: 1;
}
.stick {
  width: 3px;
  height: 78px;
  background: var(--incense-unlit);
  position: relative;
  transition: height 400ms ease-out;
}
.stick--lit {
  background: linear-gradient(var(--gold), var(--gold-dk));
}
.stick--lit::after {
  content: "";
  position: absolute;
  top: -9px;
  left: -2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: var(--shadow-ember);
}

.burner {
  width: 190px;
  height: 74px;
  border-radius: 4px 4px 7px 7px;
  background: var(--fill-10);
  border: 1px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 26px;
  letter-spacing: var(--ls-burner);
  color: var(--gold-lt);
  z-index: 1;
}

.block {
  /* 64:90, matching the viewBox. A real 筊 is a split bamboo root: the belly is half the
     length of the piece, and the inner edge is properly hollow rather than nearly straight. */
  width: 54px;
  height: 76px;
  will-change: transform;
}
.block svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.block path {
  fill: none;
  stroke: var(--gold);
  /* The tips of a real 筊 are blunt, not pointed. A round join on a stroked path blunts them
     at every size without a second set of control points. */
  stroke-width: 2.5;
  stroke-linejoin: round;
}
.block--flat path {
  fill: var(--gold-lt);
  stroke: var(--gold-dk);
}
/* The pair mirrors, the way a split root does. Mirroring the SVG and not the .block leaves
   the element's own transform free — the toss writes to it every frame. */
.block:first-child svg {
  transform: scaleX(-1);
}

/* Parked in its corner, the pair always shows 聖筊 — one solid, one hollow.
   Two hollows is 陰筊 and two solids is 笑筊, so a pair sitting idle in either of those
   states is the altar quietly displaying a refusal nobody asked for. 聖筊 is the only
   arrangement that reads as「the blocks are waiting」rather than as an answer, and it is
   also what the prop looks like in a temple: laid down open.

   Written against the two stages that are not 擲筊 rather than against `:not([cast])`,
   so that the moment the blocks take the middle the flight owns their faces again. */
[data-stage="incense"] .blocks .block:first-child path,
[data-stage="draw"] .blocks .block:first-child path {
  fill: var(--gold-lt);
  stroke: var(--gold-dk);
}
[data-stage="incense"] .blocks .block:last-child path,
[data-stage="draw"] .blocks .block:last-child path {
  fill: none;
  stroke: var(--gold);
}
/* 籤筒 — beat three. Not in designAI's handoff; added so the tube has a moment on stage. */.tube__body {
  position: absolute;
  inset: auto 0 0 0;
  height: 108px;
  border: 1px solid var(--gold-lt);
  border-radius: 5px 5px 3px 3px;
  background: linear-gradient(180deg, var(--fill-18), var(--fill-08));
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: var(--s-13);
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: var(--ls-burner);
  color: var(--gold-lt);
  writing-mode: vertical-rl;
  will-change: transform;
}
.tube__sticks {
  position: absolute;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
}
.lot {
  width: 4px;
  height: 44px;
  border-radius: 2px;
  background: var(--gold);
  opacity: 0.8;
  will-change: transform;
}

.verdict {
  text-align: center;
  z-index: 1;
}
.verdict__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: 34px;
  line-height: 1.1;
  color: var(--ink);
  margin: 0;
}
.verdict__hint {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 270px;
  margin: var(--s-6) auto 0;
}

.holy {
  display: flex;
  align-items: center;
  gap: var(--s-9);
  z-index: 1;
}
.holy__label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: var(--ls-kicker);
  text-transform: uppercase;
  color: var(--ink-3);
}
.holy__dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(240, 198, 117, 0.45);
}
.holy__dot[data-filled="1"] {
  background: var(--gold-lt);
  border-color: var(--gold-lt);
}

/* ---------------------------------------------------------------- actions */

.actions {
  margin-top: auto;
  padding-top: var(--s-16);
  display: grid;
  gap: var(--s-9);
}
.btn {
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  padding: var(--s-16);
  border-radius: var(--r);
  background: transparent;
  border: 1px solid var(--gold-lt);
  color: var(--gold-lt);
  cursor: pointer;
  text-align: center;
}
.btn:hover:not(:disabled) {
  background: var(--hover-gold-lt);
}
.btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.btn--ghost {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: var(--ls-kicker-sm);
  text-transform: uppercase;
  border: 0;
  color: var(--gold);
  padding: var(--s-6);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- 籤詩 */

/* 籤紙. Modelled on a printed 六十甲子籤: a ruled frame, a horizontal head band naming the
   temple, the 干支 large at the head of the rightmost column, then the poem in columns
   running right to left.

   Vertical is CJK only — Latin scripts get the horizontal stele layout, because
   `writing-mode: vertical-rl` on English is unreadable. See CLAUDE.md § i18n.

   No flexbox inside the vertical block on purpose. In `vertical-rl` the flex row axis is the
   *inline* axis, which runs top to bottom, so `flex-direction` means the opposite of what it
   looks like it means. Plain block children column themselves right to left with no such trap,
   and logical margins put the gaps on the correct physical side. */
.slip {
  /* 慢慢捲開. The verse is not there when the page opens: the keeper walks on, then the paper
     unrolls, then he reads it. Opening leftward from the right edge is the direction the slip
     is written and read in, so the 干支 appears first and the four columns follow in order —
     which is also, conveniently, the order someone reads them. */
  animation: slip-unroll 1400ms ease-out var(--t-enter) both;
  /* The head band rules the full width; the verse is centred under it. `inline-size:
     max-content` on the body makes it exactly as wide as the poem needs, which is narrower
     than the frame, so without this it hangs off the right-hand edge. Column flex puts the
     cross axis horizontal, which is the one thing here that is not upside down. */
  display: flex;
  flex-direction: column;
  margin-top: var(--s-16);
  border: 1px solid var(--gold);
  border-radius: var(--r);
  background: var(--fill-10);
  /* The second rule inside the first — a woodblock frame, not a UI card. */
  box-shadow: inset 0 0 0 4px var(--fill-10), inset 0 0 0 5px var(--hair-30);
  padding: var(--s-13);
  overflow: hidden;
}
.slip__head {
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: var(--ls-poem);
  text-align: center;
  color: var(--gold-lt);
  padding-bottom: var(--s-9);
  border-bottom: 1px solid var(--hair-30);
}
.slip__body {
  writing-mode: vertical-rl;
  /* In vertical-rl the INLINE axis runs top to bottom, so a column's length is its inline
     size — not its height. Sizing it to the longest column makes the frame hug the verse the
     way a printed slip does; a fixed length left the foot of every column empty, and the
     amount of dead space changed with the poem. */
  inline-size: max-content;
  /* Hard against the right edge of the frame, where a printed slip starts its first column —
     so a short verse leaves its gap on the left, which is the direction the reading ends in.
     Centring looked wrong even when it was geometrically right: the two right-hand columns
     are the 34px 干支 and a 12px mark, so the optical centre sits left of the true one. */
  align-self: flex-end;
  margin: var(--s-16) 0 var(--s-11);
  color: var(--ink);
}
/* Largest thing on the slip, the way it is on the paper one. */
.slip__ganzhi {
  font-family: var(--display);
  font-size: 34px;
  line-height: 1;
  letter-spacing: var(--ls-poem);
  color: var(--gold-lt);
  margin-block-end: var(--s-11);
}
.slip__mark {
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: var(--ls-poem);
  color: var(--ink-2);
  margin-block-end: var(--s-18);
}
.slip__line {
  margin: 0 0 0;
  margin-block-end: var(--s-13);
  font-family: var(--display);
  font-size: 25px;
  line-height: 1.35;
  letter-spacing: var(--ls-poem);
}
.slip__line:last-child {
  margin-block-end: 0;
}

/* The stele. Latin scripts cannot use the vertical slip — rotated letters, or one letter per
   line, are not a stylistic compromise but genuinely unreadable — so English gets a rubbing
   from a stone tablet instead of a paper slip. Same object, different tradition, and the two
   share the frame, the head band, the mark and the unroll.

   This is the whole difference between the two layouts. It is small on purpose: everything
   that carries the character of the thing lives above, and only the axis changes here. */
.slip--stele .slip__body {
  writing-mode: horizontal-tb;
  inline-size: auto;
  align-self: stretch;
  /* Left, not centred. A centred four-line verse reads as a greeting card; an inscription is
     set flush and lets the ragged right edge do the work. It also keeps the eye's return
     point fixed, which matters at 19px with a line and a half of width. */
  text-align: left;
}
.slip--stele .slip__ganzhi {
  font-size: 28px;
  letter-spacing: var(--ls-kicker);
  text-transform: uppercase;
  margin: 0 0 var(--s-6);
}
.slip--stele .slip__mark {
  margin: 0 0 var(--s-18);
}
.slip--stele .slip__line {
  font-size: 19px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  margin: 0 0 var(--s-6);
}
/* A stone tablet is read downward, so the rubbing lifts off from the top rather than the
   right. Same 1400 ms, same easing, same wait on the keeper. */
.slip--stele {
  animation-name: stele-unroll;
}
@keyframes stele-unroll {
  from {
    clip-path: inset(0 0 100% 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

.pick {
  text-decoration: none;
  display: block;
  margin-top: var(--s-13);
  padding: var(--s-20);
  border: 1px solid var(--gold-lt);
  border-radius: var(--r);
  color: var(--gold-lt);
}
.pick:hover {
  background: var(--hover-gold-lt);
}
.pick__kicker {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: var(--ls-kicker);
  text-transform: uppercase;
}
.pick__name {
  display: block;
  font-family: var(--display);
  font-size: 27px;
  line-height: 1.1;
  margin-top: var(--s-4);
}
.pick__meta {
  display: block;
  font-size: 13px;
  margin-top: var(--s-6);
  opacity: 0.85;
}

.links {
  display: grid;
  gap: var(--s-6);
  margin-top: var(--s-11);
}
.linkrow {
  text-decoration: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-9);
  border: 1px solid var(--hair-40);
  border-radius: var(--r);
  padding: var(--s-13);
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-lt);
}
.linkrow:hover {
  background: var(--fill-12);
}
.linkrow small {
  font-size: 10px;
  letter-spacing: var(--ls-kicker-xs);
  text-transform: uppercase;
  color: var(--gold);
}

/* A city's districts, shut until asked for. Forty-five of them is a wall to scroll past to
   reach the two somebody actually uses, so the chosen ones live above and this holds the rest.

   `<details>` rather than a script: it is the element built for this, it works with
   JavaScript off, and the keyboard and screen-reader behaviour comes free. */
.citylist {
  margin-top: var(--s-18);
}
.citylist__head {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: var(--ls-kicker);
  text-transform: uppercase;
  color: var(--gold);
  cursor: pointer;
  padding: var(--s-6) 0;
  list-style: none;
}
/* The default triangle is a browser artefact rather than part of the world; this is the same
   ← → vocabulary the rest of the app uses. */
.citylist__head::-webkit-details-marker {
  display: none;
}
.citylist__head::after {
  content: " ▾";
  color: var(--ink-4);
}
.citylist[open] .citylist__head::after {
  content: " ▴";
}
.citylist__head:hover {
  color: var(--gold-lt);
}
.citylist .areas {
  margin-bottom: var(--s-13);
}

/* ---------------------------------------------------------------- 釘位置 */

/* Leaflet paints its own white ground and its controls are built for daylight, so the panel
   is toned down to sit in a temple at night rather than glow out of it. */
.mapbox {
  height: 340px;
  margin-top: var(--s-16);
  border: 1px solid var(--hair-40);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--fill-08);
}
.mapbox .leaflet-tile-pane {
  filter: brightness(0.72) saturate(0.7) contrast(1.05);
}
.mapbox .leaflet-control-zoom a {
  background: var(--card);
  border-color: var(--hair-30);
  color: var(--gold-lt);
}
.mapbox .leaflet-control-attribution {
  background: rgba(28, 25, 23, 0.8);
  color: var(--ink-4);
  font-size: 10px;
}
.mapbox .leaflet-control-attribution a {
  color: var(--gold);
}

/* The pin itself — drawn, not fetched. See the note in pin.js: Leaflet's default marker is a
   PNG from the CDN and our image policy does not allow it, which is why it arrived broken.
   A ring on a stem rather than a filled teardrop, so the map underneath still shows through
   the point being marked. */
/* The demo notice on 籤詩. Loud enough to be believed and quiet enough not to be the card —
   a made-up restaurant read as a real one is the worst thing this screen can do. */
.pick__demo {
  margin-top: var(--s-6);
  padding: var(--s-6) var(--s-11);
  border: 1px dashed var(--gold-dk);
  border-radius: var(--r);
  color: var(--gold);
  font-size: 12px;
  line-height: 1.5;
}

.pinmark {
  display: block;
  width: 22px;
  height: 22px;
  border: 2px solid var(--gold-lt);
  border-radius: 50%;
  background: rgba(35, 31, 28, 0.7);
  box-shadow: 0 0 0 1px rgba(35, 31, 28, 0.9);
}
/* The stem, and the reason `iconAnchor` is [11, 30]: the tip sits on the coordinate. */
.pinmark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 20px;
  width: 2px;
  height: 10px;
  margin-left: -1px;
  background: var(--gold-lt);
}

/* ---------------------------------------------------------------- 供桌 */

/* 所求, above everything, because it is the frame the whole room is inside. */
.wishline {
  font-size: 12px;
  letter-spacing: var(--ls-plaque);
  color: var(--gold);
  text-align: center;
  margin: var(--s-22) 0 0;
}

.countdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-4);
  margin-top: var(--s-16);
  padding-bottom: var(--s-20);
  border-bottom: 1px solid var(--hair-35);
}
.countdown__at {
  font-family: var(--display);
  font-size: 40px;
  line-height: 1;
  letter-spacing: var(--ls-plaque);
  color: var(--gold-lt);
}
.countdown__note {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: var(--ls-kicker);
  text-transform: uppercase;
  color: var(--ink-4);
}

.row__name {
  text-decoration: none;
  color: inherit;
}

/* The two arrows. Each is its own form so neither needs a script, and they sit in a flex row
   so the gap survives one of them being pressed and the page coming back. */
.votes {
  display: flex;
  align-items: center;
  gap: var(--s-9);
}
.vote {
  font-family: inherit;
  font-size: 15px;
  line-height: 1;
  /* 44px, because this is a real hit target on a phone and a 20px glyph is not one. */
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-4);
  cursor: pointer;
}
/* Lit means 「you pressed this」 and nothing else. There is no count here and never will be:
   「2↑ 1↓」 cannot be anonymous in a group of two. See CLAUDE.md § 投票. */
.vote--on {
  color: var(--gold-lt);
}
.vote--down.vote--on {
  color: var(--cinnabar);
}

/* ---------------------------------------------------------------- 入籍 */

/* A text field, styled like a `.row` so a screen of them reads as one register rather than as
   a form bolted onto a temple. `font-size: 16px` is not a design choice — anything smaller and
   iOS zooms the page on focus, which throws the layout out from under the reader's thumb. */
.field {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  padding: var(--s-13);
  border: 1px solid var(--hair-30);
  border-radius: var(--r);
  background: transparent;
  color: var(--ink);
}
.field::placeholder {
  color: var(--ink-4);
}
.field:focus {
  border-color: var(--gold-lt);
  outline: none;
}

/* The second of two buttons that do the same thing by different means. Quieter, not smaller —
   somebody who types an email should not feel they chose the lesser door. */
.btn--quiet {
  border-color: var(--hair-40);
  color: var(--gold);
}

/* 或者 — a rule with a word sitting in it. */
.orline {
  display: flex;
  align-items: center;
  gap: var(--s-11);
  margin: var(--s-16) 0;
}
.orline::before,
.orline::after {
  content: "";
  flex-grow: 1;
  height: 1px;
  background: var(--hair-30);
}
.orline span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: var(--ls-kicker);
  text-transform: uppercase;
  color: var(--ink-4);
}

/* ---------------------------------------------------------------- 自訂清單 */

.jot {
  display: grid;
  gap: var(--s-6);
  margin-top: var(--s-11);
}
.jot__row,
.jot__add {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-9);
  border: 1px solid var(--hair-30);
  border-radius: var(--r);
  padding: var(--s-11) var(--s-13);
  font-size: 14px;
  color: var(--ink);
}
/* On the list, and in today's draw, are two different states. Off is still legible — it is a
   place they chose to write down — just visibly out of play. */
.jot__row--on {
  border-color: var(--gold-lt);
  background: var(--fill-10);
}
.jot__row:not(.jot__row--on) .jot__pick {
  color: var(--ink-4);
  text-decoration: line-through;
  text-decoration-color: var(--hair-40);
}
.jot__pick {
  flex: 1;
  min-width: 0;
  text-align: left;
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}
.jot__drop {
  background: none;
  border: 0;
  padding: var(--s-2) var(--s-6);
  font-family: inherit;
  font-size: 12px;
  color: var(--cinnabar);
  cursor: pointer;
}
.jot__add {
  border-style: dashed;
  border-color: var(--hair-40);
  padding: var(--s-6) var(--s-9) var(--s-6) var(--s-13);
}
/* A bare field, because a boxed input inside a boxed row is two frames around one thing. */
.jot__field {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  padding: var(--s-4) 0;
}
.jot__field::placeholder {
  color: var(--ink-4);
}
.jot__field:focus {
  outline: none;
}
.jot__add:focus-within {
  border-color: var(--gold-lt);
  border-style: solid;
}
.jot__save {
  background: none;
  border: 1px solid var(--hair-40);
  border-radius: var(--r);
  padding: var(--s-4) var(--s-11);
  font-family: inherit;
  font-size: 12px;
  color: var(--gold-lt);
  cursor: pointer;
}
.jot__save:hover {
  background: var(--fill-12);
}
/* The toggle is a form now, so its options are buttons. They still have to read as the quiet
   line of text they were, not as three more things competing with 一人急求. */
/* Buttons need the browser's own styling undone, and nothing else.
   `background` and `border` used to be reset here too — and `button.whererow__opt` outranks
   `.whererow__opt--on`, so every chip that was a submit button lost its ground and its border
   while every chip that was a link kept them. Two rows looked chosen and one did not, for no
   reason a reader could see. */
button.whererow__opt {
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}

/* ---------------------------------------------------------------- 找不到你在哪 */

/* The panel that replaces a dead end. It is not an error box: one of the two ways out needs
   no permission at all, so this is a fork rather than an apology. */
.lost {
  margin-top: var(--s-16);
}
.lost__why {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0;
  text-align: center;
}
.lost__steps {
  display: grid;
  gap: var(--s-9);
  margin: var(--s-13) 0 0;
  padding: var(--s-13) var(--s-16) var(--s-13) var(--s-26);
  border: 1px solid var(--hair-30);
  border-radius: var(--r);
  background: var(--fill-08);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
}
.lost__steps li::marker {
  color: var(--gold-lt);
}
.lost .actions {
  margin-top: var(--s-13);
  padding-top: 0;
}
/* The escape hatch is a link, so it works with JavaScript broken — which is exactly the kind
   of session that also fails to get a position. */
a.btn {
  display: block;
  text-decoration: none;
}

/* The handover. Quiet, because it is a caveat rather than an instruction — but not so quiet
   that someone misses it and drives to a shut restaurant. */
.handover {
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-3);
  margin: var(--s-13) 0 0;
  padding-left: var(--s-11);
  border-left: 1px solid var(--hair-30);
}

/* ---------------------------------------------------------------- 選地區 */

/* The per-draw choice, sitting where the draw is about to start. Quiet: it is a correction
   most people never make, and it must not compete with 一人急求. */
/* All three rows wrap now: with the options carrying a ground they are wider, and 想吃什麼
   never fitted on one line anyway. The label taking the whole first line is what separates it
   from the set below it. */
.whererow {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s-6);
  margin-top: var(--s-16);
  font-size: 12px;
}
/* Its own line, always. `flex: 0 0 100%` rather than `flex-basis` alone: a basis of 100% is
   still shrinkable, and a shrunk two-character label wraps to one character per line — which
   is what it did. */
.whererow__label {
  flex: 0 0 100%;
  margin-bottom: var(--s-2);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: var(--ls-kicker-xs);
  text-transform: uppercase;
  color: var(--ink-4);
}
.whererow__sep {
  color: var(--hair-40);
}
/* Every option carries a ground of its own, so the row reads as 「label, then a set of
   things」 rather than as one run of text. Before this the only filled chip was the chosen
   one, which made the others look like prose and made the label look like another option. */
.whererow__opt {
  text-decoration: none;
  color: var(--ink-3);
  padding: 3px var(--s-9);
  border-radius: var(--r);
  background: var(--fill-08);
  border: 1px solid var(--hair-30);
  white-space: nowrap;
}
.whererow__opt:hover {
  background: var(--fill-18);
  color: var(--ink);
}
/* Chosen. The old values — hair-35 on fill-10 against a base of hair-30 on fill-08 — were
   two percent apart and read as identical; the only real signal was the text colour. */
.whererow__opt--on {
  color: var(--gold-lt);
  border-color: var(--gold-lt);
  background: var(--fill-14);
}

/* The picker. A grid, because twelve districts as a list is a scroll and as a grid it is a
   glance — and every one of them is the same two characters wide. */
.areas {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-6);
  margin-top: var(--s-11);
}
.area {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-9);
  border: 1px solid var(--hair-30);
  border-radius: var(--r);
  background: transparent;
  padding: var(--s-13);
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.area:hover {
  background: var(--fill-12);
}
.area--on {
  border-color: var(--gold-lt);
  background: var(--fill-10);
  color: var(--gold-lt);
}
.area small,
.area--on small {
  font-size: 10px;
  letter-spacing: var(--ls-kicker-xs);
  text-transform: uppercase;
  color: var(--gold);
}
/* The 自動 row is a submit button wearing the settings-row costume. */
button.row {
  width: 100%;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}
button.row:hover {
  background: var(--fill-12);
}

/* ---------------------------------------------------------------- 側殿 */

/* The settings hall. Named and written as part of the world, per CLAUDE.md § Naming — a
   screen called 「設定」 would be the one place the app admits it is an app.

   Most rows here are doors to phases that do not exist yet. They are shown rather than
   hidden, and marked 尚未開放 in the same words the home screen uses, because the shape of
   the hall is the useful thing: it says what the app will hold. A row nobody can use is
   `.row--locked` and is not a link. */
.hallname {
  font-family: var(--display);
  font-weight: 400;
  font-size: 34px;
  line-height: 1.1;
  color: var(--ink);
  margin: var(--s-22) 0 var(--s-4);
}
.hallsub {
  font-size: 12px;
  color: var(--ink-3);
  margin: 0 0 var(--s-20);
}
.group {
  margin-top: var(--s-22);
}
.group__label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: var(--ls-kicker);
  text-transform: uppercase;
  color: var(--gold);
}
.group__note {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-3);
  margin: var(--s-9) 0 0;
}
.rows {
  display: grid;
  gap: var(--s-6);
  margin-top: var(--s-11);
}
.row {
  text-decoration: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-13);
  border: 1px solid var(--hair-30);
  border-radius: var(--r);
  padding: var(--s-13);
  font-size: 14px;
  color: var(--ink);
}
a.row:hover {
  background: var(--fill-12);
}
.row--locked {
  opacity: 0.5;
}
/* The current choice, not a highlight — 通譯 is a set of three and one of them is always on. */
.row--on {
  border-color: var(--gold-lt);
  background: var(--fill-10);
  color: var(--gold-lt);
}
.row__val {
  font-size: 13px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: var(--s-6);
}
.row--on .row__val {
  color: var(--gold);
}
.row__val small {
  font-size: 10px;
  letter-spacing: var(--ls-kicker-xs);
  text-transform: uppercase;
  color: var(--gold);
}
/* A native <select>, kept native. The OS picker is the right control on a phone, it is
   keyboard- and screen-reader-correct without any work, and `color-scheme: dark` in
   tokens.css already makes the dropdown list itself render dark rather than white. Only the
   closed control is styled — no custom arrow, because a bespoke one would be the first pill
   in a system that has none. */
.select {
  font-family: inherit;
  font-size: 14px;
  color: var(--gold-lt);
  background: transparent;
  border: 1px solid var(--hair-40);
  border-radius: var(--r);
  padding: var(--s-4) var(--s-9);
  cursor: pointer;
}
.select:hover {
  background: var(--fill-12);
}
/* The row is a <label>, so the whole line is a hit target, not just the control. */
label.row {
  cursor: pointer;
}

.tierchip {
  display: inline-flex;
  align-items: center;
  padding: 4px var(--s-9);
  border: 1px solid var(--hair-40);
  border-radius: var(--r);
  background: var(--fill-10);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: var(--ls-kicker-xs);
  color: var(--gold-lt);
}
.invite {
  margin-top: var(--s-11);
  border: 1px solid var(--gold-lt);
  border-radius: var(--r);
  background: var(--fill-10);
  padding: var(--s-16);
}
.invite__body {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0 0 var(--s-13);
}
.legal {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-13);
  margin-top: var(--s-22);
  padding-top: var(--s-16);
  border-top: 1px solid var(--hair-30);
  font-size: 11px;
  color: var(--ink-4);
}
/* 除籍 is destructive and irreversible, so it is cinnabar — the same colour 雷部 strikes with.
   It is inert until the registers exist: there is nothing yet for it to purge, and a delete
   button that half-works is worse than one that says it is not open. */
.legal__danger {
  color: var(--cinnabar);
}
.build {
  font-size: 10px;
  color: var(--ink-4);
  margin-top: var(--s-11);
  letter-spacing: var(--ls-kicker-xs);
}

/* Deployment diagnostics. Never seen by a real user — only on an environment that is missing a
   piece of its own configuration. Amber rather than cinnabar: something is unfinished, nothing
   is broken. */
.banner {
  border: 1px solid var(--amber);
  border-radius: var(--r);
  background: rgba(211, 150, 63, 0.08);
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.5;
  padding: var(--s-11) var(--s-13);
  margin: 0 0 var(--s-13);
}
.banner code {
  color: var(--amber);
  font-size: 0.92em;
}

/* ---------------------------------------------------------------- 廟公上場 */

.keeperstage {
  display: flex;
  align-items: flex-end;
  gap: var(--s-16);
  margin-top: var(--s-13);
  padding: var(--s-18) var(--s-18) var(--s-13);
  border: 1px solid var(--hair-30);
  border-radius: var(--r);
  /* He walks in from off the left edge, so the edge has to cut him off rather than let him
     hover outside the box. */
  overflow: hidden;
}
.keeperstage .shrine {
  animation: keeper-enter var(--t-enter) cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.keeperstage .glyph {
  animation: keeper-breathe 2600ms ease-in-out var(--t-enter) infinite;
}
.keeperstage__say {
  flex: 1;
  align-self: center;
}
.keeperstage__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
}
.keeperstage__line {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  margin: var(--s-6) 0 0;
  /* He speaks once the paper is open, not on the way in. */
  animation: keeper-say 300ms ease-out calc(var(--t-enter) + 1500ms) both;
}
/* Him muttering, not the fortune. Smaller, dimmer, ruled off and held back a beat further —
   someone reading the card should get the answer first and the character second. */
.keeperstage__aside {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-3);
  margin: var(--s-9) 0 0;
  padding-top: var(--s-9);
  border-top: 1px solid var(--hair-30);
  animation: keeper-say 300ms ease-out calc(var(--t-enter) + 1900ms) both;
}

/* 大搖大擺 in one part: three steps with a counter-swing, then two hops and a spin, then
   still. The squash on each landing is what stops the hops reading as a lift. */
@keyframes keeper-enter {
  0% {
    transform: translateX(-120px) rotate(-6deg);
    opacity: 0;
  }
  12% {
    transform: translateX(-84px) rotate(5deg);
    opacity: 1;
  }
  29% {
    transform: translateX(-52px) translateY(-5px) rotate(-5deg);
  }
  46% {
    transform: translateX(-20px) rotate(5deg);
  }
  58% {
    transform: translateX(0) rotate(-4deg);
  }
  /* the silly part */
  66% {
    transform: translateY(-22px) rotate(180deg) scale(1.04, 0.96);
  }
  74% {
    transform: translateY(0) rotate(360deg) scale(1.12, 0.86);
  }
  82% {
    transform: translateY(-14px) rotate(374deg) scale(0.94, 1.08);
  }
  90% {
    transform: translateY(0) rotate(352deg) scale(1.1, 0.9);
  }
  100% {
    transform: translateY(0) rotate(360deg) scale(1, 1);
  }
}
@keyframes keeper-breathe {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}
@keyframes keeper-say {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* 得意 struts in; 沒好氣 trudges. Same curves, different duration — which is exactly how
   `Personality` will drive the bought keepers.

   One variable, because four things wait on him: his own breath, the paper opening, his line,
   and the plain reading under it. Three separate mood overrides meant a keeper who arrived
   late still had the paper open without him. */
.result {
  --t-enter: 2400ms;
}
.result--smug {
  --t-enter: 2200ms;
}
.result--weary {
  --t-enter: 3000ms;
}
.result--weary .keeperstage .shrine {
  animation-timing-function: ease-out;
}
/* Tapped. Every wait on this screen hangs off --t-enter, so zeroing it brings the whole
   sequence forward without touching a single keyframe — the order still holds, it just
   happens at once. The 180 ms is what stops that reading as a glitch. */
.result--now {
  --t-enter: 0ms;
}
.result--now .keeperstage .shrine,
.result--now .keeperstage__line,
.result--now .keeperstage__aside,
.result--now.slip,
.result--now .slip {
  animation-duration: 180ms;
}

@keyframes slip-unroll {
  from {
    /* Zero width at the right-hand edge — the roll, still closed. */
    clip-path: inset(0 0 0 100%);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

/* 發帖 — the invitation itself, drawn as a paper 帖 rather than as another form group.
   The double inset ring is the border a red-envelope invitation has printed on it; it is why
   this card reads as something handed over rather than as a panel in an app. */
.invite {
  margin-top: var(--s-22);
  padding: var(--s-20) var(--s-18);
  border: 1px solid var(--gold);
  border-radius: 4px;
  background: var(--fill-10);
  box-shadow: inset 0 0 0 4px var(--fill-10), inset 0 0 0 5px var(--hair-30);
}
.invite__seal {
  display: block;
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: var(--ls-poem);
  text-align: center;
  color: var(--gold-lt);
  padding-bottom: var(--s-9);
  border-bottom: 1px solid var(--hair-30);
}
.invite__wish {
  font-family: var(--display);
  font-size: 27px;
  line-height: 1.3;
  letter-spacing: var(--ls-plaque);
  color: var(--ink);
  text-align: center;
  text-wrap: pretty;
  margin: var(--s-18) 0 0;
}
/* The share and copy buttons ship hidden and `invite.js` reveals the ones the browser can
   actually honour. A later `display:` on `.btn` would silently un-hide both — this is the
   guard, because the failure is a button that does nothing when tapped. */
[hidden] {
  display: none !important;
}

/* A note that is answering something that went wrong. Cinnabar rather than gold, and nothing
   louder: the room is missing, which is a fact, not an alarm. */
.group__note--warn {
  color: var(--gold-lt);
}
