@import url('https://fonts.googleapis.com/css2?family=Mountains+of+Christmas:wght@700&family=Berkshire+Swash&family=Nunito:wght@400;700;900&display=swap');

:root {
  --red: #c8102e; --red-dk: #7a0b1c; --green: #0f7a3d; --green-dk: #063d22;
  --gold: #ffd45c; --gold-dk: #c99a1a; --snow: #fffdf7; --ink: #2b1a12;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: 'Nunito', system-ui, sans-serif; color: var(--ink);
  background:
    radial-gradient(circle at 20% 10%, rgba(255,212,92,.18), transparent 40%),
    radial-gradient(circle at 80% 30%, rgba(255,255,255,.08), transparent 35%),
    linear-gradient(180deg, #0b1d3a 0%, #13325e 45%, #1d4a7a 75%, #2a6295 100%);
  background-attachment: fixed; overflow-x: hidden; padding-bottom: 140px;
}
#snow { position: fixed; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; z-index: 1; }
.wrap { position: relative; z-index: 2; max-width: 760px; margin: 0 auto; padding: 0 14px; }

/* ---------- string of lights ---------- */
.lights { position: relative; z-index: 3; height: 54px; margin: 0; padding: 0; list-style: none; white-space: nowrap; overflow: hidden; text-align: center; }
.lights::before { content: ''; position: absolute; left: 0; right: 0; top: 10px; height: 14px; border-bottom: 2px solid #1b2a1b; border-radius: 0 0 50% 50% / 0 0 100% 100%; }
.lights li { position: relative; display: inline-block; width: 14px; height: 24px; margin: 18px 13px 0; border-radius: 50%; animation: flash 1.2s infinite alternate; }
.lights li::before { content: ''; position: absolute; top: -6px; left: 3px; width: 8px; height: 8px; background: #333; border-radius: 3px; }
.lights li:nth-child(4n+1) { background: #ff3b3b; box-shadow: 0 4px 24px 4px #ff3b3b; }
.lights li:nth-child(4n+2) { background: #3bff7a; box-shadow: 0 4px 24px 4px #3bff7a; animation-delay: .4s; }
.lights li:nth-child(4n+3) { background: #ffe14d; box-shadow: 0 4px 24px 4px #ffe14d; animation-delay: .8s; }
.lights li:nth-child(4n+4) { background: #4dc3ff; box-shadow: 0 4px 24px 4px #4dc3ff; animation-delay: .2s; }
@keyframes flash { 0%,40% { opacity: 1; } 100% { opacity: .35; box-shadow: none; } }

/* ---------- header ---------- */
header.hero { text-align: center; padding: 6px 0 10px; position: relative; }
.title {
  font-family: 'Mountains of Christmas', 'Berkshire Swash', cursive; font-size: clamp(38px, 9vw, 66px); line-height: .95; margin: 6px 0 4px;
  background: linear-gradient(180deg, #fff6c9 0%, var(--gold) 45%, var(--gold-dk) 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 var(--red-dk)) drop-shadow(0 0 18px rgba(255,212,92,.55));
  animation: glow 3s ease-in-out infinite alternate;
}
@keyframes glow { to { filter: drop-shadow(0 3px 0 var(--red-dk)) drop-shadow(0 0 32px rgba(255,212,92,.9)); } }
.subtitle { font-family: 'Berkshire Swash', cursive; color: #fff; font-size: 20px; text-shadow: 0 2px 6px #000; margin: 0; }
.ornaments { display: flex; justify-content: center; gap: 22px; margin: 6px 0 0; height: 70px; }
.orn { position: relative; width: 36px; animation: swing 3s ease-in-out infinite; transform-origin: top center; }
.orn:nth-child(2) { animation-delay: -1s; } .orn:nth-child(3) { animation-delay: -2s; } .orn:nth-child(4) { animation-delay: -.5s; } .orn:nth-child(5) { animation-delay: -1.5s; }
.orn::before { content: ''; position: absolute; left: 17px; top: 0; width: 2px; height: var(--h, 26px); background: var(--gold); }
.orn span { position: absolute; top: var(--h, 26px); left: 4px; width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #fff 0 8%, var(--c, var(--red)) 30%, #000 140%); box-shadow: 0 0 14px var(--c, var(--red)); }
.orn span::before { content: ''; position: absolute; top: -6px; left: 10px; width: 10px; height: 7px; background: linear-gradient(90deg, #a07a12, #ffe28a, #a07a12); border-radius: 2px; }
@keyframes swing { 0%,100% { transform: rotate(8deg); } 50% { transform: rotate(-8deg); } }

/* ---------- sleigh ---------- */
/* the emoji reindeer face left, so the whole team is mirrored to fly nose-first across the screen (left → right) */
.sleigh { position: fixed; top: 12%; left: -260px; font-size: 38px; z-index: 1; pointer-events: none; animation: fly 26s linear infinite; white-space: nowrap; filter: drop-shadow(0 0 8px rgba(255,255,255,.6)); transform: scaleX(-1); }
.sleigh::after { content: '✨ ✨ ✨'; font-size: 16px; position: absolute; right: -66px; top: 18px; opacity: .8; }
@keyframes fly { 0% { left: -260px; top: 14%; transform: scaleX(-1) rotate(6deg); } 45% { top: 6%; } 70%,100% { left: 110vw; top: 10%; transform: scaleX(-1) rotate(3deg); } }

/* ---------- nav ---------- */
nav.tabs { display: flex; gap: 8px; justify-content: center; margin: 10px 0 16px; flex-wrap: wrap; }
nav.tabs button { font: 900 15px 'Nunito'; border: 3px solid var(--gold); background: var(--green); color: #fff; padding: 9px 16px; border-radius: 999px; cursor: pointer; box-shadow: 0 4px 0 var(--green-dk); }
nav.tabs button.on { background: var(--red); box-shadow: 0 4px 0 var(--red-dk); }
nav.tabs button:active { transform: translateY(3px); box-shadow: none; }

/* ---------- cards ---------- */
.card {
  position: relative; background: var(--snow); border-radius: 22px; padding: 26px 22px 22px; margin: 0 0 22px;
  border: 10px solid transparent;
  background-image: linear-gradient(var(--snow), var(--snow)), repeating-linear-gradient(45deg, var(--red) 0 14px, #fff 14px 28px);
  background-origin: border-box; background-clip: padding-box, border-box;
  box-shadow: 0 14px 40px rgba(0,0,0,.45), 0 0 0 3px var(--gold) inset;
}
.card.green { background-image: linear-gradient(var(--snow), var(--snow)), repeating-linear-gradient(-45deg, var(--green) 0 14px, #fff 14px 28px); }
.card .bow { position: absolute; top: -34px; left: 50%; transform: translateX(-50%); font-size: 46px; filter: drop-shadow(0 3px 2px rgba(0,0,0,.4)); }
.card h2 { font-family: 'Mountains of Christmas', cursive; font-size: 36px; color: var(--red); text-align: center; margin: 4px 0 10px; }
.card h3 { font-family: 'Berkshire Swash', cursive; color: var(--green); margin: 14px 0 6px; font-size: 22px; }
.center { text-align: center; }
.muted { color: #7a6a60; font-size: 14px; }
.snowcap { position: absolute; top: -14px; left: 8px; right: 8px; height: 22px; background: #fff; border-radius: 20px 20px 50% 50% / 20px 20px 18px 18px; box-shadow: 0 3px 4px rgba(0,0,0,.15); }
.snowcap::before, .snowcap::after { content: ''; position: absolute; bottom: -10px; width: 16px; height: 18px; background: #fff; border-radius: 0 0 50% 50%; }
.snowcap::before { left: 20%; } .snowcap::after { left: 70%; height: 24px; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-block; font: 900 20px 'Nunito'; color: #fff; padding: 14px 28px; border-radius: 16px; border: 0; cursor: pointer;
  background: repeating-linear-gradient(45deg, var(--red) 0 16px, #e33a54 16px 32px); background-size: 200% 100%;
  box-shadow: 0 6px 0 var(--red-dk), 0 10px 24px rgba(200,16,46,.5); text-shadow: 0 2px 0 var(--red-dk); animation: candy 3s linear infinite;
}
.btn.green { background: repeating-linear-gradient(45deg, var(--green) 0 16px, #1c9a52 16px 32px); background-size: 200% 100%; box-shadow: 0 6px 0 var(--green-dk); text-shadow: 0 2px 0 var(--green-dk); }
.btn.gold { background: linear-gradient(180deg, #ffe58f, var(--gold-dk)); color: var(--red-dk); text-shadow: none; box-shadow: 0 6px 0 #8a6a10; }
.btn.small { font-size: 15px; padding: 8px 14px; border-radius: 10px; box-shadow: 0 4px 0 var(--red-dk); }
.btn:disabled { opacity: .5; cursor: default; animation: none; }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 var(--red-dk); }
.btn.big { font-size: 26px; padding: 20px 34px; }
@keyframes candy { to { background-position: 100% 0; } }
.pulse { animation: candy 3s linear infinite, pulse 1.3s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
input, select, textarea { font: 18px 'Nunito'; padding: 11px 13px; border-radius: 12px; border: 3px solid var(--green); width: 100%; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--gold); }
label { font-weight: 900; color: var(--green-dk); display: block; margin: 12px 0 4px; }
.row { display: flex; gap: 10px; } .row > * { flex: 1; }
.err { background: #ffe1e5; color: var(--red-dk); border: 2px solid var(--red); border-radius: 10px; padding: 8px 12px; margin: 10px 0; font-weight: 700; }
.linkbtn { background: none; border: 0; color: var(--green); font: 700 15px 'Nunito'; text-decoration: underline; cursor: pointer; }

/* ---------- countdown ---------- */
.countdown { display: flex; justify-content: center; gap: 10px; margin: 16px 0; }
.countdown div { background: linear-gradient(180deg, var(--red), var(--red-dk)); color: #fff; border-radius: 14px; padding: 10px 6px; width: 78px; text-align: center; border: 3px solid var(--gold); box-shadow: 0 6px 14px rgba(0,0,0,.3); }
.countdown b { display: block; font: 900 34px 'Nunito'; line-height: 1; }
.countdown small { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }

/* ---------- quiz ---------- */
.qmeta { display: flex; justify-content: space-between; align-items: center; font-weight: 900; color: var(--green-dk); margin-bottom: 8px; }
.timer { font: 900 22px 'Nunito'; color: var(--red); background: #fff3c4; border: 2px dashed var(--gold-dk); padding: 3px 12px; border-radius: 10px; }
.progress { display: flex; gap: 6px; justify-content: center; margin: 4px 0 16px; }
.progress span { font-size: 26px; filter: grayscale(1) opacity(.4); transition: .3s; }
.progress span.done { filter: none; } .progress span.cur { filter: none; transform: scale(1.3); }
.qtext { font-size: 23px; font-weight: 900; text-align: center; margin: 8px 0 18px; line-height: 1.3; }
.tag { display: inline-block; background: var(--green); color: #fff; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 900; }
.tag.red { background: var(--red); } .tag.gold { background: var(--gold); color: var(--red-dk); }
.opts { display: grid; gap: 12px; }
.opt { text-align: left; font: 700 19px 'Nunito'; padding: 14px 16px 14px 56px; border-radius: 16px; border: 3px solid #e3d6c2; background: #fff; cursor: pointer; position: relative; transition: .15s; }
.opt::before { content: attr(data-l); position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%; background: var(--green); color: #fff; font-weight: 900; display: grid; place-items: center; }
.opt:hover { border-color: var(--gold); transform: translateX(3px); }
.opt.sel { border-color: var(--red); background: #fff0f2; box-shadow: 0 0 0 3px var(--gold); }
.opt.sel::before { background: var(--red); content: '★'; }
.opt.right { border-color: var(--green); background: #e5f8ea; }
.opt.wrong { border-color: var(--red); background: #ffe7ea; text-decoration: line-through; }
.qnav { display: flex; justify-content: space-between; margin-top: 20px; gap: 10px; }

/* ---------- leaderboards ---------- */
table.board { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
table.board th { font-size: 13px; text-transform: uppercase; color: var(--green-dk); text-align: left; padding: 0 8px; }
table.board td { background: #fff; padding: 10px 8px; border-top: 2px solid #eee2cf; border-bottom: 2px solid #eee2cf; font-weight: 700; }
table.board td:first-child { border-left: 2px solid #eee2cf; border-radius: 12px 0 0 12px; text-align: center; width: 48px; font-size: 20px; }
table.board td:last-child { border-right: 2px solid #eee2cf; border-radius: 0 12px 12px 0; }
table.board tr.me td { background: #fff7d6; border-color: var(--gold); }
table.board tr.top1 td { background: linear-gradient(90deg, #fff3b0, #fff); }
.score { font: 900 22px 'Nunito'; color: var(--red); text-align: right; }
.badge { font-size: 12px; padding: 2px 7px; border-radius: 999px; margin-left: 4px; white-space: nowrap; }
.badge.first { background: #ffe6a8; color: #7a4c00; } .badge.fast { background: #d8f0ff; color: #0b4a7a; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; margin: 10px 0 20px; }
.podium > div { text-align: center; width: 30%; max-width: 150px; }
.podium .stand { border-radius: 12px 12px 0 0; color: #fff; font: 900 30px 'Mountains of Christmas', cursive; padding-top: 8px; border: 3px solid var(--gold); border-bottom: 0; }
.podium .p1 .stand { height: 110px; background: linear-gradient(var(--red), var(--red-dk)); }
.podium .p2 .stand { height: 80px; background: linear-gradient(var(--green), var(--green-dk)); }
.podium .p3 .stand { height: 60px; background: linear-gradient(#b07a2a, #6e4610); }
.podium .nm { font-weight: 900; color: #fff; text-shadow: 0 2px 4px #000; margin-bottom: 4px; word-break: break-word; }
.podium .emoji { font-size: 34px; }
.nightpick { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 14px; }
.nightpick button { width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--gold); background: var(--green); color: #fff; font: 900 17px 'Nunito'; cursor: pointer; }
.nightpick button.on { background: var(--red); transform: scale(1.12); }
.nightpick button:disabled { background: #8a9a8f; opacity: .5; cursor: default; }

/* ---------- calendar ---------- */
.advent { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.door { border-radius: 14px; padding: 10px 6px; text-align: center; color: #fff; border: 3px dashed var(--gold); background: var(--green); position: relative; min-height: 86px; }
.door:nth-child(odd) { background: var(--red); }
.door b { font: 900 30px 'Mountains of Christmas', cursive; display: block; }
.door small { font-size: 12px; font-weight: 700; display: block; }
.door.upcoming { filter: saturate(.5) brightness(.85); }
.door.open { box-shadow: 0 0 0 4px #fff, 0 0 26px var(--gold); animation: pulse 1.4s infinite; }
.door .check { position: absolute; top: -10px; right: -8px; font-size: 24px; }

/* ---------- snow drift ---------- */
.drift { position: fixed; left: 0; right: 0; bottom: 0; height: 90px; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 60% 100% at 10% 100%, #fff 60%, transparent 61%), radial-gradient(ellipse 50% 90% at 50% 100%, #f4f9ff 60%, transparent 61%), radial-gradient(ellipse 55% 110% at 90% 100%, #fff 60%, transparent 61%); }
.trees { position: fixed; bottom: 40px; left: 0; right: 0; z-index: 0; pointer-events: none; display: flex; justify-content: space-between; padding: 0 2vw; font-size: 64px; }
.trees span:nth-child(2) { font-size: 44px; margin-top: 20px; } .trees span:nth-child(3) { font-size: 50px; }

.sound { position: fixed; right: 12px; bottom: 12px; z-index: 5; width: 52px; height: 52px; border-radius: 50%; border: 3px solid var(--gold); background: var(--red); font-size: 24px; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,.4); }
.toast { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 10; background: var(--green); color: #fff; padding: 12px 20px; border-radius: 14px; font-weight: 900; border: 3px solid var(--gold); box-shadow: 0 8px 20px rgba(0,0,0,.4); }
#confetti { position: fixed; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; z-index: 9; }
.big-emoji { font-size: 74px; text-align: center; line-height: 1; margin: 4px 0; animation: bounce 1.2s infinite; }
@keyframes bounce { 50% { transform: translateY(-10px) rotate(-5deg); } }
.stat { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin: 14px 0; }
.stat div { background: #fff6d8; border: 3px solid var(--gold); border-radius: 16px; padding: 10px 16px; text-align: center; min-width: 110px; }
.stat b { display: block; font: 900 30px 'Nunito'; color: var(--red); }
footer { text-align: center; color: #cfe3ff; font-size: 13px; margin: 20px 0; position: relative; z-index: 3; }
@media (max-width: 520px) { .qtext { font-size: 20px; } .opt { font-size: 17px; } .countdown div { width: 66px; } .countdown b { font-size: 28px; } .trees { font-size: 44px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; } }
@media (max-width: 520px) { .ornaments { height: 52px; transform: scale(.8); } .lights { height: 44px; } }

/* compact header while answering, so all options fit on laptop screens */
body.quizzing .ornaments, body.quizzing .subtitle { display: none; }
body.quizzing .title { font-size: clamp(28px, 5vw, 40px); margin: 0 0 4px; }
body.quizzing nav.tabs { margin: 4px 0 26px; }
.qnav { align-items: center; }
.kbd-hint { font-size: 12px; text-align: center; flex: 1; }
@media (hover: none), (max-width: 700px) { .kbd-hint { display: none; } }

/* ---------- Thanksgiving warm-up theme ---------- */
body.thanksgiving {
  --red: #c2410c; --red-dk: #7c2d12; --green: #8a5a1f; --green-dk: #4a2f0b; --gold: #fbbf24;
  background: radial-gradient(circle at 20% 10%, rgba(251,191,36,.25), transparent 40%), linear-gradient(180deg, #3b1d0e 0%, #6b2f12 45%, #9a4a16 80%, #b8621b 100%);
  background-attachment: fixed;
}
body.thanksgiving .lights li:nth-child(4n+2) { background: #f97316; box-shadow: 0 4px 24px 4px #f97316; }
body.thanksgiving .lights li:nth-child(4n+4) { background: #fde047; box-shadow: 0 4px 24px 4px #fde047; }
body.thanksgiving .drift { background: radial-gradient(ellipse 60% 100% at 10% 100%, #7c4a1e 60%, transparent 61%), radial-gradient(ellipse 50% 90% at 50% 100%, #92400e 60%, transparent 61%), radial-gradient(ellipse 55% 110% at 90% 100%, #7c4a1e 60%, transparent 61%); }
body.thanksgiving .snowcap { display: none; }
body.thanksgiving .orn span { --c: #ea580c; }
body.thanksgiving .orn:nth-child(even) span { --c: #facc15; }
body.thanksgiving .btn { background: repeating-linear-gradient(45deg, #c2410c 0 16px, #ea580c 16px 32px); background-size: 200% 100%; }
body.thanksgiving .btn.green { background: repeating-linear-gradient(45deg, #8a5a1f 0 16px, #a16207 16px 32px); background-size: 200% 100%; }
nav.tabs[hidden] { display: none; }

/* ---------- music button ---------- */
.music-btn { position: fixed; left: 12px; bottom: 12px; z-index: 6; border: 3px solid var(--gold); background: var(--green); color: #fff; font: 900 15px 'Nunito', sans-serif; padding: 10px 14px; border-radius: 999px; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,.4); }
.music-btn.on { background: var(--red); }
.music-btn.hint { animation: pulse 1.3s ease-in-out infinite; }
@media (max-width: 520px) { .music-btn span { display: none; } .music-btn { width: 52px; height: 52px; padding: 0; font-size: 22px; } }

/* ---------- live leaderboard bits ---------- */
.ticker { background: #fff6d8; border: 2px dashed var(--gold-dk); border-radius: 12px; padding: 8px 12px; margin: 0 0 12px; font-weight: 700; font-size: 14px; }
.ticker div { padding: 2px 0; } .ticker div:first-child { animation: flashin 1.2s ease; }
@keyframes flashin { from { background: #ffe58f; } to { background: transparent; } }
.live-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #ff3b3b; box-shadow: 0 0 8px #ff3b3b; margin-right: 6px; animation: flash 1s infinite alternate; }
table.board tr.new td { animation: flashin 2.5s ease; }
.mv { font-size: 12px; margin-left: 4px; } .mv.up { color: var(--green); } .mv.down { color: var(--red); }

/* "2026 Edition" ribbon under the title */
.title .edition { display: table; margin: 10px auto 2px; font: 900 .36em 'Nunito', sans-serif; letter-spacing: .12em; text-transform: uppercase;
  color: var(--red-dk); background: linear-gradient(180deg, #fff6c9, var(--gold)); -webkit-background-clip: border-box; background-clip: border-box;
  padding: .28em 1.1em; border-radius: 6px; box-shadow: 0 3px 0 var(--gold-dk), 0 6px 14px rgba(0,0,0,.35); -webkit-text-fill-color: var(--red-dk); }
.top .title .edition { margin-left: 0; }

/* ---------- 📸 Photo Bingo ---------- */
.bg-winners { background: #fff6d8; border: 2px dashed var(--gold-dk); border-radius: 12px; padding: 8px; }
.bg-how summary { cursor: pointer; font-weight: 900; color: var(--green-dk); text-align: center; }
.bg-how li { margin: 6px 0; }
.bg-board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; max-width: 520px; margin: 10px auto; }
.bg-cell { position: relative; aspect-ratio: 1; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; background-size: cover; background-position: center; border: 3px solid var(--gold); }
.bg-cell span { font-size: clamp(18px, 6vw, 34px); font-weight: 900; color: #fff; text-shadow: 0 2px 3px rgba(0,0,0,.5); }
.bg-cell small { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.6); color: #fff; font-size: clamp(8px, 2.1vw, 11px); line-height: 1.15; padding: 3px; font-weight: 700; text-align: center; }
.bg-cell.hidden { background: repeating-linear-gradient(45deg, var(--red) 0 10px, #e33a54 10px 20px); box-shadow: inset 0 0 0 4px rgba(255,255,255,.15); }
.bg-cell.hidden::before { content: ''; position: absolute; left: 44%; top: 0; bottom: 0; width: 12%; background: var(--gold); opacity: .9; }
.bg-cell.hidden::after { content: ''; position: absolute; top: 44%; left: 0; right: 0; height: 12%; background: var(--gold); opacity: .9; }
.bg-cell.hidden span { position: relative; z-index: 1; }
.bg-cell.free { background: radial-gradient(circle, #fff6c9, var(--gold)); }
.bg-cell.free small { position: static; background: none; color: var(--red-dk); font-size: 11px; font-weight: 900; }
.bg-cell.pending { filter: grayscale(.4) brightness(.8); border-style: dashed; }
.bg-cell.photo { cursor: zoom-in; border-color: var(--green); box-shadow: 0 0 0 2px #fff inset; animation: flip .6s ease; }
@keyframes flip { from { transform: rotateY(90deg); } to { transform: none; } }
.bg-filters { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 6px 0 12px; }
.bg-filters button { font: 800 13px 'Nunito', sans-serif; border: 2px solid var(--green); background: #fff; color: var(--green-dk); padding: 6px 10px; border-radius: 999px; cursor: pointer; }
.bg-filters button.on { background: var(--green); color: #fff; }
.bg-prompts { display: grid; gap: 8px; }
.bg-prompt { display: flex; align-items: center; gap: 10px; background: #fff; border: 2px solid #eee2cf; border-radius: 12px; padding: 8px 10px; }
.bg-prompt img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; }
.bg-prompt .txt { flex: 1; font-size: 16px; }
.bg-prompt .st { font-size: 13px; color: #7a6a60; margin-top: 2px; }
.bg-prompt.pending, .bg-prompt.approved { border-color: var(--green); background: #f1fbf3; }
.bg-prompt.offboard { opacity: .7; }
.bg-prompt.rejected { border-color: var(--red); background: #fff3f4; }
.bg-recent { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.bg-find { flex: 0 0 120px; cursor: zoom-in; text-align: center; font-size: 13px; }
.bg-find div { width: 120px; height: 120px; border-radius: 12px; background-size: cover; background-position: center; border: 3px solid var(--gold); }
.bg-find b, .bg-find small { display: block; } .bg-find small { color: #7a6a60; line-height: 1.2; }
.bg-family { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.bg-fam { text-align: center; cursor: pointer; background: #fff; border: 2px solid #eee2cf; border-radius: 12px; padding: 8px; }
.bg-fam.me { border-color: var(--gold); background: #fff7d6; }
.bg-fam b, .bg-fam small { display: block; } .bg-fam small { color: #7a6a60; }
.bg-mini { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; margin-bottom: 6px; }
.bg-mini .bg-cell { border-width: 1px; border-radius: 3px; }
.bg-mini .bg-cell span { font-size: 9px; }
.bg-mini .bg-cell.hidden::before, .bg-mini .bg-cell.hidden::after { display: none; }
.bg-modal { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 20; background: rgba(5,15,35,.75); display: flex; align-items: center; justify-content: center; padding: 14px; }
.bg-sheet { background: var(--snow); border: 6px solid var(--gold); border-radius: 18px; padding: 18px; max-width: 560px; width: 100%; max-height: 92vh; overflow: auto; }
.bg-sheet h2 { font-family: 'Mountains of Christmas', cursive; color: var(--red); text-align: center; margin: 4px 0 8px; font-size: 30px; }
.bg-big { display: block; max-width: 100%; max-height: 60vh; margin: 8px auto; border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.3); }

/* ---------- 🎁🎁🪨 Two Gifts & a Lump of Coal ---------- */
.card .bow.gc-bow { font-size: 30px; top: -24px; white-space: nowrap; }
.card.gc-star { background-image: linear-gradient(var(--snow), var(--snow)), repeating-linear-gradient(45deg, var(--gold-dk) 0 14px, #fff 14px 28px); }
.card.gc-nudge { box-shadow: 0 14px 40px rgba(0,0,0,.45), 0 0 0 3px var(--gold) inset, 0 0 0 5px var(--gold); }
.gc-name { font-size: 50px !important; margin: 2px 0 4px !important; }
.gc-items { display: grid; gap: 10px; margin: 12px 0; }
.gc-item { display: block; width: 100%; text-align: left; font: 700 18px/1.35 'Nunito', sans-serif; color: var(--ink); padding: 14px 16px 14px 60px; border-radius: 16px; border: 3px solid #e3d6c2; background: #fff; position: relative; }
.gc-item .n { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; background: var(--green); color: #fff; font-weight: 900; display: grid; place-items: center; font-size: 18px; }
.gc-item.pick { cursor: pointer; transition: .15s; -webkit-tap-highlight-color: transparent; }
.gc-item.pick:hover:not(:disabled) { border-color: var(--gold); transform: translateX(3px); }
.gc-item.pick:disabled { cursor: default; color: var(--ink); opacity: .75; }
.gc-item.sel, .gc-item.sel:disabled { opacity: 1; border-color: #2b2b2b; background: #f3f0ea; box-shadow: 0 0 0 3px var(--gold); }
.gc-item.sel .n { background: #2b2b2b; }
.gc-item.gift { border-color: var(--green); background: #e5f8ea; }
.gc-item.coal { border-color: #111; background: linear-gradient(#444, #1d1d1d); color: #fff; }
.gc-item.gift .n, .gc-item.coal .n { background: none; font-size: 28px; }
.gc-item.mine { box-shadow: 0 0 0 3px var(--gold); }
.gc-item small { display: block; font-size: 12px; font-weight: 900; opacity: .8; margin-top: 4px; letter-spacing: .3px; }
.gc-you { display: block; font-size: 13px; margin-top: 4px; color: var(--red); }
.gc-mine div { background: #fff; border: 2px solid var(--green); border-radius: 12px; padding: 10px 12px 10px 46px; position: relative; margin: 8px 0; font-weight: 700; }
.gc-mine span { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 24px; }
.gc-mine .coal { background: #2b2b2b; color: #fff; border-color: #111; }
.gc-form textarea { min-height: 0; resize: vertical; font-size: 17px; }
.gc-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.gc-chips span { background: #fff; border: 2px solid var(--green); color: var(--green-dk); border-radius: 999px; padding: 4px 11px; font-weight: 800; font-size: 14px; }
.gc-reveal + .gc-reveal, details .gc-reveal { border-top: 2px dashed #e3d6c2; margin-top: 14px; padding-top: 8px; }
.gc-mini .big-emoji { font-size: 54px; }

/* ---------- 📲 install as an app ---------- */
.app-steps { max-width: 420px; margin: 8px auto; font-size: 17px; line-height: 1.5; }
.app-steps li { margin: 6px 0; }
.app-key { display: inline-block; background: #fff; border: 2px solid #ccc; border-radius: 8px; padding: 0 6px; }
@media (display-mode: standalone) { body { padding-top: env(safe-area-inset-top); } }

/* ---------- 📱 bottom tab bar (phones) + home buttons ---------- */
.bottom-nav { display: none; }
.home-pill { display: none; }
@media (max-width: 760px), (display-mode: standalone) { .home-pill { display: inline-block; } }
.home-pill { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 7; text-decoration: none; background: var(--green); color: #fff; border: 3px solid var(--gold); border-radius: 999px; padding: 10px 18px; font: 900 15px 'Nunito', sans-serif; box-shadow: 0 4px 10px rgba(0,0,0,.4); }
@media (max-width: 760px) {
  body.has-bnav nav.tabs { display: none; }
  body.has-bnav .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; justify-content: space-around; padding: 6px 2px calc(6px + env(safe-area-inset-bottom));
    background: linear-gradient(#13325e, #0b1d3a); border-top: 3px solid var(--gold); box-shadow: 0 -6px 18px rgba(0,0,0,.35); }
  .bottom-nav button { flex: 1; min-width: 0; background: none; border: 0; color: #cfe3ff; font: 800 11.5px 'Nunito', sans-serif; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 3px 0; position: relative; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .bottom-nav button span { font-size: 24px; line-height: 1.1; transition: transform .15s; }
  .bottom-nav button.on { color: var(--gold); } .bottom-nav button.on span { transform: scale(1.18); }
  .bottom-nav .dot { position: absolute; top: 1px; left: calc(50% + 8px); width: 11px; height: 11px; background: #ff3b4f; border-radius: 50%; border: 2px solid #0b1d3a; }
  body.has-bnav .music-btn, body.has-bnav .sound { bottom: calc(78px + env(safe-area-inset-bottom)); }
  body.has-bnav .trees { bottom: calc(110px + env(safe-area-inset-bottom)); opacity: .6; }
  body.has-bnav { padding-bottom: calc(170px + env(safe-area-inset-bottom)); }
  body.has-bnav.quizzing .bottom-nav { display: none; }
  body.has-bnav.quizzing .music-btn, body.has-bnav.quizzing .sound { bottom: 12px; }
}
.more-list { display: grid; gap: 10px; margin: 8px 0; }
.more-list button { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: 800 18px 'Nunito', sans-serif; padding: 14px 16px; border-radius: 14px; border: 3px solid var(--gold); background: #fff; color: var(--ink); cursor: pointer; }
.more-list button span { font-size: 26px; }

/* ---------- the Glancy Seal logo ---------- */
.ornaments { align-items: flex-start; height: auto; min-height: 70px; }
.hero-logo { width: 112px; height: 112px; margin: 0 6px; filter: drop-shadow(0 6px 12px rgba(0,0,0,.55)); animation: sealbob 4s ease-in-out infinite; }
@keyframes sealbob { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(5px) rotate(2deg); } }
@media (max-width: 520px) { .hero-logo { width: 96px; height: 96px; } .ornaments { gap: 14px; } }

@media (max-width: 760px) { body:has(.home-pill) { padding-bottom: 170px; } }

/* ---------- 🎉 first-visit welcome ---------- */
.welcome { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 24px;
  background: radial-gradient(circle at 50% 30%, #2a6295, #13325e 50%, #0b1d3a); color: #fff; transition: opacity .5s; }
.welcome.bye { opacity: 0; pointer-events: none; }
.welcome-logo { width: 170px; height: 170px; filter: drop-shadow(0 10px 18px rgba(0,0,0,.6)); animation: sealbob 3s ease-in-out infinite; }
.welcome h1 { font-family: 'Mountains of Christmas', cursive; color: var(--gold); font-size: 52px; margin: 6px 0 0; text-shadow: 0 3px 0 var(--red-dk); }
.welcome p { font-size: 19px; line-height: 1.4; margin: 4px 0 18px; }
.welcome .welcome-sound { font-size: 15px; color: #cfe3ff; margin-top: 16px; }

/* 💬 Family Feed */
.fd-compose textarea { width: 100%; font: 600 17px 'Nunito', sans-serif; padding: 12px; border: 3px solid var(--gold); border-radius: 14px; resize: vertical; min-height: 66px; background: #fff; color: var(--ink); }
.fd-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; }
.fd-count { font-size: 13px; color: #7a6a60; } .fd-count.low { color: var(--red); font-weight: 800; }
.fd-shield { background: #fff6d8; border: 2px solid #e8c96a; border-radius: 12px; padding: 10px 12px; margin: 0 0 10px; font-size: 15px; line-height: 1.4; }
.fd-shield.ok { background: #eaf7ee; border-color: #8fd1a5; }
.fd-shield .btn { margin-top: 6px; }
.fd-post { padding: 14px; }
.fd-post.auto { border-color: var(--gold); background: linear-gradient(#fffdf2, #fff6d2); }
.fd-post.fresh { outline: 3px solid #ff3b4f66; outline-offset: 2px; }
.fd-head { display: flex; align-items: center; gap: 10px; }
.fd-av { width: 38px; height: 38px; border-radius: 50%; color: #fff; display: inline-flex; align-items: center; justify-content: center; font: 900 18px 'Nunito', sans-serif; flex: none; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.fd-av.host { background: #fff; font-size: 21px; }
.fd-icon { font-size: 30px; width: 38px; text-align: center; flex: none; line-height: 1; }
.fd-who { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; flex: 1; }
.fd-who b { color: var(--ink); }
.fd-who small, .fd-c small { color: #7a6a60; font-size: 12.5px; }
.fd-badge { display: inline-block; background: var(--red); color: #fff; font: 900 11px 'Nunito', sans-serif; border-radius: 6px; padding: 1px 6px; margin-left: 6px; vertical-align: 2px; }
.fd-new { background: #ff3b4f; color: #fff; font: 900 11px 'Nunito', sans-serif; border-radius: 6px; padding: 2px 7px; }
.fd-del { background: none; border: 0; font: 800 15px 'Nunito', sans-serif; cursor: pointer; color: var(--red-dk); padding: 4px; }
.fd-body { font-size: 17px; line-height: 1.45; margin: 10px 2px; overflow-wrap: anywhere; color: var(--ink); }
.fd-post.auto .fd-body { font-weight: 800; font-size: 18px; }
.fd-photo { display: block; width: 100%; max-height: 360px; object-fit: cover; border-radius: 12px; margin: 6px 0 4px; cursor: zoom-in; background: #000; }
.fd-reacts { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 2px; }
.fd-r { border: 2px solid #e6dccd; background: #fff; border-radius: 999px; padding: 4px 10px; font-size: 17px; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; -webkit-tap-highlight-color: transparent; }
.fd-r span { font: 800 14px 'Nunito', sans-serif; color: var(--ink); }
.fd-r.mine { border-color: var(--green); background: #eaf7ee; }
.fd-comments { margin-top: 6px; }
.fd-allc { font-size: 14px; margin: 2px 0 4px; }
.fd-c { display: flex; gap: 8px; align-items: flex-start; padding: 7px 0; border-top: 1px dashed #eadfcf; font-size: 15px; line-height: 1.35; color: var(--ink); overflow-wrap: anywhere; }
.fd-c .fd-av { width: 28px; height: 28px; font-size: 13px; border-width: 1px; }
.fd-c small { display: block; }
.fd-c .linkbtn { font-size: 12.5px; }
.fd-locked { color: #7a6a60; font-style: italic; }
.fd-cform { display: flex; gap: 6px; margin-top: 8px; }
.fd-cin { flex: 1; min-width: 0; font: 600 15px 'Nunito', sans-serif; padding: 9px 12px; border: 2px solid #e6dccd; border-radius: 999px; background: #fff; }
.fd-cform .btn { padding: 6px 14px; }
.fd-nudge { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.fd-nudge > span { font-size: 30px; } .fd-nudge > div { flex: 1; }
nav.tabs button { position: relative; }
nav.tabs .dot { position: absolute; top: -3px; right: -3px; width: 13px; height: 13px; background: #ff3b4f; border-radius: 50%; border: 2px solid #fff; }
@media (max-width: 400px) { .bottom-nav button { font-size: 10.5px; } }
