/* Draw From The Hat */

/* Fonts are self-hosted (SIL Open Font License, see fonts/OFL-LICENSE.txt) so pages make no third-party requests. */
@font-face { font-family: Fredoka; font-weight: 600; font-display: swap; src: url(fonts/fredoka-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: Nunito; font-weight: 400; font-display: swap; src: url(fonts/nunito-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Nunito; font-weight: 400; font-display: swap; src: url(fonts/nunito-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Nunito; font-weight: 700; font-display: swap; src: url(fonts/nunito-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Nunito; font-weight: 700; font-display: swap; src: url(fonts/nunito-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Nunito; font-weight: 800; font-display: swap; src: url(fonts/nunito-latin-800-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Nunito; font-weight: 800; font-display: swap; src: url(fonts/nunito-latin-ext-800-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Caveat; font-weight: 700; font-display: swap; src: url(fonts/caveat-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Caveat; font-weight: 700; font-display: swap; src: url(fonts/caveat-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --gold: #f4c34f;
  --gold2: #c98d1c;
  --paper: #fffdf7;
  --red: #b3203f;
  --ok: #1f7a4f;
  --w: clamp(190px, 56vw, 270px);
  color-scheme: dark;
  --bg: #1e2148;
  --deep: #151735;
  --glow: #3a3f8f;
  --ink: #f4f3ff;
  --soft: #cfd0f0;
  --text: #1f1d3a;
  --muted: #5d5b7a;
  --line: #dedcef;
  --chip: #eeedf9;
  --tint: #f5f4fc;
  --accent: #3b46c4;
  --accent2: #2a3399;
  --hat: #2b2838;
  --hat-hi: #4d4864;
  --hat-lo: #121019;
  --brim: #363246;
  --brim-line: #4d4864;
  --band: #f4c34f;
  --band-hi: #ffe08a;
  --hole: #09080d;
  --slip-ink: #3b3a8f;
  --sky-dot: rgba(255, 240, 200, .7);
  --sky-dot2: rgba(255, 255, 255, .25);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  background: radial-gradient(ellipse 110% 640px at 50% -120px, var(--glow), transparent) no-repeat, var(--bg);
  color: var(--ink);
  font: 17px/1.55 Nunito, system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow-x: clip;
}
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a { color: inherit; }
button { font: 800 16px Nunito, system-ui, sans-serif; cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* page modes - set in <head> before paint */
html:not([data-mode="reveal"]) #reveal { display: none; }
html[data-mode="reveal"] #create { display: none; }

/* ---------- header ---------- */
.top { max-width: 720px; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 20px 0; display: flex; justify-content: center; }
.brand { display: inline-flex; align-items: center; gap: 16px; text-decoration: none; font: 600 36px/1 Fredoka, Nunito, sans-serif; letter-spacing: -.01em; }
.logo { width: 80px; height: 80px; flex: none; }
@media (max-width: 480px) {
  .brand { gap: 10px; font-size: 28px; }
  .logo { width: 52px; height: 52px; }
}
.logo-disc { fill: var(--paper); }
.logo-crown { fill: var(--hat); }
.logo-top { fill: var(--hat-hi); }
.logo-band { fill: var(--band); }
.logo-brim { fill: var(--hat-lo); }
.logo-slip { fill: var(--paper); stroke: var(--slip-ink); stroke-width: 1.5; }
.logo-slip-line { stroke: var(--slip-ink); opacity: .65; fill: none; }
.spark { fill: var(--gold2); }

/* ---------- layout ---------- */
main { max-width: 720px; margin: 0 auto; padding: 8px 20px 28px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
main > * { min-width: 0; }

.hero { text-align: center; padding-bottom: 28px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.lede { margin: 16px auto 0; color: var(--soft); font: 400 clamp(17px, 2.4vw, 20px)/1.5 Nunito, sans-serif; max-width: 52ch; text-wrap: pretty; }

.step, .card {
  background: var(--paper);
  color: var(--text);
  border-radius: 22px;
  padding: 22px clamp(18px, 4.5vw, 30px) 24px;
  box-shadow: 0 14px 34px rgba(10, 0, 20, .3);
  transition: opacity .25s;
}
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.num { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: var(--text); display: grid; place-items: center; font: 600 18px Fredoka, sans-serif; box-shadow: 0 2px 0 var(--gold2); }
.step h2 { font: 600 22px/1.2 Fredoka, Nunito, sans-serif; margin: 0; }
.opt { font: 700 13px Nunito, sans-serif; color: var(--muted); background: var(--chip); padding: 2px 9px; border-radius: 999px; vertical-align: 3px; margin-left: 4px; }
.sub { display: block; margin: 0 0 12px; color: var(--muted); }
.step.is-off { opacity: .5; }

textarea, input[type="text"] {
  width: 100%;
  font: 600 17px/1.5 Nunito, system-ui, sans-serif;
  color: var(--text);
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 11px 14px;
}
textarea { min-height: 156px; resize: vertical; display: block; }
textarea::placeholder, input::placeholder { color: #b7a9ae; font-weight: 600; }
textarea:focus, input[type="text"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.count-row { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 0; }
.count { font-weight: 800; }
.warn { margin: 8px 0 0; color: var(--red); font-weight: 700; }

/* chips + rules */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-weight: 700; color: var(--text); background: var(--chip);
  border: 2px solid transparent; border-radius: 999px;
  padding: 7px 15px; min-height: 44px; max-width: 100%;
  overflow-wrap: anywhere; transition: background-color .15s, border-color .15s, transform .1s;
}
.chip:hover { border-color: var(--line); }
.chip:active { transform: scale(.97); }
.chip.is-sel { background: var(--accent); border-color: var(--accent2); color: #fff; }
.chip.is-linked { border-color: var(--red); border-style: dashed; }
.chips-empty { margin: 0; color: var(--muted); font-style: italic; }

.rules { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.rule { display: flex; align-items: center; gap: 10px; background: var(--tint); border-radius: 14px; padding: 8px 8px 8px 14px; }
.rule-body { flex: 1; min-width: 0; }
.rule-names { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-weight: 800; overflow-wrap: anywhere; }
.rule-text { display: block; color: var(--muted); font-size: 14px; }
.dir, .x { flex: none; border: 2px solid var(--line); background: #fff; color: var(--text); border-radius: 10px; }
.dir { width: 44px; height: 34px; font-size: 18px; line-height: 1; }
.x { width: 40px; height: 40px; font-size: 22px; line-height: 1; border-color: transparent; background: transparent; color: var(--muted); }
.x:hover { color: var(--red); }
.feasible { margin: 14px 0 0; font-weight: 700; }
.feasible:empty { display: none; }
.feasible.ok { color: var(--ok); }
.feasible.bad { color: var(--red); }

/* buttons */
.btn-gold {
  background: var(--gold); color: #2b1a10; border: 0; border-radius: 14px;
  height: 52px; padding: 0 24px; box-shadow: 0 3px 0 var(--gold2); flex: none;
}
.btn-gold:hover:not(:disabled) { filter: brightness(1.06); }
.btn-gold:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--gold2); }
.btn-gold:disabled { opacity: .45; cursor: not-allowed; }
.btn-wide { width: 100%; font-size: 18px; }
.btn-line { background: #fff; color: var(--text); border: 2px solid var(--line); border-radius: 14px; height: 48px; padding: 0 18px; }
.btn-line:hover { border-color: var(--muted); }
.btn-light { background: transparent; color: var(--ink); border-color: rgba(255, 255, 255, .5); }
.btn-light:hover { background: rgba(255, 255, 255, .1); border-color: var(--ink); }

.row { display: flex; gap: 8px; }
.row input { flex: 1; min-width: 0; height: 52px; }
.row-2 { margin-top: 8px; }
.row-2 .btn-line { flex: 1; }
.result { margin-top: 16px; }
.notes { margin: 14px 0 0; padding-left: 20px; color: var(--muted); font-size: 15px; display: grid; gap: 4px; }
.stale { margin: 12px 0 0; font-weight: 700; color: var(--red); }

/* reset row */
.reset-row { text-align: center; padding: 4px 0 8px; }
.reset-row .btn-line { color: var(--red); border-color: var(--red); min-width: 110px; opacity: .8; }
.reset-row .btn-line:hover { opacity: 1; background: #fdeef0; border-color: var(--red); }

/* how it works */
.how { padding: 18px 2px 0; }
.how h2 { font: 600 clamp(24px, 4vw, 30px)/1.15 Fredoka, Nunito, sans-serif; margin: 0 0 14px; text-wrap: balance; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 28px; }
@media (max-width: 540px) {
  .how-grid { grid-template-columns: repeat(2, 1fr); }
  .how-grid > div:last-child:nth-child(odd) { grid-column: 1 / -1; max-width: 50%; margin: 0 auto; text-align: center; }
  .how h2 { text-align: center; }
}
@media (max-width: 360px) { .how-grid { grid-template-columns: 1fr; text-align: center; } }
.how h3 { font: 600 18px/1.25 Fredoka, Nunito, sans-serif; margin: 0 0 4px; color: var(--gold); }
.how p { margin: 0; color: var(--soft); }
.how-edit-row { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--line); text-align: center; }

.noscript { max-width: 680px; margin: 0 auto 30px; padding: 16px 20px; background: var(--paper); color: var(--text); border-radius: 14px; font-weight: 700; }

/* ---------- reveal ---------- */
#reveal { gap: 16px; }
.card { margin-top: 18px; }
.eyebrow { margin: 0 0 2px; font-weight: 800; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--slip-ink); }
.r-title { font: 600 clamp(30px, 6.5vw, 42px)/1.08 Fredoka, Nunito, sans-serif; letter-spacing: -.02em; margin: 0 0 24px; text-wrap: balance; }
.welcome { margin-top: 14px; padding: 12px 14px; background: var(--tint); border-radius: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.welcome p { margin: 0; font-weight: 700; flex: 1 1 180px; }
.msg { margin: 14px 0 0; padding: 12px 14px; border-radius: 14px; font-weight: 700; background: var(--tint); }
.msg.warn { color: var(--red); background: #fdeef0; }
.msg.lock { color: var(--text); background: #fff4d6; border: 2px solid var(--gold); }
.msg.ok { color: var(--accent2); background: #eceefe; }
.msg strong { display: block; font: 600 19px/1.2 Fredoka, sans-serif; margin-bottom: 2px; }
.broken p { margin: 10px 0 0; font-weight: 700; color: var(--red); }
.r-result { margin-top: 14px; padding: 18px 16px 16px; background: #eceefe; border-radius: 14px; text-align: center; }
.r-result-eyebrow { margin: 0 0 4px; font-size: 13px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--accent2); }
.r-result-name { display: block; font: 700 clamp(26px, 6.5vw, 38px)/1.1 Fredoka, sans-serif; color: var(--accent2); }

.stage {
  position: relative;
  height: calc(var(--w) * 1.62 + 56px);
  border-radius: 24px;
  overflow: hidden;
  background: radial-gradient(ellipse 60% 50% at 50% 78%, var(--glow), transparent 72%), var(--deep);
  isolation: isolate;
}
.sky {
  position: absolute; inset: -60px 0 0; z-index: -1;
  background:
    radial-gradient(var(--sky-dot) 1.3px, transparent 1.9px) 7px 11px / 71px 59px,
    radial-gradient(var(--sky-dot2) 1px, transparent 1.6px) 31px 37px / 43px 47px;
  animation: twinkle 4s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .55; } to { opacity: 1; } }

.floor { position: absolute; left: 50%; bottom: 30px; width: calc(var(--w) * 1.25); height: 24px; transform: translateX(-50%); border-radius: 50%; background: rgba(0, 0, 0, .32); }

.hat { position: absolute; left: 50%; bottom: 36px; width: var(--w); height: calc(var(--w) * 220 / 240); transform: translateX(-50%); }
.hat svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.hat-back { z-index: 1; }
.hat-front { z-index: 3; pointer-events: none; }
.brim { fill: var(--brim); }
.brim-edge { fill: none; stroke: none; }
.brim-shine { fill: none; stroke: rgba(255, 255, 255, .12); stroke-width: 3; }
.hole { fill: var(--hole); }
.band { fill: var(--band); }
.band-hi { fill: var(--band-hi); opacity: .6; }
.s-hi { stop-color: var(--hat-hi); }
.s-mid { stop-color: var(--hat); }
.s-lo { stop-color: var(--hat-lo); }
.sparkles { fill: var(--gold); }

.slip {
  position: absolute; z-index: 2; left: 50%; top: calc(var(--w) * .33);
  width: calc(var(--w) * .5); height: calc(var(--w) * .46);
  transform: translate(-50%, 0);
  background: var(--paper); color: var(--text);
  border-radius: 6px 6px 3px 3px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
  padding: calc(var(--w) * .045) 8px 0;
  text-align: center;
  transition: transform .85s cubic-bezier(.2, 1.3, .4, 1) .1s;
}
.slip::before { content: ""; position: absolute; left: 8px; right: 8px; top: 6px; height: 3px; border-radius: 2px; background: var(--slip-ink); opacity: .25; }
.slip small { display: block; font-weight: 800; font-size: clamp(12px, calc(var(--w) * .052), 14px); line-height: 1.2; color: var(--slip-ink); margin-top: 4px; }
.slip b { display: block; margin-top: 2px; font: 700 calc(var(--w) * .17 * var(--fs, 1))/1.02 Caveat, "Segoe Print", cursive; overflow-wrap: anywhere; }

.hat.open .slip { transform: translate(-50%, calc(var(--w) * -.55)) rotate(-3deg); }
.hat.shake { animation: shake .9s ease-in-out; }
@keyframes shake {
  0%, 100% { transform: translateX(-50%) rotate(0); }
  15% { transform: translateX(-50%) rotate(-6deg); }
  30% { transform: translateX(-50%) rotate(5deg); }
  45% { transform: translateX(-50%) rotate(-4deg); }
  60% { transform: translateX(-50%) rotate(3deg); }
  78% { transform: translateX(-50%) rotate(-1.5deg); }
}

.bits { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.bits span {
  position: absolute; left: 50%; bottom: calc(36px + var(--w) * .66);
  width: 8px; height: 13px; border-radius: 2px; background: var(--c);
  animation: pop 1.5s cubic-bezier(.15, .7, .3, 1) forwards;
}
.bits span.star { width: 12px; height: 12px; border-radius: 0; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
@keyframes pop {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translate(var(--x), var(--y)) rotate(var(--r)); opacity: 0; }
}

.hint { position: absolute; left: 16px; right: 16px; top: 12px; margin: 0; text-align: center; color: var(--soft); font-weight: 700; font-size: 15px; z-index: 5; }
.after { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 2px; }
.own { color: var(--soft); font-weight: 700; margin-top: 20px; }
.own:hover { color: var(--ink); }

/* ---------- edit modal ---------- */
.edit-modal { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .55); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; padding: 20px; }
.edit-modal-box { background: var(--paper); color: var(--text); border-radius: 22px; padding: 24px clamp(18px, 4.5vw, 28px) 22px; max-width: 480px; width: 100%; box-shadow: 0 20px 50px rgba(0, 0, 0, .45); }
.edit-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.edit-modal-head h2 { font: 600 22px/1.2 Fredoka, Nunito, sans-serif; margin: 0; }
.edit-modal-close { background: none; border: 0; padding: 2px 8px; color: var(--muted); font-size: 26px; line-height: 1; border-radius: 8px; }
.edit-modal-close:hover { color: var(--text); }
.edit-modal-box > p { margin: 0 0 14px; color: var(--muted); font-size: 15px; }
.edit-modal .btn-line { height: 52px; }
.edit-modal .msg { margin: 10px 0 0; }

/* ---------- link modal ---------- */
.link-modal { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .55); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; padding: 20px; }
.link-modal-bits { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.page-bits { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.link-modal-bits span, .page-bits span { position: absolute; left: 50%; top: 0; width: 8px; height: 13px; border-radius: 2px; background: var(--c); animation: pop 1.8s cubic-bezier(.1, .6, .3, 1) forwards; }
.link-modal-bits span.star, .page-bits span.star { width: 12px; height: 12px; border-radius: 0; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.link-modal-bits .fw, .page-bits .fw { width: 5px; height: 5px; border-radius: 50%; animation-duration: 1.1s; animation-timing-function: cubic-bezier(.2, .9, .4, 1); }
.link-modal-box { background: var(--paper); color: var(--text); border-radius: 22px; padding: 24px clamp(18px, 4.5vw, 28px) 22px; max-width: 540px; width: 100%; box-shadow: 0 20px 50px rgba(0, 0, 0, .45); position: relative; }
.link-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.link-modal-head h2 { font: 600 22px/1.2 Fredoka, Nunito, sans-serif; margin: 0; }
.link-modal-box .linkbox { margin-bottom: 8px; background: #edf7f1; border-color: #2f9b66; color: var(--ok); }
.link-modal-box .lb-slug { color: #166038; }
.link-actions { display: flex; gap: 8px; }
.link-actions .btn-gold, .link-actions .btn-line { flex: 1; }
.link-actions #copy { border: 2px solid transparent; }
.link-actions #copy.copied { background: #fff; color: var(--text); box-shadow: none; border-color: var(--line); }
.modal-divider { border: none; border-top: 1px solid var(--line); margin: 18px 0 14px; }
.link-modal-box #title { display: block; width: 100%; margin-bottom: 10px; height: 52px; }
.shuffle-btn { display: block; width: 100%; }

/* ---------- step 3 ---------- */
.small { font-size: 15px; }
.linkbox {
  display: flex; align-items: baseline; min-width: 0;
  background: var(--tint); border: 2px dashed var(--line); border-radius: 14px;
  padding: 12px 14px; font-weight: 700; font-size: 15px; color: var(--muted);
  white-space: nowrap; overflow: hidden;
}
.lb-base { flex: none; }
.lb-slug { flex: none; color: var(--text); max-width: 70%; overflow: hidden; text-overflow: ellipsis; }
.lb-code { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.lb-open { flex: none; display: flex; align-items: center; padding: 2px 2px 2px 8px; color: var(--ok); opacity: .6; text-decoration: none; }
.lb-open:hover { opacity: 1; }
.share-menu { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.share-menu a { flex: 1 1 100px; display: grid; place-items: center; height: 46px; border-radius: 12px; background: var(--chip); color: var(--text); font-weight: 800; text-decoration: none; }
.share-menu a:hover { background: var(--line); }
.suggest { display: block; margin-top: 10px; height: 44px; }
.linklike { background: none; border: 0; padding: 4px; color: var(--soft); font: 700 14px Nunito, sans-serif; text-decoration: underline; text-underline-offset: 3px; opacity: .8; }
.linklike:hover { opacity: 1; color: var(--ink); }

/* ---------- footer ---------- */
.foot { max-width: 720px; margin: 10px auto 0; padding: 22px 20px max(28px, env(safe-area-inset-bottom)); color: var(--soft); font-size: 14px; border-top: 1px solid rgba(255, 255, 255, .12); }
.foot p { margin: 6px 0 0; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 6px; }
.foot-nav a { color: var(--ink); font-weight: 800; text-decoration: none; padding: 4px 0; }
.foot-nav a:hover, .foot-nav a[aria-current="page"] { color: var(--gold); }
.foot-nav button { background: none; border: 0; padding: 4px 0; color: var(--ink); font: 800 14px Nunito, system-ui, sans-serif; cursor: pointer; }
.foot-nav button:hover { color: var(--gold); }
#foot-own { display: none; }
html[data-mode="reveal"] #foot-own { display: inline-flex; align-items: center; background: var(--gold); color: #2b1a10; border: 0; border-radius: 14px; height: 40px; padding: 0 18px; font: 800 14px Nunito, system-ui, sans-serif; box-shadow: 0 3px 0 var(--gold2); cursor: pointer; }
html[data-mode="reveal"] #foot-own:hover { filter: brightness(1.06); }
.copy { opacity: .7; }

/* ---------- content pages (about, privacy, terms) ---------- */
.page { max-width: 720px; }
.page .card { margin-top: 18px; }
.prose h1 { font: 600 clamp(32px, 6.5vw, 46px)/1.08 Fredoka, Nunito, sans-serif; letter-spacing: -.02em; margin: 0 0 10px; }
.prose h2 { font: 600 22px/1.25 Fredoka, Nunito, sans-serif; margin: 26px 0 6px; }
.prose p, .prose li { color: #3e3c5a; }
.prose p { margin: 0 0 12px; }
.prose h3 { font: 600 18px/1.3 Fredoka, Nunito, sans-serif; margin: 18px 0 4px; }
.prose ul, .prose ol { margin: 0 0 12px; padding-left: 22px; display: grid; gap: 4px; }
.prose a { color: var(--slip-ink); font-weight: 700; }
.prose .updated { color: var(--muted); font-size: 14px; }
.cta { display: inline-grid; place-items: center; margin-top: 8px; text-decoration: none; }

/* ---------- wishlist ---------- */
.wish-card { margin-top: 0; }
.wish-h { font: 600 22px/1.2 Fredoka, Nunito, sans-serif; margin: 0 0 12px; color: var(--text); }
.wish-text { margin: 0; font-weight: 700; color: var(--text); white-space: pre-wrap; line-height: 1.6; }
.wish-none .sub { margin-bottom: 12px; }
.wish-nudge-btn { width: 100%; }
#wish-input { min-height: 90px; resize: vertical; display: block; margin-bottom: 0; }
.wish-count { margin: 5px 0 0; min-height: 18px; font-size: 13px; color: var(--muted); text-align: right; }
#wish-submit { margin-top: 10px; }
.wish-saved { display: flex; flex-direction: column; gap: 12px; }
.wish-saved-row { display: flex; align-items: center; gap: 10px; }
.wish-ok { font-weight: 800; color: var(--ok); flex: 1; }
.wish-ok::before { content: "✓  "; }

/* ---------- wishlist scroll button ---------- */
.wish-scroll-btn { width: 100%; margin-top: 10px; }

/* ---------- wider screens ---------- */
@media (min-width: 760px) {
  :root { --w: 240px; }
  html[data-mode="reveal"] #reveal,
  html[data-mode="reveal"] .top,
  html[data-mode="reveal"] .foot { max-width: 540px; }
}

@media (prefers-reduced-motion: reduce) {
  .slip { transition: none; }
  .hat.shake, .sky { animation: none !important; }
  .bits { display: none; }
}
