:root {
  color-scheme: light;
  font: 16px/1.55 ui-sans-serif, system-ui, sans-serif;
  --paper: #f7ecd8;
  --ink: #302321;
  --muted: #645450;
  --red: #8d263d;
  --red-dark: #65162a;
  --border: #d8c2a5;
  --cream: #fffbf0;
  background: var(--paper);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; display: flex; flex-direction: column;
  background: radial-gradient(ellipse at 18% 14%, #fff9ea, transparent 53%); }
main { flex: 1; width: min(75rem, 100% - 3rem); margin-inline: auto; padding-block: clamp(2rem, 6vw, 5.75rem); }
h1, h2 { font-family: Georgia, 'Times New Roman', serif; line-height: .99; letter-spacing: -.045em; margin: 0; }
h1 { font-size: clamp(2.7rem, 6.4vw, 5.6rem); text-wrap: balance; overflow-wrap: anywhere; }
h2 { font-size: clamp(1.6rem, 3vw, 2.35rem); }
a { color: var(--red-dark); text-underline-offset: .2em; }
button, input, textarea { font: inherit; }
button, .primary { border: 1px solid var(--border); padding: .68rem 1rem; background: var(--cream);
  color: var(--ink); border-radius: .55rem; min-height: 44px; cursor: pointer; font-weight: 700; }
button:hover { background: #fff3e1; }
button:disabled { opacity: .65; cursor: wait; }
.primary { color: #fff9ed; background: var(--red); border-color: var(--red); text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; }
.primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
:focus-visible { outline: 3px solid #24747a; outline-offset: 3px; }
[hidden] { display: none !important; }
.masthead { display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .9rem max(1.5rem, (100% - 75rem) / 2); border-top: 7px solid transparent;
  border-image: repeating-linear-gradient(110deg, #9d3b47 0 38px, #f7ecd8 38px 74px, #41616a 74px 112px, #f7ecd8 112px 148px) 7;
  background: #fffaeb8c; }
.brand { font: bold 1.38rem Georgia, serif; text-decoration: none; color: var(--ink); white-space: nowrap; }
.brand span { color: var(--red); margin-right: .25rem; }
.main-nav, footer div, .languages { display: flex; align-items: center; gap: .55rem 1.25rem; flex-wrap: wrap; }
.main-nav a, footer a { font-size: .9rem; font-weight: 650; }
footer { border-top: 1px solid var(--border); width: min(75rem, 100% - 3rem); padding: 1.3rem 0 2rem; margin: auto; }
footer div { margin-bottom: .6rem; }
.languages [aria-current] { color: var(--ink); text-decoration-thickness: .18em; }
.hero { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(2rem, 5.5vw, 6rem); align-items: center; }
.hero-copy { min-width: 0; }
.lead { font-size: clamp(1.04rem, 2vw, 1.25rem); max-width: 35rem; color: var(--muted); margin: 1.25rem 0 1.55rem; }
form, #saved { display: grid; gap: .95rem; max-width: 34rem; }
label, legend { font-weight: 650; }
input:not([type=radio]), textarea { display: block; margin-top: .35rem; padding: .65rem .8rem; width: 100%;
  border: 1px solid #a78b79; border-radius: .45rem; background: var(--cream); color: var(--ink); }
textarea { resize: vertical; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0 0 .4rem; }
.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.theme-choice, .sticker { position: relative; display: grid; text-align: center;
  place-items: center; padding: .5rem .35rem; background: var(--cream); border: 1px solid var(--border);
  border-radius: .5rem; cursor: pointer; font-size: .88rem; line-height: 1.25; }
.theme-choice span:first-of-type { font-size: 1.45rem; margin: .18rem 0; }
.theme-choice input, .sticker input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
label:has(input[type=radio]:checked) { box-shadow: inset 0 0 0 2px #8e3142; background: #fff5e1; }
label:has(input:focus-visible) { outline: 3px solid #24747a; outline-offset: 2px; }
.form-error { color: var(--red-dark); font-weight: 700; margin: 0; }
.form-error:empty { display: none; }
.subtle-link { display: inline-block; margin-top: 1rem; }
#saved { margin-top: 1.5rem; gap: .35rem; }
#saved ul { margin: 0; padding-left: 1.3rem; }
.preview { position: relative; padding: .5rem; isolation: isolate; }
.preview::before { content: ''; position: absolute; z-index: -1; inset: 2% -1%; background: #d9b889;
  border-radius: 1.2rem; transform: rotate(3deg); }
.postcard { --envelope: #8f4a37; --tint: #f5d1a6; --accent: #a75b3e;
  padding: clamp(.8rem, 2.6vw, 1.65rem); border-radius: 1rem;
  color: #fff5e1; background: linear-gradient(152deg, var(--accent), var(--envelope));
  border: 1px solid #30232150; box-shadow: 0 12px 34px #533b3125; }
.postcard.snow { --envelope: #183957; --tint: #d7e8ec; --accent: #45738a; }
.postcard.candy { --envelope: #6d1938; --tint: #f8d8d9; --accent: #ab4e66; }
.postcard-top { display: flex; justify-content: space-between; align-items: center; gap: .55rem;
  text-align: center; color: #fff7e3; padding: 0 .2rem .85rem; font: 700 clamp(1.3rem, 2.8vw, 1.9rem) Georgia, serif; }
.door-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(.3rem, .8vw, .65rem); }
.post-door { position: relative; min-width: 0; display: grid; align-content: center; justify-items: center; gap: .1rem;
  padding: .55rem .2rem .3rem; min-height: 3.4rem; aspect-ratio: 1.02; border-radius: .36rem;
  background: linear-gradient(151deg, transparent 47%, #573d3529 49%, transparent 51%) top right / 50% 56% no-repeat,
    linear-gradient(209deg, transparent 47%, #573d3529 49%, transparent 51%) top left / 50% 56% no-repeat, #fff4df;
  border: 1px solid #49362653; color: var(--ink); box-shadow: 0 2px 0 #28232b38; }
.post-door.paper-0 { background-color: var(--tint); }
.post-door.paper-2 { background-color: #edd8bd; }
.post-door b { position: absolute; top: .15rem; left: .32rem; font-size: clamp(.64rem, 1.2vw, .87rem); }
.post-door span { font-size: clamp(1rem, 2.3vw, 1.75rem); line-height: 1.15; }
.post-door small { max-width: 98%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(.65rem, 1vw, .8rem); }
button.post-door:hover, .sample-door { background-color: #fffaf0; }
button.post-door:focus-visible { outline-color: #fff; }
.sample-door { box-shadow: inset 0 0 0 2px #b96855; }
.demo-action { display: block; margin: 1.05rem auto 0; background: transparent; color: #fff5e1; border-color: #f4e5ca88; }
.demo-action:hover { background: #ffffff24; }
.sheet { background: var(--cream); border: 1px solid var(--border); border-radius: 1rem;
  width: min(100%, 52rem); margin-inline: auto; padding: clamp(1.2rem, 5vw, 4rem); }
.sheet.narrow { max-width: 39rem; }
.sheet h1, .arcade h1, .calendar-heading h1 { font-size: clamp(2.4rem, 5.5vw, 4.6rem); }
.legal p { max-width: 64ch; }
.code-entry, .share-code { font-family: ui-monospace, monospace; letter-spacing: .09em; }
.calendar-page { max-width: 53rem; margin-inline: auto; }
.calendar-heading { text-align: center; margin-bottom: 1.3rem; }
.calendar-heading p { margin: .55rem 0 0; }
progress { accent-color: var(--red); width: min(100%, 14rem); }
.sharing { display: flex; align-items: center; gap: .7rem; justify-content: center; flex-wrap: wrap; margin-top: 1.3rem; }
.share-code { font-weight: 700; padding: .5rem; }
.owner-tools { width: 100%; text-align: center; padding-top: .65rem; border-top: 1px solid var(--border); }
.owner-tools p { margin: .4rem 0; color: var(--muted); font-size: .93rem; }
dialog { color: var(--ink); background: var(--cream); width: min(95vw, 34rem); padding: 1.65rem;
  border: 1px solid var(--border); border-radius: .9rem; box-shadow: 0 12px 60px #29212480; }
dialog::backdrop { background: #211b28a6; }
.modal-close { display: block; margin-left: auto; padding: 0; margin-bottom: .5rem; min-width: 44px;
  font-size: 1.6rem; line-height: 1; }
dialog form { margin-top: .85rem; }
.stickers { display: grid; grid-template-columns: repeat(6, 1fr); gap: .4rem; }
.sticker { min-height: 42px; font-size: 1.35rem; }
.note-preview { white-space: pre-wrap; overflow-wrap: anywhere; background: #f9ebd5; padding: 1rem; border-radius: .45rem; }
.gold-note { background: linear-gradient(115deg, #ffe3a0, #fff5d9, #eabf59); }
.copy-fallback { margin-top: 1rem; min-height: 7rem; }
.success-links { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem 1rem; }
#toast { z-index: 10; position: fixed; inset: auto auto 1.2rem 50%; transform: translateX(-50%);
  background: #302321; color: #fff8e9; border-radius: .55rem; max-width: 90vw; padding: .65rem 1.15rem; margin: 0; }
.arcade { width: min(100%, 56rem); margin-inline: auto; }
.game-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.game-card { padding: clamp(1rem, 3.5vw, 2rem); border: 1px solid var(--border);
  border-radius: .75rem; background: var(--cream); display: flex; flex-direction: column; align-items: start; }
.game-icon { font-size: 2rem; margin-bottom: .65rem; }
.game-card p { flex: 1; color: var(--muted); }
.game-card div { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
.game-card button:target { outline: 3px solid #24747a; outline-offset: 4px; }
canvas { display: block; width: 100%; max-width: 100%; height: auto; border-radius: .55rem; touch-action: none; background: #1b3149; }
.game-status { margin: .6rem 0; font-variant-numeric: tabular-nums; }
.memory-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .45rem; }
.memory-board button { aspect-ratio: 1; font-size: clamp(.95rem, 5vw, 1.9rem); padding: 0; color: #fff5dc; background: #365b65; }
.memory-board button.up { background: #fae6c4; color: var(--ink); }
.scramble { background: #fae6c4; padding: .75rem 1rem; border-radius: .45rem; font-family: ui-monospace, monospace;
  font-weight: 800; letter-spacing: .11em; font-size: clamp(1rem, 5vw, 1.65rem); overflow-wrap: anywhere; }
.result-score strong { font-size: 2rem; }
@media (max-width: 52rem) {
  .hero { grid-template-columns: 1fr; gap: 2.2rem; }
  .hero-copy, .preview { width: min(100%, 36rem); margin-inline: auto; }
}
@media (max-width: 37rem) {
  main, footer { width: calc(100% - 2rem); }
  main { padding-block: 1.65rem 2.5rem; }
  .masthead { padding-inline: 1rem; flex-wrap: wrap; gap: .35rem 1.1rem; }
  .main-nav a { font-size: .84rem; }
  .game-cards { grid-template-columns: 1fr; }
  .post-door { aspect-ratio: auto; }
  .post-door small { font-size: .65rem; }
}
.trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.language-menu { position: relative; z-index: 3; }
.language-menu summary { cursor: pointer; min-height: 44px; display: list-item; padding: .6rem .5rem; }
.language-menu .languages { position: absolute; inset: calc(100% + .35rem) 0 auto auto; width: 12rem;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: .1rem;
  border: 1px solid var(--border); background: var(--cream); padding: .55rem; border-radius: .65rem;
  box-shadow: 0 8px 24px #30232126; }
.language-menu a { display: flex; align-items: center; padding: .3rem; min-height: 44px; }
.languages [aria-current] { font-weight: 800; text-decoration-thickness: .14em; }
.home-below { margin-block-start: clamp(2.5rem, 8vw, 6rem); }
.countdown-capsule { display: inline-flex; gap: .35rem .85rem; flex-wrap: wrap; align-items: baseline;
  padding: .65rem 1rem; border: 1px solid var(--border); border-radius: 1.15rem; background: var(--cream); }
.countdown-capsule span:last-child { color: var(--muted); font-size: .92rem; }
.post-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; padding: 0; margin: 1.25rem 0 0; list-style: none; }
.post-steps li { padding: clamp(1rem, 3vw, 1.85rem); background: var(--cream); border: 1px solid var(--border); border-radius: .7rem; }
.post-steps h2 { font-size: clamp(1.35rem, 2.6vw, 2rem); line-height: 1.12; }
.post-steps p { margin: .55rem 0 0; color: var(--muted); }
.step-stamp { display: inline-grid; place-items: center; min-width: 2rem; height: 2rem;
  margin-bottom: .85rem; border-radius: 50%; border: 1px dashed currentColor; color: var(--red); }
.highlights { display: flex; flex-wrap: wrap; gap: .35rem 1.35rem; padding: .8rem 0; list-style: none; border-block: 1px solid var(--border); }
.highlights li::before { content: '✓'; color: var(--red); font-weight: 800; margin-inline-end: .4rem; }
.faq { width: min(100%, 48rem); margin: clamp(2.5rem, 6vw, 5rem) auto 0; }
.faq h2 { margin-bottom: 1.15rem; line-height: 1.15; }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary { cursor: pointer; font-weight: 700; padding-block: .9rem; }
.faq details p { margin: 0 0 1rem; color: var(--muted); }
.feature-page { width: min(100%, 52rem); }
.feature-page h1 { font-size: clamp(2rem, 6vw, 4rem); line-height: 1.07; }
.idea-tabs { display: flex; flex-wrap: wrap; gap: .55rem; margin-block: 1.3rem; }
.idea-tabs a { display: inline-flex; align-items: center; min-height: 44px; border: 1px solid var(--border);
  border-radius: 99px; padding: .45rem .8rem; background: #faefd9; }
.idea-group { margin: 2.15rem 0; scroll-margin-top: 1rem; }
.idea-group ul { padding: 0; list-style: none; }
.idea-group li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .8rem; align-items: center; padding: .65rem 0; border-top: 1px solid var(--border); }
.idea-group p { margin: 0; overflow-wrap: anywhere; }
.post-cta { margin-top: 2rem; padding: 1rem 1.25rem; background: #f7ecd8; border: 1px dashed var(--border); border-radius: .75rem; }
.post-cta p { margin: 0 0 .75rem; }
.clock { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin: 1.6rem 0 2rem; text-align: center; }
.clock div { background: #faefd9; border: 1px solid var(--border); border-radius: .55rem; padding: .6rem .15rem; }
.clock strong, .clock span { display: block; overflow-wrap: anywhere; }
.clock strong { font-size: clamp(1.5rem, 6vw, 3.25rem); color: var(--red-dark); font-variant-numeric: tabular-nums; }
.clock span { font-size: clamp(.72rem, 2.2vw, 1rem); }
.unlock-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .42rem; list-style: none; padding: 0; }
.unlock-grid .post-door { min-height: 40px; aspect-ratio: auto; opacity: .73; box-shadow: none; }
.unlock-grid .released { background: #f8ecd5; opacity: 1; }
.unlock-grid [aria-current] { color: var(--cream); background: var(--red-dark); box-shadow: inset 0 0 0 1px var(--cream); }
.calendar-heading [data-random] { display: block; margin: .85rem auto 0; }
.calendar-page .post-door.vacant { border-style: dashed; box-shadow: none; }
.calendar-page .post-door.sealed { border-style: solid; background: #f8debf; color: #522b24; }
.calendar-page .post-door.ready { background: linear-gradient(145deg, #fff4d1, #edc674);
  border-color: #9c691d; color: #56330e; animation: door-glow 2.6s ease-out 3; }
.calendar-page .post-door.opened { background: #ede6d7; color: #524737; box-shadow: inset 0 0 0 2px #fffaed; }
@keyframes door-glow { 50% { box-shadow: 0 0 .7rem .16rem #f8d67c; } }
.calendar-page .post-door small { width: 100%; overflow-wrap: anywhere; }
.owner-actions, .starters { display: flex; flex-wrap: wrap; justify-content: center; gap: .55rem; }
.starters { justify-content: start; }
.starters button { font-size: .86rem; text-align: left; border-radius: .95rem; padding: .35rem .65rem; }
.sharing > a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: .5rem; }
.remove-note { color: var(--red-dark); }
#modal-body { position: relative; }
.confetti { position: absolute; inset: 0; pointer-events: none; border-radius: 0; background: transparent; height: 100%; }
:lang(ja) h1, :lang(ja) h2, :lang(ko) h1, :lang(ko) h2 { line-height: 1.22; letter-spacing: -.025em; }
@media (max-width: 37rem) {
  .masthead .main-nav { order: 1; width: 100%; gap: .3rem .9rem; }
  .main-nav a { display: inline-flex; align-items: center; min-height: 44px; }
  .post-steps { grid-template-columns: 1fr; }
  .calendar-page .door-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .calendar-page .post-door { min-height: 63px; }
}
@media (prefers-reduced-motion: reduce) { .calendar-page .post-door.ready { animation: none; } }
