/* Delft: a white architectural model under a North Sea sky. One loud colour, the cobalt of Delft blue. */
:root {
  --sky: #e4e8ea;
  --paper: #ffffff;
  --ink: #000000;
  --muted: #5d6266;
  --rule: #cfd5d8;
  --accent: #1f3f9a;
  --gutter: clamp(16px, 2.4vw, 32px);
  font: 400 14px/1.5 "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--sky); color: var(--ink); overflow: hidden; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
/* Sky veils keep the masthead and the timeline legible over the model. */
.veil { position: fixed; left: 0; right: 0; pointer-events: none; }
.veil-top { top: 0; height: 150px; background: linear-gradient(var(--sky) 35%, rgba(228, 232, 234, 0)); }
.veil-bottom { bottom: 0; height: 150px; background: linear-gradient(rgba(228, 232, 234, 0), var(--sky) 55%); }

/* Masthead: the three crosses, then the name set large and tight. */
.masthead { position: fixed; top: calc(env(safe-area-inset-top, 0px) + var(--gutter)); left: var(--gutter);
  display: flex; gap: 14px; align-items: flex-start; pointer-events: none; }
/* The three crosses stand exactly as tall as the capitals of the name. */
/* LAYRS: the wordmark set vertically on a block of the city's accent, as tall as the name's capitals (sized in app.js). */
h1 { position: relative; }
.layrs { font-family: "Schibsted Grotesk", sans-serif; position: absolute; left: 0; top: 0; writing-mode: vertical-rl; transform: rotate(180deg); display: flex;
  align-items: center; justify-content: center; background: var(--accent); color: var(--paper); font-weight: 800;
  line-height: 1; letter-spacing: .14em; padding: 0 .3em; border-radius: 2px; box-sizing: border-box; }
.layrs { visibility: hidden; }
.layrs.fitted { visibility: visible; }
.baseline { display: inline-block; width: 0; height: 0; vertical-align: baseline; }
.sibling { position: fixed; right: var(--gutter); top: calc(env(safe-area-inset-top, 0px) + var(--gutter) + 124px);
  color: var(--muted); font-size: 12px; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
h1 { margin: 0; font-size: clamp(34px, 4.4vw, 56px); font-weight: 800; letter-spacing: -0.035em; line-height: .9; }
.dek { margin: 8px 0 0; color: var(--muted); max-width: 26ch; font-size: 14px; line-height: 1.4; }

/* Mode switch: a single bar, the active mode filled black. */
.modes { position: fixed; top: calc(env(safe-area-inset-top, 0px) + var(--gutter)); left: 50%; transform: translateX(-50%);
  display: flex; background: var(--paper); border-radius: 999px; padding: 3px; box-shadow: 0 1px 0 var(--rule); }
.modes button { border: 0; background: none; padding: 7px 16px; border-radius: 999px; cursor: pointer; font-weight: 500; }
.modes button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.tally { position: fixed; top: calc(env(safe-area-inset-top, 0px) + var(--gutter)); right: var(--gutter); text-align: right; }
.tally-year { display: block; font-size: clamp(40px, 5vw, 64px); font-weight: 800; letter-spacing: -0.04em; line-height: .85; }
.tally-count { color: var(--muted); }

/* Context panel: legend, ramp or layer list, always on the left under the masthead. */
.panel { position: fixed; left: var(--gutter); top: calc(env(safe-area-inset-top, 0px) + var(--gutter) + 120px);
  width: min(340px, calc(100vw - 2 * var(--gutter))); max-height: calc(100vh - 300px); overflow-y: auto;
  background: var(--paper); border-radius: 10px; padding: 14px 16px; }
.panel h2 { margin: 0 0 8px; font-size: 13px; font-weight: 700; }
.panel h2.section { margin: 14px 0 4px; color: var(--muted); font-weight: 600; }
.panel h2.section:first-child { margin-top: 0; }
.panel h2.section { display: flex; align-items: center; gap: 7px; scroll-margin-top: 6px; }
.icon { width: 16px; height: 16px; flex: none; }
.layer-title .icon { width: 20px; height: 20px; margin-right: 8px; vertical-align: -3px; }
.jump { display: flex; gap: 4px; margin: 0 0 10px; position: sticky; top: -14px; background: var(--paper); padding: 6px 0; z-index: 1; }
.jump button { width: 34px; height: 34px; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper);
  display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.jump button:hover { background: var(--sky); }
.jump .icon { width: 18px; height: 18px; }
/* Language: two letters under the year. */
.lang { position: fixed; right: var(--gutter); top: calc(env(safe-area-inset-top, 0px) + var(--gutter) + 92px); display: flex;
  background: var(--paper); border-radius: 999px; padding: 2px; }
.lang button { border: 0; background: none; padding: 3px 9px; border-radius: 999px; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--muted); }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.swatches { display: flex; flex-direction: column; }
.swatch { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; background: none; border: 0;
  text-align: left; padding: 4px 0; cursor: pointer; }
.swatch i { width: 12px; height: 12px; border-radius: 2px; }
.swatch .n { color: var(--muted); font-size: 12px; }
.sheet-handle { display: none; }
.energy-scale div { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 2px 0; }
.energy-scale i { height: 14px; border-radius: 2px; }
.energy-scale .n { color: var(--muted); font-size: 12px; }
.src { font-size: 12px; color: var(--ink); text-decoration-color: var(--accent); text-underline-offset: 3px; }
.layer-intro { margin: 6px 0 10px; line-height: 1.5; }
.filter { width: 100%; font: inherit; padding: 7px 10px; border: 1px solid var(--rule); border-radius: 6px; margin-bottom: 6px; background: var(--paper); }
.people .addr { color: var(--ink); opacity: .55; }
.n, .tally, .card dd, .card .y { font-variant-numeric: tabular-nums; }
.swatch[aria-pressed="false"] { opacity: .35; }
.ramp { height: 10px; border-radius: 2px; margin: 4px 0 6px; }
.ramp-scale { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.note { color: var(--muted); font-size: 12px; margin: 10px 0 0; }

.layers { display: flex; flex-direction: column; gap: 2px; margin: 0 -8px; }
.layer { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; background: none; border: 0; text-align: left;
  padding: 8px; border-radius: 6px; cursor: pointer; }
.layer:hover { background: var(--sky); }
.layer[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.layer b { font-weight: 700; }
.layer .era, .layer .n { font-size: 12px; opacity: .7; }
.layer .n { grid-row: 1 / 3; grid-column: 2; align-self: center; }
.layer-detail { margin-top: 10px; }
.stories { list-style: none; margin: 0 -8px; padding: 0; }
.story { display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 6px; padding: 7px 8px; cursor: pointer; }
.story:hover { background: var(--sky); }
.story b { display: block; font-weight: 600; }
.story span { display: block; color: var(--muted); font-size: 12px; line-height: 1.45; margin-top: 2px; }
.back { border: 0; background: none; padding: 0; margin: 0 0 10px; color: var(--muted); cursor: pointer; font-size: 13px; }
.back::before { content: "‹ "; }
.layer-title { font-size: 22px !important; font-weight: 800 !important; letter-spacing: -0.02em; margin: 0 !important; line-height: 1.1; }
.layer-era { margin: 2px 0 0; color: var(--muted); }
.layer-detail p { margin: 0 0 10px; line-height: 1.55; }
.layer-detail a { color: var(--ink); text-decoration-color: var(--accent); text-underline-offset: 3px; font-size: 12px; }
.caveat { color: var(--muted); font-size: 12px; }

/* Building card: a white slip of paper. Follows the pointer on hover; pinned by a click, then it takes clicks.
   Hierarchy: name and year are the heading; small sentence-case headings mark the sections below. */
.card { position: fixed; z-index: 10; pointer-events: none; background: var(--paper); border-radius: 10px;
  width: 330px; max-height: calc(100vh - 24px); overflow-y: auto; box-shadow: 0 8px 28px rgba(30, 40, 50, .16); font-size: 13px; }
.card.pinned { pointer-events: auto; width: 400px; }
.card-close { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.92); cursor: pointer; font-size: 18px; line-height: 1; z-index: 1; }
.card .photo { margin: 0; }
.card .photo img { display: block; width: 100%; max-height: 210px; object-fit: cover; border-radius: 10px 10px 0 0; background: var(--sky); }
.card .photo figcaption { font-size: 11px; color: var(--muted); padding: 5px 16px 0; }
.card a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.card-head { padding: 12px 16px 10px; }
.card-head h3 { margin: 0 0 6px; font-size: 17px; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; padding-right: 26px; }
.card .when { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.card .y { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.card .period { color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.card .period i, .card .chips i { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.card section { padding: 10px 16px; border-top: 1px solid var(--rule); }
.card h4 { margin: 0 0 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.card .extract { margin: 0; line-height: 1.55; }
.card .fact { background: #fff6e8; border-top-color: #f0dcc0; }
.card .fact p { margin: 0; line-height: 1.5; }
.card .chips { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.card .chips li { display: flex; gap: 8px; align-items: flex-start; }
.card .chips li i { margin-top: 5px; }
.card .chips b { font-weight: 600; }
.card .chips span { color: var(--muted); }
.card .chips p { margin: 3px 0 0; line-height: 1.5; }
.card dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; }
.card dt { color: var(--muted); }
.card dd { margin: 0; text-align: right; }
.card .why { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.card .sources p { margin: 0; }
.card .elabel { color: #fff; font-weight: 700; padding: 1px 7px; border-radius: 3px; }
.card .residents { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.card .residents span, .card .residents .desc { color: var(--muted); }
.card .residents blockquote { margin: 4px 0 0; padding-left: 10px; border-left: 2px solid var(--rule); font-size: 12px; line-height: 1.5; color: #3e4448; }
.card .photo.inline { margin: 0 -16px -10px; }
.card .photo.inline img { border-radius: 0; }
.card .hint { margin: 0; padding: 8px 16px 12px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--rule); }

/* How to move: a quiet line under the timeline's right end. */
.howto { position: fixed; right: var(--gutter); bottom: calc(env(safe-area-inset-bottom, 0px) + 120px); color: var(--muted); background: rgba(228,232,234,.85); padding: 2px 8px; border-radius: 4px;
  font-size: 12px; pointer-events: none; }
@media (max-width: 720px), (hover: none) { .howto { display: none; } }

.timeline { position: fixed; left: 0; right: 0; bottom: 0; display: flex; align-items: flex-end; gap: 14px;
  padding: 0 var(--gutter) calc(env(safe-area-inset-bottom, 0px) + 14px); pointer-events: none; }
.timeline > * { pointer-events: auto; }
.timeline canvas { flex: 1; height: 96px; cursor: ew-resize; touch-action: none; }
.play { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--ink); color: var(--paper);
  cursor: pointer; margin-bottom: 24px; display: grid; place-items: center; flex: none; }
.play svg { width: 16px; height: 16px; fill: currentColor; }

.loading { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); color: var(--muted); }

@media (max-width: 720px) {
  .dek { display: none; }
  h1 { font-size: 30px; }
  .tally-year { font-size: 30px; }
  .tally-count { font-size: 12px; }
  .masthead, .tally { top: calc(env(safe-area-inset-top, 0px) + 14px); }
  .lang { top: calc(env(safe-area-inset-top, 0px) + 66px); }
  .sibling { top: calc(env(safe-area-inset-top, 0px) + 98px); }
  /* Modes: one scrolling strip above the timeline. */
  .modes { top: auto; left: 12px; right: 12px; transform: none; bottom: calc(env(safe-area-inset-bottom, 0px) + 100px);
    overflow-x: auto; scrollbar-width: none; justify-content: flex-start; }
  .modes::-webkit-scrollbar { display: none; }
  .modes button { flex: none; padding: 8px 14px; }
  /* Panel: a sheet above the modes, folded to its handle by default. */
  .panel { top: auto; left: 12px; right: 12px; width: auto; bottom: calc(env(safe-area-inset-bottom, 0px) + 150px);
    max-height: 48vh; padding: 0 14px 12px; }
  .sheet-handle { display: block; width: calc(100% + 28px); margin: 0 -14px 8px; padding: 12px 14px; border: 0;
    background: none; text-align: left; font-weight: 600; cursor: pointer; border-bottom: 1px solid var(--rule); }
  .sheet-handle::after { content: ""; float: right; width: 8px; height: 8px; margin-top: 4px; border: solid var(--muted);
    border-width: 0 2px 2px 0; transform: rotate(225deg); }
  .panel.collapsed { overflow: hidden; padding-bottom: 0; }
  .panel.collapsed .sheet-handle { margin-bottom: 0; border-bottom: 0; }
  .panel.collapsed .sheet-handle::after { transform: rotate(45deg); margin-top: 0; }
  .panel.collapsed #panel-body { display: none; }
  /* Card: a sheet from the bottom edge. */
  .card, .card.pinned { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: auto; max-height: 72vh;
    border-radius: 14px 14px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .card .photo img { border-radius: 14px 14px 0 0; max-height: 190px; }
  .timeline { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); }
  .timeline canvas { height: 76px; }
  .play { width: 40px; height: 40px; margin-bottom: 18px; }
}
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* About: a reading page over the map. */
.lang .about-open { color: var(--ink); }
.about { border: 0; border-radius: 12px; padding: 0; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  box-shadow: 0 20px 60px rgba(30, 40, 50, .25); color: var(--ink); }
.about::backdrop { background: rgba(228, 232, 234, .7); }
.about article { padding: 28px 32px 32px; overflow-y: auto; }
.about h2 { margin: 0 0 12px; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.about h3 { margin: 22px 0 6px; font-size: 15px; font-weight: 700; }
.about p, .about li { line-height: 1.6; max-width: 64ch; }
.about ul { padding-left: 18px; margin: 6px 0 0; }
.about li { margin-bottom: 6px; }
.about a { color: var(--ink); text-decoration-color: var(--accent); text-underline-offset: 3px; }
.about .credit { color: var(--muted); }
.about .author { font-weight: 600; margin-bottom: 4px; }
.about .author + .credit { margin-top: 0; }
.about .notice { border-left: 3px solid var(--accent); padding-left: 12px; font-weight: 500; }
.about-close { position: sticky; float: right; top: 10px; margin: 10px 10px 0 0; width: 32px; height: 32px; border: 0;
  border-radius: 50%; background: var(--sky); cursor: pointer; font-size: 18px; }
@media (max-width: 720px) { .about article { padding: 20px 18px 24px; } }
.contribute { margin: 14px 0 0; padding-top: 10px; border-top: 1px solid var(--rule); font-size: 12px; }
.contribute a { color: var(--ink); text-decoration-color: var(--accent); text-underline-offset: 3px; }

/* Quests. The one playful thing on the page: Delft tiles. Each quest is a tile with painted corners, the score is
   counted in tiles, and a found building gets a blue stamp. */
.modes .quests-open { display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; background: var(--accent);
  color: var(--paper); }
.modes .quests-open svg { width: 13px; height: 13px; fill: currentColor; }
.modes .quests-open:hover { filter: brightness(1.15); }
.q-tiles { display: inline-flex; gap: 2px; vertical-align: -1px; }
.q-tiles i { width: 9px; height: 9px; border-radius: 2px; border: 1.5px solid var(--accent); background: transparent; }
.q-tiles i.on { background: var(--accent); }
.q-level { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--accent); }

/* The list: a wall of ten tiles that fits without scrolling. The deeper the blue, the harder the quest. */
.quests { width: min(1000px, calc(100vw - 32px)); }
.quests article { padding: 22px 26px 24px; }
.quests h2 { margin: 0; }
.quests .q-lede { max-width: 72ch; margin: 6px 0 0; font-size: 13px; line-height: 1.5; }
.quests .q-score { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.quests .q-score b { color: var(--accent); font-size: 17px; }
.quests .q-grid { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.quests .q-tile { margin: 0; max-width: none; line-height: 1.35; }
.q-tile { --fill: .06; position: relative; display: flex; flex-direction: column; gap: 4px; padding: 15px 14px 12px;
  border: 1px solid #c9d3ea; border-radius: 3px; outline: 1px solid #c9d3ea; outline-offset: -6px;
  /* the painted corners of a Delft tile, over a wash as deep as the quest is hard */
  background: radial-gradient(circle at 0 0, var(--accent) 0 8px, transparent 9px),
    radial-gradient(circle at 100% 0, var(--accent) 0 8px, transparent 9px),
    radial-gradient(circle at 0 100%, var(--accent) 0 8px, transparent 9px),
    radial-gradient(circle at 100% 100%, var(--accent) 0 8px, transparent 9px),
    rgb(31 63 154 / var(--fill)); }
.q-tile.l2 { --fill: .16; }
.q-tile.l3 { --fill: .3; }
.q-tile h3 { margin: 2px 0 0; font-size: 14px; line-height: 1.25; letter-spacing: -0.01em; }
.q-tile p { margin: 0; color: #4b5560; font-size: 12px; line-height: 1.4; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.q-tile footer { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; gap: 6px; }
.q-tile .q-progress { font-size: 11px; color: #4b5560; font-variant-numeric: tabular-nums; }
.q-tile.complete::after { content: "✓"; position: absolute; top: 9px; right: 12px; color: var(--accent); font-weight: 800; }
.quests .q-start { border: 0; background: var(--accent); color: var(--paper); border-radius: 999px; padding: 4px 11px;
  cursor: pointer; font-size: 11px; font-weight: 700; }
.q-tile.complete .q-start { background: var(--paper); color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }

/* The riddle card: stays in the corner while the map is used to find the answer. */
.quest { position: fixed; z-index: 11; right: var(--gutter); bottom: 132px; width: 340px; max-height: calc(100vh - 290px);
  overflow-y: auto; background: var(--paper); border-radius: 12px; box-shadow: 0 2px 0 var(--accent), 0 10px 30px rgba(20, 40, 100, .14); }
.quest header { cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 11px 44px 10px 16px;
  background: var(--accent); color: var(--paper); border-radius: 12px 12px 0 0; }
.quest header b { font-size: 13px; }
.quest header .q-level { color: rgba(255, 255, 255, .85); margin-left: auto; }
.quest header .q-tiles i { border-color: rgba(255, 255, 255, .85); }
.quest header .q-tiles i.on { background: rgba(255, 255, 255, .85); }
.quest .q-close { position: absolute; top: 5px; right: 6px; width: 30px; height: 30px; border: 0; border-radius: 50%;
  background: none; cursor: pointer; font-size: 18px; color: var(--paper); z-index: 1; }
.quest .q-steps { display: flex; align-items: center; gap: 5px; padding: 10px 16px 0; }
.quest .q-steps i { width: 14px; height: 14px; border-radius: 3px; border: 1.5px solid #c9d3ea; }
.quest .q-steps i.done { background: var(--accent); border-color: var(--accent); }
.quest .q-steps i.now { border-color: var(--accent); }
.quest .q-steps span { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.quest .q-photo { margin: 10px 16px 0; overflow: hidden; height: 150px; border-radius: 6px; background: var(--sky); }
.quest .q-photo img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.35); display: block; }
.quest .q-credit { font-size: 11px; color: var(--muted); padding: 4px 16px 0; margin: 0; }
.quest .q-credit a { color: inherit; }
.quest .q-riddle { margin: 0; padding: 10px 16px 0; font-size: 15px; line-height: 1.5; }
.quest .q-count { margin: 6px 16px 0; font-size: 12px; color: var(--accent); font-weight: 600; }
.quest .q-hints { margin: 8px 16px 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.quest .q-hints li { color: #3e4448; font-size: 13px; line-height: 1.45; padding-left: 10px; border-left: 2px solid var(--accent); }
.quest .q-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 12px 16px 14px; }
.quest .q-actions button { border: 1px solid var(--rule); background: var(--paper); border-radius: 999px;
  padding: 5px 12px; cursor: pointer; font-size: 12px; font-weight: 600; }
.quest .q-actions button small { color: var(--muted); font-weight: 500; }
.quest .q-actions .primary { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.quest .q-worth { margin-left: auto; }
.quest .q-feedback { margin: 0; padding: 8px 16px 0; font-size: 13px; color: var(--muted); min-height: 1.4em; }
.quest .q-feedback.hot { color: #c2410c; font-weight: 600; }
.quest .q-feedback.warm { color: #b7791f; }
.quest .q-feedback.cold { color: #4a6fa5; }
.quest .q-feedback.miss { animation: q-shake .35s; }
.quest .q-found { position: relative; margin: 12px 16px 0; padding: 12px 12px 10px; background: #eef2fb; border-radius: 8px; }
.quest .q-found b { display: block; margin-bottom: 4px; padding-right: 90px; }
.quest .q-found p { margin: 0; font-size: 13px; line-height: 1.5; }
.quest .q-found a { color: inherit; text-decoration-color: var(--accent); }
.quest .q-found .q-earned { margin-top: 8px; font-size: 12px; color: var(--muted); }
.quest .q-found .q-final { margin-top: 8px; font-size: 14px; }
.quest .q-found .q-final b { color: var(--accent); font-size: 18px; }
.q-stamp { position: absolute; top: -10px; right: 10px; padding: 4px 10px; border: 2.5px solid var(--accent); border-radius: 6px;
  color: var(--accent); font-weight: 800; font-size: 14px; letter-spacing: .02em; background: rgba(238, 242, 251, .9);
  transform: rotate(-8deg); animation: q-stamp .45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes q-stamp { from { transform: rotate(-30deg) scale(2.2); opacity: 0; } to { transform: rotate(-8deg) scale(1); opacity: 1; } }
@keyframes q-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.quest.folded > :not(header):not(.q-close):not(.q-steps):not(.q-feedback) { display: none; }
.quest.folded .q-feedback, .quest.folded .q-steps { padding-bottom: 10px; }
@media (max-width: 720px) {
  .quest { left: 12px; right: 12px; width: auto; bottom: auto; top: calc(env(safe-area-inset-top, 0px) + 100px); max-height: 46vh; }
  .quest .q-photo { height: 110px; }
  .quests .q-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .quests article { padding: 18px 16px 18px; }
  .quests .q-lede { display: none; }
  .q-tile p { display: none; }
  .q-tile { padding: 12px 11px 10px; }
  .modes .quests-open { order: -1; margin: 0 4px 0 0; }
}
@media (prefers-reduced-motion: reduce) { .quest .q-feedback.miss, .q-stamp { animation: none; } }

@media (min-width: 721px) and (max-width: 960px) { .quests .q-grid { grid-template-columns: repeat(4, 1fr); } }

.modes .quests-open[hidden] { display: none !important; }
