/* PartyWrite on the web. Dark to draw, light to write: a desk at night where cards glow in their
   deck's colour, then paper in a quiet room. Colours follow ../partywrite/tokens/partywrite-tokens.toml:
   each deck surface comes from its hue (--h) by the same oklch formulas. EB Garamond is the story;
   Archivo is the app. */

.pw-page {
  --night: #0E0B0A; --paper: #F5EFE3; --desk: #E7DFCF; --stock-top: #FDFAF2; --stock-bottom: #F4EDDD;
  --on-night: #F4EDE0; --on-night-2: #C8BCAC; --on-night-floor: #A4988A; --gold: #E8C98A; --deep-gold: #C9A86B;
  --ink: #1C1815; --ink-2: #4C443C; --ink-3: #6C635A; --accent: #7A5C25; --mark: #8C6A2C;
  --serif: "EB Garamond", Garamond, "Times New Roman", serif;
  --sans: Archivo, "Helvetica Neue", Arial, sans-serif;
  background: var(--night);
}
.pw { position: relative; min-height: 100svh; display: grid; grid-template-rows: auto 1fr; grid-template-columns: minmax(0, 1fr); color: var(--on-night); font-family: var(--sans);
  background: radial-gradient(120% 80% at 50% 0%, #241A14 0%, var(--night) 62%); overflow: hidden; overflow: clip; transition: background .8s ease; }
.pw[data-scene="room"] { background: radial-gradient(140% 100% at 50% 0%, #F1EADD 0%, var(--desk) 70%); color: var(--ink); }
.pw-weather { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.pw-bar, .pw-stage { position: relative; z-index: 1; }
.pw-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pw-stage { display: grid; place-items: center; padding: 8px 16px 40px; min-width: 0; }
.pw-stage.is-arriving > * { animation: pw-in .6s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes pw-in { from { opacity: 0; transform: translateY(14px); } }

/* ---------- bar ---------- */
.pw-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; min-width: 0; }
.pw-brand { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; font: 500 24px/1 var(--serif); letter-spacing: .01em; }
.pw-brand svg { width: 28px; height: 28px; }
.pw-by { color: var(--on-night-floor); font-size: 13px; text-decoration: none; }
.pw[data-scene="room"] .pw-by { color: var(--ink-3); }
.pw-bar-space { flex: 1; }
.pw-icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(232, 201, 138, .28); background: rgba(255, 255, 255, .03); color: inherit; display: grid; place-items: center; cursor: pointer; }
.pw-icon-btn svg { width: 20px; height: 20px; }
.pw[data-scene="room"] .pw-icon-btn { border-color: rgba(140, 106, 44, .35); }
.pw-icon-btn:hover, .pw-icon-btn:focus-visible { border-color: var(--gold); }
#pwSoundBtn .on, #pwSoundBtn[aria-pressed="true"] .off { display: none; }
#pwSoundBtn[aria-pressed="true"] .on { display: block; }

/* ---------- buttons ---------- */
.pw-btn { font: 600 15px/1.2 var(--sans); padding: 13px 22px; min-height: 48px; border-radius: 999px; border: 1px solid rgba(232, 201, 138, .5); background: rgba(255, 255, 255, .02);
  color: inherit; cursor: pointer; transition: transform .15s ease, box-shadow .2s ease, background .2s ease; }
.pw-btn:hover, .pw-btn:focus-visible { transform: translateY(-1px); border-color: var(--gold); }
.pw-btn-glow { background: linear-gradient(180deg, #F1D79F, var(--deep-gold)); color: #1C1815; border-color: transparent; box-shadow: 0 0 0 1px rgba(255, 230, 170, .35), 0 8px 30px rgba(232, 180, 90, .35); }
.pw-btn-glow:hover, .pw-btn-glow:focus-visible { box-shadow: 0 0 0 1px rgba(255, 230, 170, .6), 0 10px 40px rgba(232, 180, 90, .55); }
.pw-btn-quiet { border-color: transparent; }
.pw[data-scene="room"] .pw-btn, .sheet.pw-sheet .pw-btn { border-color: rgba(140, 106, 44, .45); }
.pw-link-btn { border: 0; background: none; padding: 8px 4px; min-height: 40px; color: inherit; opacity: .8; font: 500 14px var(--sans); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.pw-link-btn:hover, .pw-link-btn:focus-visible { opacity: 1; }
.pw-link-btn[disabled] { opacity: .45; text-decoration: none; cursor: default; }
.pw-danger { color: #B3261E; }
.pw-chip-btn { font: 600 14px var(--sans); padding: 8px 14px; min-height: 40px; border-radius: 999px; border: 1px solid rgba(140, 106, 44, .45); background: var(--paper); color: var(--ink); cursor: pointer; }
.pw-chip-btn:hover, .pw-chip-btn:focus-visible { background: #FFF8EA; border-color: var(--mark); }
.pw-toggle { display: flex; align-items: center; gap: 12px; border: 0; background: none; color: inherit; font: 500 14px/1.35 var(--sans); text-align: left; cursor: pointer; padding: 6px 0; min-height: 44px; }
.pw-toggle-knob { flex: none; width: 42px; height: 24px; border-radius: 99px; background: rgba(28, 24, 21, .2); position: relative; transition: background .2s; }
.pw-toggle-knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.pw-toggle.is-on .pw-toggle-knob { background: var(--mark); }
.pw-toggle.is-on .pw-toggle-knob::after { transform: translateX(18px); }

/* ---------- arrival: the desk and the shelf ---------- */
.pw-arrival, .pw-library { width: min(820px, 100%); display: grid; justify-items: center; text-align: center; gap: 14px; }
.pw-desk-candle { position: relative; width: 26px; height: 74px; margin-top: 4px; }
.pw-desk-wax { position: absolute; bottom: 0; left: 2px; width: 22px; height: 50px; border-radius: 4px; background: linear-gradient(90deg, #E9DFCC, #FBF5E8 45%, #D8CBB2); }
.pw-desk-flame { position: absolute; left: 50%; bottom: 52px; width: 14px; height: 24px; margin-left: -7px; border-radius: 50% 50% 45% 45% / 62% 62% 38% 38%;
  background: radial-gradient(circle at 50% 72%, #FFFBEA 0 18%, #FFD866 34%, #F28C28 70%, transparent 74%); transform-origin: 50% 90%;
  animation: pw-light 1.2s .25s cubic-bezier(.3, 1.6, .5, 1) both, pw-flicker 2.6s 1.5s ease-in-out infinite; box-shadow: 0 0 40px 14px rgba(255, 196, 92, .28); }
@keyframes pw-light { from { transform: scale(0); opacity: 0; } }
@keyframes pw-flicker { 0%, 100% { transform: scale(1) rotate(-1deg); } 30% { transform: scale(1.05, .96) rotate(2deg); } 60% { transform: scale(.97, 1.04) rotate(-2deg); } }
.pw-hello { font: 500 clamp(34px, 6vw, 52px)/1.05 var(--serif); margin: 6px 0 0; letter-spacing: -.01em; }
.pw-hello-sub { margin: 0 0 18px; color: var(--on-night-2); font-size: 15px; max-width: 46ch; }
.pw-shelf { display: flex; justify-content: center; align-items: flex-end; gap: clamp(4px, 1.6vw, 14px); width: 100%; }
@media (max-width: 420px) { .pw-by { display: none; } .pw-spine-title { font-size: 14px; } .pw-spine-tag { font-size: 8px; letter-spacing: .06em; } }
.pw-spine { --wh: 30; position: relative; width: clamp(48px, 15vw, 84px); height: clamp(230px, 46vw, 320px); border: 0; border-radius: 5px 5px 2px 2px; cursor: pointer; color: #F7EBCF;
  background: linear-gradient(90deg, oklch(0.2 0.04 var(--wh)), oklch(0.36 0.075 var(--wh)) 28%, oklch(0.3 0.065 var(--wh)) 70%, oklch(0.2 0.04 var(--wh)));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), 0 10px 24px rgba(0, 0, 0, .5); display: flex; flex-direction: column; align-items: center; padding: 14px 4px;
  animation: pw-rise .9s cubic-bezier(.2, .8, .2, 1) both; transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s; }
.pw-spine::before, .pw-spine::after { content: ""; position: absolute; left: 6px; right: 6px; height: 2px; background: rgba(232, 201, 138, .55); }
.pw-spine::before { top: 52px; } .pw-spine::after { bottom: 46px; }
.pw-spine:nth-child(2) { height: clamp(250px, 50vw, 340px); } .pw-spine:nth-child(4) { height: clamp(220px, 44vw, 300px); }
.pw-spine:hover, .pw-spine:focus-visible { transform: translateY(-16px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), 0 0 46px oklch(0.72 0.14 var(--wh) / .55), 0 18px 30px rgba(0, 0, 0, .5); outline: none; }
.pw-spine-sigil svg { width: 28px; height: 28px; color: var(--gold); }
.pw-spine-title { flex: 1; writing-mode: vertical-rl; transform: rotate(180deg); font: 500 clamp(15px, 2.6vw, 20px)/1.1 var(--serif); padding: 16px 0; text-align: center; overflow: hidden; }
.pw-spine-tag { font: 600 9.5px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); opacity: .85; }
.pw-shelf-board { width: min(760px, 100%); height: 16px; margin-top: -14px; border-radius: 3px; background: linear-gradient(180deg, #5B4030, #3A281D); box-shadow: 0 14px 30px rgba(0, 0, 0, .55); }
@keyframes pw-rise { from { opacity: 0; transform: translateY(60px); } }
.pw-continue { margin-top: 18px; display: grid; gap: 2px; text-align: left; padding: 14px 20px; border-radius: 14px; border: 1px solid rgba(232, 201, 138, .35); background: rgba(255, 255, 255, .04); color: inherit; cursor: pointer; min-width: min(360px, 100%); }
.pw-continue:hover, .pw-continue:focus-visible { border-color: var(--gold); background: rgba(255, 255, 255, .07); }
.pw-continue-label { font: 600 11px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.pw-continue-title { font: 500 22px/1.2 var(--serif); }
.pw-continue-meta { font-size: 13px; color: var(--on-night-2); }

/* ---------- an open book: the world ---------- */
.pw-open-book { --wh: 30; width: min(860px, 100%); display: grid; grid-template-columns: 1fr 1fr; border-radius: 6px; overflow: hidden; color: var(--ink);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 120px oklch(0.6 0.12 var(--wh) / .25); perspective: 1600px; }
.pw-page-left, .pw-page-right { background: linear-gradient(90deg, #EFE6D3, var(--paper) 12%); padding: clamp(24px, 4vw, 48px); }
.pw-page-left { background: linear-gradient(270deg, #E6DBC4, var(--paper) 14%); display: flex; flex-direction: column; justify-content: center; gap: 10px; transform-origin: right center; animation: pw-open 1s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes pw-open { from { transform: rotateY(70deg); opacity: .4; } }
.pw-open-sigil svg { width: 56px; height: 56px; color: oklch(0.42 0.1 var(--wh)); }
.pw-open-tag { margin: 0; font: 600 11px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.pw-open-title { margin: 0; font: 500 clamp(30px, 4.6vw, 44px)/1.05 var(--serif); }
.pw-page-right { display: grid; align-content: center; gap: 14px; }
.pw-open-premise { margin: 0; font: italic 400 clamp(19px, 2.4vw, 23px)/1.45 var(--serif); color: var(--ink); }
.pw-open-how { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.5; }

/* ---------- the table ---------- */
.pw-table { width: min(980px, 100%); display: grid; justify-items: center; gap: 18px; }
.pw-deck-head { text-align: center; display: grid; gap: 2px; }
.pw-deck-numeral { margin: 0; font: 500 18px var(--serif); color: oklch(0.82 0.065 var(--h, 70)); letter-spacing: .2em; }
.pw-deck-name { margin: 0; font: 500 clamp(32px, 5vw, 44px)/1 var(--serif); }
.pw-deck-hint { margin: 6px 0 0; color: var(--on-night-2); font-size: 14.5px; }
.pw-offers { display: flex; justify-content: center; align-items: center; gap: clamp(10px, 3vw, 32px); min-height: clamp(180px, 50vw, 330px); width: 100%; }
.pw-after { min-height: 52px; display: grid; place-items: center; }
.pw-table-foot { display: grid; justify-items: center; gap: 6px; }

/* a card: stock lit by its deck's hue */
.pw-card { --h: 70; position: relative; width: clamp(96px, 27vw, 220px); aspect-ratio: 5 / 7; perspective: 1200px; container-type: inline-size; flex: none;
  transition: width .6s cubic-bezier(.2, .8, .2, 1), opacity .45s ease, transform .6s cubic-bezier(.2, .8, .2, 1), margin .6s ease; }
.pw-offer { animation: pw-rise .8s cubic-bezier(.2, .8, .2, 1) both, pw-breathe 4.6s ease-in-out infinite alternate; }
@keyframes pw-breathe { from { translate: 0 -5px; } to { translate: 0 6px; } }
.pw-card-inner { position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; border-radius: 4.5cqw;
  transform-style: preserve-3d; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .9s cubic-bezier(.3, 1.3, .5, 1); }
.pw-card.is-turned .pw-card-inner { transform: rotateX(var(--rx, 0deg)) rotateY(calc(180deg + var(--ry, 0deg))); }
.pw-card-inner:focus-visible { outline: 3px solid var(--gold); outline-offset: 6px; }
.pw-card-back, .pw-card-face { position: absolute; inset: 0; border-radius: inherit; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.pw-card-back { display: grid; place-content: center; justify-items: center; gap: 2cqw;
  background: radial-gradient(circle at var(--sx, 50%) var(--sy, 30%), oklch(0.5 0.08 var(--h) / .45), transparent 55%),
    repeating-linear-gradient(45deg, transparent 0 7cqw, oklch(0.82 0.065 var(--h) / .07) 7cqw 7.6cqw),
    linear-gradient(160deg, oklch(0.24 0.032 var(--h)), oklch(0.17 0.024 var(--h)));
  box-shadow: inset 0 0 0 1.4cqw oklch(0.17 0.024 var(--h)), inset 0 0 0 1.9cqw oklch(0.82 0.065 var(--h) / .55), 0 0 40px oklch(0.6 0.09 var(--h) / .35), 0 18px 34px rgba(0, 0, 0, .55); }
.pw-back-numeral { font: 500 26cqw/1 var(--serif); color: oklch(0.85 0.055 var(--h)); text-shadow: 0 0 18px oklch(0.7 0.1 var(--h) / .6); }
.pw-back-name { font: 600 6cqw var(--sans); letter-spacing: .2em; text-transform: uppercase; color: oklch(0.82 0.065 var(--h) / .8); }
.pw-offer:hover .pw-card-back { box-shadow: inset 0 0 0 1.4cqw oklch(0.17 0.024 var(--h)), inset 0 0 0 1.9cqw oklch(0.85 0.055 var(--h)), 0 0 70px oklch(0.7 0.12 var(--h) / .6), 0 18px 34px rgba(0, 0, 0, .55); }
.pw-card-face { transform: rotateY(180deg); color: var(--ink); text-align: left; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--stock-top), var(--stock-bottom)); box-shadow: inset 0 0 0 1px oklch(0.6 0.09 var(--h) / .45), 0 0 50px oklch(0.75 0.1 var(--h) / .35), 0 18px 34px rgba(0, 0, 0, .45); }
.pw-card-band { display: flex; align-items: center; gap: 3cqw; padding: 4.5cqw 6cqw; background: oklch(0.955 0.028 var(--h)); border-bottom: 1px solid oklch(0.6 0.09 var(--h) / .45);
  font: 600 5.6cqw var(--sans); letter-spacing: .14em; text-transform: uppercase; color: oklch(0.36 0.075 var(--h)); }
.pw-band-numeral { font: 500 7.6cqw var(--serif); letter-spacing: .06em; }
.pw-band-private { margin-left: auto; font-size: 4.6cqw; padding: .6cqw 2cqw; border: 1px solid currentColor; border-radius: 99px; }
.pw-card-words { padding: 6cqw 7cqw; display: grid; gap: 3.5cqw; transition: filter .35s ease, opacity .35s ease; }
.pw-card-title { margin: 0; font: 500 10.5cqw/1.08 var(--serif); color: var(--ink); }
.pw-card-body { margin: 0; font: italic 400 7.4cqw/1.32 var(--serif); color: var(--ink-2); }
.pw-word { white-space: nowrap; }
.pw-ink { opacity: 0; animation: pw-ink .45s ease-out forwards; display: inline-block; white-space: pre; }
@keyframes pw-ink { from { opacity: 0; filter: blur(3px); transform: translateY(.08em); } 40% { opacity: 1; color: #241E49; } to { opacity: 1; filter: none; transform: none; } }

/* private: hatched stock under wax */
.pw-card-face.is-private { background: repeating-linear-gradient(135deg, transparent 0 3.6cqw, oklch(0.6 0.09 var(--h) / .16) 3.6cqw 4.3cqw), linear-gradient(180deg, var(--stock-top), var(--stock-bottom)); }
.is-private .pw-card-words { filter: blur(9px); opacity: 0; user-select: none; }
.pw-seal { position: absolute; left: 50%; top: 56%; width: 34cqw; height: 34cqw; margin: -17cqw 0 0 -17cqw; transition: transform .5s cubic-bezier(.3, 1.4, .5, 1), opacity .4s ease; }
.pw-seal-wax { position: absolute; inset: 0; border-radius: 47% 53% 50% 50% / 52% 48% 52% 48%;
  background: radial-gradient(circle at 36% 30%, #D2544A 0 12%, #A8282A 38%, #741619 78%); box-shadow: 0 3px 0 #5E1214, 0 8px 18px rgba(80, 10, 12, .45), inset 0 -3px 6px rgba(0, 0, 0, .25); }
.pw-seal-wax::after { content: ""; position: absolute; inset: 11%; border-radius: 50%; border: 1.2cqw solid rgba(0, 0, 0, .14); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18); }
.pw-seal-mark { position: absolute; inset: 24%; display: grid; place-items: center; color: rgba(70, 8, 10, .75); filter: drop-shadow(0 1px 0 rgba(255, 190, 180, .35)); }
.pw-seal-mark svg { width: 100%; height: 100%; }
.pw-seal-hint { position: absolute; left: 0; right: 0; bottom: 6cqw; margin: 0; text-align: center; font: 600 5cqw var(--sans); letter-spacing: .14em; text-transform: uppercase; color: oklch(0.36 0.075 var(--h)); transition: opacity .3s; }
.pw-card-inner.is-open .is-private .pw-card-words { filter: none; opacity: 1; }
.pw-card-inner.is-open .pw-seal { transform: translate(28cqw, 38cqw) rotate(-24deg) scale(.55); opacity: .5; }
.pw-card-inner.is-open .pw-seal-hint { opacity: 0; }

/* choosing */
.pw-offers.has-choice .pw-offer:not(.is-chosen) { opacity: 0; transform: translateY(50px) scale(.85); width: 0; margin: 0 -8px; pointer-events: none; }
.pw-offers.has-choice .pw-offer { animation: none; }
.pw-offer.is-chosen { width: clamp(220px, 64vw, 290px); }
.pw-offers.is-shuffling .pw-offer { transform: translateY(80px) rotate(8deg); opacity: 0; transition-duration: .4s; }

/* the kit row along the bottom of the table */
.pw-kit-row { list-style: none; margin: 8px 0 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.pw-slot { --h: 70; display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 6px; border-radius: 99px; border: 1px dashed oklch(0.82 0.065 var(--h) / .35); color: var(--on-night-floor); font-size: 12.5px; max-width: 170px; }
.pw-slot-numeral { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 500 12px var(--serif); background: oklch(0.24 0.032 var(--h)); color: oklch(0.85 0.055 var(--h)); flex: none; }
.pw-slot.is-now { border-style: solid; border-color: oklch(0.82 0.065 var(--h) / .8); color: var(--on-night); }
.pw-slot.is-filled { border-style: solid; background: oklch(0.955 0.028 var(--h)); color: var(--ink); border-color: transparent; }
.pw-slot.is-filled .pw-slot-numeral { background: oklch(0.36 0.075 var(--h)); color: #fff; }
.pw-slot-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: italic 500 14px var(--serif); }

/* all six, fanned */
.pw-fan { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; width: 100%; max-width: 980px; }
.pw-fanned { width: 100%; animation: pw-rise .8s cubic-bezier(.2, .8, .2, 1) both; transform: rotate(calc((var(--i) - 2.5) * 2.4deg)) translateY(calc((var(--i) - 2.5) * (var(--i) - 2.5) * 3px)); }
.pw-fanned .pw-card-inner { cursor: default; }
.pw-fanned .pw-card-inner[role="button"] { cursor: pointer; }
.pw-table-done .pw-deck-numeral { letter-spacing: .14em; text-transform: uppercase; font: 600 12px var(--sans); color: var(--gold); }

/* ---------- the room ---------- */
.pw[data-scene="room"] .pw-stage { padding: 0; place-items: stretch; height: calc(100svh - 68px); }
.pw-room { display: grid; grid-template-columns: minmax(170px, 230px) minmax(0, 740px) minmax(130px, 190px); grid-template-rows: minmax(0, 1fr) auto; justify-content: center; column-gap: clamp(16px, 3vw, 40px); height: 100%; min-height: 0; }
.pw-kit { grid-column: 1; grid-row: 1; align-self: center; display: grid; gap: 10px; }
.pw-chips { position: relative; display: grid; gap: 6px; }
.pw-stars { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.pw-stars line { stroke: #C99A3C; stroke-width: 1.4; stroke-dasharray: 3 4; animation: pw-thread .9s ease both; }
@keyframes pw-thread { from { opacity: 0; } }
.pw-chip { --h: 70; position: relative; display: grid; grid-template-columns: 16px 26px 1fr; align-items: center; gap: 8px; text-align: left; padding: 8px 10px; border-radius: 12px; border: 1px solid transparent; background: none; color: var(--ink); cursor: pointer; min-height: 52px; }
.pw-chip:hover, .pw-chip:focus-visible { background: rgba(255, 255, 255, .45); border-color: oklch(0.6 0.09 var(--h) / .45); }
.pw-chip-star { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid oklch(0.6 0.09 var(--h)); background: var(--paper); justify-self: center; transition: all .4s ease; z-index: 1; }
.pw-chip.is-woven .pw-chip-star { background: #F6C453; border-color: #C99A3C; box-shadow: 0 0 0 4px rgba(246, 196, 83, .25), 0 0 16px rgba(246, 196, 83, .9); }
.pw-chip-numeral { font: 500 14px var(--serif); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: oklch(0.955 0.028 var(--h)); color: oklch(0.36 0.075 var(--h)); }
.pw-chip-text { display: grid; min-width: 0; }
.pw-chip-deck { font: 600 10px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: oklch(0.36 0.075 var(--h)); }
.pw-chip-title { font: italic 500 16px/1.2 var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-chip.is-nudge { animation: pw-nudge 2.4s ease-in-out infinite; }
@keyframes pw-nudge { 50% { background: oklch(0.955 0.028 var(--h)); box-shadow: 0 0 24px oklch(0.75 0.1 var(--h) / .55); } }
.pw-whisper { margin: 0; min-height: 1.4em; font: italic 400 15px var(--serif); color: var(--ink-3); padding-left: 12px; }

.pw-paper { grid-column: 2; grid-row: 1; overflow-y: auto; overscroll-behavior: contain; padding: 24px 4px 0; scrollbar-width: thin; }
.pw-sheet-of-paper { background: var(--paper); border-radius: 3px; min-height: calc(100% - 24px); padding: clamp(28px, 6vw, 72px) clamp(22px, 6vw, 76px) 45vh;
  box-shadow: 0 1px 0 #fff inset, 0 30px 60px rgba(60, 40, 20, .14), 0 2px 6px rgba(60, 40, 20, .08);
  background-image: radial-gradient(rgba(120, 90, 50, .05) 1px, transparent 1px); background-size: 3px 3px; }
.pw-title { width: 100%; border: 0; border-bottom: 1px solid rgba(140, 106, 44, .25); background: transparent; font: 500 clamp(28px, 4vw, 38px)/1.2 var(--serif); color: var(--ink); padding: 0 0 10px; margin-bottom: 26px; outline: none; }
.pw-title::placeholder { color: rgba(108, 99, 90, .55); }
.pw-write { display: grid; }
.pw-mirror, .pw-body { grid-area: 1 / 1; font: 400 clamp(19px, 2.1vw, 21px)/1.7 var(--serif); letter-spacing: 0; white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; tab-size: 4; padding: 0; margin: 0; border: 0; }
.pw-mirror { color: var(--ink); pointer-events: none; }
.pw-body { resize: none; overflow: hidden; background: transparent; color: transparent; caret-color: var(--accent); outline: none; min-height: 40vh; }
.pw-body::placeholder { color: rgba(108, 99, 90, .6); font-style: italic; }
.pw-body::selection { background: rgba(201, 154, 60, .3); color: transparent; }
.pw-write.is-plain .pw-body { color: var(--ink); }
.pw-write.is-plain .pw-body::selection { color: var(--ink); }
.pw-write.is-plain .pw-mirror { visibility: hidden; }
.pw-wet { animation: pw-dry 1.6s ease-out both; }
@keyframes pw-dry { from { color: #1F2A5C; text-shadow: 0 0 .6px rgba(31, 42, 92, .7), 0 .5px 1px rgba(31, 42, 92, .25); } to { color: var(--ink); text-shadow: none; } }
.pw-caret { display: inline; }

.pw-candle-side { grid-column: 3; grid-row: 1; align-self: center; display: grid; justify-items: center; gap: 10px; text-align: center; }
.pw-candle { --burnt: 0; --lean: 0deg; display: grid; justify-items: center; gap: 4px; }
.pw-candle-svg { width: 76px; height: 210px; overflow: hidden; }
.pw-candle-plate { fill: #6B5644; }
.pw-candle-body { transform: translateY(calc(var(--burnt) * 118px)); transition: transform 1s linear; }
.pw-flame-wrap { transform-box: fill-box; transform-origin: 50% 100%; transform: rotate(var(--lean)); transition: transform .35s ease; }
.pw-flame { transform-box: fill-box; transform-origin: 50% 85%; animation: pw-flame 1.8s ease-in-out infinite; transition: opacity .6s, transform .6s; }
.pw-flame-glow { animation: pw-glow 2.4s ease-in-out infinite; }
@keyframes pw-flame { 0%, 100% { transform: scale(1, 1); } 25% { transform: scale(.96, 1.06); } 50% { transform: scale(1.04, .95) skewX(-2deg); } 75% { transform: scale(.98, 1.03) skewX(2deg); } }
@keyframes pw-glow { 50% { opacity: .75; } }
.pw-candle.is-idle .pw-flame-wrap { transform: rotate(var(--lean)) scale(.82); opacity: .8; }
.pw-candle.is-unlit .pw-flame-wrap, .pw-candle.is-out .pw-flame-wrap { opacity: 0; transform: scale(.2); transition: opacity .8s, transform .8s; }
.pw-smoke { opacity: 0; stroke-dasharray: 90; stroke-dashoffset: 90; }
.pw-candle.is-out .pw-smoke { animation: pw-smoke 3.2s ease-out forwards; }
@keyframes pw-smoke { 0% { opacity: 0; stroke-dashoffset: 90; } 20% { opacity: .8; } 100% { opacity: 0; stroke-dashoffset: 0; transform: translateY(-14px); } }
.pw-drip { opacity: 0; transform-box: fill-box; transform-origin: top; transform: scaleY(.2); transition: opacity 1.2s, transform 2.4s ease-out; }
.pw-candle[data-drips="1"] .pw-drip-1, .pw-candle[data-drips="2"] .pw-drip-1, .pw-candle[data-drips="2"] .pw-drip-2,
.pw-candle[data-drips="3"] .pw-drip { opacity: 1; transform: none; }
.pw-candle-time { margin: 0; min-height: 1.3em; font: 600 15px var(--sans); font-variant-numeric: tabular-nums; color: var(--ink-2); }
.pw-candle.is-overtime .pw-candle-time { color: var(--accent); }
.pw-candle-note { display: grid; gap: 2px; }
.pw-candle-said { margin: 0; font: 400 19px/1.3 var(--serif); }
.pw-candle-sub { margin: 0; font-size: 13px; color: var(--ink-3); }
.pw-candle-controls { display: grid; justify-items: center; gap: 8px; }
.pw-candle-ask { margin: 0; font: 600 11px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.pw-sprints { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pw-ember { position: fixed; z-index: 30; width: 5px; height: 5px; border-radius: 50%; background: #FFD27A; box-shadow: 0 0 10px 3px rgba(255, 170, 70, .7); pointer-events: none; animation: pw-ember 2.6s ease-out both; }
@keyframes pw-ember { from { opacity: 1; transform: none; } to { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.3); } }

.pw-room-bar { grid-column: 1 / -1; grid-row: 2; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(140, 106, 44, .2); background: rgba(245, 239, 227, .7); backdrop-filter: blur(8px); }
.pw-words { font: 600 14px var(--sans); font-variant-numeric: tabular-nums; }
.pw-saved { font-size: 13px; color: var(--ink-3); }
.pw-saved.is-bad { color: #B3261E; font-weight: 600; }
.pw-btn-seal { background: oklch(0.36 0.075 25); color: #FFF4EA; border-color: transparent; }
.pw-btn-seal:hover, .pw-btn-seal:focus-visible { background: oklch(0.32 0.08 25); }

/* the card sheet in the room */
.sheet.pw-sheet { background: var(--paper); color: var(--ink); font-family: var(--sans); }
.pw-sheet-card { display: grid; justify-items: center; gap: 14px; text-align: center; }
.pw-card-big { width: min(290px, 74vw); }
.pw-sheet-note { margin: 0; font-size: 13.5px; color: var(--ink-3); max-width: 36ch; }
.pw-sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pw-weave.is-on { background: linear-gradient(180deg, #F6D58C, #E3B455); border-color: transparent; color: var(--ink); }
.pw-story-sheet { display: grid; gap: 10px; }
.pw-sheet-title { margin: 0; font: 500 30px/1.1 var(--serif); }
.pw-sheet-meta { margin: 0; color: var(--ink-3); font-size: 13.5px; }
.pw-sheet-excerpt { margin: 4px 0 8px; font: italic 400 17px/1.5 var(--serif); color: var(--ink-2); }
.pw-story-sheet .pw-sheet-actions { justify-content: flex-start; }

/* ---------- sealing ---------- */
.pw-sealing { width: min(900px, 100%); display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: clamp(24px, 5vw, 64px); perspective: 1600px; }
.pw-book { --h: 30; position: relative; width: clamp(230px, 34vw, 320px); aspect-ratio: 3 / 4; transform-style: preserve-3d; animation: pw-fold 1.3s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes pw-fold { 0% { transform: scale(1.35) rotateY(0); filter: sepia(.4) brightness(1.6) saturate(.4); } 55% { filter: none; } 100% { transform: rotateY(-16deg) rotateX(4deg); } }
.pw-book-front { position: absolute; inset: 0; border-radius: 3px 10px 10px 3px; padding: 11% 10%; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; color: var(--on-night);
  background: radial-gradient(120% 80% at 30% 10%, oklch(0.36 0.07 var(--h)), oklch(0.2 0.04 var(--h)) 70%);
  box-shadow: inset 0 0 0 7px oklch(0.2 0.04 var(--h)), inset 0 0 0 8.5px rgba(232, 201, 138, .7), inset 0 0 0 12px oklch(0.2 0.04 var(--h)), inset 0 0 0 12.6px rgba(232, 201, 138, .45), 12px 24px 50px rgba(0, 0, 0, .55); }
.pw-book-spine { position: absolute; top: 0; bottom: 0; left: -14px; width: 16px; border-radius: 3px 0 0 3px; background: linear-gradient(90deg, oklch(0.16 0.03 var(--h)), oklch(0.26 0.05 var(--h))); transform: rotateY(-80deg); transform-origin: right; }
.pw-book-world { margin: 0; font: 600 10.5px var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.pw-book-title { margin: 8px 0 0; font: 500 clamp(24px, 3.4vw, 32px)/1.08 var(--serif); }
.pw-book-line { margin: 0; font: italic 400 15px/1.4 var(--serif); color: var(--on-night-2); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.pw-book-sky { margin-top: auto; width: 80%; }
.pw-book-stars line { stroke: rgba(232, 201, 138, .75); stroke-width: .9; }
.pw-book-stars circle { fill: rgba(244, 237, 224, .35); }
.pw-book-stars circle.on { fill: #FFE7A8; filter: drop-shadow(0 0 3px #FFD27A); }
.pw-book-count { margin: 0; font: 600 10.5px var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.pw-wax { position: absolute; right: -18px; bottom: 16%; width: 76px; height: 76px; padding: 18px; border-radius: 47% 53% 50% 50% / 52% 48% 52% 48%; color: rgba(70, 8, 10, .8);
  background: radial-gradient(circle at 36% 30%, #D2544A 0 12%, #A8282A 38%, #741619 78%); box-shadow: 0 3px 0 #5E1214, 0 10px 24px rgba(60, 6, 8, .5);
  animation: pw-stamp .55s 1.15s cubic-bezier(.3, 1.6, .5, 1) both; transform: translateZ(20px); }
.pw-wax svg { width: 100%; height: 100%; }
@keyframes pw-stamp { from { opacity: 0; transform: translateZ(20px) scale(2.6) rotate(-20deg); } }
.pw-keepsake { display: grid; gap: 14px; animation: pw-in .7s 1.6s both; }
.pw-recap { margin: 0; font: 400 clamp(22px, 3vw, 28px)/1.3 var(--serif); }
.pw-recap strong { font-weight: 500; color: var(--gold); }
.pw-recap-left { margin: 0; color: var(--on-night-2); font-size: 15px; line-height: 1.5; }
.pw-recap-left em { font: italic 400 17px var(--serif); color: var(--on-night); }
.pw-keepsake-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pw-sealing.is-still .pw-book, .pw-sealing.is-still .pw-wax, .pw-sealing.is-still .pw-keepsake { animation: none; }

/* ---------- the library ---------- */
.pw-library-shelf { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 4px; width: min(760px, 100%); padding: 0 12px; }
.pw-story { --wh: 30; --thick: 40px; position: relative; width: var(--thick); height: clamp(170px, 34vw, 230px); border: 0; border-radius: 3px 3px 1px 1px; color: #F7EBCF; cursor: pointer;
  background: linear-gradient(90deg, oklch(0.2 0.04 var(--wh)), oklch(0.36 0.075 var(--wh)) 35%, oklch(0.26 0.05 var(--wh)));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), 0 6px 14px rgba(0, 0, 0, .5); animation: pw-rise .7s both; transition: transform .3s; }
.pw-story:nth-child(3n) { height: clamp(160px, 31vw, 210px); } .pw-story:nth-child(4n+1) { height: clamp(180px, 36vw, 245px); }
.pw-story:hover, .pw-story:focus-visible { transform: translateY(-10px); outline: none; box-shadow: 0 0 30px oklch(0.72 0.14 var(--wh) / .5); }
.pw-story-title { position: absolute; inset: 14px 0 30px; writing-mode: vertical-rl; transform: rotate(180deg); font: 500 15px/1 var(--serif); text-align: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pw-story-wax { position: absolute; left: 50%; bottom: 8px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #D2544A, #741619); }
.pw-shelf-library { color: var(--on-night-2); }

/* ---------- phones ---------- */
@media (max-width: 860px) {
  .pw-room { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
  .pw-kit { grid-column: 1; grid-row: 1; align-self: start; padding: 6px 12px 0; gap: 2px; }
  .pw-chips { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
  .pw-stars { display: none; }
  .pw-chip { grid-template-columns: 12px 24px; min-height: 44px; padding: 6px 8px; flex: none; max-width: 170px; grid-auto-flow: column; }
  .pw-chip-text { display: none; }
  .pw-chip.is-woven { background: rgba(246, 196, 83, .16); }
  .pw-whisper { font-size: 13.5px; padding-left: 4px; min-height: 0; }
  .pw-paper { grid-column: 1; grid-row: 2; padding: 8px 8px 0; }
  .pw-candle-side { grid-column: 1; grid-row: 2; align-self: start; justify-self: end; position: relative; z-index: 2; margin: 14px 18px 0 0; gap: 2px; pointer-events: none; }
  .pw-candle-side > * { pointer-events: auto; }
  .pw-candle-svg { width: 30px; height: 84px; }
  .pw-candle-time { font-size: 12px; }
  .pw-candle-controls, .pw-candle-note { display: none; }
  .pw-candle-side.is-asking .pw-candle-controls { display: grid; }
  .pw-room-bar { grid-row: 3; gap: 8px 12px; }
  .pw-room-bar .pw-btn-seal { padding: 10px 16px; min-height: 44px; }
  .pw-sheet-of-paper { padding-right: 56px; }
  .pw-open-book { grid-template-columns: 1fr; }
  .pw-page-left { animation: none; }
  .pw-fan { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .pw-fanned { transform: none; }
  .pw-sealing { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .pw-keepsake-actions { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .pw *, .pw *::before, .pw *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .12s !important; }
  .pw-offer { animation: none; }
  .pw-ink { opacity: 1; }
}
@media (max-width: 860px) {
  .pw-candle-side.is-asking .pw-candle-controls { position: absolute; top: 100%; right: 0; margin-top: 6px; padding: 12px; width: 190px; border-radius: 14px; background: var(--paper); box-shadow: 0 12px 30px rgba(60, 40, 20, .2); }
}

/* a faint numeral at the foot of every face, and room for the words */
.pw-card-face::after { content: attr(data-numeral); position: absolute; right: 6cqw; bottom: 2cqw; font: 500 30cqw/1 var(--serif); color: oklch(0.6 0.09 var(--h) / .13); pointer-events: none; }
.pw-card-face.is-private::after { display: none; }
.pw-chip-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@media (max-width: 560px) {
  .pw-slot { padding: 0 6px; }
  .pw-slot-title { display: none; }
}
/* the stories stand in one row on the shelf, scrolling sideways when there are many */
.pw-library-shelf { flex-wrap: nowrap; overflow-x: auto; justify-content: safe center; padding-top: 16px; scrollbar-width: thin; }
.pw-story { flex: none; }
@media (max-width: 560px) { .pw-story { width: calc(var(--thick) * .72); } .pw-story-title { font-size: 13px; } }

/* the back of a card: a gilded frame and a ring around the deck's numeral */
.pw-card-back::before { content: ""; position: absolute; inset: 6cqw; border-radius: 3cqw; border: 1px solid oklch(0.82 0.065 var(--h) / .45);
  background: radial-gradient(circle at 0 0, oklch(0.82 0.065 var(--h) / .5) 0 1.2cqw, transparent 1.4cqw) 1.5cqw 1.5cqw / 100% 100% no-repeat,
    radial-gradient(circle at 100% 100%, oklch(0.82 0.065 var(--h) / .5) 0 1.2cqw, transparent 1.4cqw) -1.5cqw -1.5cqw / 100% 100% no-repeat; }
.pw-card-back::after { content: ""; position: absolute; left: 50%; top: 50%; width: 52cqw; height: 52cqw; margin: -32cqw 0 0 -26cqw; border-radius: 50%;
  border: 1px solid oklch(0.82 0.065 var(--h) / .4); box-shadow: 0 0 0 3cqw oklch(0.82 0.065 var(--h) / .05), inset 0 0 30px oklch(0.6 0.1 var(--h) / .35); }
.pw-back-numeral, .pw-back-name { position: relative; z-index: 1; }
.pw-offer::after { content: ""; position: absolute; left: 10%; right: 10%; bottom: -14%; height: 14%; border-radius: 50%; background: radial-gradient(closest-side, oklch(0.7 0.12 var(--h) / .35), transparent); filter: blur(6px); pointer-events: none; }
.pw:fullscreen { overflow-y: auto; }
.pw[data-scene="room"]:fullscreen .pw-stage { height: calc(100vh - 68px); }

/* ---------- the November town ---------- */
.pw-town { position: relative; width: min(760px, 100%); display: grid; justify-items: center; text-align: center; gap: 10px; }
.pw-town-sky { position: absolute; right: 2%; top: -6px; width: clamp(54px, 12vw, 84px); pointer-events: none; }
.pw-moon { width: 100%; filter: drop-shadow(0 0 22px rgba(255, 243, 196, .45)); }
.pw-town-tag { color: var(--gold); }
.pw-town .pw-hello-sub { margin-bottom: 4px; }
.pw-town-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; width: 100%; margin: 4px 0 0; }
.pw-town-stats div { padding: 10px 6px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(232, 201, 138, .16); }
.pw-town-stats dt { font: 600 10px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--on-night-floor); }
.pw-town-stats dd { margin: 2px 0 0; font: 500 clamp(20px, 3.4vw, 26px)/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.pw-town-road { width: 100%; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.pw-town-road-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #C99A3C, #FFE29A); box-shadow: 0 0 12px rgba(255, 210, 122, .6); transition: width 1.2s ease; }
.pw-hill { width: 100%; display: grid; gap: 0; margin-top: 18px; }
.pw-street { --row: 0; position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2%; padding: 0 calc(10% - var(--row) * 2.4%); margin-top: -2%;
  transform-origin: 50% 100%; }
.pw-street::after { content: ""; position: absolute; left: calc(4% - var(--row) * 1%); right: calc(4% - var(--row) * 1%); bottom: 2px; height: 10px; z-index: -1; border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  background: hsl(230 26% calc(9% + var(--row) * 1.6%)); }
.pw-lot { border: 0; background: none; padding: 0; cursor: pointer; border-radius: 8px; transition: transform .25s ease; }
.pw-lot:hover, .pw-lot:focus-visible { transform: translateY(-3px); outline: none; }
.pw-lot:focus-visible { box-shadow: 0 0 0 2px var(--gold); }
.pw-house { display: block; width: 100%; height: auto; overflow: visible; }
.pw-lot.is-future { opacity: .55; }
.pw-win { fill: #1D2033; transition: fill .8s ease; }
.pw-win.on { fill: #FFD37A; filter: drop-shadow(0 0 3px rgba(255, 196, 92, .9)); }
.pw-house-n { font: 600 6.5px var(--sans); fill: rgba(244, 237, 224, .55); }
.pw-lot.is-tonight .pw-house-n { fill: var(--gold); }
.pw-lamp { animation: pw-lamp 2.2s ease-in-out infinite; }
.pw-lamp-glow { animation: pw-lamp 2.2s ease-in-out infinite; }
@keyframes pw-lamp { 50% { opacity: .55; } }
.pw-smoke-puff { stroke-dasharray: 30; animation: pw-puff 4s ease-in-out infinite; }
@keyframes pw-puff { 0% { stroke-dashoffset: 30; opacity: 0; } 30% { opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; transform: translateY(-6px); } }
.pw-hill.is-done .pw-win.on { filter: drop-shadow(0 0 5px rgba(255, 196, 92, 1)); }
.pw-town-ground { width: 108%; height: 26px; margin-top: -6px; border-radius: 50% 50% 0 0 / 100% 100% 0 0; background: linear-gradient(180deg, hsl(230 26% 17%), var(--night)); }
.pw-town-goal { display: grid; justify-items: center; gap: 8px; margin-top: 6px; }
.pw-town-goal-label { margin: 0; font: 600 11px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--on-night-floor); }
.pw-goals { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pw-chip-btn.is-on { background: linear-gradient(180deg, #F1D79F, var(--deep-gold)); border-color: transparent; }
.pw-chip-btn:disabled { opacity: .5; cursor: default; }
.pw-town-actions { display: grid; justify-items: center; gap: 6px; margin-top: 8px; }
.pw-town.is-preview .pw-hello-sub { color: var(--gold); }
.pw-shelf-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; }
.pw-field { display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.pw-number { font: 500 22px var(--serif); padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(140, 106, 44, .4); background: #FFFDF7; color: var(--ink); width: 100%; box-sizing: border-box; }
.pw-lantern { position: fixed; z-index: 30; width: 9px; height: 12px; border-radius: 3px 3px 5px 5px; background: radial-gradient(circle at 50% 60%, #FFF1C4, #F7A440 70%); box-shadow: 0 0 14px 5px rgba(255, 170, 70, .55); pointer-events: none;
  animation: pw-lantern 8s ease-in both; }
@keyframes pw-lantern { 0% { opacity: 0; transform: none; } 10% { opacity: 1; } 50% { transform: translate(calc(var(--dx) * .5 + 10px), calc(var(--dy) * .5)); } 85% { opacity: .9; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.6); } }
@media (max-width: 560px) {
  .pw-town-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pw-street { padding: 0 calc(4% - var(--row) * .6%); }
}
@media (max-width: 480px) {
  #pwFullBtn { display: none; }
  .pw-bar { gap: 8px; }
  .pw-icon-btn { width: 40px; height: 40px; }
  .pw-town-sky { width: 44px; right: 0; top: -20px; }
}
