/* Christmas English Advent Calendar — @teachercami.r
   VOICE: warm, nostalgic, an illustrated storybook — never childish.
   IDEA: a real wooden advent calendar in a snowy village at night.
   PICTURE: the glowing village panorama + 25 little doors that swing open.
   COLOUR & TYPE: forest green night, warm cream paper, muted red, soft gold; Playfair Display + DM Sans.
   LAYOUT: green hero → cream "how" → sage calendar → green certificate → cream creator → green footer. */

/* Self-hosted fonts (SIL Open Font License — see fonts/ folder) */
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/playfair-display-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/playfair-display-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Playfair Display"; font-style: italic; font-weight: 600; font-display: swap; src: url(../fonts/playfair-display-latin-600-italic.woff2) format("woff2"); }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/dm-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/dm-sans-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/dm-sans-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "DM Sans"; font-style: italic; font-weight: 400; font-display: swap; src: url(../fonts/dm-sans-latin-400-italic.woff2) format("woff2"); }

:root {
  --green: #244B3D; --green-d: #1B3A2F; --green-2: #3C6B57; --red: #B9514B; --red-d: #8E3B36;
  --cream: #F6F0E5; --paper: #FFFDF8; --gold: #D6B879; --gold-d: #9E7C3A; --brown: #493A35; --sage: #DDE6DA;
  --ink: #33291F; --muted: #6B5D55;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 16px; --shadow: 0 10px 30px rgba(36, 75, 61, .14);
  color-scheme: light;
}
* { box-sizing: border-box; min-width: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
html.reduce { scroll-behavior: auto; }
html.reduce *, html.reduce *::before, html.reduce *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--cream); color: var(--ink); font: 17px/1.6 var(--sans); overflow-x: clip; }
h1, h2, h3, h4 { font-family: var(--serif); color: var(--green); line-height: 1.12; margin: 0 0 .5em; text-wrap: balance; }
h2 { font-size: clamp(30px, 4.4vw, 44px); }
h3 { font-size: 23px; }
p { margin: 0 0 1em; }
a { color: var(--red-d); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--gold); color: var(--green-d); padding: 10px 16px; border-radius: 10px; z-index: 100; font-weight: 700; }
.skip:focus { top: 12px; }
.muted { color: var(--muted); font-weight: 400; }
.tiny { font-size: 13.5px; }
.wrap { max-width: 1180px; margin: 0 auto; }
.band { padding: clamp(48px, 7vw, 96px) max(5vw, 18px); position: relative; }
#snow { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
.ill { display: block; flex: none; }
svg.ui { display: inline-block; vertical-align: -4px; flex: none; }

/* ------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 20px; border-radius: 999px; border: 2px solid transparent; font-weight: 700; font-size: 16px; cursor: pointer; text-decoration: none; transition: transform .15s, background .2s, box-shadow .2s, color .2s; -webkit-tap-highlight-color: transparent; }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--green); color: var(--cream); }
.btn-primary:hover:not(:disabled) { background: var(--green-d); box-shadow: 0 6px 18px rgba(36, 75, 61, .3); }
.btn-gold { background: var(--gold); color: var(--green-d); box-shadow: 0 6px 0 var(--gold-d); }
.btn-gold:hover:not(:disabled) { background: #E0C68E; }
.btn-gold:active:not(:disabled) { box-shadow: 0 3px 0 var(--gold-d); transform: translateY(3px); }
.btn-ghost { background: transparent; border-color: currentColor; color: var(--green); }
.btn-ghost:hover:not(:disabled) { background: rgba(36, 75, 61, .07); }
.btn-ghost.light { color: var(--cream); }
.btn-ghost.light:hover:not(:disabled) { background: rgba(246, 240, 229, .12); }
.btn-soft { background: var(--sage); color: var(--green); }
.btn-sm { min-height: 40px; padding: 7px 14px; font-size: 15px; }
.btn-xl { min-height: 62px; padding: 14px 34px; font-size: 20px; font-family: var(--serif); }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--sage); background: var(--paper); color: var(--green); cursor: pointer; font-size: 20px; font-weight: 700; flex: none; }
.icon-btn:hover:not(:disabled) { border-color: var(--green-2); }
.icon-btn:disabled { opacity: .4; }
.row-btns { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.row-btns.center { justify-content: center; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--sage); color: var(--green); font-size: 14px; font-weight: 700; white-space: nowrap; }
.pill-gold { background: #F3E6C8; color: var(--brown); }
.pill-dark { background: rgba(246, 240, 229, .12); color: var(--cream); }

/* ------------------------------------------------------------- topbar */
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px max(4vw, 14px); background: rgba(27, 58, 47, .94); backdrop-filter: blur(8px); color: var(--cream); border-bottom: 1px solid rgba(214, 184, 121, .25); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--cream); text-decoration: none; font-family: var(--serif); font-size: 18px; line-height: 1.1; }
.brand b { color: var(--gold); font-weight: 700; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-text { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(246, 240, 229, .35); background: transparent; color: var(--cream); cursor: pointer; font-size: 14px; font-weight: 500; }
.icon-text:hover { background: rgba(246, 240, 229, .1); }
.icon-text[aria-pressed="false"] { opacity: .7; }
@media (max-width: 640px) { .brand span { display: none; } .icon-text span { display: none; } .icon-text { width: 40px; justify-content: center; padding: 0; } }

/* ------------------------------------------------------------- hero */
.hero { position: relative; background: radial-gradient(120% 80% at 50% 0%, #2E5C4B 0%, var(--green) 45%, var(--green-d) 100%); color: var(--cream); text-align: center; padding: clamp(40px, 7vw, 84px) max(5vw, 18px) 0; overflow: hidden; }
.hero-inner { position: relative; z-index: 2; max-width: 780px; margin: 0 auto; }
.by { display: inline-block; font-size: 15px; letter-spacing: .02em; color: var(--sage); border: 1px solid rgba(214, 184, 121, .5); border-radius: 999px; padding: 5px 16px; margin-bottom: 22px; }
.by b { color: var(--gold); }
.hero h1 { color: var(--cream); font-size: clamp(42px, 8.4vw, 86px); line-height: 1.02; margin-bottom: 18px; }
.hero h1 em { color: var(--gold); font-style: italic; font-weight: 600; }
.slogan { font-family: var(--serif); font-style: italic; font-size: clamp(20px, 2.8vw, 27px); color: var(--gold); margin-bottom: 14px; }
.intro { font-size: 17.5px; color: #E6EDE3; max-width: 640px; margin: 0 auto 26px; }
.level-wrap { background: rgba(246, 240, 229, .07); border: 1px solid rgba(214, 184, 121, .35); border-radius: 22px; padding: 18px; margin: 0 auto 22px; max-width: 620px; transition: box-shadow .3s; }
.level-wrap.nudge { box-shadow: 0 0 0 4px var(--gold); animation: nudge .5s; }
@keyframes nudge { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.level-q { font-family: var(--serif); font-size: 21px; color: var(--cream); margin-bottom: 12px; }
.level-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.lv { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 70px; padding: 10px 6px; border-radius: 14px; border: 2px solid rgba(246, 240, 229, .3); background: rgba(27, 58, 47, .55); color: var(--cream); cursor: pointer; transition: all .2s; }
.lv b { font-family: var(--serif); font-size: 26px; line-height: 1; }
.lv span { font-size: 13.5px; opacity: .9; }
.lv:hover { border-color: var(--gold); }
.lv.on { background: var(--gold); border-color: var(--gold); color: var(--green-d); box-shadow: 0 6px 0 var(--gold-d); transform: translateY(-2px); }
.level-note { font-size: 14.5px; color: var(--sage); margin: 12px 0 0; min-height: 1.5em; }
.free { font-size: 14px; color: var(--sage); margin: 16px 0 0; }
.village { display: block; width: calc(100% + 2 * max(5vw, 18px)); margin-left: calc(-1 * max(5vw, 18px)) !important; height: clamp(170px, 26vw, 330px); margin-top: 10px; position: relative; z-index: 1; }
@media (max-width: 520px) { .level-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); } .lv { min-height: 60px; flex-direction: row; justify-content: center; gap: 10px; } .lv b { font-size: 22px; } }

/* ------------------------------------------------------------- how */
.how { background: var(--paper); }
.how h2, .how .lead { text-align: center; }
.lead { font-size: 18.5px; max-width: 760px; margin: 0 auto 36px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; background: var(--cream); border-radius: var(--r); padding: 20px; border: 1px solid #EDE3D1; }
.step-n { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--red); color: var(--cream); font-family: var(--serif); font-size: 21px; font-weight: 700; }
.steps h3 { font-size: 20px; margin-bottom: 6px; }
.steps p { font-size: 15.5px; margin: 0; color: var(--muted); }
@media (max-width: 980px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .steps { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------------- calendar */
.calendar { background: var(--sage); background-image: radial-gradient(rgba(36, 75, 61, .08) 1.5px, transparent 1.6px); background-size: 22px 22px; }
.calendar:focus { outline: none; }
.cal-head { text-align: center; }
.slogan2 { font-family: var(--serif); font-style: italic; color: var(--red-d); font-size: 19px; }
.progress { background: var(--paper); border-radius: 18px; padding: 16px 20px; margin: 10px auto 28px; max-width: 760px; box-shadow: var(--shadow); }
.progress p { margin: 0 0 10px; font-weight: 700; color: var(--green); text-align: center; }
.pbar { height: 16px; border-radius: 999px; background: #E9E2D3; overflow: hidden; }
.pbar i { display: block; height: 100%; width: 0; border-radius: 999px; background: repeating-linear-gradient(-45deg, var(--red) 0 12px, #C9675F 12px 24px); transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.doors { list-style: none; padding: clamp(14px, 2.4vw, 26px); margin: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(10px, 1.6vw, 18px); background: #6B4E3D; background-image: repeating-linear-gradient(90deg, rgba(0, 0, 0, .05) 0 3px, transparent 3px 46px), linear-gradient(#7A5A47, #5E4535); border-radius: 22px; border: 8px solid var(--brown); box-shadow: inset 0 0 0 3px rgba(214, 184, 121, .45), var(--shadow); }
.door-li.wide { grid-column: 1 / -1; }
.door { position: relative; display: block; width: 100%; aspect-ratio: 3 / 4; padding: 0; border: 0; background: none; cursor: pointer; perspective: 900px; border-radius: 12px; }
.door-li.wide .door { aspect-ratio: auto; height: clamp(120px, 16vw, 170px); }
.door-back { position: absolute; inset: 0; border-radius: 12px; background: var(--paper); box-shadow: inset 0 4px 14px rgba(73, 58, 53, .35); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px; text-align: center; }
.door-title { font-family: var(--serif); font-size: 13.5px; line-height: 1.15; color: var(--green); font-weight: 700; }
.badge { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; background: var(--green); color: var(--cream); display: grid; place-items: center; }
.door-leaf { position: absolute; inset: 0; border-radius: 12px; transform-origin: left center; transition: transform .7s cubic-bezier(.3, .7, .3, 1), box-shadow .3s; backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 3px solid var(--gold); box-shadow: 0 4px 0 rgba(0, 0, 0, .25); }
.door-leaf::before { content: ""; position: absolute; inset: 7px; border: 1.5px dashed rgba(246, 240, 229, .4); border-radius: 7px; }
.door .num { font-family: var(--serif); font-weight: 700; font-size: clamp(30px, 4.4vw, 46px); color: var(--cream); line-height: 1; text-shadow: 0 2px 0 rgba(0, 0, 0, .2); }
.leaf-ill { margin-top: 8px; opacity: .95; background: rgba(246, 240, 229, .92); border-radius: 50%; padding: 5px; }
.leaf-label { margin-top: 6px; font-family: var(--serif); font-style: italic; color: var(--gold); font-size: 18px; }
.knob { position: absolute; right: 10px; top: 50%; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 1px 0 rgba(0, 0, 0, .3); }
.c0 .door-leaf { background: var(--green); } .c1 .door-leaf { background: var(--red); } .c2 .door-leaf { background: #6E5243; }
.c3 .door-leaf { background: var(--green-2); } .c4 .door-leaf { background: var(--red-d); }
.door.finale .door-leaf { background: linear-gradient(135deg, var(--red) 0%, var(--red-d) 100%); flex-direction: row; gap: 18px; }
.door.finale .door-leaf::after { content: "★ ★ ★"; position: absolute; bottom: 12px; color: var(--gold); letter-spacing: 6px; font-size: 13px; }
.door.finale .num { font-size: clamp(46px, 6vw, 64px); }
.door:hover .door-leaf, .door:focus-visible .door-leaf { transform: rotateY(-24deg); box-shadow: 8px 6px 14px rgba(0, 0, 0, .3); }
.door.is-done .door-leaf { transform: rotateY(-100deg); }
.door.is-done:hover .door-leaf { transform: rotateY(-100deg); }
.door.is-done .door-back { box-shadow: inset 6px 0 0 var(--gold), inset 0 4px 14px rgba(73, 58, 53, .3); }
.door.is-done:hover .door-back { transform: translateY(-2px); }
.door-back { transition: transform .2s; }
.door:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
.weeks-note { text-align: center; color: var(--muted); font-size: 14.5px; margin-top: 22px; }
@media (max-width: 900px) { .doors { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 560px) { .doors { grid-template-columns: repeat(3, minmax(0, 1fr)); border-width: 6px; } .door-title { font-size: 12.5px; } .door-back .ill { width: 34px; height: 34px; } .leaf-ill { display: none; } }

/* ------------------------------------------------------------- certificate section */
.certificate { background: var(--green); color: var(--cream); }
.certificate h2 { color: var(--cream); text-align: center; }
.cert-box { max-width: 1060px; margin: 0 auto; }
.cert-locked { display: flex; gap: 24px; align-items: center; background: rgba(246, 240, 229, .07); border: 1px solid rgba(214, 184, 121, .4); border-radius: 22px; padding: 26px; }
.cert-locked h3 { color: var(--gold); }
.cert-locked p { color: #E6EDE3; }
.mini-doors { display: grid; grid-template-columns: repeat(25, minmax(0, 1fr)); gap: 4px; max-width: 520px; }
.mini-doors i { height: 14px; border-radius: 3px; background: rgba(246, 240, 229, .18); }
.mini-doors i.on { background: var(--gold); }
.cert-open { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 28px; align-items: center; }
.cert-open h3 { color: var(--gold); font-size: 28px; }
.cert-open p { color: #E6EDE3; }
.cert-form label { display: block; font-weight: 700; margin-bottom: 6px; }
.cert-form input { width: 100%; min-height: 52px; border-radius: 12px; border: 2px solid var(--gold); background: var(--paper); color: var(--ink); padding: 10px 14px; font-size: 18px; }
.cert-preview canvas { width: 100%; height: auto; border-radius: 10px; box-shadow: 0 20px 40px rgba(0, 0, 0, .35); background: var(--cream); display: block; }
@media (max-width: 820px) { .cert-open { grid-template-columns: minmax(0, 1fr); } .cert-preview { order: -1; } .cert-locked { flex-direction: column; text-align: center; } .mini-doors { margin: 0 auto; } }

/* ------------------------------------------------------------- creator & footer */
.creator { background: var(--cream); background-image: radial-gradient(rgba(214, 184, 121, .18) 1.5px, transparent 1.6px); background-size: 26px 26px; }
.creator-inner { max-width: 760px; text-align: center; }
.creator-title { font-size: clamp(28px, 4.2vw, 40px); }
.handle { color: var(--red); white-space: nowrap; text-decoration: none; }
a.handle:hover { text-decoration: underline; }
.creator-card { background: var(--paper); border: 1px solid #EDE3D1; border-radius: 28px; padding: clamp(24px, 4vw, 44px); box-shadow: var(--shadow); }
.portrait { position: relative; width: min(240px, 66vw); aspect-ratio: 1; margin: 0 auto 10px; }
.portrait img { position: absolute; inset: 9%; width: 82%; height: 82%; object-fit: cover; border-radius: 50%; border: 6px solid var(--green); box-shadow: 0 0 0 4px var(--gold), 0 14px 30px rgba(36, 75, 61, .25); background: var(--sage); }
.portrait-deco { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.portrait-name { font-family: var(--serif); font-size: 20px; color: var(--green); font-weight: 700; margin-bottom: 18px; }
.hello { font-size: clamp(24px, 3.4vw, 30px); color: var(--red-d); }
.creator-card > p { font-size: 17.5px; max-width: 600px; margin-left: auto; margin-right: auto; }
.btn-ig { background: linear-gradient(135deg, var(--red) 0%, var(--red-d) 100%); color: var(--cream); min-height: 56px; padding: 12px 28px; font-size: 18px; box-shadow: 0 6px 0 #6E2C28; margin-top: 6px; }
.btn-ig:hover { filter: brightness(1.06); }
.btn-ig:active { box-shadow: 0 3px 0 #6E2C28; transform: translateY(3px); }
.ig-handle { margin: 12px 0 18px; font-weight: 700; } .ig-handle a { color: var(--red-d); font-size: 18px; text-decoration: none; }
.signature { font-family: var(--serif); font-style: italic; font-size: 21px; color: var(--green); border-top: 2px dashed var(--sage); padding-top: 16px; }
.sig-by { display: block; font-family: var(--sans); font-style: normal; font-size: 15px; color: var(--red-d); font-weight: 700; margin-top: 4px; }
.footer { background: var(--green-d); color: var(--sage); padding: 48px max(5vw, 18px) 40px; text-align: center; }
.f-title { font-family: var(--serif); font-size: 26px; color: var(--cream); margin-bottom: 6px; }
.f-sig { color: var(--gold); font-style: italic; }
.f-sig b { font-style: normal; }
.f-ig a { color: var(--gold); font-weight: 700; }
.f-small { font-size: 13.5px; max-width: 720px; margin: 0 auto 18px; opacity: .85; }
.f-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ------------------------------------------------------------- dialogs */
dialog { border: 0; padding: 0; }
dialog::backdrop { background: rgba(20, 38, 31, .72); backdrop-filter: blur(3px); }
#act { width: min(820px, 100vw); max-width: 100vw; height: min(92vh, 980px); max-height: 100dvh; border-radius: 24px; background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .4); overflow: hidden; }
#act[open] { animation: pop .35s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes pop { from { transform: translateY(24px) scale(.97); opacity: 0; } }
.act-shell { display: flex; flex-direction: column; height: 100%; }
.act-head { display: flex; gap: 14px; align-items: center; padding: 16px 18px; background: var(--green); color: var(--cream); background-image: radial-gradient(rgba(246, 240, 229, .12) 1.5px, transparent 1.6px); background-size: 18px 18px; }
.act-ill { flex: none; width: 64px; height: 64px; border-radius: 50%; background: var(--cream); display: grid; place-items: center; border: 3px solid var(--gold); }
.act-meta { flex: 1; }
.act-week { margin: 0; font-size: 13px; color: var(--gold); font-weight: 700; }
.act-head h2 { color: var(--cream); font-size: clamp(22px, 3.4vw, 30px); margin: 2px 0 0; }
.act-day { color: var(--gold); font-style: italic; }
.act-status { margin: 4px 0 0; font-size: 14px; color: var(--sage); font-weight: 700; min-height: 0; }
.act-status:empty { display: none; }
.close { background: rgba(246, 240, 229, .12); border-color: rgba(246, 240, 229, .4); color: var(--cream); }
.act-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px clamp(16px, 3vw, 30px) 30px; }
.act-bar { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; background: var(--cream); border-radius: 14px; padding: 12px 14px; margin-bottom: 18px; }
.act-instr { margin: 0; font-size: 16.5px; flex: 1; }
.lvl-select { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--green); white-space: nowrap; }
.lvl-select select { min-width: 13em; min-height: 40px; border-radius: 10px; border: 2px solid var(--sage); background: var(--paper); padding: 4px 8px; font-size: 15px; }
.act-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid #EDE3D1; background: var(--cream); }
.act-sig { font-family: var(--serif); font-style: italic; color: var(--red-d); font-size: 15px; }
@media (max-width: 640px) {
  #act { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
  .act-ill { width: 48px; height: 48px; } .act-ill .ill { width: 38px; height: 38px; }
  .act-bar { flex-direction: column; }
  .act-sig { display: none; }
}
#act.finale .act-head { background-color: var(--red); background-image: radial-gradient(rgba(214, 184, 121, .3) 1.5px, transparent 1.6px); }
#act.finale .act-scroll { background: linear-gradient(var(--paper), var(--cream)); }
#celebrate { width: min(560px, 94vw); border-radius: 26px; background: var(--green); color: var(--cream); text-align: center; overflow: hidden; }
#confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cel-inner { position: relative; padding: 36px 28px 30px; }
#celebrate h2 { color: var(--gold); font-size: 44px; }
.cel-ill { display: grid; place-items: center; margin-bottom: 8px; }
.sig { font-family: var(--serif); font-style: italic; color: var(--gold); }
#copybox { width: min(520px, 94vw); border-radius: 20px; padding: 24px; background: var(--paper); }
#copybox textarea { width: 100%; border-radius: 12px; border: 2px solid var(--sage); padding: 10px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 30px); background: var(--brown); color: var(--cream); padding: 12px 20px; border-radius: 14px; font-weight: 500; font-size: 15px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); opacity: 0; pointer-events: none; transition: all .3s; z-index: 200; max-width: 92vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------- activity common */
.part-title { font-size: 21px; margin: 28px 0 12px; padding-top: 18px; border-top: 2px dashed var(--sage); }
.part-title:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.hint { color: var(--muted); font-size: 15.5px; }
.notice { background: #F7E9D6; border-left: 4px solid var(--gold); padding: 12px 14px; border-radius: 10px; font-size: 15.5px; }
.credit { font-size: 13.5px; color: var(--muted); margin: 8px 0 14px; }
.tag { display: inline-block; font-size: 12.5px; font-weight: 700; color: var(--red-d); background: #F6E1DE; padding: 2px 10px; border-radius: 999px; margin-bottom: 8px; }
.q-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.bar { height: 8px; border-radius: 999px; background: var(--sage); overflow: hidden; margin-bottom: 14px; }
.bar i { display: block; height: 100%; background: var(--green-2); transition: width .4s; }
.q-card { background: var(--cream); border-radius: 18px; padding: clamp(16px, 3vw, 24px); }
.q-ill, .mystery { display: grid; place-items: center; margin-bottom: 8px; }
.mystery .ill { animation: wiggle 2.4s ease-in-out infinite; }
@keyframes wiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-8deg); } 90% { transform: rotate(8deg); } 95% { transform: rotate(-4deg); } }
.clues { margin: 0 0 12px; padding-left: 22px; }
.clues li { font-size: 17.5px; margin-bottom: 6px; animation: fadein .4s; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } }
.q-text { font-family: var(--serif); font-size: clamp(20px, 2.8vw, 24px); color: var(--green); font-weight: 700; line-height: 1.3; }
.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.opts.tf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 560px) { .opts { grid-template-columns: minmax(0, 1fr); } .opts.tf { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.opt { min-height: 52px; padding: 10px 14px; border-radius: 14px; border: 2px solid #E3D8C4; background: var(--paper); text-align: left; cursor: pointer; font-size: 16.5px; font-weight: 500; transition: border-color .15s, background .15s, transform .1s; }
.opts.tf .opt { text-align: center; font-weight: 700; font-size: 18px; }
.opt:hover:not(:disabled) { border-color: var(--green-2); background: #FBF8F1; }
.opt:disabled { cursor: default; }
.opt.correct { border-color: var(--green-2); background: #E2EDDF; color: var(--green-d); font-weight: 700; }
.opt.correct::before { content: "✓ "; }
.opt.wrong { border-color: var(--red); background: #F6E1DE; color: var(--red-d); }
.opt.wrong::before { content: "✗ "; }
.fb { margin-top: 14px; border-radius: 12px; font-size: 16px; }
.fb:empty { display: none; }
.fb.good, .fb.bad, .fb:not(:empty) { padding: 12px 14px; background: var(--cream); }
.fb.good { background: #E6F0E3; border-left: 4px solid var(--green-2); }
.fb.bad { background: #F8E7E4; border-left: 4px solid var(--red); }
.fb strong { display: block; color: var(--green-d); }
.fb.bad strong { color: var(--red-d); }
.fb span { display: block; margin-top: 4px; }
.fb .btn { margin-top: 10px; margin-right: 8px; }
.q-actions { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 10px; }
.q-actions:empty { display: none; }
.result { text-align: center; background: var(--cream); border-radius: 18px; padding: 26px 18px; }
.result.small { padding: 16px; margin-top: 14px; }
.result-ill { display: grid; place-items: center; }
.result-score { font-family: var(--serif); font-size: 48px; font-weight: 700; color: var(--green); margin: 8px 0 0; }
.result-score small { font-size: 24px; color: var(--muted); }
.result-msg { font-size: 18px; font-weight: 500; }
.result .row-btns { justify-content: center; }
.done-banner { display: flex; gap: 8px; align-items: center; background: var(--green); color: var(--cream); padding: 10px 14px; border-radius: 12px; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.chip { min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 2px solid var(--sage); background: var(--paper); color: var(--green); cursor: pointer; font-size: 15px; font-weight: 500; text-align: left; }
.chips.small .chip { min-height: 36px; font-size: 14px; padding: 4px 12px; }
.chip.big { min-height: 46px; font-size: 16px; }
.chip:hover { border-color: var(--green-2); }
.chip.on { background: var(--green); border-color: var(--green); color: var(--cream); }
.inline { display: inline-flex; align-items: center; gap: 6px; font-size: 14.5px; font-weight: 700; color: var(--green); }
.inline select { min-height: 40px; border-radius: 10px; border: 2px solid var(--sage); background: var(--paper); padding: 4px 8px; }
.player { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.glossary { background: var(--cream); border-radius: 14px; padding: 12px 16px; margin-top: 16px; }
.glossary summary { cursor: pointer; font-weight: 700; color: var(--green); min-height: 32px; }
.glossary dl, .mini-gloss { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 18px; margin: 10px 0 0; }
.glossary dt, .mini-gloss dt { font-weight: 700; color: var(--red-d); }
.glossary dd, .mini-gloss dd { margin: 0; font-size: 15px; color: var(--muted); }

/* match */
.match { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.mcol { display: flex; flex-direction: column; gap: 10px; }
.match.icons .mcol:first-child { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; }
.mcard { position: relative; min-height: 54px; padding: 10px 12px; border-radius: 14px; border: 2px solid #E3D8C4; background: var(--paper); cursor: pointer; font-size: 15.5px; font-weight: 500; text-align: left; transition: all .15s; }
.match.icons .mcard.L { display: grid; place-items: center; min-height: 92px; padding: 8px; }
.mcard:hover:not(:disabled) { border-color: var(--green-2); }
.mcard.sel { border-color: var(--gold); background: #FBF2DE; box-shadow: 0 0 0 3px rgba(214, 184, 121, .45); }
.mcard.matched { cursor: default; color: var(--green-d); }
.mlabel { font-size: 13px; font-weight: 700; margin-top: 2px; }
.m0 { background: #E2EDDF !important; border-color: #8DB39B !important; } .m1 { background: #F6E1DE !important; border-color: #D9958F !important; }
.m2 { background: #F7EBD0 !important; border-color: #D6B879 !important; } .m3 { background: #E3ECEA !important; border-color: #8FB3AC !important; }
.m4 { background: #EFE3DA !important; border-color: #BC9A84 !important; } .m5 { background: #EAE8DA !important; border-color: #ABA67F !important; }
.m-status { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
@media (max-width: 420px) { .match.icons .mcol:first-child { grid-template-columns: minmax(0, 1fr); } .mcard { font-size: 14.5px; } }

/* scene */
.scene-wrap { position: relative; max-width: 680px; margin: 0 auto; border-radius: 16px; overflow: hidden; border: 4px solid var(--brown); background: var(--cream); }
.scene { display: block; width: 100%; height: auto; }
.markers { position: absolute; inset: 0; pointer-events: none; }
.marker { position: absolute; transform: translate(-50%, -50%); width: 32px; height: 32px; border-radius: 50%; background: var(--paper); color: var(--green-d); border: 3px solid var(--green); font-weight: 700; font-size: 15px; display: grid; place-items: center; box-shadow: 0 3px 8px rgba(0, 0, 0, .3); }
.marker.now { background: var(--gold); border-color: var(--paper); animation: pulse 1.2s infinite; z-index: 2; }
.marker.ok { background: var(--green-2); color: var(--cream); border-color: var(--paper); }
.marker.no { background: var(--red); color: var(--cream); border-color: var(--paper); }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px rgba(214, 184, 121, .35); } }
@media (max-width: 560px) { .marker { width: 26px; height: 26px; font-size: 13px; border-width: 2px; } }
.scene-q { margin-top: 14px; }

/* song & karaoke */
.lyrics { background: var(--cream); border-radius: 16px; padding: 16px; margin-top: 4px; }
.lyrics-title { font-size: 22px; }
.ly { display: flex; gap: 10px; align-items: center; margin: 0 0 8px; font-size: 17.5px; line-height: 2.2; }
.ly .icon-btn { width: 36px; height: 36px; }
.ly.gap-line { height: 10px; }
.gap { min-height: 40px; border-radius: 10px; border: 2px dashed var(--gold-d); background: var(--paper); padding: 2px 8px; font-weight: 700; color: var(--green-d); max-width: 100%; }
input.gap { width: auto; text-transform: none; }
.gap.good { border-style: solid; border-color: var(--green-2); background: #E2EDDF; }
.gap.bad { border-style: solid; border-color: var(--red); background: #F8E7E4; }
.karaoke { background: var(--green); border-radius: 18px; padding: 16px; color: var(--cream); }
.karaoke .btn-ghost { color: var(--cream); }
.karaoke .btn-primary { background: var(--gold); color: var(--green-d); }
.karaoke .btn-primary:hover:not(:disabled) { background: #E0C68E; }
.karaoke .inline { color: var(--cream); }
.karaoke .credit { color: var(--sage); }
.mini-gloss dt { color: var(--gold); } .mini-gloss dd { color: var(--sage); }
.k-screen { background: var(--green-d); border-radius: 14px; padding: 16px; margin-bottom: 14px; max-height: 300px; overflow-y: auto; }
.k-line { position: relative; font-family: var(--serif); font-size: clamp(19px, 3vw, 24px); color: rgba(246, 240, 229, .55); margin: 0 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-line.now { color: var(--cream); }
.k-line.past { color: rgba(246, 240, 229, .8); }
.k-fill { position: absolute; left: 0; top: 0; width: 0; overflow: hidden; color: var(--gold); white-space: nowrap; }
.pron { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.pron-card { background: var(--cream); border-radius: 16px; padding: 14px; border: 2px solid transparent; }
.pron-card.done { border-color: var(--green-2); background: #E9F1E6; }
.pron-card.done .pr-say::after { content: " ✓"; color: var(--green-2); }
.pr-say { font-family: var(--serif); font-size: 21px; color: var(--green); font-weight: 700; margin: 0 0 4px; }
.pr-tip { font-size: 14.5px; color: var(--muted); }
.pr-btns { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pr-fb { font-size: 14px; margin: 8px 0 0; color: var(--green-d); }
.pr-fb:empty { display: none; }

/* card maker */
.cardmaker { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cm-form label { display: block; font-weight: 700; font-size: 15px; color: var(--green); }
.cm-form fieldset { border: 0; padding: 0; margin: 10px 0; }
.cm-form legend { font-weight: 700; font-size: 15px; color: var(--green); }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-bottom: 10px; }
.cm-form select, .cm-form input, textarea, .seq select { width: 100%; min-height: 46px; border-radius: 12px; border: 2px solid var(--sage); background: var(--paper); padding: 8px 12px; font-size: 16px; margin-top: 4px; }
textarea { line-height: 1.5; resize: vertical; }
.cm-form textarea { margin-bottom: 4px; }
.xcard { position: sticky; top: 0; background: var(--red); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); }
.xcard-ill { display: grid; place-items: center; background: var(--cream); border-radius: 12px 12px 0 0; padding: 10px; }
.xcard-body { background: var(--paper); border-radius: 0 0 12px 12px; padding: 18px; font-family: var(--serif); font-size: 17px; line-height: 1.5; color: var(--green-d); min-height: 160px; border: 2px dashed var(--gold); border-top: 0; overflow-wrap: anywhere; }
.wc { font-size: 14px; color: var(--muted); margin: 6px 0 0; }
@media (max-width: 640px) { .cardmaker { grid-template-columns: minmax(0, 1fr); } .xcard { position: static; } }

/* word search */
.ws-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 16px; align-items: start; }
.ws { display: grid; gap: 3px; background: var(--brown); padding: 6px; border-radius: 14px; touch-action: none; user-select: none; -webkit-user-select: none; max-width: 560px; }
.ws-row { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 3px; }
.ws-c { aspect-ratio: 1; min-width: 0; padding: 0; border: 0; border-radius: 5px; background: var(--paper); font-weight: 700; font-size: clamp(12px, 2.6vw, 18px); color: var(--green-d); cursor: pointer; }
.ws-c.pre { background: var(--gold); }
.ws-c.start { box-shadow: inset 0 0 0 3px var(--red); }
.ws-c.found { color: var(--paper); }
.ws-c.f0 { background: var(--green-2); } .ws-c.f1 { background: var(--red); } .ws-c.f2 { background: #9E7C3A; } .ws-c.f3 { background: #2F7A6A; } .ws-c.f4 { background: var(--red-d); } .ws-c.f5 { background: #6E5243; }
.ws-c.hint { animation: pulse 0.5s 3; background: var(--gold); }
.ws-list { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ws-list li { font-weight: 700; font-size: 14px; letter-spacing: .04em; background: var(--cream); padding: 4px 10px; border-radius: 8px; color: var(--green); }
.ws-list li.got { text-decoration: line-through; opacity: .5; }
@media (max-width: 680px) { .ws-wrap { grid-template-columns: minmax(0, 1fr); } .ws-side { order: -1; } }

/* order */
.order { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.pool, .ordered { margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.pool { list-style: none; }
.ordered { padding-left: 26px; background: var(--cream); border-radius: 14px; padding: 12px 12px 12px 36px; }
.ordered li::marker { font-family: var(--serif); font-weight: 700; color: var(--red-d); }
.step { width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 12px; border: 2px solid #E3D8C4; background: var(--paper); text-align: left; cursor: pointer; font-size: 15.5px; }
.step:hover { border-color: var(--green-2); }
.step.in { border-color: var(--gold); }
.step.good { border-color: var(--green-2); background: #E2EDDF; }
.step.bad { border-color: var(--red); background: #F8E7E4; }
.seq-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 10px; align-items: center; margin-bottom: 8px; }
.seq-row select { margin: 0; }
.seq select.good { border-color: var(--green-2); background: #E2EDDF; } .seq select.bad { border-color: var(--red); background: #F8E7E4; }
.para { font-family: var(--serif); font-size: 17px; line-height: 1.6; color: var(--ink); }
@media (max-width: 640px) { .order { grid-template-columns: minmax(0, 1fr); } .seq-row { grid-template-columns: minmax(0, 1fr); gap: 4px; margin-bottom: 14px; } }

/* shop */
.shop-head { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; background: var(--green); color: var(--cream); border-radius: 16px; padding: 12px; text-align: center; }
.shop-head .label { display: block; font-size: 13px; color: var(--sage); }
.shop-head b { font-family: var(--serif); font-size: 24px; white-space: nowrap; }
.shop-head b.neg { color: #F3B3AC; }
.budget-bar { height: 10px; border-radius: 999px; background: var(--sage); overflow: hidden; margin: 10px 0; }
.budget-bar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .3s; }
.budget-bar i.over { background: var(--red); }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.shop-item { background: var(--cream); border-radius: 14px; padding: 12px; text-align: center; border: 2px solid transparent; display: flex; flex-direction: column; align-items: center; }
.shop-item.in { border-color: var(--gold); background: #FBF2DE; }
.si-name { font-weight: 700; margin: 6px 0 2px; text-transform: capitalize; font-size: 15.5px; }
.si-price { margin: 0 0 8px; font-size: 15px; } .si-price b { font-size: 18px; color: var(--green); }
.si-price s { color: var(--muted); } .sale { background: var(--red); color: var(--cream); font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 6px; }
.qty { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.qty .q { min-width: 20px; font-weight: 700; font-size: 18px; }
.qty .icon-btn { width: 40px; height: 40px; }
.basket { background: var(--paper); border: 2px dashed var(--gold); border-radius: 16px; padding: 14px; margin-top: 14px; }
.basket h4 { font-size: 19px; }
.b-list { list-style: none; padding: 0; margin: 0 0 8px; }
.b-list li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dotted #E3D8C4; }
.b-list li b { white-space: nowrap; }
.b-list .tot { font-weight: 700; border-bottom: 0; color: var(--green); font-size: 17px; }
.dialogue p { background: var(--cream); padding: 10px 14px; border-radius: 14px 14px 14px 4px; max-width: 88%; margin-bottom: 8px; }
.dialogue p.me { background: #E2EDDF; margin-left: auto; border-radius: 14px 14px 4px 14px; }

/* reading */
.reading { background: var(--paper); border: 1px solid #EDE3D1; border-radius: 18px; padding: clamp(16px, 3vw, 26px); box-shadow: 0 6px 20px rgba(73, 58, 53, .06); }
.read-title { font-size: 28px; color: var(--red-d); }
.reading .text { font-size: 17.5px; line-height: 1.7; margin-top: 12px; }
.reading .text h4 { font-size: 19px; margin-top: 16px; }
.reading .text .meta { font-size: 14.5px; color: var(--muted); font-style: italic; }
.reading .text ol, .reading .text ul { padding-left: 24px; } .reading .text li { margin-bottom: 6px; }
.gl { display: inline; padding: 0 3px; border: 0; border-bottom: 2px dotted var(--green-2); background: #E6F0E3; color: var(--green-d); font-weight: 700; cursor: pointer; border-radius: 4px; font-size: inherit; line-height: inherit; }
.sn.now { background: #FBEFC9; box-shadow: 0 0 0 3px #FBEFC9; border-radius: 3px; }
.listen .player { margin-top: 6px; }

/* builder & writer */
.builder { display: flex; flex-direction: column; gap: 6px; }
.cat { border: 0; padding: 0; margin: 0; }
.cat legend { font-family: var(--serif); font-weight: 700; font-size: 19px; color: var(--green); }
.plan-card { display: flex; gap: 16px; align-items: flex-start; background: var(--green); color: var(--cream); border-radius: 18px; padding: 18px; margin-top: 14px; }
.plan-card h4 { color: var(--gold); font-size: 20px; }
.plan-text { font-family: var(--serif); font-size: 18.5px; line-height: 1.55; }
.plan-ill { background: var(--cream); border-radius: 50%; padding: 8px; flex: none; }
.plan-card .btn-ghost { color: var(--cream); }
@media (max-width: 480px) { .plan-ill { display: none; } }
.writer .lbl { display: block; font-weight: 700; color: var(--green); margin: 10px 0 4px; }
.wmeter { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.wbar { flex: 1; height: 8px; border-radius: 999px; background: var(--sage); overflow: hidden; }
.wbar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .3s; }
.wbar.ok i { background: var(--green-2); }
.wcount { font-size: 14px; color: var(--muted); white-space: nowrap; }
.checklist { border: 2px solid var(--sage); border-radius: 14px; padding: 10px 14px; margin: 10px 0 0; }
.checklist legend { font-weight: 700; color: var(--green); padding: 0 6px; }
.checklist label { display: flex; gap: 10px; align-items: flex-start; min-height: 36px; padding: 4px 0; cursor: pointer; font-size: 15.5px; }
.checklist input { width: 22px; height: 22px; accent-color: var(--green); flex: none; margin-top: 2px; }

/* unscramble */
.unscr { background: var(--cream); border-radius: 18px; padding: 18px; text-align: center; }
.tiles { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tile { width: clamp(38px, 9vw, 52px); height: clamp(44px, 10vw, 58px); border-radius: 10px; border: 0; background: var(--red); color: var(--cream); font-family: var(--serif); font-size: clamp(20px, 4.6vw, 28px); font-weight: 700; cursor: pointer; box-shadow: 0 4px 0 var(--red-d); transition: transform .1s, opacity .2s; }
.tile.used { opacity: .25; transform: translateY(4px); box-shadow: none; }
.clue { font-size: 16.5px; color: var(--green); font-weight: 500; }
.un-form { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; }
.un-in { width: min(320px, 100%); min-height: 52px; border-radius: 12px; border: 2px solid var(--green-2); background: var(--paper); text-align: center; font-size: 22px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.timer { position: relative; height: 26px; border-radius: 999px; background: var(--sage); overflow: hidden; margin: 14px auto 0; max-width: 420px; }
.timer i { display: block; height: 100%; background: var(--gold); transition: width 1s linear; }
.timer span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.toggle input { width: 20px; height: 20px; accent-color: var(--green); }
.unscr .row-btns { justify-content: center; }

/* mistakes */
.sentence { display: flex; flex-wrap: wrap; gap: 6px; background: var(--cream); padding: 18px; border-radius: 16px; }
.tok { min-height: 46px; padding: 6px 12px; border-radius: 10px; border: 2px solid #E3D8C4; background: var(--paper); font-size: 18px; font-family: var(--serif); cursor: pointer; }
.tok:hover:not(:disabled) { border-color: var(--gold); }
.tok.nope { opacity: .45; text-decoration: line-through; }
.tok.found { border-color: var(--red); background: #F8E7E4; color: var(--red-d); font-weight: 700; }
.tok.fixed { border-color: var(--green-2); background: #E2EDDF; color: var(--green-d); }
.tok.pulse { animation: pulse 1s infinite; }
.tok:disabled { cursor: default; }
.fix { margin-top: 12px; }

/* personality */
#act.finale .act-body { --pbg: var(--green); }
.p-intro, .p-q, .p-result { background: var(--green); background-image: radial-gradient(rgba(246, 240, 229, .14) 1.6px, transparent 1.7px), radial-gradient(rgba(214, 184, 121, .2) 1px, transparent 1.1px); background-size: 26px 26px, 41px 41px; color: var(--cream); border-radius: 22px; padding: clamp(20px, 4vw, 36px); text-align: center; position: relative; border: 4px solid var(--gold); }
.p-intro-ill { display: flex; justify-content: center; align-items: flex-end; gap: 10px; margin-bottom: 8px; }
.p-h { color: var(--cream); font-size: clamp(26px, 4.2vw, 36px); }
.p-h em { color: var(--gold); }
.p-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 8px; }
.p-dots i { width: 28px; height: 8px; border-radius: 999px; background: rgba(246, 240, 229, .25); }
.p-dots i.past { background: var(--gold); } .p-dots i.now { background: var(--cream); }
.p-count { font-size: 14px; color: var(--gold); font-weight: 700; margin-bottom: 4px; }
.p-cards { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; margin-top: 14px; }
.p-card { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 10px; min-height: 190px; justify-content: center; border-radius: 20px; border: 3px solid var(--gold); background: var(--cream); color: var(--green-d); cursor: pointer; font-family: var(--serif); font-weight: 700; font-size: clamp(17px, 2.6vw, 21px); transition: transform .2s, box-shadow .2s; box-shadow: 0 8px 0 rgba(0, 0, 0, .2); }
.p-card:hover { transform: translateY(-4px) rotate(-1deg); }
.p-card:nth-child(3):hover { transform: translateY(-4px) rotate(1deg); }
.p-card.chosen { background: var(--gold); transform: scale(1.04); }
.p-or { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--gold); }
.p-back { margin-top: 18px; color: var(--cream) !important; }
@media (max-width: 480px) { .p-card { min-height: 160px; } .p-card .ill { width: 72px; height: 72px; } .p-or { font-size: 17px; } }
.p-kicker { font-family: var(--serif); font-style: italic; color: var(--gold); font-size: 20px; margin: 0; }
.p-ill { display: grid; place-items: center; margin: 4px 0; }
.p-ill svg { max-width: 100%; height: auto; }
.p-name { color: var(--cream); font-size: clamp(28px, 4.6vw, 40px); }
.p-desc { font-size: 17.5px; max-width: 560px; margin: 0 auto 12px; color: #E6EDE3; }
.p-result .tiny { color: var(--sage); margin-top: 10px; }
.p-how { background: var(--cream); border-radius: 16px; padding: 12px 16px; margin-top: 16px; }
.p-how summary { cursor: pointer; font-weight: 700; color: var(--green); min-height: 32px; }
.expr { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.expr li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; background: var(--cream); border-radius: 14px; padding: 12px 14px; border-left: 4px solid var(--gold); }
.expr b { font-family: var(--serif); font-size: 19px; color: var(--green); }
.expr span { grid-column: 1; font-size: 15px; color: var(--muted); }
.expr .icon-btn { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.p-finale { margin-top: 26px; text-align: center; background: var(--red); color: var(--cream); border-radius: 22px; padding: 26px 20px; border: 4px solid var(--gold); }
.p-finale h3 { color: var(--gold); font-size: 34px; }
.p-finale-ill { display: flex; justify-content: center; align-items: flex-end; gap: 6px; margin-bottom: 10px; }
.p-finale p { max-width: 560px; margin: 0 auto 10px; }

.lv-first { padding: 10px 0; }
.lv-first .lv { background: var(--green); }

/* ------------------------------------------------------------- bilingual helpers */
.lang-switch { display: inline-flex; border: 1px solid rgba(246, 240, 229, .4); border-radius: 999px; padding: 3px; gap: 2px; }
.lang-switch button { min-height: 34px; min-width: 52px; padding: 4px 10px; border: 0; border-radius: 999px; background: transparent; color: var(--cream); font-weight: 700; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.lang-switch button.on { background: var(--gold); color: var(--green-d); }
.lang-switch button:not(.on):hover { background: rgba(246, 240, 229, .12); }
@media (max-width: 640px) { .hide-sm { display: none; } .top-actions { gap: 6px; } .lang-switch button { min-width: 44px; padding: 4px 8px; } }
@media (max-width: 380px) { .lang-switch button span { display: none; } }
.hero-sub { font-family: var(--serif); font-size: clamp(18px, 2.6vw, 24px); color: var(--sage); margin: -6px 0 12px; }
.slogan-pt { color: var(--sage); font-size: 16px; margin: -6px 0 16px; }
.door-sub { font-size: 11.5px; line-height: 1.2; color: var(--muted); }
@media (max-width: 560px) { .door-sub { display: none; } }
.act-subtitle { margin: 2px 0 0; color: var(--sage); font-size: 15px; font-style: italic; }
.act-subtitle[hidden] { display: none; }
.ptw { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.ptw.inline-pt { display: inline; font-size: 15px; font-family: var(--sans); font-weight: 500; }
.chip .ptw { display: block; font-size: 12px; }
.chip.on .ptw, .opt.correct .ptw { color: inherit; opacity: .85; }
.opts.tf .ptw { font-weight: 500; }
.mcard .ptw { font-size: 12.5px; }
.qtr, .pt-more { margin: -4px 0 12px; font-size: 15px; }
.qtr summary, .pt-more summary { cursor: pointer; color: var(--green-2); font-weight: 700; display: inline-flex; min-height: 32px; align-items: center; }
.qtr p, .pt-more p { margin: 4px 0 0; padding: 8px 12px; background: var(--paper); border-radius: 10px; border-left: 3px solid var(--gold); }
.fb .pt-more { margin: 8px 0 0; }
.example { background: #FBF2DE; border-left: 4px solid var(--gold); border-radius: 10px; padding: 10px 14px; margin: 8px 0 12px; font-size: 15.5px; }
.example small { display: block; color: var(--muted); margin-top: 4px; font-size: 14px; }
.k-wrap { margin-bottom: 6px; }
.k-wrap .k-line { margin: 0; }
.k-pt { margin: 0 0 4px; font-size: 13.5px; color: var(--sage); opacity: .85; }
.p-sub { color: var(--sage); font-style: italic; margin: -6px 0 6px; }
.p-card small { font-family: var(--sans); font-weight: 500; font-size: 14px; color: var(--muted); margin-top: -6px; }
.p-name-pt { font-family: var(--serif); font-style: italic; color: var(--gold); font-size: clamp(18px, 2.6vw, 22px); margin: -4px 0 12px; }
.cert-lang { border: 0; padding: 0; margin: 14px 0 4px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cert-lang legend { font-weight: 700; margin-bottom: 6px; float: left; width: 100%; }
.chip-l { min-height: 40px; padding: 6px 16px; border-radius: 999px; border: 2px solid rgba(246, 240, 229, .5); background: transparent; color: var(--cream); font-weight: 700; cursor: pointer; }
.chip-l[aria-pressed="true"] { background: var(--gold); color: var(--green-d); border-color: var(--gold); }

/* real song player (Day 3) */
.song-player { display: flex; gap: 14px; align-items: center; background: var(--green); color: var(--cream); border-radius: 18px; padding: 14px 16px; margin-bottom: 10px; }
.sp-ill { flex: none; width: 64px; height: 64px; border-radius: 50%; background: var(--cream); display: grid; place-items: center; border: 3px solid var(--gold); }
.sp-main { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.sp-title { margin: 0; font-size: 15.5px; color: var(--sage); } .sp-title b { font-family: var(--serif); font-size: 20px; color: var(--cream); }
.sp-audio { width: 100%; height: 44px; border-radius: 999px; }
.song-player .inline { color: var(--cream); }
.song-player[hidden], .synth-slot[hidden] { display: none; }
@media (max-width: 480px) { .sp-ill { display: none; } }
/* tradition photos (Day 6) */
.q-photo { margin: 10px 0 8px; border-radius: 14px; overflow: hidden; border: 3px solid var(--paper); box-shadow: 0 6px 18px rgba(73, 58, 53, .18); background: var(--sage); aspect-ratio: 16 / 9; animation: fadein .4s; }
.q-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.inline select, .song-player select { color: var(--ink); background: var(--paper); }

/* gingerbread step photos (Day 10) */
.step { display: flex; gap: 12px; align-items: center; }
.step-img { flex: none; width: 92px; height: 60px; object-fit: cover; border-radius: 8px; box-shadow: 0 2px 6px rgba(73, 58, 53, .2); }
.step-txt { flex: 1; }
.seq-row { grid-template-columns: 92px 170px minmax(0, 1fr); }
.seq-row .step-img { width: 92px; height: 60px; }
@media (max-width: 640px) { .step-img { width: 72px; height: 50px; } .seq-row { grid-template-columns: 72px minmax(0, 1fr); } .seq-row .step-img { grid-row: span 2; width: 72px; height: 50px; } }

/* real song (Day 12) */
.k-sp { background: var(--green-d); }
.k-lyrics { max-height: 380px; }
.k-line.static { color: var(--cream); white-space: normal; }
.k-gap { height: 14px; }
.k-real[hidden], .k-synth[hidden] { display: none; }

.k-lyrics { position: relative; scroll-behavior: auto; }
.k-line.static { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 2px 6px; border-radius: 8px; cursor: pointer; color: rgba(246, 240, 229, .6); font-family: var(--serif); font-size: clamp(19px, 3vw, 24px); transition: color .25s, background .25s; }
.k-line.static:hover { background: rgba(246, 240, 229, .06); }
.k-wrap.past .k-line.static { color: rgba(246, 240, 229, .85); }
.k-wrap.now .k-line.static { color: var(--gold); background: rgba(214, 184, 121, .12); }
.k-wrap .k-pt { padding-left: 6px; }

/* Day 15 — traditions */
.mcard .m-ico { float: left; margin: 0 10px 2px 0; background: var(--cream); border-radius: 50%; padding: 4px; }
.mcard .m-ico .ill { width: 30px; height: 30px; }
.mcard .flag { font-size: 1.15em; }
.tr-card { margin-top: 8px; }
.tr-country { font-family: var(--serif); font-size: 22px; color: var(--green-d); margin: 0 0 2px; }
.tr-cpt { font-family: var(--sans); font-size: 16px; color: var(--muted); }
.tr-trad { font-style: italic; color: var(--ink); margin: 0 0 6px; }
.tr-note { margin: 8px 0 4px; }
.tr-pt { margin: 0 0 8px; color: var(--muted); font-size: 15.5px; border-left: 3px solid var(--gold); padding-left: 10px; }
.tr-vbox { background: var(--paper); border-radius: 12px; padding: 10px 14px; margin-top: 10px; }
.tr-vbox summary, .tr-vt { font-weight: 700; color: var(--green); margin: 0 0 4px; cursor: pointer; }
.tr-vocab { list-style: none; padding: 0; margin: 4px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 14px; font-size: 15px; }
.m-got { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; font-size: 14px; color: var(--muted); }
.m-got[hidden] { display: none; }
.m-chip { min-height: 36px; padding: 4px 12px; border-radius: 999px; border: 2px solid var(--gold); background: #FBF2DE; color: var(--green-d); font-weight: 700; cursor: pointer; }
/* Day 13 — recipe photo */
.read-photo { margin: 4px 0 14px; border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 9; border: 3px solid var(--paper); box-shadow: 0 6px 18px rgba(73, 58, 53, .18); }
.read-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fb .tr-country span, .fb .tr-vocab span, .mcard .flag { display: inline; margin: 0; }

/* ===================================================== DAY 24 · CHRISTMAS BINGO */
.bingo { position: relative; }
.bg-confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }
.bg-head { text-align: center; margin-bottom: 18px; }
.bg-deco { display: flex; justify-content: center; gap: 4px; margin-bottom: 6px; }
.bg-deco img { width: clamp(44px, 12vw, 74px); height: auto; }
.bg-deco img:nth-child(odd) { transform: translateY(6px) rotate(-4deg); }
.bg-deco img:nth-child(even) { transform: rotate(4deg); }
.bg-title { font-family: var(--serif); font-size: clamp(30px, 6vw, 42px); color: var(--green); margin: 4px 0 2px; }
.bg-sub { font-family: var(--serif); font-style: italic; color: var(--red-d); font-size: 18px; margin: 0; }
.bg-sub-pt { color: var(--muted); margin: 4px 0 0; font-size: 15px; }
.bg-rules { background: var(--paper); border: 1px solid #E6DAC2; border-radius: var(--r); padding: 16px 18px; }
.bg-rules h4 { font-family: var(--serif); color: var(--green); margin: 0 0 8px; font-size: 19px; }
.bg-rules ol { margin: 0 0 10px; padding-left: 22px; }
.bg-rules li { margin: 4px 0; }
.bg-size { margin: 0 0 6px; color: var(--brown); }
.bg-start { margin-top: 18px; }
.bg-start .btn { font-size: 18px; padding-inline: 28px; }

/* caller */
.bg-caller { background: var(--green); color: var(--cream); border-radius: var(--r); padding: 12px 14px 14px; margin-bottom: 14px; box-shadow: 0 8px 18px rgba(27, 58, 47, .28); position: sticky; top: 0; z-index: 3; max-height: 50vh; display: flex; flex-direction: column; }
.bg-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; position: relative; }
.bg-pat .nw, .bg-pat { white-space: nowrap; }
.bg-pat { white-space: normal; }
.bg-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; opacity: .9; }
.bg-meta span { display: inline-flex; align-items: center; gap: 4px; }
.bg-prompt { min-height: 54px; display: flex; flex-direction: column; justify-content: center; text-align: center; padding: 6px 4px; }
.bg-prompt p { margin: 0; }
.bg-label { font-size: 14px; color: var(--sage); }
.bg-big { font-family: var(--serif); font-size: clamp(28px, 7vw, 40px); color: var(--gold); line-height: 1.15; }
.bg-clue { font-family: var(--serif); font-size: clamp(17px, 3.6vw, 20px); line-height: 1.4; color: #FFF8EA; margin-top: 4px !important; }
.bg-ear { display: inline-flex !important; align-items: center; justify-content: center; gap: 10px; font-size: 17px; color: var(--gold); }
.bg-ready { color: var(--sage); }
.bg-noaudio { font-size: 13px; color: var(--sage); margin-top: 6px !important; }
.bg-hints { list-style: none; margin: 0 0 8px; padding: 0; }
.bg-hints:empty { display: none; }
.bg-hints li { background: rgba(246, 240, 229, .12); border-radius: 10px; padding: 7px 10px; margin-top: 6px; font-size: 15px; }
.bg-hints b { color: var(--gold); font-weight: 600; margin-right: 4px; }
.bg-pat { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; letter-spacing: .5px; white-space: pre-wrap; }
.bg-hword { font-weight: 700; }
.bg-actions { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding-top: 10px; }
.bg-caller .btn-ghost { color: var(--cream); border-color: rgba(246, 240, 229, .55); background: transparent; }
.bg-caller .btn-ghost:hover:not([disabled]) { background: rgba(246, 240, 229, .12); }
.bg-caller .btn[disabled] { opacity: .4; cursor: not-allowed; box-shadow: none; filter: grayscale(.5); }
.bg-caller .btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.bg-caller .btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.bg-fb { color: var(--ink); margin: 4px 0 2px; }
.bg-fb:empty { display: none; }
.bg-fb .bg-ans b { font-size: 17px; color: var(--green-d); }
.bg-fb .bg-was { font-size: 14.5px; color: var(--muted); }

/* card */
.bg-card { --gap: clamp(4px, 1.2vw, 8px); display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: var(--gap);
  background: var(--paper); border: 2px solid var(--gold); border-radius: 18px; padding: var(--gap);
  box-shadow: inset 0 0 0 4px var(--cream), var(--shadow); max-width: 640px; margin: 0 auto; }
.bg-cell { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px;
  aspect-ratio: 1 / 1.12; padding: 6% 4% 4%; background: #FFFDF8; border: 1.5px solid #E6DAC2; border-radius: 12px; cursor: pointer;
  font: inherit; color: var(--ink); transition: background .25s, border-color .25s, transform .15s; -webkit-tap-highlight-color: transparent; min-width: 0; min-height: 0; overflow: visible; }
.bg-cell:hover:not(.is-marked) { border-color: var(--gold-d); transform: translateY(-1px); }
.bg-cell:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; z-index: 1; }
.bg-pic { flex: 1 1 0; min-height: 0; overflow: hidden; width: 100%; display: flex; align-items: center; justify-content: center; }
.bg-pic img { max-width: 100%; max-height: 100%; width: auto; height: auto; aspect-ratio: 1 / 1; object-fit: contain; }
.bg-word { flex: 0 0 auto; min-height: 2.25em; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--green-d); text-align: center; line-height: 1.1; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere;
  font-size: calc(var(--fs, 15px)); }
.bg-card[style*="--n:3"] { --fs: clamp(13px, 3.6vw, 18px); max-width: 480px; }
.bg-card[style*="--n:4"] { --fs: clamp(11px, 2.9vw, 15.5px); max-width: 560px; }
.bg-card[style*="--n:5"] { --fs: clamp(9.5px, 2.35vw, 13.5px); }
.bg-seal { position: absolute; top: -6px; right: -6px; width: clamp(20px, 30%, 34px); opacity: 0; transform: scale(.3) rotate(-30deg); transition: opacity .3s, transform .35s cubic-bezier(.3, 1.6, .5, 1); pointer-events: none; }
.bg-seal svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 2px 3px rgba(73, 58, 53, .3)); }
.bg-cell.is-marked { background: #EEF2E6; border-color: var(--green-2); cursor: default; }
.bg-cell.is-marked .bg-pic img { opacity: .78; }
.bg-cell.is-marked .bg-seal { opacity: 1; transform: none; }
.bg-x { position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--red); color: #fff; display: none; align-items: center; justify-content: center; }
.bg-cell.shake { animation: bgShake .45s; border-color: var(--red); background: #F8E7E4; }
.bg-cell.shake .bg-x { display: inline-flex; }
.bg-cell.pop { animation: bgPop .45s; }
.bg-free { background: radial-gradient(circle at 50% 40%, #FBF3DF, #EEDDB3) !important; border-color: var(--gold-d) !important; cursor: default; justify-content: center; }
.bg-free-art { width: 74%; height: auto; flex: 1 1 0; min-height: 0; max-height: 62%; }
.bg-free .bg-word { color: var(--red-d); letter-spacing: .5px; }
.bg-free-pt { font-size: calc(var(--fs) * .8); color: var(--brown); line-height: 1; }
.bg-cell.is-win { border-color: var(--gold-d); border-width: 2.5px; background: #FBF1D6; box-shadow: 0 0 0 3px var(--gold), 0 6px 16px rgba(158, 124, 58, .35); }
.bingo.is-won .bg-cell:not(.is-win) { opacity: .62; }
.bg-foot { margin-top: 12px; }

/* win */
.bg-win { position: relative; text-align: center; background: linear-gradient(160deg, var(--green), var(--green-d)); color: var(--cream); border-radius: var(--r); padding: 20px 18px 18px; margin-bottom: 14px; box-shadow: var(--shadow); outline: none; overflow: hidden; }
.bg-win:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.bg-stars { display: flex; justify-content: center; gap: 10px; }
.bg-stars span { width: 22px; display: inline-block; animation: bgTwinkle 1.8s ease-in-out infinite; }
.bg-stars span:nth-child(2) { animation-delay: .3s; width: 28px; } .bg-stars span:nth-child(3) { animation-delay: .6s; width: 36px; }
.bg-stars span:nth-child(4) { animation-delay: .9s; width: 28px; } .bg-stars span:nth-child(5) { animation-delay: 1.2s; }
.bg-stars svg { width: 100%; height: auto; display: block; }
.bg-bingo { font-family: var(--serif); font-size: clamp(46px, 11vw, 72px); color: var(--gold); margin: 4px 0 0; letter-spacing: 2px; line-height: 1; text-shadow: 0 3px 0 rgba(0, 0, 0, .18); }
.bingo:not(.bg-still) .bg-bingo { animation: bgPop .7s; }
.bg-win-sub { font-family: var(--serif); font-size: 21px; margin: 8px 0 0; }
.bg-win-sub-pt { margin: 2px 0 0; color: var(--sage); }
.bg-line { display: inline-flex; align-items: center; gap: 6px; background: rgba(214, 184, 121, .2); border-radius: 99px; padding: 5px 12px; margin: 12px 0 0; font-size: 14.5px; }
.bg-stats { display: flex; justify-content: center; gap: 12px; margin: 14px 0 0; }
.bg-stats div { background: var(--cream); color: var(--ink); border-radius: 12px; padding: 8px 16px; min-width: 120px; }
.bg-stats dt { font-size: 13px; color: var(--muted); }
.bg-stats dd { margin: 0; font-family: var(--serif); font-size: 28px; color: var(--green); font-weight: 700; }
.bg-win-msg { max-width: 520px; margin: 14px auto 0; line-height: 1.5; }
.bg-win-btns { margin-top: 16px; }
.bg-win .btn-ghost { color: var(--cream); border-color: rgba(246, 240, 229, .6); background: transparent; }

@keyframes bgPop { 0% { transform: scale(.85); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes bgShake { 0%, 100% { transform: none; } 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
@keyframes bgTwinkle { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.7) rotate(18deg); opacity: .6; } }
.bg-still *, .bg-still *::before, .bg-still *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { .bingo *, .bingo *::before, .bingo *::after { animation: none !important; transition: none !important; } }
@media (max-width: 520px) {
  .bg-caller { padding: 10px 10px 12px; }
  .bg-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .bg-actions .btn { border-radius: 14px; padding: 8px 4px; font-size: 13px; line-height: 1.15; flex-direction: column; gap: 3px; min-height: 52px; white-space: normal; text-align: center; }
  .bg-clue { font-size: 16px; }
  .bg-big { font-size: 30px; }
  .bg-prompt { min-height: 44px; padding: 4px 2px; }
  .bg-fb { font-size: 14.5px; padding: 9px 11px !important; }
  .bg-fb .bg-ans b { font-size: 15.5px; }
  .bg-hints li { font-size: 14px; }
  .bg-card { border-radius: 14px; }
  .bg-cell { border-radius: 9px; padding: 5% 3% 4%; }
  .bg-card[style*="--n:5"] .bg-cell { aspect-ratio: 1 / 1.22; }
  .bg-stats div { min-width: 0; flex: 1; }
}

/* Day 25 tie-break (3–4 tied options) */
.p-cards.many { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }

/* ============================================ Day 14 / Day 22 · step-by-step visual builder */
.wiz-steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 12px; overflow-x: auto; scrollbar-width: thin; }
.wiz-steps li { flex: 1 1 0; min-width: 92px; }
.wiz-steps button { width: 100%; display: flex; align-items: center; gap: 8px; text-align: left; background: var(--paper); border: 2px solid var(--sage); border-radius: 12px; padding: 7px 9px; cursor: pointer; font: inherit; color: var(--green-d); min-height: 48px; }
.wiz-steps .ws-n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--sage); color: var(--green-d); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.wiz-steps .ws-l { display: flex; flex-direction: column; min-width: 0; font-weight: 700; font-size: 13.5px; line-height: 1.15; }
.wiz-steps .ws-v { font-weight: 500; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wiz-steps button.done .ws-n { background: var(--green-2); color: #fff; }
.wiz-steps button.now { border-color: var(--green); background: #EEF2E6; }
.wiz-steps button:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.wiz-panel { outline: none; scroll-margin-top: 12px; }
.wiz-cat { border: 0; padding: 0; margin: 0; }
.wiz-cat legend { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; padding: 0; }
.wc-step { font-size: 13px; color: var(--muted); font-weight: 600; }
.wc-title { font-family: var(--serif); font-size: 24px; color: var(--green); font-weight: 700; }
.wc-hint { font-size: 14px; color: var(--brown); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 190px)); gap: 12px; margin: 10px 0 14px; }
.pcard { position: relative; display: flex; flex-direction: column; text-align: left; background: var(--paper); border: 2px solid #E6DAC2; border-radius: 14px; padding: 0; overflow: hidden; cursor: pointer; font: inherit; color: var(--ink); transition: border-color .2s, box-shadow .2s, transform .15s; min-height: 64px; }
.pcard:hover { border-color: var(--gold-d); transform: translateY(-1px); }
.pcard:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.pc-photo { display: none; aspect-ratio: 4 / 3; background: var(--cream); }
.pcard.has-photo .pc-photo { display: block; }
.pc-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-body { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; padding-right: 34px; }
.pc-name { font-weight: 700; color: var(--green-d); font-size: 16px; line-height: 1.2; }
.pc-tag { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.pc-note { font-size: 12.5px; color: var(--red-d); line-height: 1.3; margin-top: 2px; }
.pc-check { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--sage); background: var(--paper); color: transparent; display: inline-flex; align-items: center; justify-content: center; }
.pcard.on { border-color: var(--green); box-shadow: 0 0 0 2px var(--green), 0 6px 16px rgba(36, 75, 61, .18); background: #F3F6EE; }
.pcard.on .pc-check { background: var(--green); border-color: var(--green); color: #fff; }
.pcard.on .pc-name::after { content: ""; }
.wiz-nav { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.menu-card { background: var(--paper); border: 2px solid var(--gold); border-radius: 18px; padding: 22px 20px; box-shadow: inset 0 0 0 5px var(--cream), var(--shadow); text-align: center; }
.mc-kicker { color: var(--gold-d); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.mc-kicker svg { width: 16px; height: 16px; }
.mc-title { font-family: var(--serif); font-size: clamp(24px, 5vw, 32px); color: var(--green); margin: 4px 0 0; }
.mc-sub { margin: 2px 0 0; color: var(--muted); font-style: italic; }
.mc-list { list-style: none; padding: 0; margin: 16px 0 0; text-align: left; }
.mc-list li { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px dashed #E2D4B8; }
.mc-course { font-family: var(--serif); font-weight: 700; color: var(--red-d); display: flex; flex-direction: column; }
.mc-course small { font-family: var(--sans); font-weight: 500; color: var(--muted); font-size: 12px; }
.mc-items { display: flex; flex-direction: column; gap: 6px; }
.mc-item { display: flex; align-items: center; gap: 10px; }
.mc-item img { display: none; width: 64px; height: 48px; object-fit: cover; border-radius: 8px; }
.mc-item.has-photo img { display: block; }
.mc-item b { color: var(--green-d); }
@media (max-width: 560px) {
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pc-name { font-size: 14.5px; }
  .mc-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .mc-course { grid-column: 1 / -1; }
  .wiz-steps .ws-v { display: none; }
}

/* Day 22 · map of Snowberry */
.dmap-fig { margin: 0 0 12px; }
.dmap-scroll { border-radius: 18px; }
@media (max-width: 560px) { .dmap-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; } .dmap { min-width: 540px; } }
.dmap { width: 100%; height: auto; display: block; border-radius: 18px; border: 2px solid var(--gold); background: #EEF2E6; }
.dmap-fig figcaption { font-size: 14px; color: var(--brown); margin-top: 6px; text-align: center; }
.dmap-words ul { list-style: none; padding: 0; margin: 4px 0 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.dmap-words li { background: var(--paper); border: 1px solid #E6DAC2; border-radius: 999px; padding: 4px 12px; font-size: 14px; }
.dmap-words li span { color: var(--muted); }

/* Day 17 · context photo (16:9) shown before answering; hidden until the file exists */
.q-scene { display: none; margin: 0 auto 12px; max-width: 460px; border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 9; background: var(--cream); }
.q-scene.has-photo { display: block; }
.q-scene img { width: 100%; height: 100%; object-fit: cover; display: block; }
.q-situation { font-size: 14px; font-weight: 700; color: var(--red-d); text-transform: uppercase; letter-spacing: .5px; margin: 0 0 4px; }
.fb .q-also { display: block; margin-top: 8px; font-size: 15px; }
.fb .q-also b { display: inline; color: var(--green-d); }
.quiz-subtitle { font-family: var(--serif); font-style: italic; font-size: 21px; color: var(--red-d); text-align: center; margin: 0 0 12px; }
/* Day 1 · bingo illustrations as pictures */
.mcard .m-pic { width: clamp(62px, 9vw, 88px); height: auto; display: block; }

/* Writing tasks · "Let's practice together!" (replaces the old self-check) */
.tshare { margin-top: 16px; background: linear-gradient(160deg, #FBF4E6, #F3E7D0); border: 1.5px solid var(--gold); border-radius: 16px; padding: 16px 18px; }
.tshare-title { font-family: var(--serif); font-size: 20px; color: var(--red-d); margin: 0 0 6px; }
.tshare p { margin: 0 0 4px; }
.tshare .row-btns { margin-top: 10px; }
.tshare .tiny { margin: 8px 0 0; }
.btn.is-disabled { opacity: .45; pointer-events: none; box-shadow: none; filter: grayscale(.4); }
@media (max-width: 520px) { .tshare .row-btns .btn { flex: 1 1 100%; } }
