/* Klopkaart — one family (Bricolage Grotesque), dusk-blue night, lantern doors. */

@font-face {
  font-family: "Bricolage";
  src: url("fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bricolage";
  src: url("fonts/bricolage-grotesque-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Overwritten per event from /api/event */
  --bg: #1A2235;
  --surface: #242E45;
  --ink: #F3EEE4;
  --accent: #F97316;

  --ink-soft: color-mix(in srgb, var(--ink) 68%, var(--bg));
  --line: color-mix(in srgb, var(--ink) 14%, transparent);
  --door-green: #5EE08F;
  --door-red: #F2546B;
  --door-grey: #8A93A6;

  --r-sheet: 22px;
  --r-control: 12px;
  --font: "Bricolage", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.45 var(--font);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- map */

#map { position: fixed; inset: 0; background: var(--bg); z-index: 0; }
/* Grey PDOK map turned into a night map, tinted with the event colour. */
.kk-tiles { filter: invert(1) hue-rotate(180deg) brightness(0.62) contrast(1.15) saturate(0.4) sepia(0.25) hue-rotate(190deg); }
.leaflet-container { font-family: var(--font); background: var(--bg); }
.leaflet-control-attribution {
  background: color-mix(in srgb, var(--bg) 70%, transparent) !important;
  color: var(--ink-soft) !important;
  font-size: 11px;
}
.leaflet-control-attribution a { color: var(--ink-soft) !important; }
.leaflet-bottom.leaflet-right { bottom: var(--sheet-h, 0px); transition: bottom .2s; }

/* Lantern doors: the one bold element. */
.door { position: relative; width: 16px; height: 20px; }
.door::before {
  content: ""; position: absolute; inset: 0;
  border-radius: 8px 8px 2px 2px;
  background: var(--c);
  border: 2px solid color-mix(in srgb, var(--c) 55%, #000);
}
.door::after { /* door knob */
  content: ""; position: absolute; width: 3px; height: 3px; border-radius: 50%;
  right: 4px; top: 11px; background: color-mix(in srgb, var(--c) 40%, #000);
}
.door--green { --c: var(--door-green); filter: drop-shadow(0 0 6px var(--door-green)) drop-shadow(0 0 14px color-mix(in srgb, var(--door-green) 60%, transparent)); }
.door--red { --c: var(--door-red); filter: drop-shadow(0 0 3px color-mix(in srgb, var(--door-red) 70%, transparent)); }
.door--red::after { width: 8px; height: 2px; border-radius: 1px; right: 4px; top: 9px; background: #fff8; }
.door--mine::before { border-color: var(--ink); }
.door--selected { transform: scale(1.35); transition: transform .15s; }
.only-open .door--red { display: none; }

.me-dot { width: 14px; height: 14px; border-radius: 50%; background: #5AB4FF; border: 3px solid #fff; box-shadow: 0 0 0 6px #5AB4FF40; }

/* ---------------------------------------------------------------- chrome */

.brand {
  position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); left: 12px; z-index: 500;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px 8px 10px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 700; letter-spacing: -0.01em;
}
.brand__mark {
  width: 12px; height: 15px; border-radius: 6px 6px 2px 2px;
  background: var(--accent); box-shadow: 0 0 10px var(--accent);
}
.brand__event { font-weight: 500; color: var(--ink-soft); }
.brand__event:empty { display: none; }

.tools {
  position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; z-index: 500;
  display: flex; flex-direction: column; gap: 8px;
}
.tool {
  width: 44px; height: 44px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: var(--r-control);
}
.tool svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.tool svg circle:first-child { fill: currentColor; }
.tool[aria-pressed="true"] { background: var(--door-green); color: #0B2A17; border-color: transparent; }
.tool--lang { font-weight: 700; font-size: 14px; }

/* ---------------------------------------------------------------- sheet */

.sheet {
  position: fixed; z-index: 600; left: 0; right: 0; bottom: 0;
  max-height: 72vh; overflow-y: auto; overscroll-behavior: contain;
  padding: 10px 20px calc(14px + var(--safe-b));
  background: var(--surface);
  border-top-left-radius: var(--r-sheet); border-top-right-radius: var(--r-sheet);
  box-shadow: 0 -12px 40px -10px #0008;
}
.sheet__grip { width: 40px; height: 4px; margin: 0 auto 12px; border-radius: 2px; background: var(--line); }

@media (min-width: 860px) {
  .sheet {
    left: 16px; right: auto; bottom: 16px; width: 400px; max-height: calc(100vh - 100px);
    border-radius: var(--r-sheet); padding: 22px 24px 16px;
  }
  .sheet__grip { display: none; }
  .leaflet-bottom.leaflet-right { bottom: 0; }
}

.question {
  margin: 0 0 4px; font-size: clamp(26px, 6.4vw, 32px); line-height: 1.08;
  font-weight: 750; letter-spacing: -0.025em; text-wrap: balance;
}
.summary { margin: 0 0 16px; color: var(--ink-soft); }
.summary strong { color: var(--ink); font-weight: 650; }

.search { position: relative; }
.search input {
  width: 100%; height: 52px; padding: 0 16px;
  background: var(--bg); border: 1.5px solid var(--line); border-radius: var(--r-control);
  font-size: 17px;
}
.search input::placeholder { color: var(--ink-soft); }
.search input:focus { outline: none; border-color: var(--accent); }
.results { list-style: none; margin: 6px 0 0; padding: 0; }
.results:empty { display: none; }
.results li button {
  width: 100%; text-align: left; padding: 12px 14px; border: 0; border-radius: 10px;
  background: transparent;
}
.results li button:hover, .results li button:focus-visible { background: var(--bg); }
.results .empty { padding: 12px 14px; color: var(--ink-soft); }

.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 16px 0 0; padding: 0; font-size: 14px; color: var(--ink-soft); }
.legend li { display: flex; align-items: center; gap: 7px; }
.dot { width: 10px; height: 12px; border-radius: 5px 5px 1px 1px; }
.dot--green { background: var(--door-green); box-shadow: 0 0 8px var(--door-green); }
.dot--red { background: var(--door-red); }
.dot--grey { background: var(--door-grey); border-radius: 50%; width: 9px; height: 9px; }
.hint { margin: 10px 0 0; font-size: 14px; color: var(--ink-soft); }

.back {
  border: 0; background: none; padding: 4px 0; margin-bottom: 6px;
  color: var(--ink-soft); font-size: 15px;
}
.back::before { content: "‹ "; }
.address { margin: 0 0 4px; font-size: 24px; line-height: 1.15; font-weight: 700; letter-spacing: -0.015em; }
.prompt, .status { margin: 0 0 16px; color: var(--ink-soft); }
.status strong { color: var(--ink); }

.choices { display: grid; gap: 10px; }
.choice {
  display: flex; align-items: center; gap: 14px;
  min-height: 60px; padding: 0 18px;
  border-radius: 14px; border: 2px solid transparent;
  font-size: 18px; font-weight: 650; text-align: left;
}
.choice__door { width: 18px; height: 23px; border-radius: 9px 9px 2px 2px; flex: none; }
.choice--green { background: color-mix(in srgb, var(--door-green) 16%, var(--bg)); }
.choice--green .choice__door { background: var(--door-green); box-shadow: 0 0 12px var(--door-green); }
.choice--red { background: color-mix(in srgb, var(--door-red) 14%, var(--bg)); }
.choice--red .choice__door { background: var(--door-red); }
.choice[aria-pressed="true"].choice--green { border-color: var(--door-green); }
.choice[aria-pressed="true"].choice--red { border-color: var(--door-red); }
.choice:disabled { opacity: .55; cursor: progress; }

.captcha { margin-top: 12px; min-height: 0; }
.captcha:empty { margin: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.link { display: inline-block; margin-top: 14px; padding: 6px 0; border: 0; background: none; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; font-size: 15px; }
.link.danger { color: var(--door-red); }
.note { margin: 14px 0 0; font-size: 13.5px; color: var(--ink-soft); }

.sheet__foot {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 13px;
}
.sheet__foot a { color: var(--ink-soft); text-decoration: none; }
.sheet__foot a:hover { color: var(--ink); text-decoration: underline; }
#credit b { color: var(--accent); font-weight: 650; }

.toast {
  position: fixed; z-index: 700; left: 50%; top: calc(70px + env(safe-area-inset-top, 0px));
  transform: translateX(-50%);
  max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 12px;
  background: var(--ink); color: var(--bg); font-weight: 600;
  box-shadow: 0 10px 30px -8px #000a;
}
.toast--error { background: var(--door-red); color: #fff; }

@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toast-in .22s ease-out; }
  @keyframes toast-in { from { opacity: 0; transform: translate(-50%, -8px); } }
}

.leaflet-bar { border: 1px solid var(--line) !important; border-radius: var(--r-control) !important; overflow: hidden; box-shadow: none !important; }
.leaflet-bar a { background: color-mix(in srgb, var(--bg) 82%, transparent) !important; color: var(--ink) !important; border-color: var(--line) !important; }
.leaflet-bar a:hover { background: var(--surface) !important; }
