:root {
  --paper: #f8f1e2;
  --paper-2: #f2e8d3;
  --ink: #3a2c22;
  --ink-2: #6f5d4e;
  --ink-3: #a3917d;
  --rule: #dccdb0;
  --tomato: #b4472f;
  --olive: #6d7b3c;
  --mustard: #cf9a2b;
  --teal: #3f7473;
  --plum: #7a4a63;
  --desk: #2e231c;
  --display: "IM Fell English", Georgia, serif;
  --body: "Courier Prime", "Courier New", monospace;
  --hand: "Homemade Apple", "Segoe Script", cursive;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.45;
  color: var(--ink);
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.018) 0 2px, transparent 2px 9px),
    radial-gradient(ellipse at 50% 0%, #4a382c 0%, var(--desk) 70%);
  background-color: var(--desk);
  min-height: 100vh;
}
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { font-family: var(--display); margin: 0; }

.desk { max-width: 1340px; margin: 0 auto; padding: 18px 64px 28px 20px; }

/* ---------- Masthead ---------- */
.masthead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; color: #f1e4cb; padding: 0 6px 12px; }
.masthead h1 { font-size: 34px; font-weight: 800; letter-spacing: .01em; line-height: 1; }
.masthead p { margin: 4px 0 0; font-style: italic; color: #cdb99a; }
.linkbtn { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.linkbtn:hover { color: #fff; }
.foot { color: #b9a58a; font-size: 15px; text-align: center; padding-top: 16px; }

/* ---------- Book ---------- */
.book {
  position: relative;
  background: #5b4233;
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 24px 50px rgba(0,0,0,.5), inset 0 0 0 1px rgba(255,255,255,.06);
}
.view { min-height: min(820px, calc(100vh - 150px)); }
.view[hidden] { display: none; }
.spread { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); }
.page {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255,255,255,.35), transparent 120px),
    var(--paper);
  padding: 30px 36px 34px;
  min-width: 0;
}
.spread .page.left { border-radius: 4px 0 0 4px; box-shadow: inset -26px 0 30px -22px rgba(73,48,25,.38); }
.spread .page.right { border-radius: 0 4px 4px 0; box-shadow: inset 26px 0 30px -22px rgba(73,48,25,.38); }
/* The map column stays in view while a long recipe scrolls. */
.stick { position: sticky; top: 14px; display: flex; flex-direction: column; min-height: min(756px, calc(100vh - 60px)); max-height: calc(100vh - 28px); }
.single .page { border-radius: 4px; min-height: inherit; }

/* ---------- Index tabs ---------- */
.tabs { position: absolute; left: 100%; top: 36px; display: flex; flex-direction: column; gap: 8px; z-index: 2; }
.tab {
  writing-mode: vertical-rl;
  border: 0;
  padding: 16px 9px 16px 8px;
  min-width: 40px;
  border-radius: 0 9px 9px 0;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .04em;
  color: #fff8ea;
  box-shadow: 3px 3px 8px rgba(0,0,0,.35);
  transform: translateX(-6px);
  transition: transform .15s;
}
.tab:hover { transform: translateX(-2px); }
.tab.on { transform: translateX(0); padding-right: 14px; }
.t1 { background: var(--tomato); } .t2 { background: var(--olive); } .t3 { background: var(--teal); }
.t4 { background: var(--mustard); } .t5 { background: var(--plum); }

/* ---------- Recipe page ---------- */
.kicker { font-family: var(--display); font-style: italic; color: var(--tomato); font-size: 16px; display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--rule); padding-bottom: 8px; }
.title { font-size: 38px; font-weight: 800; line-height: 1.1; margin: 14px 0 4px; }
.title .w { display: inline-block; margin-right: .38em; white-space: nowrap; }
.title .b { display: inline-block; width: .52em; height: .9em; margin-right: .1em; border-bottom: 3px solid var(--ink); vertical-align: baseline; }
.course { margin: 0 0 14px; font-variant: small-caps; letter-spacing: .08em; color: var(--ink-2); }

.photo { position: relative; margin: 0 0 16px; padding: 9px 9px 10px; background: #fffdf7; box-shadow: 0 3px 12px rgba(60,40,20,.25); transform: rotate(-.7deg); }
.photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--paper-2); }
.photo::before, .photo::after { content: ""; position: absolute; top: -9px; width: 84px; height: 24px; background: rgba(226,205,150,.72); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.photo::before { left: -22px; transform: rotate(-38deg); }
.photo::after { right: -22px; transform: rotate(38deg); }

.blurb { font-size: 20px; font-style: italic; margin: 0 0 16px; }

.hint { border-top: 1px dashed var(--rule); padding: 10px 0 11px; }
.hint h3 { font-size: 13px; font-family: var(--body); font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--tomato); margin-bottom: 3px; }
.hint p { margin: 0; }
.hint ul { margin: 0; padding: 0; list-style: none; columns: 2; column-gap: 22px; }
.hint li { padding-left: 14px; position: relative; break-inside: avoid; }
.hint li::before { content: "·"; position: absolute; left: 3px; font-weight: 700; color: var(--tomato); }
.hint.locked h3 { color: var(--ink-3); }
.hint.locked .lines { height: 26px; background: repeating-linear-gradient(180deg, transparent 0 11px, var(--rule) 11px 12px); opacity: .7; }
.hint.locked .when { font-family: var(--hand); font-size: 13px; line-height: 1.5; color: var(--ink-3); margin: 2px 0 6px; }
.hint.fresh > *:not(h3) { animation: ink 1.1s ease-out; }
@keyframes ink { from { opacity: 0; filter: blur(3px); } to { opacity: 1; filter: none; } }

/* Finished recipe */
.stamp { position: absolute; top: 74px; right: 26px; z-index: 1; font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: 15px; text-align: center; line-height: 1.15; padding: 9px 13px; border: 3px double currentColor; border-radius: 6px; transform: rotate(9deg); background: rgba(248,241,226,.86); }
.stamp.won { color: var(--olive); } .stamp.lost { color: var(--tomato); }
.stamp small { display: block; font-family: var(--body); font-weight: 500; font-size: 12px; letter-spacing: .1em; }
.origin { background: var(--paper-2); border-left: 4px solid var(--olive); padding: 12px 16px; margin: 4px 0 14px; }
.origin .where { font-family: var(--display); font-size: 22px; font-weight: 600; }
.origin p { margin: 6px 0 0; }
.origin .disputed { font-family: var(--hand); font-size: 20px; color: var(--tomato); }
.method { margin: 0; padding-left: 22px; }
.method li { margin-bottom: 6px; }
.meta { font-style: italic; color: var(--ink-2); margin: 0 0 4px; }
.credit { font-size: 14px; color: var(--ink-3); margin: 14px 0 0; }
.credit a { color: inherit; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 4px; }

.btn { border: 1.5px solid var(--ink); background: transparent; border-radius: 999px; padding: 7px 18px; font-family: var(--display); font-weight: 600; font-size: 16px; }
.btn:hover { background: rgba(58,44,34,.07); }
.btn.primary { background: var(--tomato); border-color: var(--tomato); color: #fff8ea; }
.btn.primary:hover { background: #9c3b26; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.fav.on { background: var(--tomato); border-color: var(--tomato); color: #fff8ea; }

/* ---------- Map page ---------- */
.maphead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.maphead h2 { font-size: 24px; font-style: italic; font-weight: 600; }
.pins { display: flex; gap: 7px; flex: none; }
.pins span { width: 15px; height: 15px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 2px solid var(--ink-3); }
.pins .miss { background: var(--tomato); border-color: var(--tomato); }
.pins .far, .mpin.far, .dot.far { background: #5f2a22; border-color: #5f2a22; }
.pins .neighbour, .mpin.neighbour, .dot.neighbour { background: #d9772b; border-color: #d9772b; }
.mpin.far, .mpin.neighbour { border-color: #fff8ea; }
.pins .country { background: var(--mustard); border-color: var(--mustard); }
.pins .win { background: var(--olive); border-color: var(--olive); }

.mapframe { flex: 1; min-height: 380px; position: relative; padding: 8px; background: #fffdf7; box-shadow: 0 3px 12px rgba(60,40,20,.22); }
.mapframe.tall { min-height: 560px; height: 100%; }
#map, #atlasMap { position: absolute; inset: 8px; background: #d9e3df; }
.leaflet-tile-pane { filter: sepia(.12) saturate(.92); }
/* Hide hairline seams between tiles: overlap them slightly and turn off Leaflet's additive blending. */
.leaflet-container img.leaflet-tile { mix-blend-mode: normal; width: 256.6px !important; height: 256.6px !important; }
.leaflet-container { font-family: var(--body); font-size: 15px; cursor: crosshair; }
.leaflet-container.done { cursor: grab; }
.leaflet-bar a { color: var(--ink); background: var(--paper); }
.leaflet-control-attribution { font-size: 10px; background: rgba(248,241,226,.8) !important; }

.mpin { display: block; width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 2px solid #fff8ea; box-shadow: -2px 3px 5px rgba(0,0,0,.35); background: var(--ink); }
.mpin b { display: block; transform: rotate(45deg); color: #fff8ea; font: 700 13px/22px var(--display); text-align: center; }
.mpin.miss { background: var(--tomato); } .mpin.country { background: var(--mustard); } .mpin.win { background: var(--olive); }
.mpin.draft { background: var(--ink); animation: bob .9s ease-in-out infinite alternate; }
@keyframes bob { from { margin-top: 0; } to { margin-top: -5px; } }
.home { display: block; width: 34px; height: 34px; border-radius: 50%; background: var(--olive); color: #fff8ea; border: 2px solid #fff8ea; font: 400 19px/30px var(--body); text-align: center; box-shadow: 0 2px 6px rgba(0,0,0,.4); }

.mapbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.check { font-size: 16px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.feedback { min-height: 54px; margin: 12px 0 4px; font-size: 20px; }
.feedback strong { font-weight: 600; }
.feedback .hand { font-family: var(--hand); font-size: 24px; color: var(--tomato); }
.log { margin: 0; padding: 0; list-style: none; font-size: 16px; color: var(--ink-2); }
.log li { display: flex; gap: 9px; align-items: baseline; padding: 3px 0; border-top: 1px dotted var(--rule); }
.log .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.miss { background: var(--tomato); } .dot.country { background: var(--mustard); } .dot.win { background: var(--olive); }
.warn { font-size: 15px; color: var(--tomato); margin: 8px 0 0; }

/* ---------- Single pages ---------- */
.pagehead { border-bottom: 1px solid var(--rule); padding-bottom: 12px; margin-bottom: 20px; }
.pagehead h2 { font-size: 36px; font-weight: 800; }
.pagehead p { margin: 4px 0 0; font-style: italic; color: var(--ink-2); }
.filters { display: flex; gap: 8px; margin-top: 12px; }
.chip { border: 1.5px solid var(--rule); background: transparent; border-radius: 999px; padding: 3px 14px; font-size: 16px; }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 22px; }
.card { position: relative; border: 0; text-align: left; background: #fffdf7; padding: 8px 8px 12px; box-shadow: 0 3px 10px rgba(60,40,20,.2); transition: transform .15s, box-shadow .15s; }
.card:nth-child(odd) { transform: rotate(-.5deg); } .card:nth-child(even) { transform: rotate(.4deg); }
.card:hover { transform: translateY(-3px) rotate(0); box-shadow: 0 8px 18px rgba(60,40,20,.28); }
.card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--paper-2); }
.card .no { font-family: var(--display); font-style: italic; color: var(--tomato); font-size: 14px; margin-top: 8px; display: block; }
.card .nm { font-family: var(--display); font-weight: 600; font-size: 19px; line-height: 1.2; display: block; }
.card .sub { color: var(--ink-2); font-size: 15px; display: block; }
.card .tag { position: absolute; top: 14px; left: 14px; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; padding: 2px 8px; border-radius: 3px; color: #fff8ea; background: var(--ink-2); }
.tag.won { background: var(--olive); } .tag.lost { background: var(--tomato); } .tag.today { background: var(--mustard); } .tag.prog { background: var(--teal); }
.card .heart { position: absolute; top: 12px; right: 14px; color: #fff; font-size: 20px; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.empty { font-size: 20px; font-style: italic; color: var(--ink-2); padding: 30px 0; }

/* Atlas summary + stats */
.big { font-family: var(--display); font-weight: 800; font-size: 56px; line-height: 1; }
.big small { font-size: 22px; font-weight: 600; color: var(--ink-2); }
.bars { margin-top: 22px; display: grid; gap: 12px; }
.bar { display: grid; grid-template-columns: 130px 1fr 44px; gap: 10px; align-items: center; font-size: 16px; }
.bar .track { height: 12px; background: var(--paper-2); border-radius: 6px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--teal); border-radius: 6px; min-width: 0; }
.bar .n { text-align: right; color: var(--ink-2); }
.stamps { margin: 22px 0 0; padding: 0; list-style: none; }
.stamps li { padding: 6px 0; border-top: 1px dotted var(--rule); }
.stamps b { font-family: var(--display); font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 30px; }
.tile { background: var(--paper-2); padding: 16px 18px; border-top: 4px solid var(--plum); }
.tile .v { font-family: var(--display); font-weight: 800; font-size: 40px; line-height: 1.05; }
.tile .k { color: var(--ink-2); font-size: 15px; text-transform: uppercase; letter-spacing: .1em; }
.dist h3 { font-size: 20px; margin-bottom: 12px; }
.dist .bar { grid-template-columns: 90px 1fr 34px; }
.dist .fill { background: var(--plum); }

/* ---------- Overlay ---------- */
.overlay { position: fixed; inset: 0; z-index: 2000; background: rgba(30,20,14,.66); display: flex; align-items: flex-start; justify-content: center; padding: 30px 16px; overflow: auto; }
.overlay[hidden] { display: none; }
.sheet { position: relative; width: min(640px, 100%); background: var(--paper); padding: 30px 36px 34px; border-radius: 4px; box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.sheet h2 { font-size: 30px; font-weight: 800; margin-bottom: 10px; }
.sheet ol.how { padding-left: 22px; } .sheet ol.how li { margin-bottom: 8px; }
.close { position: absolute; top: 8px; right: 12px; border: 0; background: none; font-size: 32px; line-height: 1; color: var(--ink-2); z-index: 2; }
.creditlist { list-style: none; padding: 0; font-size: 16px; } .creditlist li { padding: 5px 0; border-top: 1px dotted var(--rule); } .creditlist a { color: var(--tomato); }
.key { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 4px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 3000; background: var(--ink); color: var(--paper); padding: 9px 20px; border-radius: 999px; box-shadow: 0 6px 18px rgba(0,0,0,.4); }
.toast[hidden] { display: none; }

/* ---------- Narrow screens ---------- */
@media (max-width: 900px) {
  body { font-size: 17px; }
  .desk { padding: 12px 10px 86px; }
  .masthead h1 { font-size: 27px; }
  .book { padding: 6px; }
  .spread { grid-template-columns: 1fr; }
  .page { padding: 22px 18px 24px; }
  .spread .page.left, .spread .page.right { border-radius: 4px; box-shadow: none; }
  .spread .page.right { border-top: 1px solid var(--rule); }
  .stick { position: static; min-height: 0; max-height: none; }
  .mapframe { min-height: 0; height: 58vh; flex: none; }
  .mapframe.tall { min-height: 0; height: 60vh; }
  .title { font-size: 30px; }
  .stamp { top: 64px; right: 12px; font-size: 13px; }
  .tabs { position: fixed; left: 0; right: 0; top: auto; bottom: 0; flex-direction: row; gap: 0; z-index: 1500; box-shadow: 0 -4px 14px rgba(0,0,0,.35); }
  .tab, .tab.on, .tab:hover { writing-mode: horizontal-tb; flex: 1; min-width: 0; transform: none; border-radius: 0; padding: 14px 2px; font-size: 13px; box-shadow: none; opacity: .82; }
  .tab.on { opacity: 1; box-shadow: inset 0 4px 0 rgba(255,255,255,.75); }
  .cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .sheet { padding: 24px 20px; }
  .bar { grid-template-columns: 104px 1fr 40px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Font set: old atlas headings, typewriter text ---------- */
body { font-size: 16px; line-height: 1.5; }
h1, h2, h3, .title, .btn, .tab, .big, .tile .v, .stamp, .card .nm, .origin .where, .stamps b, .mpin b { font-weight: 400 !important; }
.masthead h1 { font-size: 38px; }
.title { font-size: 42px; }
.pagehead h2 { font-size: 40px; }
.maphead h2 { font-size: 27px; }
.kicker { font-size: 18px; }
.tab { font-size: 17px; letter-spacing: .02em; }
.btn { font-size: 18px; padding: 5px 18px; }
.course { font-variant: normal; text-transform: uppercase; font-size: 13px; letter-spacing: .1em; }
.blurb { font-size: 17px; }
.hint h3 { font-family: var(--body); font-weight: 700 !important; }
.feedback { font-size: 16px; }
.feedback .hand { font-size: 17px; }
.origin .disputed { font-size: 14px; line-height: 1.6; }
.log, .check, .card .sub, .bar { font-size: 14px; }
.stamp { font-size: 17px; } .stamp small { font-size: 11px; }
.card .no { font-size: 15px; } .card .nm { font-size: 21px; }
.empty { font-size: 17px; }

/* Extra small-town labels, styled to match the map's own place names. */
.town { white-space: nowrap; position: relative; }
.town i { position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%; background: #4a4a4a; border: 1px solid #fff; }
.town span { position: absolute; left: 7px; top: -9px; font: 13px/1.3 "PT Sans", Arial, sans-serif; color: #3d3d3d; text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff, 0 0 3px #fff; }

/* ---------- Hot/cold pin colours ---------- */
.pins .h1, .mpin.h1, .dot.h1, .key.h1 { background: #27408b; border-color: #27408b; }
.pins .h2, .mpin.h2, .dot.h2, .key.h2 { background: #2fa3c4; border-color: #2fa3c4; }
.pins .h3, .mpin.h3, .dot.h3, .key.h3 { background: #e8bd22; border-color: #e8bd22; }
.pins .h4, .mpin.h4, .dot.h4, .key.h4 { background: #e8701a; border-color: #e8701a; }
.pins .h5, .mpin.h5, .dot.h5, .key.h5 { background: #c9211a; border-color: #c9211a; }
.pins .win, .mpin.win, .dot.win, .key.win { background: #2f8f3e; border-color: #2f8f3e; }
.mpin.h1, .mpin.h2, .mpin.h3, .mpin.h4, .mpin.h5, .mpin.win { border-color: #fff8ea; }
.mpin.h3 b { color: #3a2c22; }

/* ---------- Compact recipe page: photo beside the title, hints without scrolling ---------- */
.desk { max-width: 1560px; }
.spread { grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); }
.page { padding: 22px 30px 24px; }
.top { display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 1fr); gap: 22px; align-items: start; margin: 16px 0 10px; }
.top .photo { margin: 0; padding: 7px 7px 8px; }
.top .title { font-size: 34px; margin: 0 0 4px; }
.top .course { margin: 0 0 8px; }
.top .blurb { margin: 0; font-size: 15px; }
.photo::before, .photo::after { width: 60px; height: 18px; }
.hint { padding: 7px 0 8px; }
.hint p, .hint li { font-size: 15px; line-height: 1.45; }
.hint ul { columns: 3; column-gap: 16px; }
.hint.locked { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.hint.locked .lines { display: none; }
.hint.locked .when { margin: 0; text-align: right; }
.stamp { top: 14px; right: 150px; transform: rotate(-6deg); padding: 4px 10px; font-size: 14px; }
.kicker { padding-bottom: 6px; }
.masthead { padding-bottom: 8px; }
.masthead h1 { font-size: 30px; }
.view { min-height: min(760px, calc(100vh - 120px)); }
.stick { min-height: min(700px, calc(100vh - 130px)); }
.feedback { min-height: 0; margin: 10px 0 4px; }
@media (max-width: 900px) {
  .hint ul { columns: 2; }
  .top { grid-template-columns: 1fr; }
  .stamp { right: 12px; top: 40px; }
}

/* ---------- Map credits: a small "i" in the corner that opens on click ---------- */
.leaflet-control-attribution { font-size: 0 !important; cursor: pointer; border-radius: 50%; margin: 0 6px 6px 0 !important; padding: 0 !important; background: rgba(248,241,226,.75) !important; }
.leaflet-control-attribution::before { content: "i"; display: block; width: 16px; height: 16px; font: italic 12px/16px Georgia, serif; text-align: center; color: #6f5d4e; }
.leaflet-control-attribution.open { font-size: 10px !important; border-radius: 3px; padding: 1px 6px !important; }
.leaflet-control-attribution.open::before { display: none; }

/* Map column fits the window: the map flexes and the guess log stays in view. */
.stick { min-height: 0; height: min(720px, calc(100vh - 150px)); max-height: none; }
.mapframe { min-height: 200px; }
.log { overflow: auto; flex: none; max-height: 132px; }
@media (max-width: 900px) { .stick { height: auto; } .log { max-height: none; } }

/* ---------- Pins run red (far) to green (close) ---------- */
.pins .h1, .mpin.h1, .dot.h1, .key.h1, .ripple.h1 { background: #c9211a; border-color: #c9211a; }
.pins .h2, .mpin.h2, .dot.h2, .key.h2, .ripple.h2 { background: #e8701a; border-color: #e8701a; }
.pins .h3, .mpin.h3, .dot.h3, .key.h3, .ripple.h3 { background: #e8bd22; border-color: #e8bd22; }
.pins .h4, .mpin.h4, .dot.h4, .key.h4, .ripple.h4 { background: #9cc02e; border-color: #9cc02e; }
.pins .h5, .mpin.h5, .dot.h5, .key.h5, .ripple.h5 { background: #3fa64b; border-color: #3fa64b; }
.pins .win, .mpin.win, .dot.win, .key.win, .ripple.win { background: #1c7a36; border-color: #1c7a36; }
.mpin.h1, .mpin.h2, .mpin.h3, .mpin.h4, .mpin.h5 { border-color: #fff8ea; }
.mpin.win { border-color: #f3d06a; }
.mpin.h3 b, .mpin.h4 b { color: #3a2c22; }

/* ---------- Quieter locked hints, local-name subtitle ---------- */
.hint.locked .when { font-family: var(--body); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.hint.locked h3 { margin: 0; }
.local { font-family: var(--display); font-style: italic; font-size: 19px; color: var(--ink-2); margin: 0 0 6px; }
.checks { display: flex; gap: 16px; }

/* ---------- Motion ---------- */
.mpin.new { animation: pindrop .6s cubic-bezier(.3, 0, .4, 1) both; }
@keyframes pindrop {
  0% { transform: translateY(-70px) rotate(-45deg); opacity: 0; }
  55% { transform: translateY(0) rotate(-45deg) scale(1.12, .88); opacity: 1; }
  72% { transform: translateY(-9px) rotate(-45deg); }
  88% { transform: translateY(0) rotate(-45deg) scale(1.05, .95); }
  100% { transform: translateY(0) rotate(-45deg); }
}
.ripple { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; opacity: 0; animation: ripple .9s .3s ease-out; pointer-events: none; }
@keyframes ripple { 0% { transform: scale(.4); opacity: .6; } 100% { transform: scale(5); opacity: 0; } }
.mpin.draft { animation: pop .22s ease-out, bob .9s .22s ease-in-out infinite alternate; }
@keyframes pop { from { transform: rotate(-45deg) scale(.3); opacity: 0; } to { transform: rotate(-45deg) scale(1); opacity: 1; } }
.stamp { animation: slam .5s .35s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes slam { 0% { transform: rotate(-6deg) scale(2.6); opacity: 0; } 60% { opacity: 1; } 100% { transform: rotate(-6deg) scale(1); opacity: 1; } }
.fb { display: inline-block; animation: rise .35s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.hint.fresh { animation: reveal .5s ease-out; }
@keyframes reveal { from { background: rgba(207,154,43,.22); } to { background: transparent; } }
.pins span { transition: background-color .4s, border-color .4s, transform .3s; }
.pins span[class~="h1"], .pins span[class~="h2"], .pins span[class~="h3"], .pins span[class~="h4"], .pins span[class~="h5"], .pins .win { transform: rotate(-45deg) scale(1.15); }
.btn { transition: transform .12s, background-color .15s; }
.btn:active:not(:disabled) { transform: scale(.95); }
.home { animation: homepop .6s .5s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes homepop { from { transform: scale(0) rotate(-90deg); } to { transform: none; } }

/* ---------- "Mapetite fulfilled!" banner ---------- */
.winbanner { position: absolute; inset: 8px; z-index: 1200; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; pointer-events: none; background: radial-gradient(ellipse at center, rgba(248,241,226,.94) 0%, rgba(248,241,226,.75) 45%, rgba(248,241,226,0) 75%); }
.winbanner[hidden] { display: none; }
.wb-big { font-family: var(--display); font-style: italic; font-size: clamp(34px, 4.6vw, 62px); line-height: 1.05; color: #1c7a36; text-shadow: 0 2px 0 #fffdf7; }
.wb-small { font-family: var(--body); font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); }
.winbanner.show { animation: wb-fade 3.2s ease-in-out both; }
.winbanner.show .wb-big { animation: wb-pop .7s .15s cubic-bezier(.2, 1.5, .4, 1) both; }
.winbanner.show .wb-small { animation: rise .5s .6s ease-out both; }
@keyframes wb-fade { 0% { opacity: 0; } 8% { opacity: 1; } 78% { opacity: 1; } 100% { opacity: 0; } }
@keyframes wb-pop { from { transform: scale(.4) rotate(-4deg); opacity: 0; } to { transform: scale(1) rotate(-2deg); opacity: 1; } }
.stamp.won { font-size: 13px; }

/* The result stamp sits on the corner of the photo. */
.photo .stamp { top: auto; right: -16px; bottom: -14px; z-index: 2; }
@media (max-width: 900px) { .photo .stamp { right: 8px; bottom: -12px; top: auto; } }

/* Fallback OpenStreetMap tiles: soften the bright colours towards the cookbook palette. */
.leaflet-tile-pane.osm { filter: sepia(.35) saturate(.7) contrast(.95) brightness(1.02); }
