:root {
  --cream: #f7f1e8;
  --blush: #f4cfc9;
  --forest: #1e3a2c;
  --red: #d8402f;
  --red-deep: #b5301f;
  --ink: #1b1f1c;
  --muted: #5d6660;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 18px/1.65 "DM Sans", system-ui, sans-serif;
}

a { color: inherit; }

.display { font-family: "DM Serif Display", Georgia, serif; font-weight: 400; letter-spacing: -.02em; }

/* ---------- top banner + header ---------- */
.banner {
  background: var(--forest); color: var(--cream); text-align: center;
  font-size: .75rem; font-weight: 500; letter-spacing: .18em; text-transform: uppercase;
  padding: .7rem 1rem;
}
.banner span { color: var(--blush); }

.site-header {
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; justify-content: space-between;
  max-width: 1100px; margin: 0 auto; padding: 2rem 2rem 1.5rem;
}
.logo { font-size: 1.6rem; text-decoration: none; }
nav { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; font-size: .85rem; font-weight: 500; }
nav a { text-decoration: none; color: var(--muted); padding: .3rem 0; border-bottom: 2px solid transparent; }
nav a:hover, nav a[aria-current] { color: var(--ink); border-color: var(--red); }

/* ---------- hero ---------- */
.hero {
  max-width: 1100px; margin: 1.5rem auto 0; padding: 0 2rem;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 4rem; align-items: center;
}

.label {
  display: inline-block; background: var(--red); color: #fff;
  font-size: .75rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  padding: .5rem 1.1rem; border-radius: 999px; margin-bottom: 1.75rem;
}

.hero h1 { font-size: clamp(3.5rem, 9vw, 6.5rem); line-height: 1; margin: 0 0 1.5rem; color: var(--forest); }
.hero h1 em { color: var(--red); }
.author { font-size: 1.25rem; color: var(--muted); margin: 0; }

.cover-panel {
  background: var(--blush); border-radius: 28px; padding: 4.5rem 2rem;
  display: grid; place-items: center; position: relative; overflow: hidden;
}
.cover-panel::before, .cover-panel::after { content: ""; position: absolute; border-radius: 50%; }
.cover-panel::before { width: 220px; height: 220px; background: var(--red); top: -70px; right: -60px; opacity: .9; }
.cover-panel::after { width: 160px; height: 160px; background: var(--forest); bottom: -50px; left: -40px; }
.cover-panel img {
  position: relative; z-index: 1; display: block; width: min(250px, 60vw); height: auto;
  border-radius: 6px; box-shadow: 0 24px 40px -12px rgba(30, 58, 44, .5);
  transform: rotate(3deg);
}

/* ---------- meeting info ---------- */
.meeting { max-width: 1100px; margin: 4rem auto 5rem; padding: 0 2rem; }
.meeting-grid { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 1.5rem; }

.tile { border-radius: 24px; padding: 2.25rem 2rem; background: #fff; }
.tile.green { background: var(--forest); color: var(--cream); }
.tile.pink { background: var(--blush); }

.tile h2, .tile h3 { font-size: .75rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; margin: 0 0 1.25rem; opacity: .7; }
.tile .big { font-size: clamp(2.5rem, 5vw, 3.75rem); line-height: 1; margin: 0; }
.tile p { margin: .6rem 0 0; }
.tile .big { margin-top: 0; }
.tile .sub { opacity: .75; }
.tile a { text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* ---------- buttons ---------- */
.button {
  display: inline-block; padding: .9rem 1.75rem; border-radius: 999px;
  background: var(--ink); color: var(--cream); text-decoration: none;
  font: 700 .85rem "DM Sans", sans-serif; letter-spacing: .06em;
  border: 2px solid var(--ink); cursor: pointer; transition: background .2s, color .2s;
}
.button:hover { background: var(--red); border-color: var(--red); }
.button:focus-visible, .field input:focus-visible, .opt:focus-within { outline: 3px solid var(--red); outline-offset: 2px; }
.button.ghost { background: transparent; color: var(--ink); }
.button.ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.button.small { padding: .55rem 1.1rem; font-size: .8rem; }
.button[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- details ---------- */
.details { max-width: 1100px; margin: 0 auto; padding: 0 2rem 6rem; scroll-margin-top: 1rem; }
.details > h2 { font-size: clamp(2.5rem, 6vw, 4rem); line-height: 1.05; color: var(--forest); margin: 0 0 2rem; }
.details > h2 em { color: var(--red); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.card { background: #fff; border-radius: 24px; padding: 2.25rem 2rem; }
.card:nth-child(1) { background: var(--blush); }
.card:last-child { background: var(--forest); color: var(--cream); }
.card h3 { font-size: 1.75rem; line-height: 1.15; margin: 0 0 .75rem; font-weight: 400; }
.card p { margin: 0; opacity: .8; }

/* ---------- add to calendar ---------- */
.cal { position: relative; display: inline-block; margin-top: 1.5rem; }

.cal-menu {
  position: absolute; left: 0; top: calc(100% + .5rem); z-index: 10; min-width: 15rem;
  background: #fff; border-radius: 16px; padding: .5rem; box-shadow: 0 12px 32px rgba(30, 58, 44, .25);
}
.cal-menu[hidden] { display: none; }
.cal-menu a, .cal-menu button {
  display: block; width: 100%; text-align: left; padding: .8rem 1rem; border: 0; border-radius: 10px;
  background: none; font: 500 .95rem "DM Sans", sans-serif; color: var(--ink); text-decoration: none; cursor: pointer;
}
.cal-menu a:hover, .cal-menu button:hover, .cal-menu a:focus-visible, .cal-menu button:focus-visible { background: var(--blush); outline: none; }

/* ---------- next meeting ---------- */
.label.dark { background: var(--forest); }
.next { max-width: 1100px; margin: 0 auto; padding: 0 2rem 6rem; scroll-margin-top: 1rem; }
.next-head h2 { font-size: clamp(2.5rem, 6vw, 4rem); line-height: 1.05; color: var(--forest); margin: 0 0 2rem; }
.next-head h2 em { color: var(--red); }
.next-book { display: flex; align-items: center; gap: 1.5rem; margin-bottom: 1.5rem; }
.next-book .big { font-size: clamp(2rem, 5vw, 3rem); line-height: 1; margin: 0; }
.next-book .sub { margin: .5rem 0 0; color: var(--muted); }
.mini-cover, .cover-placeholder {
  display: grid; place-items: center; color: var(--forest);
  border: 2px dashed var(--forest); border-radius: 8px; background: var(--blush);
}
.mini-cover { flex: none; width: 84px; height: 126px; font-size: 2.5rem; }
.cover-placeholder { position: relative; z-index: 1; width: min(250px, 60vw); aspect-ratio: 228 / 346; font-size: 5rem; }
.tbd { opacity: .55; }

/* ---------- footer ---------- */
.site-footer {
  max-width: 1100px; width: calc(100% - 4rem); margin: 0 auto; padding: 2rem 0; border-top: 1px solid rgba(0,0,0,.12);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem;
  font-size: .85rem; color: var(--muted);
}

/* ---------- mobile ---------- */
@media (max-width: 800px) {
  body { font-size: 17px; }
  .site-header { padding: 1.25rem 1.25rem 1rem; }
  .hero { grid-template-columns: 1fr; gap: 2rem; padding: 0 1.25rem; margin-top: .5rem; }
  .hero h1 { font-size: clamp(3.25rem, 17vw, 4.5rem); }
  .cover-panel { order: -1; padding: 3rem 1rem; border-radius: 24px; }
  .cover-panel::before { width: 150px; height: 150px; top: -50px; right: -40px; }
  .cover-panel::after { width: 110px; height: 110px; bottom: -35px; left: -30px; }
  .meeting { margin: 2.5rem auto 3.5rem; padding: 0 1.25rem; }
  .meeting-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .meeting-grid .tile:last-child { grid-column: 1 / -1; }
  .tile { padding: 1.75rem 1.5rem; }
  .details { padding: 0 1.25rem 4rem; }
  .cards { grid-template-columns: 1fr; gap: 1rem; }
  .next { padding: 0 1.25rem 4rem; }
  .next-book { margin-bottom: 1.25rem; }
  .card { padding: 1.75rem 1.5rem; }
  .site-footer { width: calc(100% - 2.5rem); padding: 1.5rem 0 2rem; flex-direction: column; }
}

/* ---------- polls page ---------- */
.polls { max-width: 760px; margin: 0 auto; padding: 1rem 2rem 6rem; }
.polls-head h1 { font-size: clamp(3rem, 8vw, 5rem); line-height: 1; color: var(--forest); margin: 0 0 .75rem; }
.polls-head h1 em { color: var(--red); }
.polls-head p { color: var(--muted); margin: 0 0 2rem; }

.tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.tab {
  padding: .6rem 1.2rem; border-radius: 999px; text-decoration: none; font-size: .9rem; font-weight: 700;
  background: #fff; color: var(--ink); border: 2px solid transparent;
}
.tab:hover { border-color: var(--ink); }
.tab[aria-current="page"] { background: var(--forest); color: var(--cream); }
.tab.new { margin-left: auto; background: var(--red); color: #fff; }
.tab.new[aria-current="page"] { background: var(--ink); }

.poll-list { display: grid; gap: 1rem; }
.poll-card {
  display: block; text-decoration: none; background: #fff; border-radius: 24px; padding: 1.5rem 1.75rem;
  transition: transform .15s;
}
.poll-row:nth-child(3n+1) .poll-card { background: var(--blush); }
.poll-card:hover { transform: translateY(-2px); }
.poll-card h2 { font-size: 1.7rem; line-height: 1.15; margin: 0 0 .5rem; color: var(--forest); }
.meta { margin: 0; font-size: .9rem; color: var(--muted); }

.empty { background: #fff; border-radius: 24px; padding: 2.5rem 1.75rem; text-align: center; color: var(--muted); }
.empty p { margin: 0 0 1.25rem; }

.pill { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; padding: .3rem .7rem; border-radius: 999px; background: var(--forest); color: var(--cream); vertical-align: middle; }
.pill.closed { background: var(--ink); }

.back { display: inline-block; margin-bottom: 1.25rem; color: var(--muted); font-size: .9rem; }
.poll-title { font-size: clamp(2.25rem, 6vw, 3.5rem); line-height: 1.05; color: var(--forest); margin: .5rem 0 .5rem; }

.panel { background: #fff; border-radius: 24px; padding: 2rem; margin-top: 1.5rem; }
.panel h2 { font-size: .75rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; margin: 0 0 1.25rem; opacity: .7; }

.field { display: block; margin-bottom: 1.25rem; }
.field span { display: block; font-size: .85rem; font-weight: 700; margin-bottom: .4rem; }
.field input[type="text"], .field input[type="password"], .field input[type="datetime-local"] {
  width: 100%; padding: .85rem 1rem; font: inherit; color: var(--ink);
  background: var(--cream); border: 2px solid transparent; border-radius: 14px;
}
.field input[type="text"]:focus, .field input[type="password"]:focus, .field input[type="datetime-local"]:focus { border-color: var(--forest); outline: none; }
.hint { font-size: .85rem; color: var(--muted); margin: -.5rem 0 1.25rem; }

.option-inputs { display: grid; gap: .6rem; margin-bottom: 1rem; }
.option-row { display: flex; gap: .5rem; }
.option-row input { flex: 1; min-width: 0; padding: .85rem 1rem; font: inherit; background: var(--cream); border: 2px solid transparent; border-radius: 14px; }
.option-row input:focus { border-color: var(--forest); outline: none; }
.icon-btn { flex: none; width: 3rem; border: 0; border-radius: 14px; background: var(--cream); color: var(--muted); font-size: 1.3rem; cursor: pointer; }
.icon-btn:hover { background: var(--blush); color: var(--red); }
.form-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

.error { background: #fde7e4; color: #8a1c10; border-radius: 12px; padding: .8rem 1rem; margin: 0 0 1.25rem; font-weight: 500; }
.error:empty { display: none; }
.notice { color: var(--forest); font-weight: 700; margin: 1rem 0 0; }
.notice:empty { display: none; }

/* option rows double as vote choices and result bars */
.opts { display: grid; gap: .6rem; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.opt {
  position: relative; display: flex; align-items: center; gap: .9rem; overflow: hidden;
  padding: 1rem 1.1rem; border-radius: 16px; background: var(--cream); cursor: pointer; isolation: isolate;
}
.opts.static .opt { cursor: default; }
.opt .bar { position: absolute; inset: 0 auto 0 0; background: var(--blush); z-index: -1; transition: width .4s; }
.opt.win .bar { background: #a8d5ba; }
.opt input { width: 1.25rem; height: 1.25rem; accent-color: var(--red); flex: none; }
.opt .label-text { flex: 1; font-weight: 500; }
.opt .count { font-size: .9rem; color: var(--muted); white-space: nowrap; }
.opt .count b { color: var(--ink); }
.opt .crown { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--forest); }

@media (max-width: 800px) {
  .polls { padding: .5rem 1.25rem 4rem; }
  .panel { padding: 1.5rem 1.25rem; }
  .tab.new { margin-left: 0; }
}

/* ---------- nav log out ---------- */
.logout { border: 0; background: none; padding: .3rem 0; font: inherit; font-size: .85rem; font-weight: 500; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.logout:hover { color: var(--red); }

/* ---------- login page ---------- */
.login-page { min-height: 100vh; display: flex; flex-direction: column; }
.login-wrap { flex: 1; display: grid; place-items: center; padding: 2rem 1.25rem 4rem; }
.login-card {
  position: relative; overflow: hidden; width: 100%; max-width: 520px; background: var(--blush);
  border-radius: 28px; padding: 3rem 2.25rem; text-align: center;
}
.login-card::before, .login-card::after { content: ""; position: absolute; border-radius: 50%; z-index: 0; }
.login-card::before { width: 180px; height: 180px; background: var(--red); top: -70px; right: -60px; opacity: .9; }
.login-card::after { width: 140px; height: 140px; background: var(--forest); bottom: -55px; left: -45px; }
.login-card > * { position: relative; z-index: 1; }
.login-card h1 { font-size: clamp(2.75rem, 11vw, 4rem); line-height: 1; color: var(--forest); margin: .25rem 0 1rem; }
.login-card h1 em { color: var(--red); }
.login-lead { color: var(--muted); margin: 0 0 2rem; }
.login-form { background: #fff; border-radius: 20px; padding: 1.5rem; text-align: left; }
.login-form .button { width: 100%; text-align: center; }

/* ---------- members admin ---------- */
.check { display: flex; align-items: center; gap: .6rem; font-size: .95rem; margin-bottom: 1rem; cursor: pointer; }
.check input { width: 1.15rem; height: 1.15rem; accent-color: var(--red); }
.members { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.member { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; background: var(--cream); border-radius: 14px; }
.member-name { flex: 1; font-weight: 500; }

/* ---------- poll deadlines, updating votes, manage panel ---------- */
.field-hint { display: block; margin-top: .4rem; font-size: .85rem; color: var(--muted); font-weight: 400; }
.field span.field-hint { font-weight: 400; }
.deadline { display: inline-block; margin: .75rem 0 0; padding: .5rem 1rem; background: var(--blush); border-radius: 999px; font-weight: 700; font-size: .95rem; }
.deadline.soft { background: none; padding: 0; font-weight: 400; color: var(--muted); }
.info { background: #e4f1e8; color: var(--forest); border-radius: 12px; padding: .8rem 1rem; margin: 0 0 1.25rem; font-weight: 500; }
.opt .tag { font-size: .75rem; font-weight: 700; color: var(--forest); white-space: nowrap; }
.form-actions.tight { margin-top: 0; }
.rule { border: 0; border-top: 1px solid rgba(0,0,0,.1); margin: 1.5rem 0; }

/* ---------- danger button ---------- */
.button.danger { background: transparent; color: #a3261a; border-color: #a3261a; }
.button.danger:hover { background: #a3261a; border-color: #a3261a; color: #fff; }

/* ---------- ratings page ---------- */
.linkish { border: 0; background: none; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkish:hover { color: var(--red); }

.recs { background: var(--forest); color: var(--cream); border-radius: 24px; padding: 1.25rem 1.5rem; margin-bottom: 2.5rem; }
.recs h2 { font-size: .75rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; margin: 0 0 .75rem; opacity: .75; }
.recs-empty { margin: 0; padding: .9rem 1rem; border: 2px dashed rgba(247, 241, 232, .4); border-radius: 14px; font-size: .95rem; }
.rec-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.rec-list li p { margin: .15rem 0 0; opacity: .85; font-size: .95rem; }
.rec-author { opacity: .75; }
.recs-updated { margin: .9rem 0 0; font-size: .8rem; opacity: .6; }

.section-title { font-size: clamp(1.9rem, 5vw, 2.5rem); line-height: 1.1; color: var(--forest); margin: 0 0 1rem; }
.book-list { display: grid; gap: 1rem; margin-bottom: 2.5rem; }
.book-card { display: grid; grid-template-columns: 96px 1fr; gap: 1.25rem; background: #fff; border-radius: 24px; padding: 1.5rem; align-items: start; }
.book-card.current { background: var(--blush); }
.cover-img { width: 96px; height: auto; border-radius: 6px; box-shadow: 0 10px 20px -8px rgba(30, 58, 44, .5); display: block; }
.book-body { min-width: 0; }
.book-body .pill { margin-bottom: .6rem; }
.book-body h3 { font-size: 1.6rem; line-height: 1.15; margin: 0; color: var(--forest); font-weight: 400; }
.book-author { margin: .15rem 0 .6rem; color: var(--muted); }
.book-summary { margin: 0 0 .9rem; }
.avg { margin: 0 0 .4rem; font-size: .9rem; font-weight: 700; color: var(--forest); }
.rate-row { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; }
.stars { display: inline-flex; }
.star { border: 0; background: none; padding: 0 .08rem; font-size: 2rem; line-height: 1; color: #d9cfc4; cursor: pointer; transition: transform .1s; }
.star.on { color: var(--red); }
.star.lit { color: #ee8f84; }
.star:hover { transform: scale(1.12); }
.star:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; border-radius: 6px; }
.your { font-size: .9rem; color: var(--ink); }
.your.soft { color: var(--muted); }

@media (max-width: 800px) {
  .recs { padding: 1.1rem 1.25rem; }
  .book-card { grid-template-columns: 72px 1fr; gap: 1rem; padding: 1.25rem; }
  .cover-img { width: 72px; }
  .star { font-size: 2.2rem; padding: 0 .15rem; }
}

/* ---------- admin delete controls ---------- */
.poll-row .row-actions { display: flex; justify-content: flex-end; margin: .5rem .5rem 0; }
.poll-row .error { margin: .5rem 0 0; }
.pill-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------- secret santa ---------- */
.polls-head .label { margin-bottom: 1rem; }
.santa-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.santa-tiles .tile { padding: 1.75rem 1.5rem; }
.santa-msg { margin: 0; font-size: 1.15rem; }
.muted-panel { background: var(--blush); }
.muted-panel h2 { opacity: .6; }
.gift { font-size: 4rem; line-height: 1; margin: .25rem 0 1rem; }

.santa-reveal { position: relative; overflow: hidden; background: var(--forest); color: var(--cream); text-align: center; padding: 2.5rem 1.5rem 2.75rem; }
.santa-reveal::before, .santa-reveal::after { content: ""; position: absolute; border-radius: 50%; }
.santa-reveal::before { width: 170px; height: 170px; background: var(--red); top: -70px; right: -50px; }
.santa-reveal::after { width: 120px; height: 120px; background: var(--blush); bottom: -50px; left: -40px; opacity: .9; }
.santa-reveal > * { position: relative; z-index: 1; }
.santa-reveal h2 { opacity: .75; }
.santa-reveal .button { background: var(--red); border-color: var(--red); color: #fff; margin-top: 1.25rem; }
.santa-reveal .button:hover { background: var(--cream); border-color: var(--cream); color: var(--forest); }
.reveal-label { margin: 0; text-transform: uppercase; letter-spacing: .16em; font-size: .75rem; font-weight: 700; opacity: .8; }
.reveal-name { margin: .5rem 0 1.25rem; font-size: clamp(3.25rem, 15vw, 5.5rem); line-height: 1; color: var(--blush); overflow-wrap: anywhere; }
.reveal-note { margin: 0; color: rgba(247, 241, 232, .85); font-size: .95rem; }
[hidden] { display: none !important; }

/* ---------- home page: secret santa promo ---------- */
.santa-promo { max-width: 1100px; margin: 0 auto 4rem; padding: 0 2rem; }
.promo-card {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 1.75rem;
  background: var(--red-deep); color: var(--cream); border-radius: 28px; padding: 2.25rem 2.5rem;
}
.promo-card::after { content: ""; position: absolute; width: 200px; height: 200px; border-radius: 50%; background: var(--forest); right: -60px; bottom: -90px; }
.promo-card > * { position: relative; z-index: 1; }
.promo-emoji { font-size: 4rem; line-height: 1; flex: none; }
.promo-text { flex: 1; }
.promo-text h2 { font-size: clamp(2rem, 5vw, 2.75rem); line-height: 1.05; margin: 0 0 .5rem; }
.promo-text p { margin: 0; font-size: 1.1rem; opacity: .95; }
.promo-card .button { background: var(--cream); border-color: var(--cream); color: var(--red-deep); flex: none; }
.promo-card .button:hover { background: var(--forest); border-color: var(--forest); color: var(--cream); }

@media (max-width: 800px) {
  .santa-tiles .tile { padding: 1.4rem 1.1rem; }
  .santa-promo { padding: 0 1.25rem; margin-bottom: 3rem; }
  .promo-card { flex-direction: column; align-items: flex-start; gap: 1rem; padding: 1.75rem 1.5rem 2rem; }
  .promo-emoji { font-size: 3rem; }
}
