/* A Manitowoc Christmas Lights Walk — festive, warm, no AI-template look.
   Deep Christmas green, classic red, gold, cream paper, snow. */

:root {
  --green-deep: #0b3524;
  --green: #14532d;
  --green-soft: #1d6b41;
  --cream: #fdf6dd;
  --cream-dark: #f3e8c3;
  --red: #b42318;
  --red-deep: #8f1d13;
  --gold: #d9a441;
  --gold-light: #f2c94c;
  --ink: #22301f;
  --blue-team: #1d4ed8;
  --green-team: #15803d;
  --red-team: #b91c1c;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--green-deep);
  color: var(--cream);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

/* Gentle falling snow — a few flakes, slow, low-key so it stays readable */
.snow { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.snow span {
  position: absolute; top: -2rem; color: #fff; opacity: .55;
  font-size: 1rem; animation: snowfall 14s linear infinite;
}
.snow span:nth-child(1) { left: 8%;  animation-delay: 0s;  font-size: .9rem; }
.snow span:nth-child(2) { left: 26%; animation-delay: 3s;  font-size: 1.3rem; }
.snow span:nth-child(3) { left: 44%; animation-delay: 7s;  font-size: .8rem; }
.snow span:nth-child(4) { left: 62%; animation-delay: 1.5s; font-size: 1.1rem; }
.snow span:nth-child(5) { left: 79%; animation-delay: 5s;  font-size: .9rem; }
.snow span:nth-child(6) { left: 93%; animation-delay: 9s;  font-size: 1.2rem; }
@keyframes snowfall {
  0% { transform: translateY(-2rem) rotate(0deg); }
  100% { transform: translateY(105vh) rotate(320deg); }
}
@media (prefers-reduced-motion: reduce) {
  .snow span, .bulb { animation: none !important; }
}

header, main, footer { position: relative; z-index: 1; }

/* ---- String lights across the top ---- */
.string-lights {
  display: flex; justify-content: space-around;
  padding: .4rem .6rem 1.1rem;
  background: #07271a;
  border-bottom: 3px solid #052015;
}
.string-lights .bulb {
  width: .85rem; height: 1.15rem; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  margin-top: .35rem; opacity: .95;
  box-shadow: 0 0 10px 2px currentColor;
  animation: twinkle 1.6s ease-in-out infinite;
}
.bulb.red   { background: #ff5a4e; color: #ff5a4e; }
.bulb.gold  { background: var(--gold-light); color: var(--gold-light); }
.bulb.green { background: #7ee2a0; color: #7ee2a0; }
.bulb.white { background: #fff8dc; color: #fff8dc; }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ---- Hero ---- */
.hero { text-align: center; padding: 1.2rem 1rem 0; }
.kicker { margin: .2rem 0; letter-spacing: .12em; text-transform: uppercase; font-size: .8rem; color: var(--gold-light); font-weight: 700; }
h1 {
  font-family: "Mountains of Christmas", "Comic Sans MS", cursive, serif;
  font-size: 2.9rem; line-height: 1.05; margin: .3rem 0 .4rem;
  color: var(--gold-light);
  text-shadow: 0 2px 0 var(--red-deep), 0 4px 14px rgba(0,0,0,.45);
}
.sub { margin: .2rem 0; font-size: 1.02rem; color: #e8f5e9; }
.tagline { margin: .4rem 0 1rem; font-weight: 700; color: #fff; font-size: 1.08rem; }
.hero-photo, .stop-photo { margin: 0 auto 1.2rem; max-width: 34rem; }
.hero-photo img, .stop-photo img {
  width: 100%; height: auto; display: block;
  border: 6px solid var(--gold); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.hero-photo img { max-height: 26rem; object-fit: cover; object-position: center 30%; }
figcaption {
  font-size: .82rem; color: #cfe3d4; margin-top: .45rem; line-height: 1.4;
}

/* ---- Layout ---- */
main { max-width: 46rem; margin: 0 auto; padding: 0 1rem 2rem; }
.card {
  background: var(--cream); color: var(--ink);
  border: 3px solid var(--gold); border-radius: 16px;
  padding: 1.1rem 1.1rem 1.2rem; margin: 1rem 0;
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
}
.card h2, .hunt h2 {
  font-family: "Mountains of Christmas", Georgia, serif;
  font-size: 1.9rem; margin: 0 0 .5rem; color: var(--red);
}
.card h3 { color: var(--green); margin: .9rem 0 .25rem; font-size: 1.12rem; }
.card p { margin: .45rem 0; }
.note { font-size: .95rem; background: #fff8e1; border-left: 4px solid var(--gold); padding: .5rem .7rem; border-radius: 0 8px 8px 0; }
.error { color: var(--red); font-weight: 700; }

/* ---- Scoreboard ---- */
.scoreboard {
  background: var(--red); color: #fff;
  border: 3px solid var(--gold); border-radius: 16px;
  padding: .9rem 1rem 1rem; margin: 1rem 0;
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
  position: sticky; top: .5rem; z-index: 5;
}
.scoreboard h2 {
  font-family: "Mountains of Christmas", Georgia, serif;
  font-size: 1.7rem; margin: 0 0 .6rem; text-align: center; color: #fff;
}
.scoreboard .teams { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.score-team {
  background: rgba(255,255,255,.14); border: 2px solid rgba(255,255,255,.35);
  border-radius: 12px; padding: .55rem .4rem; text-align: center;
}
.score-team.leading { background: var(--gold); color: var(--green-deep); border-color: #fff2b0; }
.score-team .t-name { font-weight: 800; font-size: .95rem; display: block; }
.score-team .t-points { font-size: 1.7rem; font-weight: 900; line-height: 1.1; display: block; }
.score-team .t-points small { font-size: .85rem; font-weight: 700; }
.score-team .t-found { font-size: .8rem; opacity: .95; display: block; }
.score-team .bar { height: .45rem; background: rgba(0,0,0,.25); border-radius: 99px; margin-top: .35rem; overflow: hidden; }
.score-team .bar i { display: block; height: 100%; background: #fff; border-radius: 99px; }
.score-team.leading .bar i { background: var(--green-deep); }
.score-team .t-tag { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.updated { text-align: center; font-size: .8rem; margin: .55rem 0 0; opacity: .9; }
.updated .dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: #7ee2a0; margin-right: .3rem; }
.updated.offline .dot { background: #ffb4ab; }

/* ---- Team pick / PIN ---- */
.team-pick { display: grid; gap: .7rem; margin-top: .8rem; }
.team-btn {
  display: flex; align-items: center; gap: .8rem; width: 100%;
  font-size: 1.15rem; font-weight: 800; text-align: left;
  padding: .9rem 1rem; border-radius: 14px; cursor: pointer;
  border: 3px solid; background: #fff;
}
.team-btn .swatch { width: 1.6rem; height: 1.6rem; border-radius: 50%; flex: none; border: 2px solid rgba(0,0,0,.2); }
.team-btn small { display: block; font-weight: 600; font-size: .85rem; opacity: .75; }
.team-btn.blue  { color: var(--blue-team);  border-color: var(--blue-team); }
.team-btn.green { color: var(--green-team); border-color: var(--green-team); }
.team-btn.red   { color: var(--red-team);   border-color: var(--red-team); }
.team-btn.blue .swatch  { background: var(--blue-team); }
.team-btn.green .swatch { background: var(--green-team); }
.team-btn.red .swatch   { background: var(--red-team); }
.pin-form { margin-top: 1rem; border-top: 2px dashed var(--gold); padding-top: .9rem; }
.pin-form label { display: block; font-weight: 700; margin: .6rem 0 .25rem; }
.pin-form input {
  font-size: 1.6rem; letter-spacing: .5em; text-align: center;
  width: 100%; max-width: 16rem; padding: .55rem .6rem;
  border: 3px solid var(--green); border-radius: 12px; background: #fff; color: var(--ink);
}

/* ---- Buttons ---- */
.btn {
  font: inherit; font-weight: 800; cursor: pointer;
  border-radius: 12px; padding: .7rem 1.1rem; border: 3px solid var(--red-deep);
  background: var(--red); color: #fff;
}
.btn-big { width: 100%; font-size: 1.15rem; margin-top: .8rem; }
.btn-quiet { background: transparent; color: var(--green); border-color: var(--green); font-size: .9rem; padding: .45rem .8rem; }
.btn:disabled { opacity: .55; cursor: wait; }

/* ---- You are ---- */
.you-are { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.you-are p { margin: 0; font-weight: 700; font-size: 1.05rem; }

/* ---- Route ---- */
.stops { list-style: none; padding: 0; margin: .5rem 0 0; counter-reset: stop; }
.stops > li {
  border: 2px solid var(--green); border-radius: 14px; background: #fffdf4;
  padding: .9rem 1rem; margin-bottom: .8rem;
}
.stops > li h3 { margin-top: 0; }
.stop-kind { font-size: .8rem; background: var(--green); color: #fff; border-radius: 99px; padding: .15rem .6rem; white-space: nowrap; }
.stop-meta { font-size: .9rem; font-style: italic; color: #4c6448; }
.map-link { font-weight: 800; color: var(--blue-team); }

/* ---- Hunt items ---- */
.hunt { margin: 1.4rem 0; }
.hunt > h2, .hunt > p { color: var(--cream); }
.hunt h2 { text-shadow: 0 2px 0 rgba(0,0,0,.35); }
.hunt-section { margin-bottom: 1.1rem; }
.hunt-section > h3 {
  font-family: "Mountains of Christmas", Georgia, serif;
  font-size: 1.6rem; color: var(--gold-light); margin: .4rem 0 .55rem;
}
.hunt-section > h3 small { font-family: inherit; font-size: 1rem; color: #cfe3d4; }
.item {
  background: var(--cream); color: var(--ink);
  border: 3px solid var(--gold); border-radius: 14px;
  padding: .8rem .9rem; margin-bottom: .6rem;
}
.item.found { border-color: var(--green-soft); background: #e9f7ee; }
.item-text { font-weight: 700; font-size: 1.02rem; }
.item-text .star { color: var(--gold); }
.item-dots { font-size: .82rem; color: #5a6b57; margin-top: .25rem; }
.item-dots .d { font-weight: 800; }
.item-dots .d.blue { color: var(--blue-team); }
.item-dots .d.green { color: var(--green-team); }
.item-dots .d.red { color: var(--red-team); }
.item-actions { display: flex; gap: .55rem; margin-top: .6rem; flex-wrap: wrap; }
.found-btn {
  flex: 1 1 10rem; font-size: 1.05rem; padding: .7rem .8rem;
  border-radius: 12px; border: 3px solid var(--red-deep);
  background: var(--red); color: #fff; font-weight: 800; cursor: pointer;
}
.found-btn[aria-pressed="true"] {
  background: var(--green-soft); border-color: var(--green); color: #fff;
}
.photo-btn {
  font-size: .95rem; padding: .7rem .8rem; border-radius: 12px;
  border: 3px solid var(--gold); background: #fff8e1; color: #7a5b00;
  font-weight: 800; cursor: pointer;
}
.photo-btn[aria-pressed="true"] { background: var(--gold); color: #fff; border-color: #a87b1f; }
.photo-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---- Rules / final ---- */
.rules ul { margin: .4rem 0; padding-left: 1.2rem; }
.rules li { margin: .35rem 0; }
.final-scores {
  background: var(--green-deep); color: #fff; border-radius: 12px;
  padding: .9rem 1rem; white-space: pre-wrap; font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: .95rem; line-height: 1.55; margin: .6rem 0;
}
.copied { color: var(--green-soft); font-weight: 800; }

/* ---- Footer ---- */
footer { max-width: 46rem; margin: 0 auto; padding: 0 1rem 2.5rem; text-align: center; }
footer p { margin: .5rem 0; }
.credits { font-size: .82rem; color: #bcd8c2; line-height: 1.5; }
.credits a { color: var(--gold-light); }

/* Hidden game-master reset (footer tree) */
#resetTree { user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.reset-form { margin: 0.75rem auto 0; max-width: 22rem; border-top: 2px dashed var(--gold); padding-top: .9rem; }
.reset-form label { display: block; font-weight: 700; margin: .2rem 0 .25rem; }
.reset-form input { width: 8rem; text-align: center; font-size: 1.1rem; letter-spacing: .35em; padding: .45rem .5rem; border-radius: .5rem; border: 2px solid var(--gold); background: #fff; color: #222; }
.reset-form .btn { margin-top: .6rem; }
.reset-done { color: #bcd8c2; font-weight: 700; }

@media (min-width: 40rem) {
  h1 { font-size: 3.6rem; }
  .team-pick { grid-template-columns: repeat(3, 1fr); }
  .team-btn { flex-direction: column; text-align: center; gap: .4rem; }
}
