:root {
  color-scheme: light;
  --paper: #fbfaf1;
  --ink: #14362b;
  --muted: #4a6053;
  --red: #982f44;
  --gold: #f7d798;
  --line: #d7ddce;
  font: 16px/1.5 system-ui, sans-serif;
  color: var(--ink);
  background: #e9eee7;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: radial-gradient(ellipse at 50% 0, #f8f6e8, transparent 680px); }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #bc5264; outline-offset: 3px; }
.wrap { width: min(1100px, calc(100% - 40px)); margin-inline: auto; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 66px; }
.brand { display: grid; place-items: center; min-width: 44px; min-height: 44px; border-radius: 12px; }
.profile { max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 1px solid #bdc8ba; border-radius: 30px; background: var(--paper); padding: 6px 15px; color: var(--ink); }
.hero { position: relative; isolation: isolate; overflow: hidden; border-radius: 21px; background: radial-gradient(ellipse at 83% 26%, #385b46, #142f27 62%); box-shadow: 0 12px 30px #17372b20; color: #fffaea; }
.hero-copy { position: relative; z-index: 1; width: min(69%, 690px); padding: clamp(30px, 5vw, 62px); }
.eyebrow { margin: 0 0 12px; color: var(--red); font-size: .73rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.hero .eyebrow { color: var(--gold); }
.hero .eyebrow::before { content: ""; display: inline-block; width: 7px; height: 7px; vertical-align: 2px; margin-right: 10px; transform: rotate(45deg); background: #ed8d92; }
h1, h2 { font-family: Georgia, serif; font-weight: 500; line-height: 1.02; }
h1 { margin: 0; font-size: clamp(2.75rem, 7.2vw, 5.2rem); letter-spacing: -.063em; text-wrap: balance; }
.hero-copy > p:last-child { max-width: 36ch; margin: 17px 0 0; color: #f3efe0; }
.winter { position: absolute; inset: 0 0 0 47%; pointer-events: none; }
.winter span { position: absolute; display: block; }
.moon { width: clamp(45px, 17%, 100px); aspect-ratio: 1; border-radius: 50%; right: 37%; top: 13%; background: #f0cc87; box-shadow: 0 0 60px #efc87d55; }
.star { color: var(--gold); }
.star.one { top: 13%; left: 27%; font-size: 1.5rem; }
.star.two { top: 40%; left: 38%; }
.star.three { top: 21%; right: 8%; font-size: 1.1rem; }
.snow { inset: 0; opacity: .8; background:
  radial-gradient(circle at 44% 15%, #faedce 0 1px, transparent 1.6px),
  radial-gradient(circle at 70% 22%, #faedce 0 1px, transparent 1.6px),
  radial-gradient(circle at 77% 36%, #faedce 0 1px, transparent 1.6px),
  radial-gradient(circle at 26% 38%, #faedce 0 1px, transparent 1.6px),
  radial-gradient(circle at 84% 11%, #faedce 0 1px, transparent 1.6px),
  radial-gradient(circle at 34% 29%, #faedce 0 1px, transparent 1.6px); }
.hill { border-radius: 50%; width: 115%; height: 45%; bottom: -28%; }
.far { background: #9ab59f; right: 14%; transform: rotate(-10deg); }
.near { background: #eeecd9; right: -18%; transform: rotate(7deg); }
.cottage { bottom: 14%; width: 15%; height: 21%; background: #823841; clip-path: polygon(0 46%, 50% 0, 100% 46%, 90% 46%, 90% 100%, 10% 100%, 10% 46%); }
.cottage::before { content: ""; position: absolute; inset: 0 0 auto; height: 50%; background: #ece8d1; clip-path: polygon(0 93%, 50% 0, 100% 93%, 88% 93%, 50% 28%, 12% 93%); }
.cottage::after { content: ""; position: absolute; inset: 56% 23% 22%; background: linear-gradient(90deg, #f5cb77 33%, transparent 33% 67%, #f5cb77 67%); }
.cottage.main { left: 39%; }
.cottage.small { left: 28%; bottom: 15%; width: 12%; height: 16%; background: #5e3c3a; }
.tree { width: 29%; height: 59%; bottom: 9%; background: #284f40; clip-path: polygon(50% 0, 66% 32%, 59% 30%, 75% 54%, 68% 53%, 92% 87%, 56% 80%, 55% 100%, 45% 100%, 44% 80%, 8% 87%, 32% 53%, 25% 54%, 41% 30%, 34% 32%); }
.tree.left { left: 12%; width: 24%; height: 46%; background: #507a65; bottom: 12%; }
.tree.right { right: -4%; height: 49%; bottom: 7%; }
.tree.central { width: 36%; height: 71%; right: 12%; background: #0c251d; }
.tree-star { top: 14%; right: 28.5%; line-height: 1; color: var(--gold); font-size: clamp(.85rem, 2vw, 1.5rem); }
.ornament { width: clamp(6px, 1.1vw, 11px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 34% 25%, #ffc1af, #bc414a 49%, #791d32); }
.ornament::before { content: ""; position: absolute; inset: -2px 32% auto; height: 2px; background: var(--gold); }
.ornament.first { right: 29%; bottom: 52%; }
.ornament.second { right: 36%; bottom: 34%; }
.ornament.third { right: 23%; bottom: 28%; }
.calendar { padding: clamp(28px, 5vw, 52px) 0 46px; }
.calendar-head { display: flex; gap: 10px 24px; flex-wrap: wrap; align-items: baseline; justify-content: space-between; margin-bottom: 20px; }
.calendar h2 { font-size: clamp(1.9rem, 4vw, 3rem); margin: 0; letter-spacing: -.04em; }
.calendar-head p { margin: 0; color: var(--muted); font-size: .9rem; }
.scoreboard { width: min(100%, 790px); margin: 0 auto 60px; padding: clamp(18px, 4vw, 38px); border: 1px solid var(--line); border-top: 3px solid #9a3446; border-radius: 18px; background: var(--paper); scroll-margin-top: 16px; box-shadow: 0 8px 26px #17372b10; }
.scoreboard h2 { font-size: clamp(1.9rem, 4vw, 3rem); margin: 0; letter-spacing: -.04em; }
.scoreboard p { color: var(--muted); }
#board-status:empty { margin: 0; }
.scoreboard table { width: 100%; border-collapse: collapse; text-align: left; }
.scoreboard th, .scoreboard td { padding: .65rem .5rem; border-bottom: 1px solid var(--line); }
.scoreboard td:nth-child(2) { overflow-wrap: anywhere; }
.scoreboard th:last-child, .scoreboard td:last-child { text-align: right; }
.doors { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; padding: 0; margin: 0; list-style: none; }
.door { display: grid; place-items: center; align-content: center; gap: 5px; width: 100%; min-height: 122px; padding: 9px 3px; border: 1px solid #9a3446; border-radius: 14px; color: #fffaf0; background: linear-gradient(145deg, #a0394c, #79253a); box-shadow: inset 0 0 0 4px #ffffff18; }
.door:not(:disabled):hover { filter: brightness(1.12); }
.door:disabled { cursor: default; color: #4d6054; border-color: #d3ddce; background: #f2f4eb; box-shadow: inset 0 0 0 4px #fff9; }
.door.answered { border-color: #315746; background: #315746; }
.door[aria-current="date"] { outline: 2px solid #b77437; outline-offset: 2px; }
.door[aria-current="date"]:focus-visible { outline: 3px solid #bc5264; }
.door strong { font: 400 clamp(1.65rem, 4.5vw, 2.7rem)/1 Georgia, serif; }
.month { font-size: .63rem; font-weight: 750; letter-spacing: .075em; text-transform: uppercase; }
.door-state { font-size: .77rem; }
dialog { max-width: min(510px, calc(100% - 30px)); width: 100%; max-height: calc(100% - 28px); padding: clamp(20px, 5vw, 36px); border: 1px solid var(--line); border-radius: 20px; background: var(--paper); color: var(--ink); box-shadow: 0 22px 65px #0e271a77; }
dialog::backdrop { background: #10241dc4; }
dialog h2 { margin: 0 0 14px; font-size: clamp(1.8rem, 5vw, 2.55rem); letter-spacing: -.035em; }
dialog p { color: var(--muted); }
#restore-link, .move-card a { color: var(--red); font-size: .9rem; text-underline-offset: .16em; }
.move-card { max-width: 34rem; margin: 12vh auto 0; padding: clamp(24px, 5vw, 44px); border: 1px solid var(--line); border-radius: 20px; background: var(--paper); }
label[for="username"] { display: block; margin: 20px 0 6px; font-weight: 700; }
#username { width: 100%; padding: 10px 12px; border: 1px solid #89998b; border-radius: 9px; background: #fffdf6; color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.primary, .secondary, .close { border-radius: 9px; padding: 9px 15px; font-weight: 750; }
.primary { color: white; background: var(--red); border: 1px solid var(--red); }
.primary:disabled { opacity: .7; cursor: wait; }
.secondary, .close { color: var(--ink); background: transparent; border: 1px solid #b4bcab; }
.door-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.door-head .countdown { margin: 0 10px 0 auto; padding: 3px 9px; border-radius: 20px; background: #e4ecdf; color: var(--ink); font-size: .85rem; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.door-head .countdown.urgent { background: #f4e3df; color: #752c39; }
.close { font-size: 1.35rem; padding: 0 10px; }
fieldset { display: grid; gap: 8px; margin: 18px 0 0; padding: 0; border: 0; }
fieldset:empty { display: none; }
fieldset label { display: flex; align-items: baseline; gap: 10px; padding: 9px 11px; border: 1px solid #c9cbbb; border-radius: 8px; background: #fffaf0; }
fieldset label:has(:checked) { border-color: var(--red); }
fieldset input { accent-color: var(--red); }
#feedback:empty { display: none; }
.correct, .incorrect { border-radius: 8px; padding: 10px 12px; }
dialog .correct { background: #dce8da; color: #1d472f; }
dialog .incorrect { background: #f4e3df; color: #752c39; }
#answer-submit { margin-top: 16px; }

@media (max-width: 740px) { .doors { grid-template-columns: repeat(4, minmax(0, 1fr)); } .winter { opacity: .72; } }
@media (max-width: 460px) {
  .wrap { width: calc(100% - 24px); }
  .doors { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .door { min-height: 91px; }
  .hero-copy { width: min(74%, 330px); padding: 29px 20px; }
  .hero-copy > p:last-child { font-size: .88rem; }
  .winter { inset-inline-start: 51%; opacity: .55; }
  .star.one { left: 44%; }
}
