:root {
  color-scheme: light;
  --page-background: #eddfcd;
  --ink: #243a31;
  --muted: #4c5c53;
  --line: #dfd5c7;
  --forest: #263d34;
  --bordeaux: #743b47;
  --ivory: #fffcf6;
  --hero-background: var(--forest);
  --hero-ink: var(--ivory);
  --hero-muted: #e1e9de;
  --gift-backdrop: #345346;
  --gift-box: #b83d2e;
  --gift-lid: #c44a36;
  --ribbon: #eec986;
  font: 16px/1.5 system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle, #fffdfa 1px, transparent 1.8px) 7px 11px / 47px 53px,
    radial-gradient(circle, #fffdfacc 1.6px, transparent 2.6px) 25px 22px / 91px 83px,
    radial-gradient(circle, #fffdfa99 2px, transparent 3.2px) 51px 9px / 137px 121px,
    radial-gradient(ellipse at 50% 0%, #fff0da, transparent 52rem),
    var(--page-background);
}
a { color: inherit; text-decoration: none; }
button, select { font: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: Georgia, serif; }
h2 { font-size: 1.8rem; line-height: 1.12; }
section, aside { scroll-margin-top: 1rem; }
:focus-visible { outline: 2px solid var(--bordeaux); outline-offset: 3px; }
.shell { width: min(1120px, calc(100% - 3rem)); margin-inline: auto; }
.topbar { background: var(--ivory); border-bottom: 1px solid var(--line); }
.topbar-inner { min-height: 68px; display: flex; align-items: center; gap: 1.5rem; }
.brand { margin-right: auto; font-weight: 800; }
.brand span { color: var(--bordeaux); margin-right: .25rem; }
nav { display: flex; gap: 1.5rem; color: var(--muted); font-size: .9rem; }
nav a:hover { text-decoration: underline; }
.avatar { display: grid; place-items: center; flex: none; width: 36px; aspect-ratio: 1; border-radius: 50%; color: #fff; background: var(--forest); font-weight: 800; }

.hero { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: 1fr .65fr; align-items: center; gap: 2rem; margin-top: 1.5rem; padding: clamp(2rem, 5vw, 4.5rem); background: var(--hero-background); color: var(--hero-ink); border-radius: 24px; }
.hero h1 { margin-block: .7rem 1rem; font-size: clamp(2.8rem, 7vw, 5.7rem); line-height: .96; letter-spacing: -.055em; }
.hero p { color: var(--hero-muted); }
.eyebrow { font-size: .875rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.button { display: inline-flex; align-items: center; width: fit-content; min-height: 45px; padding: .65rem 1.05rem; border: 0; border-radius: .55rem; background: var(--forest); color: var(--ivory); font-weight: 750; cursor: pointer; }
.button:hover { filter: brightness(1.13); }
.hero .button { margin-top: 1.6rem; border: 1px solid #aebfb2; }
.hero :focus-visible { outline-color: var(--hero-ink); }
.illustration { position: relative; min-height: 255px; display: grid; place-items: center; }
.illustration::before { content: ""; position: absolute; width: min(100%, 260px); aspect-ratio: 1; border-radius: 50%; background: var(--gift-backdrop); }
.winter-flurry { position: absolute; top: 50%; left: 50%; width: 3px; height: 3px; border-radius: 50%; color: var(--hero-ink); opacity: .48; box-shadow: -94px -66px, -67px -85px, 85px -73px, 101px -41px, -101px 29px, 93px 25px; }
.gift { position: relative; width: 155px; height: 140px; transform: translateY(12px) rotate(-12deg); }
.lid, .box { position: absolute; background: linear-gradient(90deg, var(--wrapping) 42%, var(--ribbon) 42% 58%, var(--wrapping) 58%); }
.lid { --wrapping: var(--gift-lid); inset: 12px -10px auto; height: 30px; border-radius: 5px; z-index: 1; box-shadow: 0 5px #23141033; }
.box { --wrapping: var(--gift-box); inset: 36px 0 0; border-radius: 0 0 8px 8px; }
.bow { position: absolute; top: -19px; left: 50%; }
.bow::before, .bow::after { content: ""; position: absolute; width: 39px; height: 24px; border: 6px solid var(--ribbon); border-radius: 65% 65% 12% 65%; }
.bow::before { right: -2px; transform: rotate(17deg); }
.bow::after { left: -2px; transform: scaleX(-1) rotate(17deg); }
.holly { position: absolute; top: 69%; left: 68%; width: 56px; height: 36px; transform: rotate(-17deg); }
.holly::before, .holly::after { content: ""; position: absolute; left: 15px; width: 36px; height: 15px; background: #84937a; border-radius: 75% 0 75% 0; transform-origin: left center; }
.holly::before { top: 13px; transform: rotate(-32deg); }
.holly::after { top: 16px; background: #a6ae8d; transform: rotate(30deg); }
.holly i { position: absolute; z-index: 1; top: 14px; left: 8px; width: 8px; height: 8px; border-radius: 50%; background: #ab4752; box-shadow: 7px -4px 0 #c06468, 8px 4px 0 #923945; }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); margin: 1.1rem 0 2.5rem; border: 1px solid var(--line); border-radius: 14px; background: var(--ivory); }
.facts div { padding: .85rem clamp(.8rem, 3vw, 1.5rem); }
.facts div + div { border-left: 1px solid var(--line); }
.facts span, .facts strong { display: block; }
.facts span { font-size: .875rem; color: var(--muted); }
.facts strong { font-size: 1.05rem; }
.facts time { color: var(--bordeaux); }
.dashboard { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; gap: 1.5rem; margin-bottom: 3rem; }
.ballot-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin: .2rem 0 1rem; }
.bet, .profile, .rules { padding: 1.2rem; border: 1px solid var(--line); border-radius: 14px; background: var(--ivory); }
.bets-list { margin: 0; padding-left: 1.75rem; }
.bets-list li::marker { color: var(--bordeaux); font-weight: 800; }
.bet + .bet, .profile + .rules { margin-top: .75rem; }
.bet label, .bet h3 { font-size: 1rem; font-weight: 800; }
.bet p, .rules p, .form-footer p { margin-top: .25rem; font-size: .9rem; color: var(--muted); }
.historic-answer { display: grid; gap: .1rem; width: min(100%, 275px); margin-top: .85rem; padding: .65rem .85rem; border: 1px solid var(--line); border-left: 4px solid var(--forest); border-radius: 7px; color: var(--forest); background: #e5ebe0; }
.historic-answer span { font-size: .875rem; }
.historic-answer strong { font-size: 1.25rem; }
.bet select { width: min(100%, 275px); min-height: 44px; margin-top: .8rem; padding: .45rem .7rem; border: 1px solid #998675; border-radius: 7px; color: var(--ink); background: #fff; }
.bet select { appearance: none; padding-right: 2rem; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.pairings { display: grid; margin-top: .85rem; border-block: 1px solid var(--line); }
.pairing { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: center; gap: .5rem; padding: .35rem 0; }
.pairing + .pairing { border-top: 1px solid var(--line); }
.pairing-heading { border-bottom: 1px solid var(--line); color: var(--muted); font-size: .875rem; font-weight: 750; }
.pairing label { font-size: .875rem; overflow-wrap: anywhere; }
.pairing select { width: 100%; margin: 0; font-size: .9rem; }
#pairing-error:not(:empty) { margin-top: .6rem; color: var(--bordeaux); }
.form-footer { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }
.profile { background: #e5ebe0; }
.profile-name { display: flex; gap: .7rem; align-items: center; margin: .7rem 0; }
.profile label { display: block; font-size: .875rem; color: var(--muted); }
.profile select { margin: .3rem 0 .7rem; min-height: 44px; padding: .4rem .7rem; border: 1px solid #998675; border-radius: 7px; color: var(--ink); background: var(--ivory); }
.score strong { font-size: 1.3rem; }
.rules ol { margin: .85rem 0; padding-left: 1.3rem; }
.rules li + li { margin-top: .55rem; }
.access-page { display: grid; place-items: start center; padding-block: clamp(2rem, 6vw, 5rem); }
.access-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; width: min(100%, 55rem); min-height: 32rem; overflow: hidden; background: var(--ivory); border: 1px solid #d5c2a8; border-radius: 20px; box-shadow: 0 16px 42px #51301b1f; }
.access-art { position: relative; background: var(--forest); }
.access-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 36%; }
.access-content { align-self: center; padding: clamp(1.4rem, 5vw, 3.15rem); }
.access-content .eyebrow { color: var(--bordeaux); }
.access-card h1, .admin-page h1 { margin-block: .4rem; font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: 1.05; }
.access-card form { display: grid; gap: .55rem; margin-top: 1.4rem; }
.access-card label { font-weight: 750; }
.access-card input { width: 100%; min-height: 44px; margin-bottom: .35rem; padding: .5rem .75rem; border: 1px solid #998675; border-radius: 7px; color: var(--ink); background: #fff; font: inherit; }
#login-status { color: var(--bordeaux); }
.quiet-button { padding: .4rem .65rem; border: 1px solid var(--line); border-radius: .4rem; color: var(--forest); background: var(--ivory); cursor: pointer; }
#unlock-bets { border-color: var(--bordeaux); background: var(--bordeaux); color: var(--ivory); font-weight: 750; }
#unlock-bets:hover { filter: brightness(1.13); }
#unlock-bets:disabled { opacity: .65; cursor: wait; }
.button:disabled { opacity: .65; cursor: wait; }
.admin-page { padding-block: 2rem; }
#admin-status { margin-block: 1rem; }
#admin-results details { padding: .8rem 1rem; margin-bottom: .65rem; border: 1px solid var(--line); border-radius: 7px; background: var(--ivory); }
#admin-results summary { font-weight: 750; cursor: pointer; }
#admin-results dt { font-weight: 750; }
#admin-results dd { margin: 0 0 .45rem; white-space: pre-line; }

@media (max-width: 720px) {
  .shell { width: calc(100% - 1.5rem); }
  .topbar-inner { min-height: 58px; flex-wrap: wrap; column-gap: .6rem; row-gap: 0; padding-block: .4rem; }
  .topbar nav { order: 1; width: 100%; gap: 1.1rem; margin-top: .25rem; border-top: 1px solid var(--line); }
  .topbar nav a { display: inline-flex; align-items: center; min-height: 44px; }
  .topbar .avatar { width: 44px; }
  .quiet-button { min-height: 44px; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: .25rem; margin-top: .6rem; padding: 1.25rem; border-radius: 16px; }
  .hero h1 { font-size: clamp(2.35rem, 8vw, 3.65rem); margin-block: .55rem .65rem; }
  .hero p br { display: none; }
  .hero .button { margin-top: .9rem; }
  .illustration { min-height: 120px; }
  .illustration::before { width: 116px; }
  .gift { position: absolute; transform: translateY(5px) rotate(-12deg) scale(.5); }
  .winter-flurry { transform: scale(.48); }
  .holly { left: calc(50% + 30px); transform: rotate(-17deg) scale(.55); transform-origin: left top; }
  .facts { margin-block: .7rem 1.4rem; }
  .facts div { min-width: 0; padding: .6rem .45rem; }
  .facts strong { font-size: .95rem; }
  .dashboard { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .bets-list { padding-left: 1.3rem; }
  .bet, .profile, .rules { padding: .85rem; }
  .bet select, .historic-answer { width: 100%; }
  .bet select { min-width: 0; min-height: 48px; font-size: 1rem; }
  .pairing { grid-template-columns: minmax(0, .85fr) minmax(0, 1.55fr); }
  .pairing label { font-size: .95rem; }
  .pairing select { padding-left: .4rem; padding-right: 1.5rem; background-position: calc(100% - 12px) 50%, calc(100% - 7px) 50%; }
  .ballot-heading .quiet-button, .form-footer .button, .access-card .button { width: 100%; justify-content: center; min-height: 48px; }
  .form-footer { gap: .4rem; }
  .access-page { padding-block: 1.5rem; }
  .access-card { grid-template-columns: 1fr; min-height: 0; width: min(100%, 31rem); border-radius: 16px; }
  .access-art { height: clamp(9.5rem, 45vw, 13rem); }
  .access-art img { object-position: center 19%; }
  .access-content { padding: 1.25rem; }
  .access-card input { min-height: 48px; }
  .admin-page { padding-block: 1.25rem; }
}

@media (min-width: 470px) and (max-width: 720px) {
  .hero { grid-template-columns: minmax(0, 1fr) 120px; }
}
