/* Light Up Linton */
:root {
  --night: #10221c;
  --night-2: #17302a;
  --pine: #1f4a36;
  --cran: #a3192f;
  --cran-d: #7c1022;
  --gold: #e7b53c;
  --gold-d: #b8871a;
  --cream: #f4ebd4;
  --cream-2: #eadfc2;
  --ink: #1b1511;
  --muted: #6b5d4c;
  --sign: #0b6b3a;

  --b-red: #ec3b2f;
  --b-green: #36b25e;
  --b-blue: #3b74e6;
  --b-orange: #f58b1f;
  --b-yellow: #f7d23a;

  --display: "Fraunces", Georgia, serif;
  --mono: "Courier Prime", "Courier New", monospace;
  --hard: 4px 4px 0 var(--ink);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--night);
  background-image:
    radial-gradient(1px 1px at 12% 18%, #ffffff55 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 9%, #ffffff44 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 38% 64%, #ffffff33 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 42%, #ffffff44 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 88%, #ffffff33 50%, transparent 51%);
  background-size: 420px 380px;
  color: var(--cream);
  font-family: var(--display);
  font-variation-settings: "SOFT" 50;
  font-size: 17px;
  line-height: 1.5;
}
a { color: inherit; }
button { font: inherit; cursor: pointer; }
b { font-weight: 700; }

/* ---------- header ---------- */
.top { position: relative; padding: 56px 16px 28px; overflow: hidden; }
.strand { position: absolute; top: 0; left: 0; width: 100%; height: 70px; overflow: visible; }
.strand .wire { fill: none; stroke: #0a1410; stroke-width: 2.2; }
.strand .bulb { transform-box: fill-box; transform-origin: 50% 0; }
.strand .glass { filter: url(#glow); }
.strand .tw { animation: twinkle var(--d, 2.6s) ease-in-out var(--delay, 0s) infinite; }
@keyframes twinkle { 0%, 100% { opacity: 1; } 45% { opacity: .35; } 55% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .strand .tw { animation: none; } }

.top-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; gap: 24px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap;
}
.kicker {
  margin: 0 0 6px; font-family: var(--mono); font-size: 13px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--gold);
}
h1 {
  margin: 0; font-weight: 900; font-variation-settings: "SOFT" 100, "opsz" 144;
  font-size: clamp(46px, 9vw, 104px); line-height: .9; letter-spacing: -.02em;
  color: var(--cream);
  text-shadow: 3px 3px 0 var(--cran), 6px 6px 0 #0a1410;
}
h1 em { font-style: italic; color: var(--gold); font-weight: 800; }
.dek { max-width: 34em; margin: 14px 0 0; color: #e6dcc2; font-size: 18px; }

.acct { margin-left: auto; }
.acct .who {
  font-family: var(--mono); font-size: 14px; text-align: right; color: #cfc4a8;
}
.acct .who strong { color: var(--cream); font-family: var(--display); font-size: 18px; display: block; }
.acct .who button { background: none; border: 0; color: var(--gold); text-decoration: underline; padding: 0; font-family: var(--mono); font-size: 13px; }

/* knit sweater band */
.knit {
  height: 34px;
  background-color: var(--cran);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='34' shape-rendering='crispEdges'%3E%3Crect width='28' height='4' fill='%23f4ebd4'/%3E%3Crect y='30' width='28' height='4' fill='%23f4ebd4'/%3E%3Cg fill='%23f4ebd4'%3E%3Crect x='12' y='9' width='4' height='4'/%3E%3Crect x='8' y='13' width='4' height='4'/%3E%3Crect x='16' y='13' width='4' height='4'/%3E%3Crect x='4' y='17' width='4' height='4'/%3E%3Crect x='20' y='17' width='4' height='4'/%3E%3Crect x='12' y='17' width='4' height='4' fill='%231f4a36'/%3E%3Crect x='8' y='21' width='4' height='4'/%3E%3Crect x='16' y='21' width='4' height='4'/%3E%3Crect x='12' y='25' width='4' height='1'/%3E%3C/g%3E%3Cg fill='%231f4a36'%3E%3Crect x='0' y='6' width='2' height='2'/%3E%3Crect x='26' y='6' width='2' height='2'/%3E%3Crect x='0' y='26' width='2' height='2'/%3E%3Crect x='26' y='26' width='2' height='2'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat-x;
  border-top: 3px solid var(--pine);
  border-bottom: 3px solid var(--pine);
}

/* ---------- main grid ---------- */
main {
  max-width: 1200px; margin: 0 auto; padding: 28px 16px 40px;
  display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px;
  grid-template-areas: "stage side" "how how" "contest contest";
}
.stage { grid-area: stage; min-width: 0; }
.side { grid-area: side; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.how { grid-area: how; }
.contest { grid-area: contest; }
@media (max-width: 900px) {
  main { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage" "side" "how" "contest"; }
}

.mapcard {
  position: relative; border: 3px solid var(--ink); box-shadow: 6px 6px 0 #050b09;
  background: #0b1714;
}
#map { height: min(68vh, 640px); min-height: 380px; background: #0b1714; }
@media (max-width: 600px) { #map { height: 60vh; min-height: 340px; } }

.legend {
  position: absolute; left: 10px; bottom: 10px; z-index: 500; margin: 0; padding: 7px 10px;
  list-style: none; display: flex; gap: 12px; flex-wrap: wrap;
  background: var(--cream); color: var(--ink); border: 2px solid var(--ink);
  font-family: var(--mono); font-size: 12px; box-shadow: 3px 3px 0 var(--ink);
}
.legend li { display: flex; align-items: center; gap: 5px; }
.k { display: inline-block; width: 12px; height: 12px; }
.k-elf { width: 9px; height: 13px; border-radius: 50% 50% 45% 45% / 60% 60% 40% 40%; background: var(--b-red); transform: rotate(180deg); box-shadow: 0 0 6px var(--b-red); }
.k-nice { background: var(--gold); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.k-win { border-radius: 50%; background: var(--cran); border: 2px solid var(--gold); }

.doers { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.doers .btn { flex: 1 1 200px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 20px; border: 3px solid var(--ink); border-radius: 0;
  font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: .01em;
  box-shadow: var(--hard); transition: transform .08s, box-shadow .08s;
  text-decoration: none;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.btn-red { background: var(--cran); color: var(--cream); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-ink { background: var(--ink); color: var(--cream); border-color: var(--ink); box-shadow: 4px 4px 0 var(--cran); }
.btn-ink:hover { box-shadow: 5px 5px 0 var(--cran); }
.btn-cream { background: var(--cream); color: var(--ink); }
.btn-sm { padding: 8px 12px; font-size: 15px; box-shadow: 3px 3px 0 var(--ink); }
.btn .plus { font-size: 24px; line-height: 0; margin-top: -2px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- paper ---------- */
.paper, .bag, .board, .coupon, dialog {
  background-color: var(--cream);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .22 0 0 0 0 .1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--ink);
}

/* bag of flakes */
.bag { border: 3px solid var(--ink); box-shadow: 6px 6px 0 #050b09; padding: 16px 18px 18px; position: relative; }
.bag h2 { margin: 0; font-size: 22px; font-weight: 900; font-variation-settings: "SOFT" 100; }
.bag .sub { margin: 2px 0 12px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.flakes { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; margin: 0 0 12px; }
.flakes svg { width: 100%; height: auto; display: block; }
.flakes .on { color: var(--b-blue); }
.flakes .off { color: #c9bc9b; }
.bag .cta { display: flex; gap: 10px; flex-wrap: wrap; }
.bag .cta .btn { flex: 1; }
.bag .closed { font-family: var(--mono); font-size: 13px; background: var(--ink); color: var(--cream); padding: 6px 8px; margin: 0 0 10px; }

/* board */
.board { border: 3px solid var(--ink); box-shadow: 6px 6px 0 #050b09; }
.board-head { padding: 14px 16px 0; border-bottom: 2px dashed #b9aa86; }
.board h2 { margin: 0 0 8px; font-size: 22px; font-weight: 900; font-variation-settings: "SOFT" 100; }
.tabs { display: flex; gap: 0; }
.tabs button {
  border: 2px solid var(--ink); border-bottom: 0; background: var(--cream-2); color: var(--muted);
  padding: 6px 12px; font-family: var(--mono); font-size: 13px; margin-right: -2px;
}
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--cream); }
.rows { list-style: none; margin: 0; padding: 4px 0; max-height: 420px; overflow-y: auto; }
.rows li button {
  width: 100%; display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center;
  padding: 9px 16px; background: none; border: 0; text-align: left; color: var(--ink);
  border-bottom: 1px solid #ddd0ae;
}
.rows li button:hover { background: #efe3c6; }
.rows .rk { font-family: var(--mono); font-weight: 700; color: var(--muted); }
.rows .ad { font-weight: 700; line-height: 1.2; }
.rows .ad small { display: block; font-family: var(--mono); font-weight: 400; font-size: 12px; color: var(--muted); }
.rows .ct { font-family: var(--mono); font-weight: 700; display: flex; align-items: center; gap: 4px; color: var(--b-blue); }
.rows .ct svg { width: 15px; height: 15px; }
.rows .empty { padding: 18px 16px; font-family: var(--mono); font-size: 14px; color: var(--muted); }
.ribbon { color: var(--cran); font-weight: 700; }

/* how */
.sect {
  font-size: clamp(30px, 4vw, 42px); font-weight: 900; margin: 18px 0 14px;
  font-variation-settings: "SOFT" 100; color: var(--cream);
}
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 2px solid #3a5b4c; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.steps li { padding: 18px 20px 6px 0; border-bottom: 2px solid #3a5b4c; }
.steps li + li { padding-left: 20px; border-left: 2px solid #3a5b4c; }
@media (max-width: 760px) { .steps li + li { padding-left: 0; border-left: 0; } }
.steps .n {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--gold); color: var(--ink); font-family: var(--mono); font-weight: 700;
}
.steps h3 { margin: 10px 0 4px; font-size: 22px; font-weight: 800; }
.steps p { margin: 0 0 12px; color: #dcd2b6; }

/* contest coupon */
.contest { margin-top: 18px; }
.coupon {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 0;
  border: 3px dashed var(--ink); outline: 3px solid var(--cream); outline-offset: 5px;
  margin: 8px;
}
@media (max-width: 760px) { .coupon { grid-template-columns: 1fr; } }
.coupon-l { padding: 26px 26px 28px; border-right: 3px dashed var(--ink); }
@media (max-width: 760px) { .coupon-l { border-right: 0; border-bottom: 3px dashed var(--ink); } }
.coupon h2 { margin: 6px 0 10px; font-size: clamp(34px, 5vw, 52px); line-height: .95; font-weight: 900; font-variation-settings: "SOFT" 100; color: var(--cran); }
.stamp {
  display: inline-block; margin: 0; padding: 3px 9px; border: 2px solid var(--cran); color: var(--cran);
  font-family: var(--mono); font-weight: 700; font-size: 13px; letter-spacing: .12em; text-transform: uppercase;
  transform: rotate(-3deg);
}
.fee { font-family: var(--mono); font-size: 14px; color: var(--muted); }
.fee:empty { display: none; }
.classes { list-style: none; margin: 0; padding: 14px 26px 22px; }
.classes li { padding: 12px 0; border-bottom: 1px solid #d3c59f; display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: start; }
.classes li:last-child { border-bottom: 0; }
.classes h3 { margin: 0; font-size: 20px; font-weight: 800; }
.classes p { margin: 0; color: var(--muted); font-size: 15px; }
.classes .rib { width: 36px; height: 44px; }
.classes .note { font-family: var(--mono); font-size: 13px; color: var(--muted); display: block; grid-template-columns: none; padding-top: 14px; }

/* footer */
.foot { text-align: center; padding: 30px 16px 50px; color: #b9b096; font-family: var(--mono); font-size: 14px; }
.foot p { margin: 6px 0; }
.foot .tiny { font-size: 12px; color: #84806c; }
.sign {
  display: inline-flex; flex-direction: column; align-items: center; margin-bottom: 18px;
  background: var(--sign); color: #fff; padding: 10px 26px 12px; border-radius: 10px;
  box-shadow: inset 0 0 0 3px var(--sign), inset 0 0 0 6px #fff, 4px 4px 0 #050b09;
  font-family: "Overpass", Arial, sans-serif;
}
.sign-top { font-size: 30px; font-weight: 800; letter-spacing: .06em; }
.sign-bot { font-size: 14px; font-weight: 700; }

/* ---------- map pins ---------- */
.pin { background: none !important; border: 0 !important; }
.pin svg { display: block; overflow: visible; }
.pin .glow { filter: drop-shadow(0 0 4px var(--c)) drop-shadow(0 0 10px var(--c)); }
.pin-nice svg { filter: drop-shadow(0 0 6px #ffd76a) drop-shadow(0 0 14px #e7b53c88); }
.pin-win .lbl {
  position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: 2px;
  white-space: nowrap; font-family: var(--mono); font-size: 11px; font-weight: 700;
  background: var(--ink); color: var(--gold); padding: 1px 5px; border: 1px solid var(--gold);
}

/* popups */
.leaflet-popup-content-wrapper {
  border-radius: 0; border: 3px solid var(--ink); box-shadow: 5px 5px 0 #050b09;
  background: var(--cream); color: var(--ink);
}
.leaflet-popup-tip { background: var(--cream); border: 3px solid var(--ink); box-shadow: none; }
.leaflet-popup-content { margin: 14px 16px; font-family: var(--display); font-size: 15px; line-height: 1.4; min-width: 220px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--ink); font-size: 22px; top: 4px; right: 4px; }
.pop .tag { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pop .tag.nice { color: var(--gold-d); font-weight: 700; }
.pop .tag.win { color: var(--cran); font-weight: 700; }
.pop h3 { margin: 2px 0 4px; font-size: 21px; font-weight: 900; line-height: 1.1; font-variation-settings: "SOFT" 100; }
.pop .note { margin: 0 0 8px; color: var(--muted); font-style: italic; }
.pop .tally { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px dashed #b9aa86; border-bottom: 1px dashed #b9aa86; margin: 8px 0; }
.pop .tally .big { font-family: var(--mono); font-size: 22px; font-weight: 700; color: var(--b-blue); display: flex; align-items: center; gap: 4px; }
.pop .tally .big svg { width: 20px; height: 20px; }
.pop .tally .big small { font-size: 12px; color: var(--muted); font-weight: 400; }
.stepper { display: flex; align-items: center; border: 2px solid var(--ink); }
.stepper button { width: 34px; height: 34px; border: 0; background: var(--ink); color: var(--cream); font-size: 20px; font-weight: 700; line-height: 1; }
.stepper button:disabled { background: #8d8473; cursor: not-allowed; }
.stepper span { min-width: 34px; text-align: center; font-family: var(--mono); font-weight: 700; }
.pop .links { display: flex; gap: 14px; font-family: var(--mono); font-size: 13px; }
.pop .links a, .pop .links button { color: var(--ink); background: none; border: 0; padding: 0; text-decoration: underline; font-family: var(--mono); font-size: 13px; }
.pop .yours { font-family: var(--mono); font-size: 12px; color: var(--muted); margin: 0; }
.pop .claim { display: block; margin-top: 8px; font-family: var(--mono); font-size: 13px; color: var(--cran); background: none; border: 0; padding: 0; text-decoration: underline; }

/* ---------- dialog / forms ---------- */
dialog {
  border: 3px solid var(--ink); box-shadow: 8px 8px 0 #050b09; padding: 26px 24px 24px;
  width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow: auto;
}
dialog::backdrop { background: rgba(6, 14, 11, .72); }
.dlg-x { position: absolute; top: 8px; right: 10px; margin: 0; }
.dlg-x button { background: none; border: 0; font-size: 30px; line-height: 1; color: var(--ink); padding: 4px; }
dialog h2 { margin: 0 0 4px; font-size: 30px; font-weight: 900; line-height: 1; font-variation-settings: "SOFT" 100; color: var(--cran); }
dialog .lead { margin: 6px 0 16px; color: var(--muted); }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 3px; }
.field > span i { font-style: normal; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); }
.field input, .field select {
  width: 100%; padding: 8px 2px 6px; border: 0; border-bottom: 2px solid var(--ink); border-radius: 0;
  background: transparent; font-family: var(--display); font-size: 20px; color: var(--ink);
}
.field input:focus, .field select:focus { outline: none; border-bottom-color: var(--cran); background: #fff7e2; }
.field .hint { display: block; font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 3px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pick { display: grid; gap: 8px; margin-bottom: 16px; }
.pick label { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 10px 12px; border: 2px solid var(--ink); cursor: pointer; background: #fbf4e2; }
.pick label:has(input:checked) { background: var(--ink); color: var(--cream); }
.pick label:has(input:checked) small { color: #cfc4a8; }
.pick input { accent-color: var(--cran); margin: 4px 0 0; }
.pick b { display: block; font-size: 17px; }
.pick small { color: var(--muted); font-size: 14px; }
.ticket { font-family: var(--mono); font-size: 14px; padding: 10px 12px; border: 2px dashed var(--ink); margin-bottom: 16px; background: #fbf4e2; }
.err { font-family: var(--mono); font-size: 14px; color: var(--cran); margin: 0 0 10px; min-height: 1em; }
.err:empty { display: none; }
.switch { font-family: var(--mono); font-size: 14px; margin: 14px 0 0; text-align: center; }
.switch button { background: none; border: 0; color: var(--cran); text-decoration: underline; padding: 0; font-family: var(--mono); font-size: 14px; }
.form-actions .btn { width: 100%; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 140%); z-index: 2000;
  background: var(--ink); color: var(--cream); border: 2px solid var(--gold); padding: 10px 16px;
  font-family: var(--mono); font-size: 15px; max-width: calc(100vw - 32px); transition: transform .25s;
  box-shadow: 4px 4px 0 #050b09; visibility: hidden;
}
.toast.show { transform: translate(-50%, 0); visibility: visible; }

.leaflet-control-attribution { font-family: var(--mono); font-size: 10px !important; background: rgba(16, 34, 28, .8) !important; color: #9a937c !important; }
.leaflet-control-attribution a { color: #c9c1a5 !important; }
.leaflet-bar a { background: var(--cream); color: var(--ink); border-color: var(--ink) !important; border-radius: 0 !important; }
.leaflet-bar { border: 2px solid var(--ink) !important; border-radius: 0 !important; box-shadow: 3px 3px 0 #050b09 !important; }

.err .dym { color: var(--ink); }
.err .dym b { color: var(--cran); }
.night-tiles { filter: invert(1) hue-rotate(180deg) brightness(.78) contrast(1.15) saturate(.35) sepia(.25); }
