/* Florensia Advent Calendar – warm, paper-and-candlelight look. No web fonts, no external assets. */
:root {
  --paper: #f6eddc;
  --paper-2: #efe2c9;
  --card: #fffaf0;
  --ink: #2c2620;
  --ink-soft: #6a5d4e;
  --line: #dccbad;
  --fir: #173226;
  --fir-2: #21463a;
  --fir-3: #2f5b49;
  --berry: #9e2f2f;
  --berry-2: #7f2224;
  --gold: #c8953f;
  --gold-soft: #e9c983;
  --snow: #fdfbf6;
  --ok: #2f6b4a;
  --bad: #9e2f2f;
  --discord: #5865f2;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 6px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 2px 0 rgba(60, 40, 20, .08), 0 8px 24px -12px rgba(60, 40, 20, .35);
}

* { box-sizing: border-box; }
html { background: var(--fir); }
body {
  margin: 0;
  min-height: 100vh;
  font: 15px/1.6 var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 50% -200px, rgba(255, 236, 200, .5), transparent 70%),
    repeating-linear-gradient(0deg, rgba(120, 90, 50, .018) 0 2px, transparent 2px 4px),
    var(--paper);
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: var(--berry); }
a:hover { color: var(--berry-2); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }
.wrap { width: min(1180px, 100% - 32px); margin: 0 auto; }
.loading { text-align: center; padding: 80px 0; color: var(--ink-soft); }
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; color: var(--fir); }

#snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid #b9a581; background: var(--card); color: var(--fir);
  padding: 10px 18px; border-radius: var(--radius); font-weight: 600; font-size: 14px;
  cursor: pointer; text-decoration: none; min-height: 42px; transition: background .15s, border-color .15s, transform .15s;
}
.btn:hover { background: #fff3dc; border-color: #9c8761; color: var(--fir); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-red { background: var(--berry); border-color: var(--berry-2); color: #fff8ee; box-shadow: 0 2px 0 var(--berry-2); }
.btn-red:hover { background: var(--berry-2); color: #fff; }
.btn-gold { background: var(--gold-soft); border-color: var(--gold); color: #3a2a12; box-shadow: 0 2px 0 #a8792f; }
.btn-gold:hover { background: #f0d496; color: #3a2a12; }
.btn-discord { background: var(--discord); border-color: #4752c4; color: #fff; }
.btn-discord:hover { background: #4752c4; color: #fff; }
.btn-ghost { background: transparent; border-color: rgba(255, 255, 255, .35); color: #f7efe0; }
.btn-ghost:hover { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .6); }
.btn-small { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.btn-link { background: none; border: 0; color: var(--berry); padding: 0; min-height: 0; text-decoration: underline; cursor: pointer; font-weight: 500; }
.discord-icon { width: 18px; height: 18px; fill: currentColor; }

/* ---------- header ---------- */
.dev-banner { background: #3b3326; color: #f3e3c3; text-align: center; font-size: 12px; padding: 5px 12px; letter-spacing: .03em; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; }
.dev-banner button, .dev-banner input { background: #574b37; color: #fff3da; border: 1px solid #7a6a4c; border-radius: 3px; padding: 2px 8px; font-size: 12px; cursor: pointer; }
.dev-banner button:hover { background: #6d5e44; }
.dev-banner.preview-on { background: #6b2a22; }
.announce {
  background: var(--berry); color: #fbeedd; text-align: center; font-size: 12.5px; letter-spacing: .08em;
  text-transform: uppercase; padding: 7px 16px; font-weight: 600;
  border-bottom: 1px solid var(--berry-2);
}
.announce:empty { display: none; }
.topbar { background: var(--fir); border-bottom: 3px solid var(--gold); position: sticky; top: 0; z-index: 40; }
.topbar-inner { width: min(1180px, 100% - 32px); margin: 0 auto; display: flex; align-items: center; gap: 24px; min-height: 72px; }
.brand { display: block; flex-shrink: 0; }
.brand img { display: block; height: 52px; width: auto; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a {
  color: #e9dfca; text-decoration: none; padding: 8px 12px; border-radius: 4px; font-weight: 500; font-size: 14.5px;
}
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.nav a.active { color: var(--gold-soft); box-shadow: inset 0 -2px 0 var(--gold); border-radius: 0; }
.account { display: flex; align-items: center; gap: 8px; }
.user-chip {
  display: inline-flex; align-items: center; gap: 8px; color: #f3ead8; text-decoration: none;
  border: 1px solid rgba(255, 255, 255, .22); padding: 5px 10px 5px 5px; border-radius: 40px; font-size: 13.5px;
}
.user-chip:hover { border-color: var(--gold); color: #fff; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--berry); color: #fff4e2; font-weight: 700; font-size: 13px; font-family: var(--serif);
}
.menu-toggle { display: none; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #f5ecda;
  background:
    radial-gradient(600px 300px at 78% 60%, rgba(255, 190, 110, .18), transparent 70%),
    radial-gradient(900px 400px at 20% 0%, rgba(80, 130, 110, .35), transparent 70%),
    linear-gradient(180deg, #10241b 0%, #183528 55%, #1d3d30 100%);
  padding: 70px 0 110px;
  --garland-h: max(90px, 7.5vw); /* grows with the width so no bulb gets cut off */
}
.hero::before { /* faint stars */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background-image:
    radial-gradient(1px 1px at 12% 22%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 33% 12%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 57% 30%, #fff8dc 50%, transparent 51%),
    radial-gradient(1px 1px at 71% 9%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 26%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 45% 48%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 6% 56%, #fff8dc 50%, transparent 51%),
    radial-gradient(1px 1px at 93% 52%, #fff 50%, transparent 51%);
}
.garland { position: absolute; left: 0; right: 0; top: -6px; width: 100%; height: var(--garland-h, 90px); pointer-events: none; z-index: 2; }
.garland .wire { fill: none; stroke: #0b1912; stroke-width: 2; }
.garland .bulb { transform-box: fill-box; transform-origin: 50% 0; }
.garland .glow, .tree .glow { filter: blur(5px); opacity: .7; animation: twinkle 3.2s ease-in-out infinite alternate; }
@keyframes twinkle { 0% { opacity: .25; } 60% { opacity: .8; } 100% { opacity: .55; } }
.hero.has-lights { padding-top: calc(var(--garland-h) + 8px); }
.hero-inner { position: relative; z-index: 3; width: min(1180px, 100% - 32px); margin: 0 auto; display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.kicker { font-size: 12.5px; letter-spacing: .18em; text-transform: uppercase; font-weight: 700; color: var(--gold-soft); }
.hero h1 { color: #fff7e8; font-size: clamp(42px, 6vw, 72px); margin: 12px 0 16px; letter-spacing: -.01em; font-weight: 500; text-shadow: 0 2px 18px rgba(0, 0, 0, .35); }
.hero-intro { font-size: 17px; max-width: 520px; color: #e6dcc6; margin: 0 0 26px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.english-pill {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 22px; font-size: 13px; font-weight: 600;
  background: rgba(255, 245, 225, .1); border: 1px solid rgba(233, 201, 131, .45); color: #f3dfb0; padding: 6px 12px; border-radius: 30px;
}
.flag-en { width: 20px; height: 14px; border-radius: 2px; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(0, 0, 0, .2); }
.hero-scene { position: relative; min-height: 380px; display: flex; align-items: flex-end; justify-content: center; }
.tree { width: min(330px, 80%); height: auto; filter: drop-shadow(0 18px 20px rgba(0, 0, 0, .35)); position: relative; z-index: 2; }

@keyframes shimmer { from { opacity: .85; } to { opacity: 1; } }
.artframe {
  position: absolute; left: 0; top: 10px; width: 56%; aspect-ratio: 4 / 3; z-index: 1;
  background: #2a1d12; padding: 10px; border-radius: 3px; transform: rotate(-3deg);
  box-shadow: 0 0 0 2px #8a6532, 0 0 0 5px #4a3219, 0 18px 30px rgba(0, 0, 0, .45);
}
.artframe img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.9) sepia(.12); }
.hero-scene.has-art .tree { margin-left: 34%; width: min(280px, 64%); }
.snowbank { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 70px; z-index: 4; display: block; }

/* ---------- layout ---------- */
.section { padding: 40px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(28px, 3.4vw, 38px); margin: 4px 0 0; font-weight: 500; }
.section-head .kicker { color: var(--berry); }
.sprig { display: block; width: 90px; height: 16px; margin-top: 8px; }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
.side { display: flex; flex-direction: column; gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card h3 { margin: 0 0 10px; font-size: 22px; font-weight: 500; }
.card p { margin: 0 0 12px; }
.card-today { border-top: 5px solid var(--berry); }
.card-english { background: #fdf4dc; border-color: #e5cd94; }
.card-english h3 { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 10px 0 10px 40px; border-top: 1px dashed var(--line); font-size: 14px; }
.steps li:first-child { border-top: 0; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 9px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--fir); color: var(--gold-soft); display: grid; place-items: center; font-family: var(--serif); font-size: 15px;
}
.countdown { font-family: var(--serif); font-size: 26px; color: var(--berry); margin: 4px 0 14px; font-variant-numeric: tabular-nums; }

/* ---------- doors ---------- */
.doors {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: 118px; gap: 12px; grid-auto-flow: dense;
  padding: 18px; border-radius: 8px; position: relative;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .03) 0 10px, transparent 10px 20px),
    linear-gradient(180deg, #23463a, #1a372d);
  box-shadow: inset 0 0 0 1px #0f241b, inset 0 0 0 6px #2d5646, inset 0 0 0 7px #0f241b, 0 12px 30px -14px rgba(20, 40, 30, .8);
}
.door { position: relative; perspective: 900px; border: 0; padding: 0; background: none; cursor: pointer; text-align: left; border-radius: 4px; }
.door.span-w { grid-column: span 2; }
.door.span-t { grid-row: span 2; }
.door.span-b { grid-column: span 2; grid-row: span 2; }
.door .inside {
  position: absolute; inset: 0; border-radius: 4px; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 45%, #5a3a1c, #2a1a0d 75%);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, .7);
  color: var(--gold-soft);
}
.door .inside svg { width: 34px; height: 34px; }
.door .flap {
  position: absolute; inset: 0; border-radius: 4px; transform-origin: left center; transition: transform .55s cubic-bezier(.3, .7, .3, 1);
  background: var(--door-bg, #a8363a); color: var(--door-ink, #fff3e0);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 3px 6px rgba(0, 0, 0, .3);
  display: flex; flex-direction: column; justify-content: space-between; padding: 10px 12px; overflow: hidden;
  backface-visibility: hidden;
}
.door .flap::before { /* perforation */
  content: ""; position: absolute; inset: 5px; border: 1.5px dashed rgba(255, 245, 225, .45); border-radius: 3px; pointer-events: none;
}
.door .flap::after { /* print texture */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background: repeating-linear-gradient(115deg, rgba(255, 255, 255, .05) 0 3px, transparent 3px 7px);
}
.door .num { font-family: var(--serif); font-size: 38px; line-height: 1; font-weight: 600; position: relative; z-index: 1; }
.door.span-b .num { font-size: 72px; }
.door .doodle { position: absolute; right: 10px; bottom: 10px; width: 30px; height: 30px; opacity: .7; z-index: 1; }
.door.span-b .doodle { width: 60px; height: 60px; right: 18px; bottom: 18px; }
.door .label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; position: relative; z-index: 1; opacity: .92; }
.door.c0 { --door-bg: #a8363a; }
.door.c1 { --door-bg: #2f6b52; }
.door.c2 { --door-bg: #f3e6c9; --door-ink: #7c2a24; }
.door.c3 { --door-bg: #c08a3a; --door-ink: #2d1d0b; }
.door.c4 { --door-bg: #1f4e66; }
.door.c2 .flap::before { border-color: rgba(124, 42, 36, .35); }
.door.c3 .flap::before { border-color: rgba(45, 29, 11, .35); }
.door:hover .flap { transform: rotateY(-14deg); }
.door.locked { cursor: default; }
.door.locked:hover .flap { transform: none; }
.door.locked .flap { filter: saturate(.75) brightness(.92); }
.door.today .flap { box-shadow: 0 0 0 3px var(--gold-soft), 0 0 22px 4px rgba(255, 210, 120, .55); }
.door.today .label { background: var(--gold-soft); color: #3a260c; align-self: flex-start; padding: 2px 7px; border-radius: 3px; }
.door.today { animation: nudge 5s ease-in-out infinite; }
@keyframes nudge { 0%, 88%, 100% { transform: none; } 92% { transform: rotate(-1.2deg); } 96% { transform: rotate(1.2deg); } }
.door.opened .flap { transform: rotateY(-62deg); }
.door.opened:hover .flap { transform: rotateY(-70deg); }
.door.missed .flap { filter: grayscale(.7) brightness(.82); }
.door.missed .label { opacity: .8; }
.door.missed { cursor: default; }
.door.missed:hover .flap { transform: none; }
.door .inside .res { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }
.door .inside .stack { display: flex; flex-direction: column; align-items: center; padding-left: 30%; text-align: center; }
.door .inside .res.correct { color: #9fe0b5; }
.door .inside .res.incorrect { color: #f1a39b; }
.door .inside .res.pending, .door .inside .res.revoked { color: #e9d7b0; }

/* ---------- leaderboard / winners ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); padding: 8px 10px; border-bottom: 2px solid var(--line); }
.table td { padding: 9px 10px; border-bottom: 1px dashed var(--line); }
.table td.rank { font-family: var(--serif); font-size: 18px; color: var(--berry); width: 48px; }
.table tr.me td { background: #fbefd2; }
.medal { display: inline-block; width: 22px; height: 22px; border-radius: 50%; text-align: center; line-height: 22px; font-size: 12px; font-weight: 700; color: #3a260c; }
.medal.m1 { background: #e8c25e; } .medal.m2 { background: #cfd3d6; } .medal.m3 { background: #d39b6a; }
.draw { padding: 14px 0; border-top: 1px dashed var(--line); }
.draw:first-of-type { border-top: 0; }
.draw h4 { margin: 0 0 6px; font-family: var(--serif); font-size: 18px; font-weight: 600; color: var(--fir); }
.winner-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.winner-list li { background: #f6e7c4; border: 1px solid #e0c58b; border-radius: 30px; padding: 4px 12px; font-weight: 600; font-size: 14px; }

/* ---------- pages ---------- */
.page { max-width: 820px; margin: 0 auto; }
.page h1 { font-size: clamp(32px, 4vw, 44px); font-weight: 500; margin: 8px 0 18px; }
.prose p { margin: 0 0 14px; }
.prose ul { padding-left: 22px; margin: 0 0 14px; }
.prose li { margin: 6px 0; }
.notice { padding: 12px 14px; border-radius: var(--radius); background: #fbf1da; border: 1px solid #e8d3a2; font-size: 14px; }
.notice.ok { background: #e5f0e6; border-color: #b7d3bc; color: #1f4a32; }
.notice.err { background: #f8e3df; border-color: #e3b5ad; color: #7b231d; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px dashed var(--line); }
.switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cbbb9c; border-radius: 30px; cursor: pointer; transition: background .2s; }
.switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::before { transform: translateX(20px); }
.mini-doors { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; }
.mini-doors span { aspect-ratio: 1; display: grid; place-items: center; border-radius: 3px; font-size: 12px; font-weight: 700; background: #eadcc0; color: #7a6a52; }
.mini-doors .correct { background: var(--ok); color: #fff; }
.mini-doors .incorrect { background: var(--bad); color: #fff; }
.mini-doors .pending, .mini-doors .revoked { background: var(--gold); color: #2d1d0b; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; }
.field label, .label { font-weight: 600; font-size: 13.5px; color: var(--fir); }
.input, .field input[type=text], .field input[type=number], .field input:not([type]), .field select, .field textarea {
  border: 1px solid #c9b48e; background: #fffdf8; border-radius: var(--radius); padding: 10px 12px; width: 100%;
}
.field textarea { min-height: 90px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 0 0 12px; cursor: pointer; }
.check input { margin-top: 4px; accent-color: var(--berry); }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(15, 25, 20, .62); display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto; animation: fade .2s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--card); border-radius: 8px; width: min(720px, 100%); position: relative;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45); border: 1px solid #d9c49c; animation: rise .25s ease;
}
.modal.narrow { width: min(480px, 100%); }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
.modal-head { background: var(--fir); color: #f5ead2; padding: 18px 56px 16px 24px; border-radius: 8px 8px 0 0; border-bottom: 3px solid var(--gold); }
.modal-head .kicker { font-size: 11.5px; }
.modal-head h2 { color: #fff6e4; margin: 4px 0 0; font-size: 28px; font-weight: 500; }
.modal-body { padding: 22px 24px 26px; }
.modal-close {
  position: absolute; right: 12px; top: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, .1); color: #fff; font-size: 22px; line-height: 1; cursor: pointer;
}
.modal-close:hover { background: rgba(255, 255, 255, .2); }
.prompt { font-size: 16.5px; margin: 0 0 16px; white-space: pre-line; }
.english-bar {
  display: flex; align-items: center; gap: 10px; background: #fdf4dc; border: 1px solid #e5cd94; color: #5a4210;
  border-radius: var(--radius); padding: 9px 12px; font-size: 13.5px; font-weight: 600; margin: 0 0 16px;
}
.answer-row { display: flex; gap: 10px; flex-wrap: wrap; }
.answer-row input { flex: 1; min-width: 200px; }
.result { margin-top: 16px; }
.solution-box { margin-top: 18px; padding: 16px; border-radius: var(--radius); background: #eef4ec; border: 1px solid #c4d8c3; }
.solution-box h4 { margin: 0 0 6px; font-family: var(--serif); font-size: 18px; color: var(--fir); }
.solution-answer { font-family: var(--serif); font-size: 22px; color: var(--ok); }
.choices { display: grid; gap: 8px; margin: 0 0 16px; }
.choice {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid #d8c5a1; border-radius: var(--radius);
  background: #fffdf8; cursor: pointer; font-weight: 500;
}
.choice:hover { border-color: var(--gold); }
.choice input { accent-color: var(--berry); }
.choice.is-correct { border-color: var(--ok); background: #e5f0e6; }
.choice.is-mine { box-shadow: inset 4px 0 0 var(--berry); }
.puzzle-img { display: block; max-height: 380px; margin: 0 auto 16px; border-radius: 4px; border: 1px solid var(--line); }

/* maze */
.maze-box { display: flex; justify-content: center; margin: 0 0 12px; }
.maze-box canvas { width: min(100%, 460px); height: auto; touch-action: none; cursor: crosshair; border-radius: 4px; background: #fbf4e4; border: 1px solid var(--line); }

/* word search */
.ws { display: grid; gap: 16px; grid-template-columns: auto 1fr; align-items: start; margin-bottom: 12px; }
.ws-grid { position: relative; display: grid; user-select: none; touch-action: none; background: #fffdf6; border: 1px solid var(--line); border-radius: 4px; padding: 6px; }
.ws-grid .cell { width: 32px; height: 32px; display: grid; place-items: center; font-family: var(--serif); font-weight: 600; font-size: 18px; color: #3a2f22; position: relative; z-index: 1; }
.ws-grid svg { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); pointer-events: none; z-index: 0; }
.ws-grid svg line { stroke-linecap: round; stroke-width: 26; }
.ws-words { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; }
.ws-words li { padding: 3px 10px; border-radius: 20px; background: #f0e3c7; font-size: 13px; font-weight: 600; letter-spacing: .04em; }
.ws-words li.found { background: #cfe3d2; text-decoration: line-through; color: #2a5a3e; }
.ws-words li.marked { cursor: pointer; background: #f6d9b5; }

/* spot */
.spot { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); margin-bottom: 12px; }
.spot.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.spot figure { margin: 0; min-width: 0; }
.spot figcaption { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); margin-bottom: 4px; }
.spot-img { position: relative; cursor: crosshair; line-height: 0; border-radius: 4px; overflow: hidden; border: 1px solid var(--line); }
.spot-img img { width: 100%; display: block; user-select: none; -webkit-user-drag: none; }
.spot-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.spot-swipe { display: none; }
.marker, .target {
  position: absolute; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: auto;
}
.marker { width: 30px; height: 30px; border: 3px solid var(--berry); background: rgba(255, 240, 220, .25); box-shadow: 0 0 0 2px #fff; cursor: pointer; }
.target { border: 3px solid #2fbf6a; box-shadow: 0 0 0 2px #fff; pointer-events: none; }

/* ---------- footer ---------- */
.footer { background: var(--fir); color: #d5cab3; margin-top: 50px; border-top: 3px solid var(--gold); position: relative; }
.footer-inner { width: min(1180px, 100% - 32px); margin: 0 auto; padding: 30px 0; display: flex; gap: 24px; justify-content: space-between; align-items: center; flex-wrap: wrap; font-size: 13.5px; }
.footer a { color: #f0dfb8; }
.footer .links { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.footer select { background: transparent; border: 1px solid rgba(255, 255, 255, .3); border-radius: 4px; padding: 5px 8px; color: #f3e9d3; }
.footer select option { color: #222; }
.footer .btn-link { color: #f0dfb8; }
.footer-logo img { height: 40px; width: auto; opacity: .9; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 80; background: var(--fir); color: #fff3dd; padding: 12px 18px; border-radius: 6px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); font-weight: 500; border-left: 4px solid var(--gold); max-width: calc(100% - 32px); }

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .cal-layout { grid-template-columns: 1fr; }
  .side { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-scene { min-height: 300px; }
}
@media (max-width: 760px) {
  .topbar-inner { flex-wrap: wrap; gap: 8px 12px; padding: 8px 0; min-height: 0; }
  .brand img { height: 42px; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .nav a { white-space: nowrap; padding: 6px 10px; font-size: 14px; }
  .account { margin-left: auto; }
  .user-chip .uname { display: none; }
  .hero { padding-bottom: 90px; }
  .hero-intro { font-size: 16px; }
  .hero-scene { min-height: 0; margin-top: 10px; }
  .tree { width: 230px; }
  .hero-scene.has-art .tree { width: 190px; }
  .doors { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 104px; gap: 9px; padding: 12px; }
  .door.span-w, .door.span-t { grid-column: auto; grid-row: auto; }
  .door .num { font-size: 32px; }
  .door.span-b .num { font-size: 60px; }
  .two-col { grid-template-columns: 1fr; }
  .ws { grid-template-columns: 1fr; }
  .ws-grid .cell { width: min(30px, calc((100vw - 90px) / var(--n))); height: min(30px, calc((100vw - 90px) / var(--n))); font-size: 15px; }
  .ws-grid svg line { stroke-width: 20; }
  .spot.two { grid-template-columns: minmax(0, 1fr); }
  .spot-scroll .spot-img { width: 760px; max-width: none; }
  .spot-swipe { display: block; margin: 0 0 6px; }
  .modal-backdrop { padding: 12px 8px; }
  .modal-body { padding: 18px 16px 22px; }
  .modal-head h2 { font-size: 24px; }
  .mini-doors { grid-template-columns: repeat(8, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ===================== Dashboard ===================== */
.admin { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 0; min-height: 70vh; background: #f3ece0; }
.admin-nav { background: #1d2f27; padding: 18px 10px; display: flex; flex-direction: column; gap: 2px; }
.admin-nav .who { color: #c9bfa8; font-size: 12px; padding: 4px 12px 16px; border-bottom: 1px solid #2f453b; margin-bottom: 8px; }
.admin-nav .who b { color: #f3e7cc; display: block; font-size: 14px; }
.admin-nav a { color: #dbd2bf; text-decoration: none; padding: 9px 12px; border-radius: 4px; font-size: 14px; }
.admin-nav a:hover { background: #2a4237; color: #fff; }
.admin-nav a.active { background: var(--berry); color: #fff; }
.admin-main { padding: 26px 30px 60px; min-width: 0; }
.admin-main h1 { font-size: 30px; margin: 0 0 4px; font-weight: 500; }
.admin-main > .muted { margin: 0 0 20px; }
.panel { background: #fffdf8; border: 1px solid #e0d3bd; border-radius: 6px; padding: 18px 20px; margin-bottom: 18px; overflow-x: auto; }
.panel h3 { margin: 0 0 12px; font-size: 19px; font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: #fffdf8; border: 1px solid #e0d3bd; border-radius: 6px; padding: 14px 16px; }
.stat .v { font-family: var(--serif); font-size: 30px; color: var(--fir); }
.stat .l { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); font-weight: 700; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 150px; padding-top: 10px; border-bottom: 1px solid #cdbd9f; }
.bars .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; position: relative; }
.bars .bar i { display: block; background: #d9c7a3; border-radius: 2px 2px 0 0; }
.bars .bar i.c { background: var(--ok); }
.bars-x { display: flex; gap: 4px; font-size: 10.5px; color: var(--ink-soft); }
.bars-x span { flex: 1; text-align: center; }
.dt { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.dt th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); padding: 8px; border-bottom: 2px solid #e0d3bd; white-space: nowrap; }
.dt td { padding: 8px; border-bottom: 1px solid #eee3d0; vertical-align: top; }
.dt tr:hover td { background: #fbf5e8; }
.scroll-x { overflow-x: auto; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 3px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.badge.correct, .badge.ready { background: #dcebdc; color: #24563a; }
.badge.incorrect, .badge.problem { background: #f4dcd7; color: #86261f; }
.badge.revoked, .badge.draft { background: #f1e2c2; color: #6a4a12; }
.badge.role { background: #e2e6f6; color: #2f3a85; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .input, .toolbar select { width: auto; min-width: 160px; }
.daypick { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; margin-bottom: 18px; }
.daypick button { border: 1px solid #d8c8a8; background: #fffdf8; border-radius: 4px; padding: 6px 0 4px; cursor: pointer; font-weight: 700; line-height: 1.1; }
.daypick button small { display: block; font-size: 9.5px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; }
.daypick button.sel { background: var(--fir); color: #fff; border-color: var(--fir); }
.daypick button.sel small { color: #cfe0d4; }
.daypick button.warn { box-shadow: inset 0 -3px 0 var(--gold); }
.daypick button.ok { box-shadow: inset 0 -3px 0 var(--ok); }
.lang-tabs { display: flex; gap: 4px; margin-bottom: 10px; flex-wrap: wrap; }
.lang-tabs button { border: 1px solid #d8c8a8; background: #fffdf8; padding: 4px 10px; border-radius: 4px; cursor: pointer; font-size: 13px; font-weight: 600; }
.lang-tabs button.sel { background: var(--berry); color: #fff; border-color: var(--berry); }
.lang-tabs button.empty { color: #b09a78; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.preview-pane { background: #fbf4e4; border: 1px dashed #cdb68a; border-radius: 6px; padding: 14px; }
.editor-canvas { max-width: 100%; display: block; border: 1px solid var(--line); border-radius: 4px; cursor: crosshair; }
.target-list { font-size: 13px; }
.audit-row { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid #eee3d0; font-size: 13.5px; }
.audit-row code { font-size: 12px; color: var(--ink-soft); word-break: break-word; }
@media (max-width: 860px) {
  .admin { grid-template-columns: 1fr; }
  .admin-nav { flex-direction: row; overflow-x: auto; padding: 8px; }
  .admin-nav .who { display: none; }
  .admin-nav a { white-space: nowrap; }
  .admin-main { padding: 18px 14px 40px; }
  .grid2 { grid-template-columns: 1fr; }
  .daypick { grid-template-columns: repeat(6, 1fr); }
}
