:root {
  color-scheme: light;
  --paper: #fff8ed;
  --ink: #30241c;
  --pine: #234138;
  --wine: #773544;
  --gold: #8e500b;
  --line: #a89379;
  --street-sky: #132b29;
  --street-snow: #f5eee2;
  --street-gold: #f0cb85;
  --window-light: #f9e6bf;
  font-family: system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.55; }
header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 0.25rem 1rem; padding: 0.5rem max(1rem, calc((100vw - 52rem) / 2)); background: var(--pine);
}
header a { color: var(--paper); font-family: Georgia, serif; font-size: 1.25rem; }
header nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1rem; }
header nav a { display: inline-flex; align-items: center; min-height: 44px; font: inherit; }
header .homepage-link { gap: 0.4rem; }
header nav a[aria-current="page"] { text-decoration-thickness: 2px; text-underline-offset: 0.25rem; }
header :focus-visible { outline-color: var(--paper); }
main { width: min(52rem, calc(100% - 2rem)); margin: 2rem auto; }
footer { display: flex; gap: 1rem; width: min(52rem, calc(100% - 2rem)); margin: 2rem auto; }
footer a { color: var(--pine); }
h1, h2, blockquote { font-family: Georgia, serif; }
h1 { font-size: clamp(1.7rem, 6vw, 3rem); line-height: 1.2; }
p { margin: 0.6rem 0; }
form { max-width: 34rem; display: grid; gap: 1rem; margin-top: 1.25rem; }
label { display: grid; gap: 0.3rem; }
label.anonymous { display: flex; align-items: center; min-height: 44px; }
input:not([type=checkbox]), select, textarea {
  min-height: 44px; width: 100%; padding: 0.6rem; border: 1px solid var(--line);
  border-radius: 0.35rem; background: var(--paper); color: var(--ink); font: inherit;
}
button { min-height: 44px; padding: 0.55rem 0.9rem; border-radius: 0.35rem; background: var(--wine); color: var(--paper); border: 1px solid transparent; font: inherit; cursor: pointer; }
form button { justify-self: start; }
button:disabled { opacity: 0.75; cursor: default; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
#owner-actions { display: grid; gap: 0.5rem; margin: 1rem 0; }
#owner-actions button { justify-self: start; }
#delete-calendar { background: transparent; color: var(--wine); border-color: var(--wine); }
.my-calendars-heading, .calendar-card-heading {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.4rem 1rem;
}
.my-calendars-heading h1 { margin: 0; }
.calendar-action {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0.5rem 0.9rem;
  border: 1px solid var(--pine); border-radius: 0.35rem; color: var(--pine);
}
.browser-note { margin-block: 1rem; padding: 0.75rem 1rem; max-width: 68ch; background: #f4eadb; border-radius: 0.35rem; }
#calendar-list { display: grid; gap: 0.75rem; list-style: none; padding: 0; }
#calendar-list li { min-width: 0; padding: 0.9rem 1rem; border: 1px solid var(--line); border-radius: 0.5rem; }
.calendar-card-heading h2 { margin: 0; font-size: 1.25rem; overflow-wrap: anywhere; }
.calendar-name { display: inline-flex; align-items: center; min-height: 44px; color: var(--pine); }
.calendar-year { color: var(--wine); }
.calendar-share { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.calendar-share input { flex: 1 1 13rem; min-width: 0; }
.calendar-copy-status:empty { margin: 0; }
.christmas-street {
  --street-facade: #35594c;
  --street-alt-facade: #743e48;
  --street-roof: #a95c60;
  margin-top: 1.25rem;
  padding: 1rem clamp(0.55rem, 2vw, 1.25rem) 0.5rem;
  border: 1px solid #3f6356;
  border-radius: 0.85rem;
  color: var(--street-snow);
  background:
    radial-gradient(circle at 11% 16%, #fff4d2 0 2px, transparent 3px),
    radial-gradient(circle at 81% 22%, #fff4d2 0 1px, transparent 2px),
    radial-gradient(circle at 60% 12%, #fff4d2 0 1px, transparent 2px),
    linear-gradient(var(--street-sky), #2c493e);
  box-shadow: 0 0.6rem 1.4rem #132b2924;
}
body[data-theme="cranberry"] .christmas-street {
  --street-facade: #743e48;
  --street-alt-facade: #574354;
  --street-roof: #a46855;
}
body[data-theme="blue"] .christmas-street {
  --street-facade: #385872;
  --street-alt-facade: #445968;
  --street-roof: #706982;
}
#street-title {
  width: fit-content; margin: 0 auto 1rem; padding: 0.28rem 0.75rem;
  border: 1px solid var(--street-gold); border-radius: 0.25rem; color: var(--street-gold);
  background: var(--street-sky); font-size: 1.1rem; text-align: center;
}
#doors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.8rem 0.45rem; padding-top: 1.25rem; }
.street-house {
  position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start; gap: 0.5rem 0.28rem; padding: 0.6rem 0.24rem 0.42rem;
  border: 1px solid #c1c8b799; border-bottom: 3px solid var(--street-snow);
  border-radius: 0 0 0.2rem 0.2rem; background: var(--street-facade);
}
.street-house:nth-child(2n) { background: var(--street-alt-facade); }
.street-house::before {
  content: ""; position: absolute; inset: auto -0.16rem calc(100% - 1px); height: 1.15rem;
  background: linear-gradient(var(--street-snow) 27%, var(--street-roof) 28% 78%, #1e352f 79%);
  clip-path: polygon(10% 100%, 34% 0, 67% 0, 90% 100%);
}
.street-window {
  display: grid; grid-template-rows: auto 2.5em; align-content: start; justify-items: center;
  gap: 0.25rem; min-width: 0; padding: 0; border: 0; color: var(--street-snow); background: transparent;
}
.street-window:disabled { opacity: 1; }
.street-window:focus-visible { outline-color: var(--street-gold); outline-offset: 1px; }
.window-pane {
  display: grid; place-items: center; width: 100%; max-width: 5.3rem; min-height: 44px;
  border: 2px solid #ecdbb4; border-radius: 0.85rem 0.85rem 0.18rem 0.18rem;
  box-shadow: 0 2px 0 #122922;
  background:
    linear-gradient(90deg, transparent 48%, #916a4870 49% 51%, transparent 52%),
    linear-gradient(transparent 48%, #916a4870 49% 51%, transparent 52%),
    var(--window-light);
  color: #382a21;
}
.window-day { min-width: 1.45em; padding: 0.12rem; border-radius: 50%; background: var(--window-light); font: 1.1rem/1.1 Georgia, serif; }
.window-status { font-size: 0.72rem; line-height: 1.2; text-align: center; }
.street-window[data-state="ready"] .window-pane { box-shadow: 0 0 0.65rem #f0cb8580; }
.street-window[data-state="filled"] .window-pane {
  border-color: #c2b795;
  background: repeating-linear-gradient(0deg, #152c29, #152c29 5px, #223f36 5px, #223f36 7px);
}
.street-window[data-state="filled"] .window-day { color: var(--street-snow); background: #152c29; }
.street-window[data-state="empty"] .window-pane { background-color: #d2d9cb; border-color: #dfdfce; }
.street-window[data-state="empty"] .window-day { background: #d2d9cb; }
.street-window:not(:disabled):hover .window-pane { border-color: #fff7e6; box-shadow: 0 0 0.65rem #f0cb8580; }
.street-presents {
  display: flex; align-items: flex-end; justify-content: center; gap: 0.45rem;
  min-height: 2.3rem; margin-top: 0.65rem; padding-bottom: 0.28rem;
  border-bottom: 3px solid var(--street-snow);
}
.street-presents span {
  --gift-paper: #884752; --gift-ribbon: var(--street-gold);
  width: 1.75rem; height: 1.15rem; border: 1px solid #152c29; border-radius: 0.15rem;
  background:
    linear-gradient(90deg, transparent 41%, var(--gift-ribbon) 41% 59%, transparent 59%),
    linear-gradient(transparent 40%, var(--gift-ribbon) 40% 56%, transparent 56%), var(--gift-paper);
}
.street-presents span:nth-child(2) { --gift-paper: #56768c; width: 2.1rem; height: 1.6rem; }
.street-presents span:nth-child(3) { --gift-paper: var(--street-gold); --gift-ribbon: #884752; height: 1.05rem; }
dialog {
  max-width: min(35rem, calc(100vw - 2rem)); max-height: 90dvh; width: 100%; overflow: auto;
  overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 0.6rem;
  padding: clamp(0.85rem, 4vw, 1.35rem); background: var(--paper); color: var(--ink);
}
body:has(#wish-dialog[open]) { overflow: hidden; }
dialog::backdrop { background: rgb(24 26 21 / 62%); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.dialog-heading h2 { margin: 0.35rem 0; }
#window-opening { display: grid; justify-items: center; gap: 0.75rem; padding: 0.85rem 0 0.25rem; }
.opening-window {
  position: relative; display: grid; place-items: center; width: min(8rem, 65%); aspect-ratio: 1;
  color: #58341d; background: radial-gradient(#fff4cf, #eac778); border: 4px solid #9d7762;
  border-radius: 1.3rem 1.3rem 0.25rem 0.25rem; perspective: 260px;
  box-shadow: 0 0 0 3px var(--pine), 0 5px 0 3px #bba279;
}
.opening-star { font-size: 2.1rem; }
.window-shutter {
  position: absolute; inset: 0 50% 0 0; transform-origin: left center;
  border: 2px solid #603843; border-radius: 1.05rem 0 0 0.1rem;
  background: repeating-linear-gradient(0deg, #653c48, #653c48 7px, #834e59 8px, #834e59 12px);
  box-shadow: inset 0 0 0 2px #c39373;
}
.window-shutter:last-child { inset: 0 0 0 50%; transform-origin: right center; border-radius: 0 1.05rem 0.1rem 0; }
#skip-opening { background: transparent; border-color: var(--pine); color: var(--pine); }
.wish-card { margin-top: 1rem; padding: 0.9rem 1rem; border: 1px solid #bd9c6c; border-radius: 0.45rem; background: #fffdf5; }
blockquote { margin: 0.7rem 0; font-size: 1.25rem; white-space: pre-wrap; overflow-wrap: anywhere; }
[hidden] { display: none !important; }
@media (min-width: 540px) { #doors { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 760px) { #doors { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
