:root {
  --bg: #EEF3FA;
  --card: #FFFFFF;
  --ink: #2B2B2B;
  --muted: #6B7178;
  --steel: #7D858D;
  --steel-dark: #4F565E;
  --accent: #E4572E;
  --line: #D6DFEC;
  --navy: #1A3157;
  --navy-hover: #233F6E;
  --navy-border: #12264A;
  --danger: #B3261E;
  --header: #DCE6F2;
  --header-line: #C2D0E3;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

a { color: var(--navy-hover); }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  background: var(--header);
  border-bottom: 1px solid var(--header-line);
}
.logo img { display: block; height: 96px; width: auto; }
.signout { display: flex; align-items: center; gap: 10px; margin: 0; }
.who { color: var(--muted); font-size: 0.9rem; }

main { max-width: 760px; margin: 0 auto; padding: 24px 16px 48px; }

h1 { margin: 0 0 8px; font-size: 1.8rem; }
h2 { margin: 24px 0 8px; font-size: 1.2rem; }

.muted { color: var(--muted); }
.hint { color: var(--muted); font-weight: normal; font-size: 0.85rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
}
.narrow { max-width: 420px; margin: 24px auto; }

.welcome { text-align: center; padding: 48px 0 16px; }
.welcome h1 { font-size: 2.2rem; }
.welcome .sub { font-size: 1rem; color: var(--muted); max-width: 520px; margin: 0 auto 32px; }
.menu { display: flex; flex-direction: column; gap: 14px; max-width: 320px; margin: 0 auto; }

.btn {
  display: inline-block;
  border: 2px solid var(--navy-border);
  background: var(--navy);
  color: #fff;
  font: inherit;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 10px;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}
.btn:hover { background: var(--navy-hover); }
.btn.big { font-size: 1.25rem; padding: 16px 24px; }
.btn.secondary { background: var(--accent); border-color: #B8431F; }
.btn.secondary:hover { background: #B8431F; }
.btn.small { padding: 6px 12px; font-size: 0.9rem; }
.btn.danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: #fff; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--navy-hover); text-decoration: underline; cursor: pointer; }

.stack { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
input, textarea {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid #C5D1E2;
  border-radius: 8px;
  background: #fff;
  width: 100%;
}
input:focus, textarea:focus { outline: 2px solid var(--navy-hover); border-color: var(--navy-hover); }

.error { background: #FDECEA; color: var(--danger); padding: 10px 12px; border-radius: 8px; }
.notice { background: #EAF4EA; color: #256029; padding: 10px 12px; border-radius: 8px; }
.pill { display: inline-block; background: #FFF1D6; color: #7A5200; padding: 2px 10px; border-radius: 999px; font-size: 0.85rem; margin: 0 0 8px; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.page-head h1 { margin: 0; }

.unverified-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FFF1D6;
  border: 1px dashed #D9A441;
  color: #7A5200;
  font-weight: 700;
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
}
.badge { background: #D9A441; color: #fff; border-radius: 999px; padding: 0 10px; font-size: 0.9rem; }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.list li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.list li > a { display: flex; flex-direction: column; padding: 14px 16px; text-decoration: none; color: var(--ink); }
.list .title { font-weight: 700; font-size: 1.1rem; }
.list .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.list .row > a { flex: 1; }
.list .row .actions { padding: 0 16px 0 0; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.actions form { margin: 0; }
.list .actions { margin-top: 0; }

.switch { margin-top: 16px; }

@media (max-width: 480px) {
  .logo img { height: 76px; }
  .welcome h1 { font-size: 1.8rem; }
  .list .row .actions { padding: 0 16px 14px; }
}

.btn.outline { background: #fff; color: var(--navy); }
.btn.outline:hover { background: var(--navy); color: #fff; }

.search { display: flex; gap: 8px; margin-bottom: 16px; }
.search input { flex: 1; min-width: 0; }

.pill.ok { background: #EAF4EA; color: #256029; }
.list .pill { align-self: flex-start; margin-bottom: 4px; }

/* Main menu: medium dark blue page under the header */
body.home { background: #2B4C7E; min-height: 100vh; }
body.home .welcome h1 { color: #FFFFFF; }
body.home .welcome .sub { color: #D3DEEF; }
body.home .welcome .sub strong { color: #FFFFFF; }
body.home .menu .btn { background: #1A3157; border-color: #4E6E9E; color: #FFFFFF; }
body.home .menu .btn:hover { background: #233F6E; border-color: #7F9CC8; }

/* Floating food: sits behind the header, text and buttons and never catches taps */
body.home .top { position: relative; z-index: 2; }
body.home main { position: relative; }
body.home .welcome { position: relative; z-index: 1; }
body.home .welcome h1, body.home .welcome .sub { text-shadow: 0 2px 6px rgba(10, 25, 50, 0.6); }

.food-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.food-bg span {
  position: absolute;
  top: 0;
  opacity: 0.55;
  line-height: 1;
  animation-name: food-float;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform;
}

@keyframes food-float {
  0%   { transform: translate(0, 110vh) rotate(0deg); }
  25%  { transform: translate(var(--sway), 80vh) rotate(90deg); }
  50%  { transform: translate(0, 45vh) rotate(180deg); }
  75%  { transform: translate(calc(var(--sway) * -1), 15vh) rotate(270deg); }
  100% { transform: translate(0, -15vh) rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .food-bg span { animation-play-state: paused; }
}

/* Favorites */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.favorites-link { display: inline-flex; align-items: center; gap: 6px; }
.favorites-link svg { width: 18px; height: 18px; fill: #E0245E; }
.favorites-link .count { background: #FDE3EA; color: #B0123F; border-radius: 999px; padding: 0 8px; font-size: 0.85rem; }

.list li.row { flex-wrap: nowrap; }
.heart-form { margin: 0 12px 0 0; flex: none; }
.heart {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.heart svg { fill: none; stroke: #8A94A3; stroke-width: 2; transition: fill 0.15s, stroke 0.15s; }
.heart:hover { background: #FDEEF2; }
.heart:hover svg { stroke: #E0245E; }
.heart.on svg { fill: #E0245E; stroke: #E0245E; }
.heart:focus-visible { outline: 2px solid var(--navy-hover); outline-offset: 2px; }
.heart:disabled { cursor: progress; }
.heart.pop svg { animation: heart-pop 0.3s ease-out; }
@keyframes heart-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .heart.pop svg { animation: none; }
}
@media (max-width: 480px) {
  .page-head { flex-wrap: wrap; }
  .page-head .head-actions { width: 100%; flex-wrap: nowrap; }
  .page-head .head-actions .btn { flex: 1; justify-content: center; padding-left: 10px; padding-right: 10px; }
}

/* Avatars and profile links */
.avatar { display: inline-block; flex: none; border-radius: 50%; object-fit: cover; vertical-align: middle; background: var(--line); }
.avatar.initial { display: inline-grid; place-items: center; color: #fff; font-weight: 700; line-height: 1; }
.signout .me { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.signout .me:hover .who { text-decoration: underline; }
.person { display: inline-flex; align-items: center; gap: 6px; color: var(--navy-hover); font-weight: 600; text-decoration: none; vertical-align: middle; }
.person:hover span { text-decoration: underline; }
.by { display: inline-flex; align-items: center; gap: 6px; }

/* Recipe cards: the title's link covers the whole card, the author link and heart sit above it */
.recipe-card { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.recipe-card .card-body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; min-width: 0; flex: 1; }
.recipe-card .card-link { color: var(--ink); text-decoration: none; }
.recipe-card .card-link::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
.recipe-card .card-link:focus-visible { outline: none; }
.recipe-card .card-link:focus-visible::after { outline: 2px solid var(--navy-hover); outline-offset: 2px; }
.recipe-card .person, .recipe-card .heart-form, .recipe-card .actions { position: relative; z-index: 1; }
.recipe-card .actions { padding: 0 16px 0 0; }
.recipe-card:hover { border-color: #B8C6DB; }

/* Profile */
.profile-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 8px; }
.profile-head .profile-info { flex: 1; min-width: 160px; }
.profile-head h1 { margin: 0; }
.profile-head .muted { margin: 4px 0 0; }
.avatar-edit { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.file-btn { cursor: pointer; }
.remove-avatar { margin-top: 12px; }
@media (max-width: 480px) {
  .recipe-card { flex-wrap: wrap; }
  .recipe-card .actions { padding: 0 16px 14px; }
  .profile-head { justify-content: center; text-align: center; }
  .profile-head .btn { width: 100%; }
}

/* Food picture choices */
.avatar.preset { display: inline-grid; place-items: center; line-height: 1; }
.avatar-edit .hint { flex: 1; min-width: 160px; margin: 0; }
.preset-grid { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.preset-grid legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.preset-option { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border: 2px solid transparent; border-radius: 12px; cursor: pointer; font-weight: 500; }
.preset-option input { position: absolute; opacity: 0; pointer-events: none; }
.preset-option:hover { background: var(--bg); }
.preset-option:has(input:checked) { border-color: var(--navy); background: #E3EAF5; }
.preset-option:has(input:focus-visible) { outline: 2px solid var(--navy-hover); outline-offset: 2px; }
.preset-label { font-size: 0.8rem; color: var(--muted); text-align: center; }
.upload-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Recipe photos */
.thumb { flex: none; width: 72px; height: 72px; margin-left: 12px; border-radius: 10px; object-fit: cover; background: var(--bg); }
.thumb.empty { display: grid; place-items: center; font-size: 30px; opacity: 0.55; }
.recipe-photo { display: block; width: 100%; max-height: 420px; object-fit: cover; border-radius: 12px; margin: 0 0 16px; }
.photo-field { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-weight: 600; }
.photo-preview img { display: block; max-width: 100%; max-height: 260px; border-radius: 12px; }
.photo-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.photo-field .hint { margin: 0; }
@media (max-width: 480px) {
  .thumb { width: 60px; height: 60px; }
}
.recipe-card .thumb + .card-body { padding-left: 12px; }

/* Editing recipes */
.recipe-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.recipe-title-row h1 { flex: 1; min-width: 200px; }
.recipe-card .edit-link { position: relative; z-index: 1; flex: none; margin-right: 16px; }
.warning { background: #FFF1D6; color: #7A5200; padding: 10px 12px; border-radius: 8px; }

/* Comments, YouTube style */
.comments { margin-top: 24px; }
.comments h2 { margin: 0 0 16px; }
.comment-form { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 24px; }
.comment-form.reply-form { margin: 10px 0 4px; }
.comment-input { flex: 1; min-width: 0; }
.comment-input textarea {
  border: 0; border-bottom: 1px solid #9AA8BD; border-radius: 0; background: transparent;
  padding: 6px 0; resize: vertical; min-height: 34px;
}
.comment-input textarea:focus { outline: none; border-bottom: 2px solid var(--navy); }
.comment-buttons { display: flex; justify-content: flex-end; margin-top: 8px; }
.comment-list { display: flex; flex-direction: column; gap: 18px; }
.comment { display: flex; gap: 12px; align-items: flex-start; }
.comment-avatar { flex: none; line-height: 0; }
.comment-main { flex: 1; min-width: 0; }
.comment-meta { margin: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 0.9rem; }
.comment-name { font-weight: 700; color: var(--ink); text-decoration: none; }
.comment-name:hover { text-decoration: underline; }
.creator { background: #E3EAF5; color: var(--navy); border-radius: 999px; padding: 0 8px; font-size: 0.75rem; font-weight: 700; }
.comment-body { margin: 2px 0 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-actions { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.comment-actions form { margin: 0; }
.reply-toggle { flex: 1 1 100%; }
.reply-toggle > summary, .small-link { font-size: 0.85rem; font-weight: 700; color: var(--muted); cursor: pointer; }
.reply-toggle > summary { list-style: none; display: inline-block; padding: 4px 10px; margin-left: -10px; border-radius: 999px; }
.reply-toggle > summary::-webkit-details-marker { display: none; }
.reply-toggle > summary:hover { background: #E3EAF5; }
.reply-toggle[open] > summary { color: var(--navy); }
.comment-actions { position: relative; }
.comment-actions > form { position: absolute; left: 70px; top: 4px; }
.small-link { text-decoration: none; }
.small-link:hover { color: var(--danger); }
.replies { margin: 6px 0 0 52px; }
.replies > summary {
  list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  color: #1A5FB4; font-weight: 700; padding: 6px 12px; margin-left: -12px; border-radius: 999px;
}
.replies > summary::-webkit-details-marker { display: none; }
.replies > summary:hover { background: #DCE8F8; }
.replies[open] .chev { display: inline-block; transform: rotate(180deg); }
.replies .comment { margin-top: 14px; }
@media (max-width: 480px) {
  .replies { margin-left: 40px; }
}

.comments-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.comments-head h2 { margin: 0; }
.comments-toggle { margin: 0; }
.comments-off { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; color: var(--muted); text-align: center; }

/* Halloween: spooky main menu and the Spooky Food Contest */
body.home.spooky { background: #26163A; }
body.home.spooky .welcome .sub { color: #E4D6F5; }
body.home.spooky .menu .btn { background: #170C26; border-color: #F28C28; }
body.home.spooky .menu .btn:hover { background: #3A2159; border-color: #FFB25B; }
.spooky-hello { margin: 0 0 8px; color: #FFB25B; font-weight: 800; font-size: 1.3rem; letter-spacing: 0.02em; }
.event-banner {
  display: flex; align-items: center; gap: 14px; max-width: 420px; margin: 28px auto 0; padding: 14px 18px;
  background: #F28C28; color: #1E1030; border-radius: 14px; text-decoration: none; text-align: left;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}
.event-banner:hover { background: #FFA040; }
.event-banner.winner { background: #FFE9A8; }
.event-emoji { font-size: 2rem; }
.crown {
  display: inline-block; margin: 4px 8px 4px 0; padding: 2px 12px; border-radius: 999px;
  background: #FFE9A8; color: #6B4A00; font-weight: 700; font-size: 0.9rem; text-decoration: none;
}
.big-crown { font-size: 1rem; padding: 6px 16px; margin-top: 8px; }
.contest-box {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 12px 0 0; padding: 12px 14px; background: #FFF1E3; border: 1px solid #F6C792; border-radius: 12px;
}
.spooky-btn { background: #F28C28; border-color: #C96A12; color: #1E1030; }
.spooky-btn:hover { background: #FFA040; }
.contest-head { text-align: center; }
.contest-trophy { font-size: 3rem; margin: 0; }
.standings { counter-reset: none; }
.standings .place { flex: none; width: 36px; margin-left: 12px; text-align: center; font-weight: 800; font-size: 1.3rem; color: var(--muted); }
.standings .place + .thumb { margin-left: 4px; }

/* Recipe videos */
.video-wrap { margin: 20px 0 8px; }
.video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #0F1B2D; }
.video-frame.vertical { aspect-ratio: 9 / 16; max-width: 400px; margin: 0 auto; }
.video-frame.instagram { aspect-ratio: auto; height: 640px; max-width: 420px; margin: 0 auto; background: #fff; border: 1px solid var(--line); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-link { display: block; margin-top: 8px; text-align: center; font-weight: 600; }
.thumb-wrap { position: relative; flex: none; display: inline-flex; }
.play-badge {
  position: absolute; right: -4px; bottom: -4px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; background: #E0245E; color: #fff; font-size: 0.75rem;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.recipe-card .thumb-wrap + .card-body { padding-left: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.admin-actions { align-items: center; padding-top: 16px; border-top: 1px solid var(--line); }

/* Sections */
.section-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0 10px; margin-bottom: 8px; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 7px 14px; border-radius: 999px;
  background: #fff; border: 1px solid #C5D1E2; color: var(--navy); font-weight: 700; text-decoration: none; white-space: nowrap;
}
.chip:hover { border-color: var(--navy); }
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip.manage { background: transparent; border-style: dashed; color: var(--muted); font-weight: 600; }
.chip.small { padding: 3px 10px; font-size: 0.85rem; }
.recipe-sections { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.section-picker { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.section-picker fieldset { border: 0; padding: 0; margin: 0; flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 8px; }
.section-picker legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.section-check {
  flex-direction: row; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid #C5D1E2; border-radius: 999px;
  font-weight: 600; cursor: pointer; background: #fff;
}
.section-check input { width: auto; margin: 0; }
.section-check:has(input:checked) { background: #E3EAF5; border-color: var(--navy); }
.section-row { display: flex; gap: 8px; align-items: center; }
.section-row input { flex: 1; min-width: 0; }
.section-row .emoji-input { flex: none; width: 64px; text-align: center; font-size: 1.2rem; }
.section-list li { padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.section-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.section-meta form { margin: 0; }
.card > h2:first-child { margin-top: 0; }
@media (max-width: 480px) {
  .section-chips { gap: 6px; }
  .section-chips .chip { padding: 5px 11px; font-size: 0.88rem; }
}

/* Seasonal headers. The logo and name get a white backing so they stay readable. */
.top.event { position: relative; overflow: hidden; }
.top.event .logo, .top.event .signout {
  position: relative; z-index: 1; background: #FFFFFF;
  border-radius: 14px; padding: 4px 10px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
.header-decor { position: absolute; inset: 0; pointer-events: none; }

/* Halloween: purple with dangling spiders and cobwebs */
.top.halloween { background: #3B1E5C; border-bottom: 3px solid #F28C28; }
.top.halloween .web { position: absolute; top: -6px; font-size: 44px; opacity: 0.55; }
.top.halloween .web.left { left: -6px; }
.top.halloween .web.right { right: -6px; transform: scaleX(-1); }
.spider { position: absolute; top: 0; left: var(--left); display: flex; flex-direction: column; align-items: center; animation: spider-bob ease-in-out infinite alternate; }
.spider::before { content: ""; width: 1px; height: var(--drop); background: rgba(255, 255, 255, 0.6); }
.spider span { font-size: 20px; line-height: 1; }
@keyframes spider-bob {
  from { transform: translateY(-10px); }
  to { transform: translateY(14px); }
}

/* Christmas: red and white candy-cane stripes */
.top.christmas {
  background: repeating-linear-gradient(135deg, #D62839 0 18px, #FFFFFF 18px 36px);
  border-bottom: 3px solid #1E6B3A;
}

/* Falling candy canes and presents on the Christmas main menu */
.food-bg.falling span { animation-name: food-fall; opacity: 0.8; }
.candy-cane { display: block; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25)); }
@keyframes food-fall {
  0%   { transform: translate(0, -15vh) rotate(-15deg); }
  25%  { transform: translate(var(--sway), 20vh) rotate(5deg); }
  50%  { transform: translate(0, 50vh) rotate(-10deg); }
  75%  { transform: translate(calc(var(--sway) * -1), 80vh) rotate(10deg); }
  100% { transform: translate(0, 110vh) rotate(-15deg); }
}
.spooky-hello.merry { color: #FFFFFF; }

@media (prefers-reduced-motion: reduce) {
  .spider { animation: none; }
  .food-bg.falling span { animation-play-state: paused; }
}
@media (max-width: 480px) {
  /* On phones the white backings fill most of the bar, so two spiders hang in the gap between them. */
  .top.halloween .spider { display: none; }
  .top.halloween .spider.s2 { display: flex; left: 51%; }
  .top.halloween .spider.s4 { display: flex; left: 58%; }
}

.top.event .signout .link { white-space: nowrap; }
@media (max-width: 480px) {
  /* Room for the picture and "Sign out" on one line inside the white backing */
  .top.event .signout .who { display: none; }
  .top.event .logo, .top.event .signout { padding: 4px 8px; }
}

/* Christmas main menu: a snowy night village */
body.home.christmas { background: linear-gradient(#0B1A36 0%, #1C3766 55%, #3E5F92 100%); background-attachment: fixed; }
body.home.christmas .welcome .sub { color: #E3ECF8; }
body.home.christmas .menu .btn { background: #0F2244; border-color: #D62839; }
body.home.christmas .menu .btn:hover { background: #1A3463; border-color: #FF5A6A; }
.winter-scene { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.village { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 34vh; min-height: 170px; }
.village .window { filter: drop-shadow(0 0 4px #FFC93D); }
.village .bulb { animation: twinkle 1.6s ease-in-out infinite alternate; }
.village .bulb:nth-of-type(2n) { animation-delay: -0.8s; }
.village .bulb:nth-of-type(3n) { animation-delay: -0.4s; }
@keyframes twinkle {
  from { opacity: 1; }
  to { opacity: 0.35; }
}
/* Snow: two layers of dots drifting down at different speeds. Moving the background by
   exactly one tile per loop keeps it seamless. */
.snow { position: absolute; inset: 0; background-repeat: repeat; animation: snowfall linear infinite; }
.snow.far {
  background-image:
    radial-gradient(1.5px 1.5px at 30px 40px, #fff 60%, transparent 61%),
    radial-gradient(1.5px 1.5px at 110px 150px, #fff 60%, transparent 61%),
    radial-gradient(1.5px 1.5px at 170px 80px, #fff 60%, transparent 61%),
    radial-gradient(1.5px 1.5px at 70px 200px, #fff 60%, transparent 61%);
  background-size: 220px 220px; opacity: 0.7; animation-duration: 18s; --tile: 220px;
}
.snow.near {
  background-image:
    radial-gradient(3px 3px at 50px 60px, #fff 60%, transparent 61%),
    radial-gradient(2.5px 2.5px at 200px 20px, #fff 60%, transparent 61%),
    radial-gradient(3px 3px at 140px 230px, #fff 60%, transparent 61%),
    radial-gradient(2.5px 2.5px at 260px 160px, #fff 60%, transparent 61%);
  background-size: 300px 300px; animation-duration: 11s; --tile: 300px;
}
@keyframes snowfall {
  from { background-position: 0 0; }
  to { background-position: 30px var(--tile); }
}
@media (prefers-reduced-motion: reduce) {
  .snow, .village .bulb { animation: none; }
}

/* Halloween main menu: a haunted house under the moon */
body.home.spooky { background: linear-gradient(#120821 0%, #2A1544 60%, #3D1F5C 100%); background-attachment: fixed; }
.haunted-scene { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.haunted-scene .moon {
  position: absolute; top: 12vh; right: 10vw; width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, #FFF8DC 0%, #F6E7A6 60%, #E9D27E 100%);
  box-shadow: 0 0 60px 18px rgba(246, 231, 166, 0.35);
}
.graveyard { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 42vh; min-height: 210px; }
/* The house stands on the back hill: to the right of the menu on wide screens, behind it on phones. */
.haunted-house {
  position: absolute; right: 1vw; bottom: calc(max(42vh, 210px) * 0.24);
  width: min(480px, 37vw); height: auto;
  filter: drop-shadow(0 0 18px rgba(255, 178, 91, 0.25));
}
.haunted-window { filter: drop-shadow(0 0 6px #FF9A2E); animation: flicker 3.5s ease-in-out infinite; }
@keyframes flicker {
  0%, 100% { opacity: 1; }
  45% { opacity: 0.85; }
  50% { opacity: 0.55; }
  55% { opacity: 0.9; }
}
.zombie { transform-box: fill-box; transform-origin: 50% 100%; animation: shamble 2.6s ease-in-out infinite alternate; }
.zombie.slow { animation-duration: 3.4s; animation-delay: -1s; }
@keyframes shamble {
  from { transform: translateX(-6px) rotate(-6deg); }
  to { transform: translateX(10px) rotate(5deg); }
}
.skeleton.waving .arm { transform-box: view-box; transform-origin: 300px 220px; animation: wave 0.9s ease-in-out infinite alternate; }
@keyframes wave {
  from { transform: rotate(-12deg); }
  to { transform: rotate(14deg); }
}
.hang-spider { animation: dangle ease-in-out infinite alternate; }
@keyframes dangle {
  from { transform: translateY(-8px); }
  to { transform: translateY(12px); }
}
.pumpkins text { filter: drop-shadow(0 0 6px rgba(255, 140, 30, 0.8)); }
/* One witch on a broomstick, crossing the sky past the moon */
.witch {
  position: absolute; top: 14vh; left: 0; display: flex; align-items: flex-end;
  animation: fly 16s linear infinite;
}
.witch span { font-size: 40px; margin-right: -64px; position: relative; z-index: 1; transform: scaleX(-1); }
@keyframes fly {
  0% { transform: translate(-140px, 10vh) rotate(-6deg); }
  50% { transform: translate(50vw, 0) rotate(-2deg); }
  100% { transform: translate(110vw, -6vh) rotate(-8deg); }
}
/* Room to scroll the menu up and see the graveyard underneath */
body.home.spooky main { padding-bottom: 22vh; }
@media (max-width: 900px) {
  .haunted-house { right: auto; left: 50%; transform: translateX(-50%); width: min(520px, 104vw); }
  body.home.spooky .menu .btn { background: rgba(23, 12, 38, 0.45); }
}
@media (max-width: 480px) {
  .haunted-scene .moon { width: 80px; height: 80px; top: 16vh; right: 6vw; }
}
@media (prefers-reduced-motion: reduce) {
  .zombie, .skeleton .arm, .hang-spider, .haunted-window, .witch { animation: none; }
  .witch { transform: translate(55vw, 0); }
}
