/* Palette lifted from the printed menu: evergreen, burgundy, old gold, warm paper. */
:root {
  --g9: #071d14;
  --g8: #0e3527;
  --g7: #174d39;
  --red: #a11d33;
  --red-d: #74131f;
  --gold: #d9b04a;
  --gold-l: #f3dfa2;
  --cream: #fbf5e6;
  --paper: #fffcf3;
  --ink: #2a1c16;
  --muted: #75675a;
  --line: #e6d9bb;
  --display: 'Mountains of Christmas', 'Lora', Georgia, serif;
  --serif: 'Lora', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--g9); }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--cream);
  background:
    radial-gradient(1100px 620px at 50% -8%, #1f6247 0%, transparent 70%),
    linear-gradient(180deg, var(--g8), var(--g9)) fixed;
}

a { color: var(--gold-l); }
button { font: inherit; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

#snow {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}

/* ---------- String of lights ---------- */
.lights {
  position: absolute; top: 0; left: 0; right: 0; height: 52px;
  overflow: hidden; pointer-events: none; z-index: 2;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='24'%3E%3Cpath d='M0 4 Q60 22 120 4' fill='none' stroke='%23030d09' stroke-width='2'/%3E%3C/svg%3E") repeat-x 0 0;
}
.bulb {
  position: absolute; width: 11px; height: 17px; margin-left: -5px;
  border-radius: 50% 50% 50% 50% / 38% 38% 62% 62%;
  animation: twinkle 2.6s ease-in-out infinite alternate;
}
.bulb::before {
  content: ''; position: absolute; left: 2px; top: -4px; width: 7px; height: 5px;
  background: #030d09; border-radius: 2px 2px 0 0;
}
.bulb.c0 { background: #ff5a6e; color: #ff5a6e; }
.bulb.c1 { background: #ffd66b; color: #ffd66b; }
.bulb.c2 { background: #6be3a0; color: #6be3a0; }
.bulb.c3 { background: #fff6dd; color: #fff6dd; }
@keyframes twinkle {
  from { opacity: .5; box-shadow: 0 0 3px 0 currentColor; }
  to   { opacity: 1;  box-shadow: 0 0 14px 3px currentColor; }
}

/* ---------- Layout ---------- */
.shell { position: relative; z-index: 1; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px 40px; }
.wrap.wide { max-width: 1060px; }

.hero {
  position: relative; z-index: 1; text-align: center;
  padding: 74px 16px 26px;
}
.topnav {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  margin-bottom: 26px;
}
.topnav a, .topnav button {
  color: var(--cream); text-decoration: none; cursor: pointer;
  padding: 7px 16px; border-radius: 999px;
  border: 1px solid rgba(217, 176, 74, .5);
  background: rgba(7, 29, 20, .45);
  transition: background .2s, border-color .2s;
}
.topnav a:hover, .topnav button:hover { background: rgba(217, 176, 74, .18); border-color: var(--gold); }
.topnav a[aria-current='page'] { background: var(--gold); border-color: var(--gold); color: var(--g9); font-weight: 600; }

.sleeps { margin: 0 0 4px; color: var(--gold-l); font-style: italic; min-height: 1.55em; }

h1.title {
  margin: 0; font-family: var(--display); font-weight: 700;
  font-size: clamp(2.7rem, 9vw, 4.8rem); line-height: 1.02; color: var(--cream);
  text-shadow: 0 2px 0 var(--red-d), 0 0 28px rgba(217, 176, 74, .35);
}
.subtitle { margin: 10px auto 0; max-width: 34em; font-size: 1.15rem; color: var(--gold-l); }
.meta { margin: 6px 0 0; color: rgba(251, 245, 230, .75); font-size: .95rem; }
.ornament { margin-top: 16px; color: var(--gold); letter-spacing: .6em; padding-left: .6em; }

/* ---------- Menu-card panels ---------- */
.panel {
  position: relative; margin: 22px 0; padding: 26px 24px 24px;
  color: var(--ink); background: var(--paper);
  border: 1px solid var(--gold); border-radius: 6px;
  box-shadow: inset 0 0 0 6px var(--paper), inset 0 0 0 7px var(--gold-l), 0 14px 34px rgba(0, 0, 0, .35);
}
.panel > h2 {
  margin: 0 0 4px; text-align: center; color: var(--red);
  font-size: 1.05rem; font-weight: 600; letter-spacing: .3em; text-transform: uppercase;
}
.panel .lede { margin: 0 0 18px; text-align: center; color: var(--muted); font-size: .95rem; }

.panel.tight { padding-block: 20px; }

/* ---------- Form bits ---------- */
label.field { display: block; font-weight: 600; margin-bottom: 6px; }
.input, textarea.input {
  width: 100%; padding: 12px 14px; font: inherit; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: 12px;
}
.input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(161, 29, 51, .15); }
textarea.input { min-height: 84px; resize: vertical; }
.hint { color: var(--muted); font-size: .9rem; margin: 6px 0 0; }

.dishes { display: grid; gap: 10px; }

.dish {
  position: relative; display: grid; grid-template-columns: 46px 1fr; gap: 14px; align-items: center;
  padding: 12px 44px 12px 14px; cursor: pointer;
  background: #fff; border: 1.5px solid var(--line); border-radius: 14px;
  transition: border-color .15s, background .15s, transform .15s;
}
.dish:hover { border-color: var(--gold); }
.dish .em {
  width: 46px; height: 46px; display: grid; place-items: center; font-size: 1.6rem;
  background: #f8f0da; border-radius: 50%;
}
.dish .nm { font-weight: 600; line-height: 1.3; }
.dish .ds { color: var(--muted); font-size: .92rem; line-height: 1.4; }
.dish .badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.dish::after {
  content: '✓'; position: absolute; right: 12px; top: 50%; width: 24px; height: 24px; margin-top: -12px;
  display: grid; place-items: center; font-size: .85rem; font-weight: 700; color: #fff;
  background: var(--red); border-radius: 50%; transform: scale(0); transition: transform .2s cubic-bezier(.3, 1.6, .5, 1);
}
.dish:has(input:checked) { border-color: var(--red); background: #fff6f3; box-shadow: 0 0 0 3px rgba(161, 29, 51, .14); }
.dish:has(input:checked)::after { transform: scale(1); }
.dish:has(input:checked) .em { background: #fbe0dc; }
.dish:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }

.dish.skip { border-style: dashed; background: transparent; }
.dish.skip .em { background: transparent; border: 1.5px dashed var(--line); filter: grayscale(.4); }

.tag, .plus {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .74rem; font-weight: 600; line-height: 1.6;
}
.tag { color: #1c5a3a; background: #dff2e5; }
.tag.VG { color: #fff; background: #1f7a49; }
.tag.GF { color: #6b4a06; background: #fbe9b6; }
.plus { color: #5b3f00; background: var(--gold-l); border: 1px solid var(--gold); }

.pills { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.pill {
  position: relative; padding: 8px 18px; cursor: pointer; border-radius: 999px;
  background: #fff; border: 1.5px solid var(--line); transition: border-color .15s, background .15s;
}
.pill:hover { border-color: var(--gold); }
.pill:has(input:checked) { background: var(--red); border-color: var(--red); color: #fff; }
.pill:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }
.pills-label { text-align: center; margin: 18px 0 0; font-weight: 600; }

.price-key {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; margin: 0;
  font-weight: 600; color: var(--red);
}
.price-key span small { color: var(--muted); font-weight: 400; }

/* ---------- Checkout bar ---------- */
.checkout {
  position: sticky; bottom: 12px; z-index: 6; margin-top: 26px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px;
  padding: 14px 18px; color: var(--cream);
  background: rgba(7, 29, 20, .94); backdrop-filter: blur(6px);
  border: 1px solid var(--gold); border-radius: 18px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
.checkout .sum { min-width: 0; flex: 1 1 220px; }
.checkout .total { font-family: var(--display); font-size: 2rem; line-height: 1; color: var(--gold-l); }
.checkout .why { display: block; font-size: .88rem; color: rgba(251, 245, 230, .8); margin-top: 3px; }
.checkout .error { display: block; margin-top: 4px; font-size: .92rem; color: #ffb3bd; }

.btn {
  cursor: pointer; padding: 12px 24px; font-weight: 600; color: var(--cream);
  background: var(--red); border: 1.5px solid var(--gold); border-radius: 999px;
  transition: transform .15s, background .15s, opacity .15s;
}
.btn:hover:not(:disabled) { background: var(--red-d); transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--red); border-color: var(--red); }
.btn.ghost:hover:not(:disabled) { background: rgba(161, 29, 51, .08); }
.btn.small { padding: 6px 14px; font-size: .9rem; }
a.btn { display: inline-block; text-decoration: none; }
.btn.on-dark { color: var(--cream); border-color: var(--gold); }
.btn.on-dark:hover:not(:disabled) { background: rgba(217, 176, 74, .15); }
.checkout .actions { display: flex; gap: 8px; }
.santa { font-size: 3rem; line-height: 1; }
.dish .nm, .dish .ds { display: block; }
.linkish { background: none; border: 0; padding: 0; color: var(--gold-l); text-decoration: underline; cursor: pointer; }

/* ---------- Banners, your-orders, dialog ---------- */
.banner {
  margin: 16px 0 0; padding: 12px 16px; text-align: center; border-radius: 12px;
  background: rgba(161, 29, 51, .85); border: 1px solid var(--gold); color: var(--cream);
}
.banner.info { background: rgba(7, 29, 20, .6); }

.mine ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mine li {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px;
  padding: 10px 14px; background: #fff; border: 1.5px solid var(--line); border-radius: 12px;
}
.mine .who { font-weight: 600; }
.mine .what { color: var(--muted); font-size: .9rem; display: block; }
.mine .acts { display: flex; gap: 8px; }

dialog {
  max-width: min(480px, calc(100vw - 32px)); padding: 30px 26px 24px; text-align: center;
  color: var(--ink); background: var(--paper); border: 1px solid var(--gold); border-radius: 8px;
  box-shadow: inset 0 0 0 6px var(--paper), inset 0 0 0 7px var(--gold-l), 0 24px 60px rgba(0, 0, 0, .6);
}
dialog::backdrop { background: rgba(3, 13, 9, .72); }
dialog h2 { margin: 6px 0 6px; font-family: var(--display); font-size: 2.2rem; color: var(--red); line-height: 1.1; }
dialog .receipt { margin: 14px 0; padding: 12px 14px; text-align: left; background: #f8f0da; border-radius: 12px; font-size: .95rem; }
dialog .receipt div { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
dialog .receipt .tot { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--gold); font-weight: 700; }
dialog .acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
dialog a.btn { text-decoration: none; }

/* ---------- Everyone page ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 8px 0 0; }
.stat {
  padding: 16px 18px; border: 1px solid rgba(217, 176, 74, .55); border-radius: 14px;
  background: rgba(7, 29, 20, .5);
}
.stat .big { font-family: var(--display); font-size: 2.6rem; line-height: 1; color: var(--gold-l); }
.stat .lbl { color: rgba(251, 245, 230, .85); font-size: .95rem; }

.breakdown { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 22px; }
.breakdown .panel { margin: 22px 0 0; }

.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.bars li { display: grid; gap: 4px; }
.bars .row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.bars .row .n { font-weight: 600; line-height: 1.3; }
.bars .row .c { font-family: var(--display); font-size: 1.5rem; color: var(--red); line-height: 1; }
.bars .track { height: 9px; background: #efe5cb; border-radius: 999px; overflow: hidden; }
.bars .fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--red-d), var(--red)); border-radius: 999px; transition: width .7s cubic-bezier(.2, .8, .2, 1); }
.bars li.zero .n { color: var(--muted); font-weight: 400; }
.bars li.top .fill { background: linear-gradient(90deg, #b58a1f, var(--gold)); }
.bars li.skipped .n { color: var(--muted); font-style: italic; font-weight: 400; }
.bars li.skipped .fill { background: #cdbf9f; }

.guests { width: 100%; border-collapse: collapse; }
.guests th { text-align: left; padding: 8px 10px; color: var(--muted); font-weight: 600; font-size: .9rem; border-bottom: 1.5px solid var(--gold); }
.guests td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.guests td.price, .guests th.price { text-align: right; white-space: nowrap; }
.guests .who { font-weight: 600; }
.guests .note { display: block; margin-top: 2px; color: var(--red); font-size: .88rem; font-style: italic; }
.guests .side { color: var(--muted); font-size: .88rem; }
.guests tr.fresh td { animation: fresh 2.4s ease-out; }
@keyframes fresh { from { background: var(--gold-l); } to { background: transparent; } }
.guests tfoot td { border-bottom: 0; font-weight: 700; padding-top: 14px; }
.guests .del, .guests .edit { margin-left: 8px; }

.empty { text-align: center; padding: 26px 8px; }
.empty .big { font-size: 2.6rem; }
.empty p { margin: 6px 0 14px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 20; transform: translate(-50%, 30px);
  padding: 10px 20px; opacity: 0; pointer-events: none; text-align: center;
  color: var(--g9); background: var(--gold-l); border: 1px solid var(--gold); border-radius: 999px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .4); transition: transform .35s, opacity .35s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

.foot { position: relative; z-index: 1; padding: 6px 16px 34px; text-align: center; color: rgba(251, 245, 230, .7); font-size: .9rem; }
.foot p { margin: 4px 0; }

.tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.tools .btn.ghost { color: var(--gold-l); border-color: rgba(217, 176, 74, .6); }
.tools .btn.ghost:hover:not(:disabled) { background: rgba(217, 176, 74, .15); }

/* ---------- Small screens ---------- */
@media (max-width: 700px) {
  .panel { padding: 22px 16px 20px; }
  .checkout { bottom: 8px; padding: 10px 14px; gap: 6px 12px; flex-wrap: nowrap; flex-direction: row; align-items: center; }
  .checkout .sum { flex: 1 1 auto; }
  .checkout .total { font-size: 1.6rem; }
  .checkout .why { display: none; }
  .checkout .actions { flex: 0 0 auto; }
  .checkout .btn { padding: 10px 16px; }
  .checkout .error { font-size: .82rem; line-height: 1.3; }
  .guests thead { display: none; }
  .guests, .guests tbody, .guests tr, .guests td { display: block; width: 100%; }
  .guests tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .guests td { border: 0; padding: 2px 10px; }
  .guests td.price { text-align: left; }
  .guests td[data-label]::before { content: attr(data-label) ': '; color: var(--muted); font-size: .85rem; }
  .guests tfoot tr { border: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .bulb { animation: none; opacity: .9; }
  .dish, .dish::after, .btn, .bars .fill, .toast { transition: none; }
  .guests tr.fresh td { animation: none; }
}

@media print {
  body { background: #fff; color: #000; }
  #snow, .lights, .topnav, .tools, .foot, .toast { display: none !important; }
  .hero { padding-top: 10px; }
  h1.title { color: #000; text-shadow: none; }
  .subtitle, .meta, .sleeps { color: #333; }
  .stat { border-color: #999; background: none; }
  .stat .big, .stat .lbl { color: #000; }
  .panel { box-shadow: none; border-color: #999; break-inside: avoid; }
}
