/* Tiendorp: flat "sticker" cartoon look. No black outlines: flat colour shapes, soft drop shadows,
   rounded corners, a rounded display face (Fredoka) and an early-reader body face (Andika).
   Single theme on purpose. Layout: one screen at a time; the play screen stacks on phones/portrait
   and splits in two on landscape tablets; big desktop screens are scaled up by game.js. */
@font-face { font-family: "Fredoka"; src: url("fonts/fredoka-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("fonts/fredoka-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("fonts/fredoka-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Andika"; src: url("fonts/andika-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Andika"; src: url("fonts/andika-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --sky: #d6eefb;
  --paper: #ffffff;
  --ink: #2f3640;
  --muted: #6b7685;
  --soft: #eef3f8;
  --soft-2: #dde7f1;
  --sun: #ffc93c;
  --sun-dark: #e3a91a;
  --tomato: #ff6b6b;
  --leaf: #5fcb7d;
  --leaf-light: #79d793;
  --leaf-dark: #43ad62;
  --water: #4fb3ea;
  --water-light: #6cc4f2;
  --water-dark: #2f8fd0;
  --wood: #b9773f;
  --wood-light: #cf9156;
  --wood-dark: #8b5a32;
  --plank2: #ffa53a;
  --plank2-light: #ffbe6a;
  --good: #2fa866;
  --bad: #e5484d;
  --font-display: "Fredoka", "Andika", "Ubuntu", system-ui, sans-serif;
  --font-body: "Andika", "Ubuntu", system-ui, -apple-system, "Segoe UI", sans-serif;
  --emoji: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  --shadow: 0 10px 24px -14px rgba(30, 70, 115, .45), 0 2px 0 rgba(30, 70, 115, .05);
  --shadow-sm: 0 6px 14px -10px rgba(30, 70, 115, .5);
  --press: 0 4px 0 var(--soft-2);
  --r: 22px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background-color: var(--sky);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: none;
}
input { -webkit-user-select: text; user-select: text; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; touch-action: manipulation; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 4px solid var(--water); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; line-height: 1.1; text-wrap: balance; }

#app { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; padding-inline: 16px; padding-block: max(12px, env(safe-area-inset-top)) 40px; }
.screen { display: flex; flex-direction: column; gap: 16px; animation: fade .25s ease-out; }
@keyframes fade { from { opacity: .3; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- characters: flat sticker look (white rim from the halo copy) ---------- */
.doodle { display: block; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 3px 2px rgba(30, 60, 100, .2)); }
.doodle .halo * { fill: #fff !important; stroke: #fff !important; stroke-width: 7px !important; stroke-linejoin: round; stroke-linecap: round; opacity: 1 !important; }
/* lines (tails, legs) get a rim around the line itself, not a white filled curve */
.doodle .halo [fill="none"] { fill: none !important; }
.doodle .halo .keep[fill="none"] { stroke-width: 13px !important; }
.doodle .art *:not(.keep) { stroke: none; }
.doodle .art [fill="none"]:not(.keep) { stroke: #463c3c; stroke-width: 2.4px; stroke-linecap: round; stroke-linejoin: round; }
.doodle .art .keep { stroke-linecap: round; stroke-linejoin: round; }

/* ---------- shared pieces ---------- */
.panel { background: var(--paper); border-radius: var(--r); padding: 22px 20px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.panel h2 { font-size: 1.8rem; }
.btn { border: 0; border-radius: 16px; padding: 11px 22px; background: var(--sun); color: var(--ink); font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; line-height: 1.15; cursor: pointer; box-shadow: 0 4px 0 var(--sun-dark); transition: transform .08s, box-shadow .08s; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--sun-dark); }
.btn.ghost { background: var(--paper); box-shadow: 0 4px 0 var(--soft-2), var(--shadow-sm); }
.btn.ghost:active { box-shadow: 0 1px 0 var(--soft-2); }
.btn.danger { background: var(--tomato); color: #fff; box-shadow: 0 4px 0 #d24c50; }
.btn:disabled { opacity: .45; cursor: default; }
a.btn { text-decoration: none; display: inline-block; }
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; align-self: center; padding: 8px; font-size: .95rem; }
.icon-btn { width: 50px; height: 50px; border-radius: 16px; border: 0; background: var(--paper); cursor: pointer; font-size: 1.35rem; font-family: var(--emoji), var(--font-body); box-shadow: 0 4px 0 var(--soft-2), var(--shadow-sm); flex: none; display: grid; place-items: center; padding: 0; }
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--soft-2); }
.row-inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row-inline.center { justify-content: center; }
.pill { background: var(--sun); border-radius: 999px; padding: 2px 14px; font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
input, select { font: inherit; font-size: 1.15rem; padding: 10px 14px; border-radius: 14px; border: 2px solid var(--soft-2); background: #fff; color: var(--ink); min-width: 0; }
input { flex: 1 1 160px; }
select { max-width: 100%; }
input:focus, select:focus { border-color: var(--water); outline: none; }
.store-note { color: var(--muted); font-size: .85rem; margin: 0; }
.hint-text { color: var(--muted); font-size: .9rem; margin: 0; }

.topbar { display: flex; align-items: center; gap: 10px; }
.topbar .who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-family: var(--font-display); font-weight: 600; font-size: 1.45rem; line-height: 1.15; }
.topbar .who strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.top-actions { display: flex; gap: 8px; }

/* ---------- profiles ---------- */
.hero { text-align: center; padding-top: 6px; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.hero h1 { font-size: clamp(2.7rem, 11vw, 4rem); font-weight: 700; line-height: .95; color: var(--water-dark); }
.hero h1 small { display: block; font-size: .4em; font-weight: 500; margin-top: 8px; color: var(--ink); }
.hero-art { display: flex; align-items: flex-end; gap: 4px; height: 124px; }
.hero-art .c { width: 112px; height: 112px; }
.hero-art .c.small { width: 88px; height: 88px; }
.hero-art .wave { animation: wave 1.8s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes wave { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.profile-list { display: grid; gap: 10px; }
.profile-btn { display: flex; align-items: center; gap: 12px; border: 0; border-radius: 18px; padding: 8px 14px; background: var(--soft); cursor: pointer; text-align: left; box-shadow: 0 4px 0 var(--soft-2); }
.profile-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--soft-2); }
.profile-btn .av { width: 56px; height: 56px; flex: none; }
.profile-btn .nm { font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.new-profile { display: flex; flex-direction: column; gap: 6px; }
.new-profile label { font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }

/* ---------- map ---------- */
.world-tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.world-tab { flex: 1 1 140px; border: 0; border-radius: 16px; background: var(--paper); padding: 8px 14px; font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; line-height: 1.15; cursor: pointer; box-shadow: 0 4px 0 var(--soft-2), var(--shadow-sm); }
.world-tab[aria-selected="true"] { background: var(--water); color: #fff; box-shadow: 0 4px 0 var(--water-dark); }
.world-tab.locked { opacity: .75; }
.world-tab:active { transform: translateY(3px); }
.gate h2 { font-size: 1.6rem; }
.gate p { margin: 0; }
.gate-list { display: grid; gap: 8px; }
.gate-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 0; border-radius: 14px; background: var(--soft); padding: 10px 14px; cursor: pointer; text-align: left; box-shadow: 0 3px 0 var(--soft-2); }
.gate-item:active { transform: translateY(2px); box-shadow: none; }
.gate-item b { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; line-height: 1.15; }
.gate-item span { font-size: .95rem; white-space: nowrap; color: var(--muted); }
.gate-progress { height: 16px; border-radius: 10px; background: var(--soft); overflow: hidden; }
.gate-progress i { display: block; height: 100%; background: var(--leaf); border-radius: 10px; }

.village { background: var(--paper); border-radius: 20px; padding: 10px 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; box-shadow: var(--shadow); }
.village .lbl { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; width: 100%; }
.village .fr { width: 56px; height: 56px; }
.village .fr.missing { opacity: .3; filter: grayscale(1); }
.trail { list-style: none; margin: 0; padding: 4px 0 0; display: flex; flex-direction: column; position: relative; }
.trail::before { content: ""; position: absolute; top: 30px; bottom: 30px; left: 50%; width: 18px; margin-left: -9px; border-radius: 10px;
  background: linear-gradient(90deg, var(--water-dark), var(--water-light) 50%, var(--water-dark)); opacity: .85; }
.stop { position: relative; display: flex; padding: 9px 0; }
.stop:nth-child(odd) { justify-content: flex-start; }
.stop:nth-child(even) { justify-content: flex-end; }
.stop button { position: relative; z-index: 1; width: min(80%, 340px); display: flex; align-items: center; gap: 10px; text-align: left; border: 0; border-radius: 20px; padding: 8px 12px; background: var(--paper); cursor: pointer; box-shadow: 0 4px 0 var(--soft-2), var(--shadow); }
.stop button:active { transform: translateY(3px); }
.stop button:disabled { cursor: default; background: #f3f7fb; box-shadow: none; }
.stop .av { width: 64px; height: 64px; flex: none; }
.stop.locked .av { opacity: .3; filter: grayscale(1); }
.stop .txt { display: flex; flex-direction: column; min-width: 0; }
.stop .ch { font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.stop .nm { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; line-height: 1.1; }
.stop .st { font-size: 1rem; font-variant-numeric: tabular-nums; }
.stop.current button { background: var(--sun); box-shadow: 0 4px 0 var(--sun-dark), var(--shadow); }
.stop .lock { font-family: var(--emoji); }

/* ---------- chapter ---------- */
.chapter-head { display: flex; gap: 12px; align-items: center; }
.chapter-friend { width: 90px; height: 90px; flex: none; }
.chapter-head p { margin: 0; font-size: 1.05rem; }
.bridges { display: grid; gap: 10px; }
.bridge-btn { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 0; border-radius: 18px; background: var(--soft); cursor: pointer; text-align: left; box-shadow: 0 4px 0 var(--soft-2); }
.bridge-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--soft-2); }
.bridge-btn.next { background: var(--sun); box-shadow: 0 4px 0 var(--sun-dark); }
.bridge-btn:disabled { opacity: .45; cursor: default; box-shadow: none; }
.bridge-btn .n { font-family: var(--font-display); font-weight: 600; font-size: 1.4rem; flex: 1; line-height: 1.1; }
.bridge-btn .n small { display: block; font-family: var(--font-body); font-weight: 700; font-size: .88rem; color: var(--muted); margin-top: 2px; }
.stars-sm { font-size: 1.45rem; letter-spacing: 1px; color: var(--sun); white-space: nowrap; }
.stars-sm .no { color: #cfdbe7; }
.chap-note { margin: 0; background: #fff4d2; border-radius: 14px; padding: 10px 14px; font-weight: 700; }
.bridge-btn .bb-planks, .bridge-btn .bb-stars, .bridge-btn .bb-lock, .bridge-btn .bb-play { display: none; }

/* ---------- story / bedtime ---------- */
/* the game is zoomed up on big screens (fitScreen in game.js), so divide by the zoom or the screen grows taller than the window */
.story { min-height: calc(82vh / var(--zoom, 1)); justify-content: center; }
.story-place { align-self: center; font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; background: var(--sun); padding: 2px 18px; border-radius: 999px; }
.story-stage { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.speaker { width: clamp(160px, 44vw, 230px); height: clamp(160px, 44vw, 230px); animation: bob 1.6s ease-in-out infinite; }
.speaker.jump { animation: jump .45s ease-out, bob 1.6s ease-in-out .45s infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-6px) rotate(1deg); } }
@keyframes jump { 0% { transform: translateY(20px) scale(.9, 1.1); } 50% { transform: translateY(-18px) scale(1.05, .95); } 100% { transform: none; } }
.bubble { position: relative; background: var(--paper); border-radius: 26px; padding: 16px 22px 18px; width: 100%; box-shadow: var(--shadow); }
.bubble::before { content: ""; position: absolute; top: -12px; left: 50%; margin-left: -13px; border: 13px solid transparent; border-top: 0; border-bottom-color: var(--paper); }
.speaker-name { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; color: var(--water-dark); }
.bubble p { margin: 4px 0 0; font-size: 1.35rem; line-height: 1.45; font-weight: 700; text-wrap: pretty; max-width: 40ch; }
.story-actions { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ---------- play ---------- */
.progress { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; max-width: 50%; }
.progress i { width: 12px; height: 24px; border-radius: 4px; background: rgba(255, 255, 255, .85); box-shadow: inset 0 -3px 0 var(--soft-2); }
.progress i.ok { background: var(--wood); box-shadow: inset 0 -3px 0 var(--wood-dark); }
.progress i.help { background: var(--plank2); box-shadow: inset 0 -3px 0 #e48a20; }
.progress i.now { background: var(--sun); box-shadow: inset 0 -3px 0 var(--sun-dark); }

.play-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* river scene */
.scene { --bankw: clamp(44px, 12vw, 70px); --actor: clamp(64px, 16vw, 100px); position: relative; display: flex; align-items: stretch; border-radius: var(--r); overflow: hidden; min-height: 200px; box-shadow: var(--shadow); background: var(--water); }
.bank { flex: 0 0 var(--bankw); position: relative; z-index: 1; background: linear-gradient(180deg, var(--leaf-light) 0 14px, var(--leaf) 14px 100%); }
.bank.left { border-radius: 0 44px 34px 0; box-shadow: 6px 0 0 #e9d9a8; }
.bank.right { border-radius: 44px 0 0 34px; box-shadow: -6px 0 0 #e9d9a8; }
.water { flex: 1; min-width: 0; position: relative; display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: 60px 4px 16px; gap: 22px;
  background: linear-gradient(180deg, var(--water-light) 0, var(--water) 45%, var(--water-dark) 100%); }
.mist-note { display: none; }
.scene.no-help .bridge, .scene.no-help .raft-wrap, .scene.no-help .dock { visibility: hidden; }
.scene.no-help .water { background: linear-gradient(180deg, #a9d9f3, #8fcbee); }
.scene.no-help .mist-note { display: block; position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 6; width: max-content; max-width: calc(100% - 16px);
  text-align: center; padding: 7px 14px; border-radius: 16px; background: rgba(255, 255, 255, .88); font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; line-height: 1.2; color: var(--ink); box-shadow: var(--shadow-sm); }

.actor { position: absolute; top: max(2px, calc(var(--deck, 0px) - var(--actor) + 10px)); left: calc(var(--bankw) / 2); width: var(--actor); height: var(--actor); transform: translateX(-50%); transition: left 1.6s ease-in-out, top .3s ease-out; z-index: 3; cursor: pointer; }
.actor.friend { left: calc(100% - var(--bankw) / 2); }
.scene.cross #actorBram { left: calc(100% - var(--bankw) - 26px); animation: hop .32s ease-in-out 5; }
@keyframes hop { 50% { margin-top: -10px; } }
.actor.boing { animation: boing .55s ease-out; }
@keyframes boing {
  0% { transform: translateX(-50%) scale(1, 1); }
  25% { transform: translateX(-50%) scale(1.25, .78); }
  50% { transform: translateX(-50%) scale(.85, 1.22) translateY(-8px); }
  75% { transform: translateX(-50%) scale(1.08, .94); }
  100% { transform: translateX(-50%) scale(1, 1); }
}
.fred { position: absolute; right: calc(var(--bankw) + 4px); bottom: -8px; width: 58px; height: 58px; padding: 0; border: 0; background: none; cursor: pointer; z-index: 2; }
.fred.jump { animation: fredJump .7s ease-out; }
@keyframes fredJump { 0% { transform: translateY(0); } 40% { transform: translateY(-50px) rotate(-20deg); } 100% { transform: translateY(0); } }
.fred-say { position: absolute; right: calc(var(--bankw) + 52px); bottom: 36px; z-index: 4; background: #fff; border-radius: 14px; padding: 2px 12px; font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; line-height: 1.3; max-width: 60%; box-shadow: var(--shadow-sm); }

/* bridge, raft and bundles: flat wood */
.bridge, .raft, .dock { display: flex; gap: 3px; align-items: center; position: relative; }
/* the bridge spans the whole river from bank to bank, with a railing on top and posts into the water */
.bridge { align-self: stretch; justify-content: center; margin: 18px -4px 0; padding: 6px 10px; border-radius: 3px; background: #6f4423;
  box-shadow: 0 6px 0 #573419, 0 26px 16px -10px rgba(0, 40, 90, .3); }
.bridge::before { content: ""; position: absolute; left: 6px; right: 6px; bottom: 100%; height: 20px; pointer-events: none;
  background:
    linear-gradient(#9a6236, #9a6236) 0 0 / 100% 5px no-repeat,
    repeating-linear-gradient(90deg, #7a4b28 0 7px, transparent 7px 52px) 0 0 / 100% 100% no-repeat;
  border-radius: 3px 3px 0 0; }
.bridge::after { content: ""; position: absolute; left: 14px; right: 14px; top: calc(100% + 6px); height: 26px; pointer-events: none;
  background: repeating-linear-gradient(90deg, #573419 0 9px, transparent 9px 64px);
  -webkit-mask: linear-gradient(#000 55%, transparent); mask: linear-gradient(#000 55%, transparent); }
.raft { padding: 7px 9px; border-radius: 14px; min-height: 58px; min-width: 70px;
  background: repeating-linear-gradient(90deg, var(--wood-dark) 0 14px, #7a4d2b 14px 16px); box-shadow: 0 5px 0 #5e3a20; }
.raft-wrap { animation: float 2.6s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(4px) rotate(1deg); } }
.plank { width: clamp(19px, 5.4vw, 30px); height: clamp(36px, 10vw, 48px); border-radius: 6px; flex: none; position: relative; transition: background .3s, transform .3s, box-shadow .3s; }
.bridge .plank:nth-child(5) { margin-right: 12px; }
.plank.empty { background: rgba(255, 255, 255, .14); border: 2px dashed rgba(255, 255, 255, .75); }
.plank.a, .plank.given { background: linear-gradient(90deg, var(--wood-light) 0 30%, var(--wood) 30% 100%); box-shadow: inset 0 -4px 0 rgba(80, 40, 10, .25); }
.plank.b { background: linear-gradient(90deg, var(--plank2-light) 0 30%, var(--plank2) 30% 100%); box-shadow: inset 0 -4px 0 rgba(160, 80, 0, .25); }
.raft .plank.cut { margin-left: 14px; }
.plank.pop { animation: pop .55s both; }
.plank.hint { box-shadow: 0 0 0 4px var(--sun), 0 0 14px 2px rgba(255, 201, 60, .8); }
@keyframes pop { 0% { transform: translateY(40px) rotate(20deg) scale(.6); } 60% { transform: translateY(-6px) rotate(-6deg) scale(1.1); } 100% { transform: none; } }
.dock { flex-wrap: wrap; justify-content: center; padding: 5px 9px; border-radius: 10px; background: #6f4423; box-shadow: 0 5px 0 #573419; min-height: 56px; max-width: 100%; align-items: flex-end; gap: 4px; }
.bundle { width: clamp(22px, 6vw, 30px); height: clamp(40px, 10vw, 48px); border-radius: 6px; position: relative; flex: none;
  background: repeating-linear-gradient(90deg, var(--wood-light) 0 2px, var(--wood) 2px 3px); box-shadow: inset 0 -4px 0 rgba(80, 40, 10, .25); }
.bundle::after { content: ""; position: absolute; left: -3px; right: -3px; top: 40%; height: 7px; background: var(--sun); border-radius: 4px; box-shadow: 0 2px 0 var(--sun-dark); }
.bundle.b { background: repeating-linear-gradient(90deg, var(--plank2-light) 0 2px, var(--plank2) 2px 3px); }
.bundle.pop { animation: pop .55s both; }
.bundle.hint { box-shadow: 0 0 0 4px var(--sun), 0 0 14px 2px rgba(255, 201, 60, .8); }
.raft .bundle { margin-inline: 1px; }

/* sum card and keypad */
.q-card, .pad-card { background: var(--paper); border-radius: var(--r); padding: 16px 14px; box-shadow: var(--shadow); }
.q-card { display: flex; flex-direction: column; gap: 10px; }
.sum { display: flex; justify-content: center; align-items: center; gap: .24em; font-family: var(--font-display); font-weight: 600; font-size: clamp(3rem, 13vw, 4.4rem); line-height: 1; position: relative; font-variant-numeric: tabular-nums; }
.sum.has-split { padding-bottom: 116px; }
.sum .na { color: var(--wood); }
.sum .nb { color: var(--plank2); position: relative; }
.sum .op { color: #a3afbd; font-weight: 500; }
.sum .unit { font-size: .45em; color: var(--muted); align-self: flex-end; margin-left: -.12em; margin-bottom: .2em; }
.sum .sp { width: .2em; }
.split { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
.split svg { width: 108px; height: 32px; display: block; overflow: visible; }
.split line { stroke: #b6c2cf; stroke-width: 4; stroke-linecap: round; }
.split .boxes { display: flex; gap: 22px; }
.box { min-width: 1.4em; height: 1.2em; padding: 0 .1em; border: 3px dashed #c5d1de; border-radius: .25em; display: grid; place-items: center; color: var(--ink); background: #fff; transition: border-color .15s, background .15s, box-shadow .15s; }
.split .box { font-size: 2.4rem; min-width: 1.5em; }
.box.given { border: 0; color: var(--wood); background: var(--soft); }
.box.active { border: 3px solid var(--sun); background: #fff7dc; box-shadow: 0 0 0 5px rgba(255, 201, 60, .25); }
.box.ok { border: 3px solid #bfe8cf; background: #effaf3; color: var(--good); }
.box.fill.ok { color: var(--plank2); border-color: #ffd9a8; background: #fff6ea; }
.box.shake { animation: shake .4s; border-color: var(--bad); }
.caret { color: #c2ccd8; }
@keyframes shake { 0%, 100% { transform: translateX(0) rotate(0); } 25% { transform: translateX(-7px) rotate(-4deg); } 75% { transform: translateX(7px) rotate(4deg); } }

.prompt { text-align: center; display: flex; flex-direction: column; gap: 2px; min-height: 5.6em; justify-content: center; }
.step-label { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.question { font-weight: 700; font-size: 1.28rem; line-height: 1.35; text-wrap: balance; }
.say { border: 0; background: var(--soft); border-radius: 10px; cursor: pointer; font-family: var(--emoji); font-size: .95rem; padding: 3px 8px; vertical-align: 2px; box-shadow: 0 2px 0 var(--soft-2); }
.feedback { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; line-height: 1.15; min-height: 1.15em; text-wrap: balance; margin: 2px 0 0; }
.feedback.good { color: var(--good); }
.feedback.bad { color: var(--bad); }
.feedback small { display: block; font-family: var(--font-body); font-weight: 700; font-size: 1.02rem; color: var(--ink); margin-top: 4px; line-height: 1.35; }

.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pad button { font-family: var(--font-display); font-weight: 600; font-size: 2rem; height: 64px; border: 0; border-radius: 16px; background: var(--soft); cursor: pointer; box-shadow: 0 4px 0 var(--soft-2); line-height: 1; transition: transform .06s, box-shadow .06s; }
.pad button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--soft-2); }
.pad .go { background: var(--leaf); color: #fff; box-shadow: 0 4px 0 var(--leaf-dark); }
.pad .go:active { box-shadow: 0 1px 0 var(--leaf-dark); }
.pad .del { font-size: 1.25rem; color: var(--muted); }

/* landscape tablets: scene + question left, keypad right, everything on one screen */
@media (min-width: 860px) and (orientation: landscape) {
  #app { max-width: 1180px; }
  .play { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); grid-template-areas: "top top" "main pad"; align-items: start; column-gap: 20px; }
  .play > .topbar { grid-area: top; }
  .play-main { grid-area: main; }
  .pad-card { grid-area: pad; position: sticky; top: 12px; }
  .pad button { height: 82px; font-size: 2.4rem; }
  .scene { min-height: 214px; }
  #scr-map, #scr-chapter, #scr-badges, #scr-parent, #scr-profiles, #scr-done, #scr-story, #scr-sleep { max-width: 720px; margin-inline: auto; width: 100%; }
}

/* ---------- done ---------- */
.done-panel { text-align: center; align-items: center; padding-block: 26px; }
.done-art { width: 150px; height: 150px; animation: bob 1.6s ease-in-out infinite; }
.done-panel h2 { font-size: 2.3rem; }
.done-panel p { margin: 0; max-width: 36ch; font-size: 1.1rem; }
.big-stars { font-size: 3.4rem; letter-spacing: 6px; line-height: 1; }
.big-stars span { display: inline-block; color: #dbe5ef; }
.big-stars span.on { color: var(--sun); text-shadow: 0 4px 0 var(--sun-dark); animation: starIn .5s both; }
.big-stars span.on:nth-child(2) { animation-delay: .3s; }
.big-stars span.on:nth-child(3) { animation-delay: .6s; }
@keyframes starIn { 0% { transform: scale(0) rotate(-120deg); } 70% { transform: scale(1.4); } 100% { transform: none; } }
.new-badges { display: flex; flex-direction: column; gap: 8px; width: 100%; }

/* ---------- badges ---------- */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.badge { background: var(--paper); border-radius: 18px; padding: 14px 10px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; box-shadow: var(--shadow); }
.badge .ic { font-family: var(--emoji); font-size: 2.2rem; width: 64px; height: 64px; border-radius: 50%; background: var(--sun); box-shadow: 0 4px 0 var(--sun-dark); display: grid; place-items: center; line-height: 1; }
.badge .t { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; line-height: 1.15; margin-top: 4px; }
.badge .d { font-size: .85rem; color: var(--muted); line-height: 1.3; }
.badge.locked { box-shadow: none; background: #f1f5f9; }
.badge.locked .ic { background: var(--soft-2); box-shadow: none; filter: grayscale(1); opacity: .5; }
.badge-row { display: flex; align-items: center; gap: 12px; background: #fff4d2; border-radius: 16px; padding: 10px 14px; text-align: left; }
.badge-row .ic { font-family: var(--emoji); font-size: 2rem; }
.badge-row .t { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; line-height: 1.1; }
.badge-row .d { font-size: .88rem; color: var(--muted); }

/* ---------- parent ---------- */
.parent { -webkit-user-select: text; user-select: text; }
.parent h3 { font-size: 1.35rem; margin-top: 6px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.stat { background: var(--soft); border-radius: 14px; padding: 10px 12px; }
.stat b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.7rem; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat span { font-size: .82rem; color: var(--muted); font-weight: 700; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: .95rem; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--soft-2); white-space: nowrap; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: center; cursor: pointer; }
.check input { flex: none; width: 24px; height: 24px; accent-color: var(--water-dark); }
.confirm { background: #ffe8e8; border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.confirm p { margin: 0; }

/* ---------- toasts ---------- */
.toasts { position: fixed; left: 0; right: 0; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; z-index: 20; padding-inline: 16px; }
.toast { display: flex; gap: 12px; align-items: center; background: var(--paper); border-radius: 18px; padding: 8px 18px 8px 10px; box-shadow: 0 14px 30px -12px rgba(30, 60, 100, .5); animation: toastIn .5s both; max-width: 100%; }
.toast .ic { font-family: var(--emoji); font-size: 1.9rem; width: 48px; height: 48px; border-radius: 50%; background: var(--sun); display: grid; place-items: center; }
.toast small { display: block; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.toast b { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; line-height: 1.1; }
@keyframes toastIn { 0% { transform: translateY(40px) scale(.9); opacity: 0; } 60% { transform: translateY(-6px) scale(1.02); opacity: 1; } 100% { transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* moving waves on the river: two tiling wave layers drifting at different speeds */
.water::before, .water::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.water::before { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='38'%3E%3Cpath d='M0 19 Q15 11 30 19 T60 19 T90 19 T120 19' fill='none' stroke='white' stroke-opacity='.38' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") 0 6px / 120px 38px repeat; animation: waves 7s linear infinite; }
.water::after { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='54'%3E%3Cpath d='M0 27 Q22.5 17 45 27 T90 27 T135 27 T180 27' fill='none' stroke='white' stroke-opacity='.22' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E") 0 20px / 180px 54px repeat; animation: waves2 11s linear infinite; }
@keyframes waves { from { background-position: 0 6px; } to { background-position: 120px 6px; } }
@keyframes waves2 { from { background-position: 180px 20px; } to { background-position: 0 20px; } }
.water > * { position: relative; z-index: 1; }
.water > .mist-note { position: absolute; }
.scene.no-help .water::before, .scene.no-help .water::after { opacity: .35; }

/* the friend on the other bank looks back at Bram (and keeps its nose inside the picture) */
.actor.friend.flip .doodle { transform: scaleX(-1); }
.actor.friend { left: calc(100% - var(--bankw) / 2 - 4px); }

/* ---------- landscape behind the game, one per place ---------- */
#backdrop { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bd-layer { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; }
.bd-layer.on { opacity: 1; }
.bd-layer.now { transition: none; }
.bd-layer svg { display: block; width: 100%; height: 100%; }
/* washes the landscape out a little so it stays calm behind the cards */
#backdrop::after { content: ""; position: absolute; inset: 0; background: rgba(255, 255, 255, .22); }
#backdrop[data-scene="night"]::after { background: rgba(255, 255, 255, .06); }
.clouds { position: absolute; inset: 0; z-index: 1; }
.cl { position: absolute; left: 0; width: 220px; opacity: .85; animation: drift linear infinite; }
.cl svg { display: block; width: 100%; height: auto; }
.cl.c1 { top: 7%; width: 200px; animation-duration: 140s; animation-delay: -30s; }
.cl.c2 { top: 17%; width: 150px; animation-duration: 190s; animation-delay: -120s; opacity: .7; }
.cl.c3 { top: 4%; width: 260px; animation-duration: 230s; animation-delay: -70s; opacity: .6; }
@keyframes drift { from { transform: translateX(-300px); } to { transform: translateX(calc(100vw + 300px)); } }
#backdrop[data-scene="night"] .clouds, #backdrop[data-scene="mistbos"] .clouds { opacity: 0; }
/* invisible clouds must not keep moving: Chromium keeps repainting under them, which can leave smears on framed boards */
#backdrop[data-scene="night"] .cl, #backdrop[data-scene="mistbos"] .cl { animation-play-state: paused; }
.clouds { transition: opacity .8s; }

/* Fred on the start screen, who "approved" the game */
.hero-fred { position: relative; cursor: pointer; }
.hero-say { position: absolute; bottom: 92%; left: 50%; transform: translateX(-30%); white-space: nowrap; background: #fff; border-radius: 14px; padding: 4px 12px; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; box-shadow: var(--shadow-sm); animation: fade .25s ease-out; }
.hero-say::after { content: ""; position: absolute; top: 100%; left: 24px; border: 8px solid transparent; border-top-color: #fff; border-bottom: 0; }
.hero-art { overflow: visible; }

/* ---------- language flags ---------- */
.lang-flags, .lang-menu { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.lang-menu { justify-content: flex-end; }
.lang-menu[hidden] { display: none; }
.flag-btn { display: flex; align-items: center; gap: 8px; border: 0; border-radius: 14px; padding: 7px 12px 7px 8px; background: var(--paper); cursor: pointer;
  font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: var(--ink); box-shadow: 0 4px 0 var(--soft-2), var(--shadow-sm); }
.flag-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--soft-2); }
.flag-btn svg, .lang-btn svg { width: 30px; height: 20px; border-radius: 4px; display: block; box-shadow: 0 0 0 1.5px rgba(0,0,0,.12); }
.flag-btn[aria-pressed="true"] { background: var(--sun); box-shadow: 0 4px 0 var(--sun-dark); }
.lang-btn svg { width: 28px; height: 19px; }

/* ---------- gags in the water when the planks are hidden ---------- */
.gag { display: none; }
.scene.no-help .water > .gag { display: block; position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 2; }
.gag svg { display: block; width: 100%; height: auto; overflow: visible; }
/* things a theme painted for the gags (props/): the same spots as the drawings */
.gag img.prop { display: block; width: 100%; height: auto; -webkit-user-drag: none; user-select: none; }
.g-tub img.prop { position: relative; }
.g-shark.painted { display: flex; flex-direction: column; align-items: center; }
.g-shark.painted .prop { width: 62%; }
.g-shark.painted .g-fish { display: block; width: 92%; margin-top: -26%; }
.g-shark.painted .g-fish .doodle { display: block; width: 100%; height: auto; }
.gag .front { position: absolute; left: 0; right: 0; bottom: 0; height: 30px; z-index: 5;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='14'%3E%3Cpath d='M0 7 Q15 0 30 7 T60 7 V14 H0 Z' fill='%238fcbee'/%3E%3Cpath d='M0 7 Q15 0 30 7 T60 7' fill='none' stroke='white' stroke-opacity='.7' stroke-width='2.5'/%3E%3C/svg%3E") 0 0 / 60px 14px repeat-x,
    linear-gradient(#8fcbee, #8fcbee) 0 13px / 100% 100% no-repeat;
  animation: waves 4s linear infinite; }
:where(.gag) .it { position: absolute; bottom: 16px; animation-duration: 14s; animation-timing-function: ease-in-out; animation-delay: 1.2s; animation-iteration-count: infinite; animation-fill-mode: both; }
.g-bub i { position: absolute; width: 10px; height: 10px; border-radius: 50%; border: 2.5px solid #fff; opacity: 0; }
.g-bub i:nth-child(2) { left: 14px; width: 7px; height: 7px; }
.g-bub i:nth-child(3) { left: 4px; width: 8px; height: 8px; }

/* 1. a paper boat bonks into a giant rubber duck, sinks, and sneaks off with a periscope */
.g-boat { width: 80px; z-index: 3; animation-name: gBoat; }
.g-duck { width: 150px; bottom: 8px; z-index: 4; animation-name: gDuck; }
.g-bonk { width: 44px; bottom: 54px; left: calc(33% + 58px); z-index: 6; animation-name: gBonk; }
.gag-boat .g-bub { left: calc(33% + 30px); bottom: 26px; z-index: 6; }
.gag-boat .g-bub i { animation: gBub 14s ease-out 1.2s infinite both; }
.gag-boat .g-bub i:nth-child(2) { animation-delay: 1.5s; }
.gag-boat .g-bub i:nth-child(3) { animation-delay: 1.8s; }
.g-scope { width: 36px; bottom: 0; left: 33%; z-index: 3; animation-name: gScope; }
@keyframes gBoat {
  0% { left: -20%; transform: none; opacity: 1; }
  28% { left: 33%; transform: rotate(0); }
  31% { left: 30%; transform: rotate(-14deg); }
  36% { left: 31%; transform: rotate(16deg); }
  50% { left: 31%; transform: translateY(70px) rotate(40deg); opacity: 1; }
  51%, 100% { left: 31%; transform: translateY(90px); opacity: 0; }
}
@keyframes gDuck {
  0% { left: 110%; transform: none; }
  28% { left: calc(33% + 68px); transform: none; }
  31% { left: calc(33% + 80px); transform: rotate(4deg); }
  34%, 60% { left: calc(33% + 76px); transform: none; }
  63% { transform: rotate(-7deg); } 66% { transform: rotate(7deg); } 69% { transform: none; }
  70% { left: calc(33% + 76px); }
  92%, 100% { left: 115%; transform: none; }
}
@keyframes gBonk {
  0%, 27% { transform: scale(0); opacity: 0; }
  29% { transform: scale(1.25) rotate(20deg); opacity: 1; }
  36% { transform: scale(1) rotate(0); opacity: 1; }
  40%, 100% { transform: scale(0); opacity: 0; }
}
@keyframes gBub {
  0%, 45% { opacity: 0; transform: translateY(0); }
  47% { opacity: 1; }
  60%, 100% { opacity: 0; transform: translateY(-56px); }
}
@keyframes gScope {
  0%, 56% { left: 33%; transform: translateY(80px) scaleX(-1); }
  62% { left: 33%; transform: translateY(0) scaleX(-1); }
  67% { left: 33%; transform: translateY(0) scaleX(-1); }
  68% { left: 33%; transform: translateY(0) scaleX(1); }
  86% { left: -15%; transform: translateY(0) scaleX(1); }
  100% { left: -15%; transform: translateY(0) scaleX(1); }
}

/* 2. Mona dives head first into the river and comes back up with an old boot */
.g-gull { width: 80px; z-index: 3; animation-name: gGull; }
.g-gull .doodle { transform: scaleX(-1); }
.g-boot { position: absolute; width: 34px; right: -14px; top: 30px; rotate: 14deg; animation: gBoot 14s linear 1.2s infinite both; }
.g-splash { width: 90px; left: calc(46% - 12px); bottom: 22px; z-index: 6; transform-origin: 50% 100%; animation-name: gSplash; }
@keyframes gGull {
  0% { left: -20%; transform: translateY(-96px) rotate(0); }
  12% { transform: translateY(-108px) rotate(-4deg); }
  20% { transform: translateY(-94px) rotate(4deg); }
  26% { left: 46%; transform: translateY(-104px) rotate(0); }
  30% { left: 46%; transform: translateY(-116px) rotate(-25deg); }
  35% { left: 46%; transform: translateY(30px) rotate(160deg); }
  36%, 45% { left: 46%; transform: translateY(100px) rotate(170deg); }
  51% { left: 46%; transform: translateY(0) rotate(0); }
  62% { left: 46%; transform: translateY(0) rotate(0); }
  65% { transform: translateY(0) rotate(-10deg); }
  68% { transform: translateY(0) rotate(10deg); }
  71% { left: 46%; transform: translateY(0) rotate(0); }
  90%, 100% { left: 115%; transform: translateY(-112px) rotate(-6deg); }
}
@keyframes gBoot { 0%, 46% { opacity: 0; } 47%, 100% { opacity: 1; } }
@keyframes gSplash {
  0%, 33% { transform: scale(0); opacity: 0; }
  35% { transform: scale(1); opacity: 1; }
  41% { transform: scale(1.2) translateY(-6px); opacity: 0; }
  48% { transform: scale(0); opacity: 0; }
  50% { transform: scale(.75); opacity: 1; }
  56%, 100% { transform: scale(1); opacity: 0; }
}

/* 3. Kobe sails by in a bathtub, with a towel for a sail */
.g-tub { width: 170px; bottom: 4px; z-index: 3; animation-name: gTub; animation-duration: 16s; animation-timing-function: linear; }
.g-tub .bob { display: block; position: relative; animation: gBob 2.2s ease-in-out infinite; }
.g-tub .frog { position: absolute; width: 76px; left: 50px; top: -14px; }
.g-tub svg:last-of-type { position: relative; }
.gag-tub .g-bub { position: absolute; left: 76px; top: -10px; }
.gag-tub .g-bub i { animation: gBubT 2.4s ease-out infinite; }
.gag-tub .g-bub i:nth-child(2) { animation-delay: .8s; }
.gag-tub .g-bub i:nth-child(3) { animation-delay: 1.6s; }
@keyframes gTub { 0% { left: -40%; } 80%, 100% { left: 110%; } }
@keyframes gBob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-4px) rotate(2deg); } }
@keyframes gBubT { 0% { opacity: 0; transform: translateY(0); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(10px, -50px); } }

/* 4. a scary shark fin ... held up on a stick by a very small goldfish: Fred himself, so meanwhile he is not in his corner */
#scene.no-help:has(#gag.gag-shark) #fred, #scene.no-help:has(#gag.gag-shark) #fredSay { visibility: hidden; }
.g-shark { width: 90px; bottom: -70px; z-index: 3; animation-name: gShark; animation-duration: 13s; }
@keyframes gShark {
  0% { left: 110%; transform: none; }
  10% { transform: translateY(-4px); } 20% { transform: translateY(2px); } 30% { transform: translateY(-4px); }
  38%, 44% { left: 46%; transform: none; }
  49% { left: 46%; transform: translateY(-92px); }
  58% { left: 46%; transform: translateY(-92px) rotate(0); }
  61% { transform: translateY(-92px) rotate(-8deg); }
  64% { left: 46%; transform: translateY(-92px) rotate(0); }
  68% { left: 46%; transform: none; }
  84%, 100% { left: -25%; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .scene.no-help .water > .gag { display: none; } }

/* ---------- keypad: the digit keys are little wooden planks (you build the bridge with them),
   delete and check are both green action buttons ---------- */
.pad button[data-k] { --k: #f2cf98; --kd: #c98f4e; color: #5a3a1e; box-shadow: 0 4px 0 var(--kd);
  background: linear-gradient(180deg, rgba(255, 255, 255, .25), rgba(255, 255, 255, 0) 45%), var(--k); }
.pad button[data-k]:active { box-shadow: 0 1px 0 var(--kd); }
.pad button[data-k="del"], .pad button[data-k="ok"] { --k: var(--leaf); --kd: var(--leaf-dark); color: #fff; background: var(--k); }
.pad button[data-k="del"] { --k: #f2665e; --kd: #c94a43; font-size: 1.35rem; }

/* the keypad sits on a dark wooden raft, like the raft in the river */
.pad-card { background:
    repeating-linear-gradient(0deg, transparent 0 30px, rgba(0, 0, 0, .10) 30px 33px),
    linear-gradient(180deg, #8a5a35, #74482a);
  box-shadow: 0 6px 0 #5a3820, var(--shadow); }

/* ---------- bridge list: colour per state + a tiny bridge that fills up with the stars ---------- */
.bridge-btn { --b: var(--soft); --bd: var(--soft-2); background: var(--b); box-shadow: 0 4px 0 var(--bd); }
.bridge-btn:active { box-shadow: 0 1px 0 var(--bd); }
.bridge-btn.started { --b: #f8e6c6; --bd: #e0bf8a; }
.bridge-btn.done { --b: #d6f2dd; --bd: #9fd8ae; }
.bridge-btn.next { --b: var(--sun); --bd: var(--sun-dark); }
.bridge-btn.locked { --b: var(--soft); opacity: .6; }
.bridge-btn .mini-bridge { width: 92px; height: 44px; flex: none; }
.bridge-btn .need { font-family: var(--font-display); font-weight: 600; font-size: .95rem; white-space: nowrap; background: #fff; border-radius: 999px; padding: 3px 10px; color: #b5651d; box-shadow: 0 2px 0 rgba(0,0,0,.08); }
.bridge-btn.locked .stars-sm { font-size: 1.2rem; }
.bridge-btn.next .stars-sm { color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.12); }
.bridge-btn.next .stars-sm .no { color: rgba(120, 80, 0, .22); text-shadow: none; }

/* ---------- phones in portrait: everything on one screen, keypad included (the scene is shrunk to fit by fitPlay in game.js) ---------- */
@media (orientation: portrait) and (max-height: 920px) {
  #app { padding-block: max(8px, env(safe-area-inset-top)) 8px; }
  .play, .play-main { gap: 8px; }
  .play .topbar .icon-btn { width: 42px; height: 42px; border-radius: 13px; }
  .play .topbar .who { font-size: 1.15rem; }
  .q-card { padding: 8px 12px 10px; gap: 4px; }
  .sum { font-size: clamp(2.3rem, 10vw, 3rem); }
  .prompt { min-height: 3.6em; }
  .sum.has-split { padding-bottom: 80px; }
  .split svg { width: 90px; height: 22px; }
  .split .boxes { gap: 16px; }
  .split .box { font-size: 1.8rem; }
  .question { font-size: 1.05rem; line-height: 1.25; }
  .feedback { font-size: 1.08rem; }
  .pad-card { padding: 8px; }
  .pad { gap: 7px; }
  .pad button { height: 50px; font-size: 1.7rem; }
  .pad button[data-k="del"] { font-size: 1.1rem; }
}
@media (orientation: portrait) and (max-height: 700px) {
  .pad button { height: 44px; font-size: 1.5rem; }
  .pad { gap: 6px; }
  .q-card { padding: 6px 10px 8px; }
  .step-label { font-size: .7rem; }
  .question { font-size: .98rem; }
}

/* ---------- online: login, pairing, family ---------- */
.family-bar { display: flex; justify-content: flex-end; }
.btn.small { padding: 6px 14px; font-size: 1rem; border-radius: 12px; }
a.btn { text-decoration: none; display: inline-block; }
.pill.small { font-size: .8rem; padding: 1px 8px; vertical-align: middle; }
.choice-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.choice { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 14px; border: 0; border-radius: 18px; cursor: pointer;
  background: var(--soft); box-shadow: 0 4px 0 var(--soft-2); text-align: center; }
.choice:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--soft-2); }
.choice .ic { font-size: 2.4rem; line-height: 1; font-family: var(--emoji), var(--font-body); }
.choice b { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; }
.choice small { color: var(--muted); font-weight: 700; }
#loginEmail input[type="email"], #pairName { width: 100%; }
.code-input { font-family: var(--font-display); font-weight: 600; font-size: 2rem; letter-spacing: .18em; text-align: center; width: 100%; max-width: 320px; align-self: center; }
.pair-code { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.6rem, 12vw, 4rem); letter-spacing: .12em; text-align: center;
  background: var(--sun); border-radius: 18px; padding: 10px 0; box-shadow: 0 4px 0 var(--sun-dark); }
.pair-steps { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; }
.check a { color: var(--water-dark); font-weight: 700; }
.list { display: grid; gap: 8px; }
.list-row { display: flex; align-items: center; gap: 12px; background: var(--soft); border-radius: 14px; padding: 8px 12px; }
.list-row .ic { font-size: 1.6rem; width: 40px; text-align: center; flex: none; font-family: var(--emoji), var(--font-body); }
.list-row .ic.av { height: 40px; }
.list-row .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list-row .tx b { overflow: hidden; text-overflow: ellipsis; }
.list-row .tx small { color: var(--muted); font-size: .85rem; }
#deleteForm { flex-wrap: wrap; }
#deleteForm input { flex: 1 1 220px; min-width: 0; }
.panel > input { flex: none; }

/* ---------- front page (online, not logged in) ---------- */
#scr-landing { gap: 18px; }
@media (min-width: 860px) and (orientation: landscape) { #scr-landing { max-width: 1000px; margin-inline: auto; width: 100%; } }
.land-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.land-logo { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 1.4rem; color: var(--water-dark); }
.land-logo-art { width: 46px; height: 46px; display: block; }
.land-logo-art svg { width: 100%; height: 100%; }
.lang-flags-compact { gap: 6px; }
.lang-flags-compact .flag-btn { padding: 5px 8px; font-size: .9rem; }
.land-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 6px 0 4px; }
.land-hero h1 { font-size: clamp(2.2rem, 7vw, 3.6rem); font-weight: 700; color: var(--water-dark); line-height: 1.02; }
.land-hero .lead { margin: 0; max-width: 40ch; font-size: 1.2rem; }
.btn.big { font-size: 1.4rem; padding: 13px 28px; border-radius: 18px; }
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.badges-row { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.badges-row li { background: var(--paper); border-radius: 999px; padding: 4px 14px 4px 10px; font-weight: 700; font-size: .95rem; box-shadow: var(--shadow-sm); }
.badges-row li::before { content: "✓ "; color: var(--good); }
.land-how p { margin: 0; }
.how-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.how-step { background: var(--soft); border-radius: 18px; padding: 14px 12px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.how-step b { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; }
.how-step span { color: var(--muted); font-size: .95rem; }
.mini-sum { font-family: var(--font-display); font-weight: 600; font-size: 1.7rem; }
.mini-row { display: flex; gap: 3px; justify-content: center; flex-wrap: wrap; min-height: 30px; }
.mini-row .pl { display: block; width: 13px; height: 28px; border-radius: 4px; }
.mini-row .pl.a { background: #c98a4b; box-shadow: inset 0 0 0 2px #7a4e2c; }
.mini-row .pl.b { background: #ffa63d; box-shadow: inset 0 0 0 2px #c9741c; }
.mini-row .gap { display: block; width: 10px; }
.land-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.land-for-art, .world-art, .land-end-art { display: flex; justify-content: center; align-items: flex-end; gap: 2px; flex-wrap: wrap; }
.land-for-art .c, .world-art .c, .land-end-art .c { width: 58px; display: block; }
.land-for-art .c svg, .world-art .c svg, .land-end-art .c svg { width: 100%; height: auto; display: block; }
.land-end-art .c { width: 90px; }
.land-end-art .c.small { width: 64px; }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ticks li { display: flex; gap: 10px; align-items: flex-start; }
.ticks .ic { font-size: 1.35rem; line-height: 1.3; font-family: var(--emoji), var(--font-body); flex: none; }
.world-card { border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 6px; text-align: center; }
.world-card h3 { font-size: 1.5rem; }
.world-card p { margin: 0; }
.world-card.w1 { background: #e6f5e6; }
.world-card.w2 { background: #fff1d6; }
.land-faq details { background: var(--soft); border-radius: 14px; padding: 10px 14px; }
.land-faq summary { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; cursor: pointer; }
.land-faq details p { margin: 8px 0 2px; }
.land-end { align-items: center; text-align: center; }
.land-foot { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); font-size: .9rem; padding-bottom: 16px; text-align: center; }
.land-foot a { color: var(--water-dark); font-weight: 700; }
@media (max-width: 480px) { .land-for-art .c, .world-art .c { width: 46px; } }

/* ---------- story book: an open book, list on the left page, detail on the right ---------- */
#scr-book { max-width: 980px; margin-inline: auto; width: 100%; }
.book-tabs { display: flex; gap: 8px; margin: 12px 0; }
.book-tab { flex: 1; border: 0; border-radius: 16px; padding: 12px 10px; font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; background: rgba(255,255,255,.55); color: var(--ink, #333); cursor: pointer; box-shadow: 0 3px 0 var(--soft-2); }
.book-tab[aria-selected="true"] { background: var(--paper); box-shadow: 0 4px 0 var(--sun-dark), var(--shadow-sm); }
.book-spread { display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: 0; background: var(--paper); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; min-height: 60vh; }
.book-list { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-right: 2px dashed var(--soft-2); max-height: 72vh; overflow-y: auto; }
.book-item { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; border-radius: 14px; padding: 6px 10px; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.book-item .av { width: 44px; height: 44px; flex: none; display: grid; place-items: center; }
.book-item .t { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; line-height: 1.15; }
.book-item[aria-current="true"] { background: var(--sun); box-shadow: 0 3px 0 var(--sun-dark); }
.book-item.unmet .av { filter: brightness(0); opacity: .16; }
.book-item.unmet .t { color: var(--muted); }
.book-page { padding: 18px 22px; display: flex; flex-direction: column; gap: 12px; max-height: 72vh; overflow-y: auto; }
.book-page h2 { margin: 0; font-family: var(--font-display); }
.who-detail { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 10px 0; flex: 1; justify-content: center; }
.who-detail .av { width: min(240px, 60vw); aspect-ratio: 1; display: grid; place-items: center; }
.who-detail p { font-size: 1.15rem; line-height: 1.45; max-width: 34ch; margin: 0; }
.who-detail.unmet .av { filter: brightness(0); opacity: .14; }
.who-detail .who-place { font-size: 1rem; color: var(--muted); font-weight: 700; }
.who-faces { display: flex; gap: 8px; justify-content: center; }
.who-faces .face { width: 56px; height: 56px; display: grid; place-items: center; }
.book-nav { display: flex; align-items: center; justify-content: center; gap: 14px; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 700; }
.book-nav .icon-btn:disabled { opacity: .35; cursor: default; }
.book-page .lines { display: flex; flex-direction: column; gap: 8px; }
.book-page .line { display: flex; gap: 10px; align-items: flex-start; }
.book-page .line .av { width: 44px; height: 44px; flex: none; display: grid; place-items: center; }
.book-page .line p { margin: 0; background: rgba(0,0,0,.04); border-radius: 4px 14px 14px 14px; padding: 8px 12px; line-height: 1.4; font-size: 1.02rem; }
.book-page .line p b { display: block; font-family: var(--font-display); font-weight: 600; font-size: .9rem; color: var(--muted); }
.book-page .between { text-align: center; font-family: var(--emoji); opacity: .7; padding: 4px 0; }
.book-page > .btn { align-self: flex-start; }
.book-end { text-align: center; color: var(--muted); font-style: italic; margin: 8px 12px; }
@media (max-width: 700px) {
  .book-spread { grid-template-columns: 1fr; min-height: 0; }
  .book-list { flex-direction: row; overflow-x: auto; overflow-y: hidden; max-height: none; border-right: 0; border-bottom: 2px dashed var(--soft-2); padding: 8px; scroll-snap-type: x proximity; }
  .book-item { flex-direction: column; flex: none; width: 84px; gap: 4px; text-align: center; padding: 6px 4px; scroll-snap-align: center; }
  .book-item .t { font-size: .8rem; }
  .book-page { max-height: none; padding: 14px; }
}

/* ---------- parent corner: tabs ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tab { flex: 1 1 auto; min-height: 44px; border: 0; border-radius: 14px; padding: 8px 12px; font-family: var(--font-display); font-weight: 600; font-size: 1rem; background: var(--soft); color: inherit; cursor: pointer; }
.tab[aria-selected="true"] { background: var(--sun); box-shadow: 0 3px 0 var(--sun-dark); }
.tab-pane > h3:first-child { margin-top: 0; }

/* ---------- map drawn by the theme (only when theme.json has "maps"): the map fills the whole screen ---------- */
.icon-btn .btn-lbl, .icon-btn.hud-only, .world-tab .wt-badge { display: none; }
.icon-btn .ic { font-family: var(--emoji); line-height: 1; }
.icon-btn .ico { width: 56%; height: 56%; overflow: visible; fill: none; stroke: currentColor; stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .ico .o { stroke: var(--ico-edge, transparent); stroke-width: 8; }
.icon-btn .ico .fill { fill: currentColor; stroke: none; }
.icon-btn .ico .o.fill { fill: none; stroke: var(--ico-edge, transparent); stroke-width: 3.4; }
.world-tab .wt-lock svg { display: inline-block; width: .9em; height: 1.05em; vertical-align: -.15em; margin-left: .35em; }

#scr-map.full-map {
  position: fixed; inset: 0; z-index: 2; display: block; max-width: none; margin: 0; overflow: hidden;
  container-type: size; animation: mapIn .3s ease-out;
  --pad: clamp(10px, 1.8cqw, 24px);
  --u: min(1cqw, 1.6cqh);
  --btn: clamp(46px, calc(var(--u) * 6.4), 64px);
  --top: max(var(--pad), env(safe-area-inset-top, 0px));
  --side-l: max(var(--pad), env(safe-area-inset-left, 0px));
  --side-r: max(var(--pad), env(safe-area-inset-right, 0px));
  --bot: max(var(--pad), env(safe-area-inset-bottom, 0px));
}
@keyframes mapIn { from { opacity: .4; } }
#scr-map.full-map > .village, #scr-map.full-map > .trail, #scr-map.full-map .topbar .who { display: none; }

/* the picture: as big as the screen; when the screen is narrower than the map you swipe sideways */
#scr-map.full-map .map-art { position: absolute; inset: 0; margin: 0; }
.map-scroll { position: absolute; inset: 0; overflow-x: auto; overflow-y: hidden; container-type: size; scrollbar-width: none; overscroll-behavior: contain; background: #78b85a; }
.map-scroll::-webkit-scrollbar { display: none; }
.map-strip { position: relative; height: 100%; width: max(100cqw, calc(100cqh * var(--ar, 1.6))); overflow: hidden; overflow: clip; }
.map-frame { position: absolute; left: 0; top: 50%; width: 100%; aspect-ratio: var(--ar, 1.6); transform: translateY(-50%); container-type: inline-size; }
.map-frame.locked { filter: saturate(.5) brightness(.8) blur(3px); }
.map-img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; user-select: none; }

/* a spot on the map: the round wooden stage in the picture is the button */
.spot { position: absolute; width: 7.6cqw; aspect-ratio: 1.9; transform: translate(-50%, -50%); padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.spot::before { content: ""; position: absolute; inset: 0; border-radius: 50%; transition: background .15s, box-shadow .15s; }
.spot:hover::before, .spot:focus-visible::before { background: rgba(255, 240, 170, .4); box-shadow: 0 0 0 .3cqw rgba(255, 226, 120, .9); }
.spot:focus-visible { outline: none; }
.spot:disabled { cursor: default; }
.spot:disabled:hover::before { background: none; box-shadow: none; }
.spot .stars { position: absolute; left: 50%; bottom: 38%; transform: translateX(-50%); display: flex; align-items: flex-end; }
.spot .stars svg { width: 2.6cqw; height: 2.6cqw; filter: drop-shadow(0 .25cqw .2cqw rgba(60, 30, 5, .45)); }
.spot .stars svg:nth-child(2) { width: 3.2cqw; height: 3.2cqw; margin: 0 -.25cqw .9cqw; }
.spot .lock { position: absolute; left: 50%; bottom: 46%; width: 3.5cqw; transform: translateX(-50%); filter: drop-shadow(0 .4cqw .3cqw rgba(0, 0, 0, .35)); }
.spot .lock svg { display: block; width: 100%; height: auto; }
/* Bram stands where you are now */
.spot.current::after { content: ""; position: absolute; inset: -10% -6%; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 224, 120, .85), rgba(255, 224, 120, 0)); animation: glow 1.6s ease-in-out infinite; }
.spot .pin { position: absolute; z-index: 1; left: 50%; bottom: calc(50% + 1.1cqw); width: min(6.4cqw, 120px); aspect-ratio: 1; transform: translateX(-50%);
  border-radius: 50%; background: radial-gradient(circle at 50% 35%, #fffcee, #ffe7a3); border: .42cqw solid #ffc534;
  box-shadow: 0 0 0 .22cqw #8a4b12, 0 .5cqw .8cqw rgba(0, 0, 0, .35), 0 0 1.6cqw .3cqw rgba(255, 214, 90, .8); animation: pinBob 1.6s ease-in-out infinite; }
.spot .pin::after { content: ""; position: absolute; left: 50%; top: calc(100% + .1cqw); width: 1.9cqw; height: 1.4cqw; transform: translateX(-50%);
  background: linear-gradient(180deg, #ff7a3d, #d9431f); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.spot .pin .face { position: absolute; inset: 7%; }
@keyframes pinBob { 50% { transform: translateX(-50%) translateY(-.6cqw); } }
@keyframes glow { 50% { opacity: .45; } }
/* the practice place: its host in a little round frame */
.spot .host { position: absolute; left: 50%; bottom: 40%; width: 4.4cqw; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; padding: .25cqw;
  background: radial-gradient(circle at 50% 35%, #fff, #e3f2fb); border: .3cqw solid var(--water-dark); box-shadow: 0 0 0 .18cqw #fff, 0 .4cqw .6cqw rgba(0, 0, 0, .35); }
/* the road to the next world */
.spot .go { position: absolute; top: 72%; left: 50%; transform: translateX(-50%); white-space: nowrap; font-family: var(--font-display); font-weight: 600;
  font-size: clamp(12px, 1.3cqw, 22px); line-height: 1.2; padding: .2em .75em; border-radius: 999px; background: var(--water); color: #fff; box-shadow: 0 3px 0 var(--water-dark); }
/* the painted boat to the next world (props/mona-boot): it rocks gently on the water; still grey while locked */
.spot .boat { position: absolute; left: 50%; bottom: 30%; width: 7.4cqw; transform: translateX(-50%); transform-origin: 50% 90%;
  filter: drop-shadow(0 .4cqw .3cqw rgba(0, 0, 0, .3)); animation: boatRock 3.2s ease-in-out infinite; pointer-events: none; }
.spot.locked .boat { filter: grayscale(.7) brightness(.9) drop-shadow(0 .4cqw .3cqw rgba(0, 0, 0, .3)); animation: none; }
.spot.has-boat .lock { bottom: 52%; z-index: 1; }
@keyframes boatRock { 0%, 100% { transform: translateX(-50%) rotate(-3deg); } 50% { transform: translateX(-50%) rotate(3deg) translateY(-2%); } }
@media (prefers-reduced-motion: reduce) { .spot .boat { animation: none; } }
.spot.edge-r .go { left: auto; right: 0; transform: none; }
.spot.edge-l .go { left: 0; transform: none; }
@media (prefers-reduced-motion: reduce) { .spot .pin, .spot.current::after { animation: none; } }

/* along the top: back, the worlds, the story book and the menu */
#scr-map.full-map .topbar { position: absolute; z-index: 5; top: var(--top); left: var(--side-l); right: var(--side-r); gap: calc(var(--btn) * .2); pointer-events: none; }
#scr-map.full-map .topbar > * { pointer-events: auto; }
#scr-map.full-map .topbar > .icon-btn { width: var(--btn); height: var(--btn); border-radius: 28%; }
#scr-map.full-map .icon-btn.hud-only { display: grid; }
#scr-map.full-map #mapStickers { margin-left: auto; }
#scr-map.full-map #mapBook { font-size: calc(var(--btn) * .48); }
#scr-map.full-map #btnBadges { display: none; }       /* the sticker book has its own button next to the story book */
#scr-map.full-map .world-tabs { position: absolute; z-index: 4; top: var(--top); left: calc(var(--side-l) + var(--btn) * 1.75); right: calc(var(--side-r) + var(--btn) * 3.9);
  height: var(--btn); display: flex; align-items: center; flex-wrap: nowrap; gap: calc(var(--btn) * .4); pointer-events: none; }
#scr-map.full-map .world-tab { pointer-events: auto; position: relative; flex: 0 1 auto; min-width: 0; height: calc(var(--btn) * .86); display: flex; align-items: center;
  padding: 0 1em; font-size: clamp(1rem, calc(var(--btn) * .4), 1.55rem); white-space: nowrap; }
#scr-map.full-map .world-tab .wt-name { overflow: hidden; text-overflow: ellipsis; }
#scr-map.full-map .world-tab[aria-selected="true"] { padding-left: calc(var(--btn) * .92); }
#scr-map.full-map .world-tab .wt-badge { display: block; position: absolute; left: calc(var(--btn) * -.34); top: 50%; width: calc(var(--btn) * 1.1); aspect-ratio: 1; transform: translateY(-50%);
  border-radius: 50%; padding: calc(var(--btn) * .08); background: radial-gradient(circle at 50% 35%, #fffcee, #f3e2b4); border: 3px solid var(--leaf); box-shadow: 0 0 0 2px var(--leaf-dark), 0 4px 6px rgba(0, 0, 0, .35); }
#scr-map.full-map .world-tab.locked { padding-right: 1.4em; }
#scr-map.full-map .world-tab .wt-lock { position: absolute; right: -.55em; top: 50%; width: 1.45em; transform: translateY(-50%); filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35)); }
#scr-map.full-map .world-tab .wt-lock svg { display: block; width: 100%; height: auto; margin: 0; }
/* the menu under the gear */
#scr-map.full-map .top-actions { position: absolute; top: calc(100% + 12px); right: 0; z-index: 6; display: none; flex-direction: column; align-items: stretch; gap: 8px;
  min-width: 230px; padding: 12px; border-radius: 20px; background: var(--paper); box-shadow: var(--shadow); }
#scr-map.full-map.menu-open .top-actions { display: flex; }
#scr-map.full-map .top-actions .icon-btn { width: auto; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: flex-start; gap: 12px; padding: 0 18px 0 12px; }
#scr-map.full-map .top-actions .ic { width: 30px; text-align: center; font-size: 1.4rem; }
#scr-map.full-map .top-actions .btn-lbl { display: inline; font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; }
#scr-map.full-map .top-actions .lang-btn svg { flex: none; }
#scr-map.full-map .lang-menu { position: absolute; z-index: 7; top: calc(var(--top) + var(--btn) + 12px); right: var(--side-r); flex-direction: column; padding: 12px; border-radius: 20px; background: var(--paper); box-shadow: var(--shadow); }
/* a world that is still closed: its map, blurred, with what is still needed on top */
#scr-map.full-map .gate { position: absolute; z-index: 4; left: 50%; top: calc(var(--top) + var(--btn) + 18px); transform: translateX(-50%);
  width: min(600px, calc(100% - 2 * var(--pad))); max-height: calc(100% - var(--top) - var(--btn) - 18px - var(--bot)); overflow-y: auto; }

/* along the bottom: the chapter where you are (tap to play) and the friends */
.map-bottom { position: absolute; z-index: 4; left: var(--side-l); right: var(--side-r); bottom: var(--bot); display: flex; align-items: flex-end; justify-content: space-between; gap: var(--pad); pointer-events: none; }
.map-bottom > * { pointer-events: auto; }
.map-sign { flex: 0 1 auto; min-width: 0; max-width: 48%; display: grid; grid-template-columns: minmax(0, auto) auto; grid-template-areas: "t go" "s go"; align-items: center; column-gap: 14px; row-gap: 4px;
  padding: 10px 12px 10px 18px; border: 0; border-radius: 18px; background: var(--paper); color: var(--ink); box-shadow: var(--shadow); cursor: pointer; text-align: left; }
.map-sign .t { grid-area: t; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.05rem, calc(var(--u) * 2.5), 1.55rem); line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-sign .stars { grid-area: s; display: flex; gap: 4px; }
.map-sign .stars svg { width: clamp(22px, calc(var(--u) * 3.4), 36px); height: auto; filter: drop-shadow(0 2px 1px rgba(60, 30, 5, .35)); }
.map-sign .go { grid-area: go; display: grid; place-items: center; width: clamp(42px, calc(var(--u) * 5.6), 58px); aspect-ratio: 1; border-radius: 14px; background: var(--leaf); box-shadow: 0 4px 0 var(--leaf-dark); }
.map-sign .go svg { width: 56%; height: auto; }
.map-sign:active { transform: translateY(2px); }
.map-cast { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; }
.cast-row { min-width: 0; display: flex; align-items: center; gap: clamp(6px, var(--u), 12px); overflow-x: auto; scrollbar-width: none; padding: 10px 6px; }
.cast-row::-webkit-scrollbar { display: none; }
.map-cast .fr { flex: none; width: clamp(44px, calc(var(--u) * 6.6), 62px); aspect-ratio: 1; padding: 4px; border-radius: 50%; border: 3px solid var(--water-dark); cursor: pointer;
  background: radial-gradient(circle at 50% 35%, #fff, #e3f2fb); box-shadow: 0 0 0 2px #fff, 0 4px 6px rgba(0, 0, 0, .35); }
.map-cast .fr.hero { width: clamp(52px, calc(var(--u) * 7.8), 74px); border-color: #ffc534; background: radial-gradient(circle at 50% 35%, #fffcee, #ffe7a3);
  box-shadow: 0 0 0 2px #fff, 0 0 12px 3px rgba(255, 214, 90, .85), 0 4px 6px rgba(0, 0, 0, .35); }
.map-cast .fr.missing .doodle { filter: grayscale(1); opacity: .45; }
.map-cast .fr:active { transform: scale(.94); }
.map-cast .cast-more { flex: none; width: clamp(40px, calc(var(--u) * 5.4), 52px); height: clamp(40px, calc(var(--u) * 5.4), 52px); border-radius: 50%; }
.map-cast .cast-more.back .ico { transform: scaleX(-1); }

.village .vhead { width: 100%; display: flex; align-items: center; gap: 10px; }
.village .vhead .lbl { width: auto; flex: 1; min-width: 0; }
.village .book-btn { flex: none; border: 0; border-radius: 14px; padding: 8px 14px; background: var(--sun); box-shadow: 0 3px 0 var(--sun-dark); font-family: var(--font-display); font-weight: 600; font-size: 1rem; cursor: pointer; color: inherit; }
.village .book-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--sun-dark); }
.village .fr { cursor: pointer; }

@media (max-width: 480px) { .tabs { display: grid; grid-template-columns: 1fr 1fr; } }

/* full-screen map on a phone held upright: the worlds on their own row, the chapter sign under the friends */
@media (max-width: 600px) {
  #scr-map.full-map .world-tabs { top: calc(var(--top) + var(--btn) + 12px); left: calc(var(--side-l) + var(--btn) * .36); right: var(--side-r); }
  .map-bottom { flex-direction: column-reverse; align-items: stretch; gap: 6px; }
  .map-sign { max-width: none; align-self: flex-start; }
  .map-cast { align-self: flex-end; max-width: 100%; }
}
/* messages (a new medal) on the full-screen map: top right, so they never hide a button */
body:has(#scr-map.full-map:not([hidden])) .toasts { top: calc(max(12px, env(safe-area-inset-top, 0px)) + 76px); bottom: auto; left: auto; right: max(16px, env(safe-area-inset-right, 0px)); align-items: flex-end; }

/* sticker book: the theme's own sticker pictures fill the round spot */
.badge .ic.has-img, .badge-row .ic .sticker-img, .toast .ic .sticker-img { background: none; box-shadow: none; }
.sticker-img { display: block; width: 100%; height: 100%; object-fit: contain; }
.icon-btn .ico .peel { fill: currentColor; opacity: .6; }

/* the sticker album: pages per subject; in this theme the spots are simply listed (number, sticker, name, how to earn it) */
.album { display: grid; gap: 16px; }
.album-page { position: relative; background: var(--paper); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.album-title { font-size: 1.4rem; margin-bottom: 12px; }
.album-pno { position: absolute; right: 14px; bottom: 8px; font-size: .8rem; color: var(--muted); }
.badge .slot { display: contents; }
.badge .no { display: none; }
.badge .ic { order: 1; } .badge .t { order: 2; } .badge .d { order: 3; }
.album-nav { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 14px; font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; }
.album-nav .icon-btn:disabled { opacity: .35; cursor: default; }
@media (orientation: landscape) and (min-width: 860px) {
  .album { grid-template-columns: 1fr 1fr; }
  #scr-badges { max-width: 1120px !important; }
}

/* ---------- a phone held upright on the play screen: "turn your phone" (it goes away by itself when the phone is turned) ---------- */
.turn-phone { display: none; }
@media (orientation: portrait) and (max-width: 600px) {
  body:not(.play-upright) #scr-play:not([hidden]) .turn-phone { display: flex; }
}
.turn-phone { position: fixed; inset: 0; z-index: 60; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(circle at 50% 40%, rgba(255, 246, 214, .96), rgba(190, 228, 250, .97)); }
.tp-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 360px; text-align: center; }
.tp-art { width: min(62vw, 250px); aspect-ratio: 1; }
.tp-art img, .tp-art .doodle { display: block; width: 100%; height: 100%; object-fit: contain; }
.tp-phone { position: absolute; top: 0; right: -6px; width: 64px; height: 64px; fill: #3a4049; animation: tpTurn 2.6s ease-in-out infinite; }
.turn-phone.painted .tp-phone { top: auto; right: auto; position: relative; margin-top: -6px; }
.tp-phone .scr { fill: #7fd0ff; } .tp-phone .dot { fill: #9aa5b1; }
@keyframes tpTurn { 0%, 25% { transform: rotate(0); } 55%, 85% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }
.tp-t { margin: 0; font-size: 1.9rem; }
.tp-s { margin: 0; font-size: 1.05rem; line-height: 1.3; color: var(--ink); }
.tp-anyway { margin-top: 8px; font-size: 1rem; padding: 9px 18px; background: rgba(255, 255, 255, .85); box-shadow: 0 3px 0 rgba(0, 0, 0, .15); }
@media (prefers-reduced-motion: reduce) { .tp-phone { animation: none; transform: rotate(-90deg); } }

/* ---------- Tiendorp at night (world 3): the Nibbler takes planks away ---------- */
/* Knabbel while nobody knows who he is: the same picture as a dark shape (in the story, in the book, on the map) */
.doodle.shade { filter: brightness(0) drop-shadow(0 0 3px rgba(190, 210, 255, .6)); }
/* in the river scene the shadow gets a little clearer every night (--seen: 0 = black, 1 = himself) */
.actor.shadow .doodle { filter: brightness(var(--seen, 0)) saturate(.7) drop-shadow(0 0 4px rgba(190, 210, 255, .55)); }
/* the friend who keeps watch on Bram's side looks across the river */
#actorBram.flip svg.doodle, #actorBram.other img.doodle { transform: scaleX(-1); }
/* a baby beaver as big as a barn */
.actor.giant .doodle { transform: scale(1.45); transform-origin: 55% 100%; }
.actor.giant.flip .doodle { transform: scale(-1.45, 1.45); }
#actorBram.giant.flip svg.doodle, #actorBram.giant.other img.doodle { transform: scale(-1.45, 1.45); transform-origin: 45% 100%; }
/* the round is over: he hops off into the dark */
.scene.flee #actorFriend { left: 130%; animation: hop .32s ease-in-out 5; }
/* a plank that has just been eaten */
.plank.gone.pop { animation: bite .65s both; }
@keyframes bite { 0% { transform: scale(1.15) rotate(-7deg); opacity: 1; } 25% { transform: scale(.9) rotate(8deg); } 50% { transform: scale(1.05) rotate(-5deg); opacity: .55; } 100% { transform: none; } }
/* a night without a night painting: the drawn river after dark */
.scene.night:not(.has-art) { background: #23346e; }
.scene.night:not(.has-art) .bank { background: linear-gradient(180deg, #3d6a55 0 14px, #2c5244 14px 100%); }
.scene.night:not(.has-art) .bank.left { box-shadow: 6px 0 0 #6a6f8f; }
.scene.night:not(.has-art) .bank.right { box-shadow: -6px 0 0 #6a6f8f; }
.scene.night.no-help:not(.has-art) .water { background: linear-gradient(180deg, #33478c, #23346e); }
/* a theme with a day painting but no night painting: dim the whole scene */
.scene.night.has-art:not(.night-art) { filter: brightness(.62) saturate(.8) hue-rotate(12deg); }
.world-tab .wt-name { white-space: nowrap; }
.scene.night:not(.has-art) .water { background: #2b3f85; }
body.night .topbar .who, body.night .topbar .who strong { color: #fff; }

/* ---------- choosing a world: one sign for where you are, the sun or the moon next to it, and a chooser ---------- */
.world-tabs { flex-wrap: nowrap; align-items: center; }
.world-tab.wt-here { flex: 0 1 auto; display: inline-flex; align-items: center; gap: .4em; }
.world-tab .wt-more { font-size: .8em; opacity: .8; }
.world-tab.wt-toggle { flex: 0 0 auto; position: relative; width: 2.4em; padding: 8px 0; text-align: center; }
.world-tab.wt-toggle .wt-sky { font-size: 1.15em; line-height: 1; }
.world-tab.wt-toggle .wt-lock { position: absolute; right: -.35em; bottom: -.3em; width: 1.1em; }
.world-tab.wt-toggle .wt-lock svg { display: block; width: 100%; height: auto; margin: 0; }
#scr-map.full-map .world-tab.wt-toggle { width: calc(var(--btn) * .95); padding: 0; justify-content: center; }
#scr-map.full-map .world-tab.wt-toggle .wt-lock { right: -.3em; top: auto; bottom: -.35em; width: 1.2em; transform: none; }
.world-menu { position: fixed; z-index: 30; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(92vw, 760px); max-height: 86vh; overflow: auto;
  background: var(--paper); border-radius: 22px; padding: 16px 18px 20px; box-shadow: 0 0 0 100vmax rgba(20, 24, 40, .45), var(--shadow); }
.world-menu[hidden] { display: none; }
.world-menu h3 { margin: 0 0 12px; font-family: var(--font-display); font-size: 1.5rem; text-align: center; }
.world-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.world-card { display: flex; flex-direction: column; gap: 6px; align-items: center; border: 3px solid transparent; border-radius: 16px; background: #fff; padding: 8px 8px 10px;
  font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; cursor: pointer; box-shadow: 0 4px 0 var(--soft-2), var(--shadow-sm); }
.world-card.current { border-color: var(--sun); }
.world-card:active { transform: translateY(3px); }
.world-card .wc-pic { position: relative; display: block; width: 100%; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: linear-gradient(180deg, #bfe3f6, #cfe9d5); }
.world-card .wc-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.world-card.locked .wc-pic img { filter: grayscale(1) brightness(1.05); opacity: .7; }
.world-card .wc-lock { position: absolute; left: 50%; top: 50%; width: 34%; max-width: 64px; transform: translate(-50%, -50%); filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .4)); }
.world-card .wc-lock svg { display: block; width: 100%; height: auto; }
.world-card .wc-stars { font-size: .95rem; font-weight: 500; opacity: .8; }

/* ---------- Knabbel's journey (world 4): bundles that are eaten or opened ---------- */
.bundle.gone { opacity: .3; filter: grayscale(1) brightness(1.5); }
.bundle.gone.pop { animation: bite .65s both; }
.bundle.b.eat { box-shadow: 0 0 0 3px var(--sun); }

/* ---------- the plank factory (world 5): packs of planks, and the card box ---------- */
.packs { display: flex; flex-wrap: wrap; justify-content: center; align-content: center; align-items: center; gap: 8px 10px; margin: auto; max-width: min(100%, 420px); padding: 4px; }
.packs[hidden] { display: none; }
.packs .brk { flex-basis: 100%; height: 0; }
.scene.no-help .packs:not(.card) { visibility: hidden; }
.pack { display: grid; grid-template-columns: repeat(var(--cols, 5), auto); gap: 2px; padding: 4px 5px; border-radius: 8px; background: #6f4423; border: 3px solid var(--tc, #fff);
  box-shadow: 0 3px 0 #573419, 0 5px 8px rgba(0, 0, 0, .22); animation: packin .35s ease-out backwards; }
.pack:nth-child(2) { animation-delay: .05s; } .pack:nth-child(3) { animation-delay: .1s; } .pack:nth-child(4) { animation-delay: .15s; } .pack:nth-child(5) { animation-delay: .2s; }
.pack:nth-child(n+6) { animation-delay: .25s; }
.pack i { display: block; width: clamp(6px, 1.7vw, 9px); height: clamp(15px, 4.2vw, 22px); border-radius: 2px; background: linear-gradient(90deg, var(--plank2-light) 0 30%, var(--plank2) 30% 100%); }
.pack.hint { box-shadow: 0 0 0 3px var(--sun), 0 0 12px 2px rgba(255, 201, 60, .8); }
@keyframes packin { from { transform: translateY(-14px) scale(.8); opacity: 0; } }
.flashcard { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: min(64vw, 250px); padding: 20px 26px 14px; border-radius: 16px;
  background: #fffdf6; border: 5px solid var(--tc, #fff); box-shadow: 0 6px 0 rgba(0, 0, 0, .18), 0 10px 18px rgba(0, 0, 0, .2); transform: rotate(-2deg); animation: cardin .3s ease-out; }
.flashcard b { font-family: var(--font-display); font-size: clamp(34px, 10vw, 54px); line-height: 1.1; color: #33415c; white-space: nowrap; }
.flashcard small { font-weight: 700; font-size: 13px; color: #fff; text-shadow: 0 0 2px #1c2333, 0 0 2px #1c2333, 0 1px 2px #1c2333; background: var(--tc, #eee); padding: 2px 10px; border-radius: 99px; }
.packs.card.turned .flashcard { transform: rotate(1deg); background: #f2ffe8; animation: cardturn .4s ease-out; }
@keyframes cardin { from { transform: translateY(-30px) rotate(-8deg); opacity: 0; } }
@keyframes cardturn { 0% { transform: rotate(-2deg) scaleX(1); } 50% { transform: rotate(0) scaleX(.05); } 100% { transform: rotate(1deg) scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .pack, .flashcard, .packs.card.turned .flashcard { animation: none; } }
/* on the map: how many cards wait today */
.spot .due { position: absolute; left: calc(50% + 1.6cqw); bottom: calc(40% + 3cqw); min-width: 2.3cqw; height: 2.3cqw; padding: 0 .5cqw; border-radius: 99px; display: grid; place-items: center;
  background: #e8453c; color: #fff; font-weight: 800; font-size: 1.4cqw; line-height: 1; border: .22cqw solid #fff; box-shadow: 0 .2cqw .4cqw rgba(0, 0, 0, .35); }
/* parents' corner */
.cards-info { margin-top: 14px; }
.cards-info h3 { margin: 0 0 6px; font-size: 1rem; }
.cards-info p { margin: 4px 0; font-size: .92rem; }
.cards-info .tc { display: inline-block; width: .85em; height: .85em; border-radius: 3px; margin-right: 6px; border: 1px solid rgba(0, 0, 0, .25); vertical-align: -1px; }

/* ---------- the clock tower and the plank shop: a clock, or money, on the table (.packs.board) ---------- */
.packs.board { gap: 14px 18px; max-width: min(100%, 520px); }
.scene[data-board] .mist-note, .scene[data-board="clock"].no-help .mist-note { display: none; }
.scene[data-board="money"].no-help .mist-note { display: block; }
.scene.no-help .packs.board.clock { visibility: visible; }
.scene.no-help .packs.board.clock .num { display: none; }
/* the clock */
.dial { width: clamp(150px, 46vw, 230px); height: auto; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .28)); animation: cardin .3s ease-out; }
.dial .rim { fill: #8a5a30; stroke: #4a2a10; stroke-width: 3; }
.dial .face { fill: #fffdf2; stroke: #4a2a10; stroke-width: 2; }
.dial .tk { stroke: #9aa3b5; stroke-width: 1.5; }
.dial .tk.big { stroke: #33415c; stroke-width: 3.5; }
.dial .num { font-family: var(--font-display); font-weight: 700; font-size: 21px; text-anchor: middle; fill: #33415c; }
.dial .hand { stroke-linecap: round; }
.dial .hand.hour { stroke: #c0392b; stroke-width: 9; }
.dial .hand.min { stroke: #2b6cb0; stroke-width: 5.5; }
.dial .pin { fill: #33415c; }
.packs.board.clock.hint .hand { filter: drop-shadow(0 0 4px #ffc93c) drop-shadow(0 0 2px #ffc93c); }
/* the sentence around the answer box: "half [ ]", "[ ] uur" */
.sum .w { font-size: .62em; font-weight: 700; color: #33415c; align-self: center; }
/* money: coins of 1 and 2, notes of 5, 10, 20, 50 and 100 */
.stapel { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 10px; }
.geld { display: grid; place-items: center; flex: none; font-family: var(--font-display); color: #26324a; box-shadow: 0 3px 0 rgba(0, 0, 0, .28), 0 5px 8px rgba(0, 0, 0, .2); animation: packin .3s ease-out backwards; }
.geld b { font-size: clamp(17px, 4.6vw, 24px); line-height: 1; }
.geld.munt { width: clamp(40px, 10.5vw, 54px); aspect-ratio: 1; border-radius: 50%; }
.geld.g1 { background: radial-gradient(circle, #e8ebf0 0 54%, #f2c744 56% 100%); border: 2px solid #9a6a10; }
.geld.g2 { background: radial-gradient(circle, #f2c744 0 54%, #e8ebf0 56% 100%); border: 2px solid #7d8590; width: clamp(45px, 11.5vw, 60px); }
.geld.brief { width: clamp(78px, 21vw, 108px); aspect-ratio: 1.85; border-radius: 6px; border: 2px solid rgba(0, 0, 0, .35); position: relative; }
.geld.brief::before { content: "€"; position: absolute; left: 6px; top: 3px; font-size: 12px; font-weight: 700; opacity: .6; }
.geld.brief::after { content: ""; position: absolute; right: 7%; top: 16%; bottom: 16%; width: 20%; border-radius: 40%; background: rgba(255, 255, 255, .4); }
.geld.g5 { background: linear-gradient(135deg, #dfe4ea, #aab4c0); }
.geld.g10 { background: linear-gradient(135deg, #ffc9c9, #f47a7a); }
.geld.g20 { background: linear-gradient(135deg, #c5dcff, #6fa4f2); }
.geld.g50 { background: linear-gradient(135deg, #ffe0b0, #f5a23c); }
.geld.g100 { background: linear-gradient(135deg, #c8f2c2, #62c466); }
.packs.board.money.hint .geld { box-shadow: 0 0 0 3px var(--sun), 0 0 10px 2px rgba(255, 201, 60, .8); }
.prijs { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.prijs small { font-weight: 800; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: #fff; text-shadow: 0 1px 2px #1c2333, 0 0 3px #1c2333; }
.kaartje { display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; border-radius: 10px; background: #fffdf2; border: 2px solid #4a2a10; box-shadow: 0 4px 0 rgba(0, 0, 0, .25); transform: rotate(-3deg); }
.kaartje i { width: 14px; height: 38px; border-radius: 3px; background: linear-gradient(90deg, var(--plank2-light) 0 30%, var(--plank2) 30% 100%); box-shadow: 0 0 0 1.5px #6a4020; }
.kaartje b { font-family: var(--font-display); font-size: clamp(20px, 5.4vw, 28px); color: #26324a; white-space: nowrap; }
.packs .plus { font-family: var(--font-display); font-size: 30px; font-weight: 700; color: #fff; text-shadow: 0 2px 3px #1c2333; align-self: flex-end; margin-bottom: 10px; }
/* the chapter signs of these worlds: three clocks, or three coins (one coloured in per star) */
.bridge-btn.signs-klok .mini-bridge, .bridge-btn.signs-geld .mini-bridge, .bridge-btn.signs-zee .mini-bridge { display: none; }
/* small screens: the clock and the money fit the little scene */
@media (max-height: 559px), (max-width: 859px) {
  .scene.has-art .dial, .scene .dial { width: min(40vw, 150px); }
  .packs.board { gap: 6px 10px; }
  .kaartje { padding: 4px 9px 4px 7px; } .kaartje i { height: 26px; width: 10px; } .kaartje b { font-size: 18px; } .prijs small { font-size: 10px; }
}
@media (orientation: landscape) and (max-height: 480px) { .scene.has-art .dial, .scene .dial { width: min(36vh, 130px); } }

/* ---------- money that looks like euros: the real colours, and the real sizes in proportion ----------
   --u = the size of one millimetre. Notes: 5 = 120 x 62 mm, 10 = 127 x 67, 20 = 133 x 72, 50 = 140 x 77, 100 = 147 x 77.
   Coins: 1 euro = 23.25 mm, 2 euro = 25.75 mm, drawn 1.8 x as big (--c), or no finger could tap them. */
.packs.board.money { --u: clamp(.5px, .16vw, .72px); --c: 1.8; }
:is(.packs.board.money, .pad-money) .geld.brief { width: calc(var(--mmw) * var(--u)); height: calc(var(--mmh) * var(--u)); aspect-ratio: auto; border-radius: calc(4 * var(--u)); border: calc(1.6 * var(--u)) solid rgba(40, 40, 40, .45);
  background: linear-gradient(100deg, rgba(255, 255, 255, .55) 0 7%, transparent 7% 100%), radial-gradient(circle at 78% 50%, rgba(255, 255, 255, .5) 0 22%, transparent 23%), linear-gradient(135deg, var(--n1), var(--n2)); }
:is(.packs.board.money, .pad-money) .geld.g5 { --mmw: 120; --mmh: 62; --n1: #d9dcd3; --n2: #a9b0a4; }
:is(.packs.board.money, .pad-money) .geld.g10 { --mmw: 127; --mmh: 67; --n1: #f6c1b8; --n2: #e0796c; }
:is(.packs.board.money, .pad-money) .geld.g20 { --mmw: 133; --mmh: 72; --n1: #c3d6f2; --n2: #6f97d3; }
:is(.packs.board.money, .pad-money) .geld.g50 { --mmw: 140; --mmh: 77; --n1: #fbd9a4; --n2: #ee9a3a; }
:is(.packs.board.money, .pad-money) .geld.g100 { --mmw: 147; --mmh: 77; --n1: #cfe8b4; --n2: #7fbf5e; }
:is(.packs.board.money, .pad-money) .geld.brief b { position: absolute; left: 14%; bottom: 6%; font-size: calc(30 * var(--u)); }
:is(.packs.board.money, .pad-money) .geld.brief::before { content: attr(data-x) "EURO"; left: auto; right: 6%; top: 8%; font-size: calc(9 * var(--u)); letter-spacing: .08em; opacity: .7; }
/* the arch of a bridge, as on the real notes */
:is(.packs.board.money, .pad-money) .geld.brief::after { right: 13%; left: 57%; top: 38%; bottom: 16%; width: auto; border-radius: 50% 50% 0 0 / 100% 100% 0 0; background: none; border: calc(3 * var(--u)) solid rgba(40, 40, 60, .4); border-bottom: 0; }
:is(.packs.board.money, .pad-money) .geld.munt { width: calc(23.25 * var(--c) * var(--u)); border-width: calc(1.4 * var(--u)); position: relative; }
:is(.packs.board.money, .pad-money) .geld.g2 { width: calc(25.75 * var(--c) * var(--u)); }
:is(.packs.board.money, .pad-money) .geld.g1 { background: radial-gradient(circle, #eceef2 0 56%, #e9c45a 58% 100%); border-color: #94700f; }
:is(.packs.board.money, .pad-money) .geld.g2 { background: radial-gradient(circle, #eccb62 0 56%, #e4e7ec 58% 100%); border-color: #7d8590; }
:is(.packs.board.money, .pad-money) .geld.munt b { font-size: calc(21 * var(--u)); }
:is(.packs.board.money, .pad-money) .geld.munt::after { content: "€"; position: absolute; right: 23%; bottom: 20%; font-size: calc(8 * var(--u)); font-weight: 700; opacity: .65; }
/* paying: the counter above, the purse below */
.packs.board.money.lay { --u: clamp(.42px, .13vw, .6px); flex-direction: column; flex-wrap: nowrap; gap: 8px; align-items: stretch; }
.toonbank { display: flex; gap: 10px; align-items: stretch; justify-content: center; }
.bon { display: flex; gap: 8px; align-items: flex-end; }
.gelegd { flex: 1; min-width: 46%; min-height: calc(92 * var(--u)); display: flex; flex-direction: column; gap: 3px; padding: 4px 8px 6px; border-radius: 12px; border: 2px dashed rgba(255, 255, 255, .85); background: rgba(40, 25, 10, .28); }
.gelegd small, .beurs::before { font-weight: 800; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: #fff; text-shadow: 0 1px 2px #1c2333; }
.gelegd .stapel { flex: 1; gap: 4px 5px; }
.gelegd em { font-style: normal; font-weight: 700; font-size: 13px; color: rgba(255, 255, 255, .85); }
.beurs { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; justify-content: center; padding: 6px 8px; border-radius: 12px; background: rgba(255, 253, 242, .9); box-shadow: 0 3px 0 rgba(0, 0, 0, .22); }
button.geld { cursor: pointer; font: inherit; font-family: var(--font-display); padding: 0; animation: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.beurs button.geld:active { transform: translateY(2px) scale(.96); }
.gelegd button.geld { animation: packin .2s ease-out; }
.sum .box.lay { display: none; }
/* nothing to type while paying: only "wis" (take the last piece back) and the check */
#pad.lay button[data-k]:not(.del):not(.go) { opacity: .22; pointer-events: none; }
@media (max-height: 559px), (max-width: 859px) { :is(.packs.board.money, .pad-money) .geld.brief { width: calc(var(--mmw) * var(--u)); } .packs.board.money { --u: .44px; } .packs.board.money.lay { --u: .46px; --c: 2.2; gap: 4px; } .gelegd small { font-size: 9px; } }

/* the purse and the till have a name; getting to know the money: everything open on the table */
.beurs { position: relative; }
.beurs small { flex-basis: 100%; text-align: center; font-weight: 800; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: #6a4020; margin-bottom: -2px; }
.beurs.kassa { background: linear-gradient(#d9dde3, #b9c0ca); border: 2px solid #5b6472; }
.beurs.kassa small { color: #2c3440; }
.beurs.portefeuille { background: linear-gradient(#b9793f, #96592a); border: 2px solid #5a3414; }
.beurs.portefeuille small { color: #fff3dd; }
.beurs.open { background: none; box-shadow: none; gap: 10px 14px; }
.packs.board.money.ken { --u: clamp(.5px, .16vw, .72px); }
.packs.board.money.ken.blind .geld b, .packs.board.money.ken.blind .geld::before, .packs.board.money.ken.blind .geld.munt::after { visibility: hidden; }
.packs.board.money.ken [data-right] { box-shadow: 0 0 0 4px #5fd068, 0 0 14px 3px rgba(95, 208, 104, .8); }
#pad.lay.tap button[data-k] { opacity: .22; pointer-events: none; }

/* the cent coins: 1, 2 and 5 cent are copper, 10, 20 and 50 cent are gold; real sizes in proportion (x --c, as the euro coins) */
:is(.packs.board.money, .pad-money) .geld.cent { border-color: #7a4a1c; }
:is(.packs.board.money, .pad-money) .geld.c1 { width: calc(16.25 * var(--c) * var(--u)); } :is(.packs.board.money, .pad-money) .geld.c2 { width: calc(18.75 * var(--c) * var(--u)); }
:is(.packs.board.money, .pad-money) .geld.c5 { width: calc(21.25 * var(--c) * var(--u)); } :is(.packs.board.money, .pad-money) .geld.c10 { width: calc(19.75 * var(--c) * var(--u)); }
:is(.packs.board.money, .pad-money) .geld.c20 { width: calc(22.25 * var(--c) * var(--u)); } :is(.packs.board.money, .pad-money) .geld.c50 { width: calc(24.25 * var(--c) * var(--u)); }
:is(.packs.board.money, .pad-money) .geld.c1, :is(.packs.board.money, .pad-money) .geld.c2, :is(.packs.board.money, .pad-money) .geld.c5 { background: radial-gradient(circle at 35% 30%, #e9a877, #c2713a 70%); }
:is(.packs.board.money, .pad-money) .geld.c10, :is(.packs.board.money, .pad-money) .geld.c20, :is(.packs.board.money, .pad-money) .geld.c50 { background: radial-gradient(circle at 35% 30%, #f5dc8a, #dcae3c 70%); border-color: #8c6a12; }
:is(.packs.board.money, .pad-money) .geld.cent b { font-size: calc(17 * var(--u)); }
:is(.packs.board.money, .pad-money) .geld.cent::after { content: "c"; right: 16%; bottom: 14%; }
.bon .plus { align-self: center; margin: 0 2px; font-size: 22px; }

/* "do I have enough?": your money and the price, with a yes and a no button under them (also when the help is off) */
.scene.no-help .packs.board.money.genoeg { visibility: visible; }
.packs.board.money.genoeg { flex-direction: column; gap: 8px; }
.packs.board.money.genoeg .rij { display: flex; align-items: flex-end; justify-content: center; gap: 18px; }
.janee { display: flex; gap: 12px; justify-content: center; }
.janee button { font: inherit; font-weight: 800; font-size: 17px; padding: 8px 16px; border-radius: 14px; border: 3px solid #2f6b3a; background: #d9f2c9; color: #1f4a27; cursor: pointer; box-shadow: 0 3px 0 rgba(0, 0, 0, .25); }
.janee button.nee { border-color: #9c3b2a; background: #fbd9cf; color: #6e2416; }
.janee button:active { transform: translateY(2px); box-shadow: none; }
#sum .box.yn { min-width: 3.2em; width: auto; padding: 0 .3em; margin-right: .5em; }

/* cent sums: no notes on the table, so the coins are drawn 1.7 times larger (still in proportion to each other) */
:is(.packs.board.money, .pad-money) .geld.c1 { width: calc(16.25 * 1.7 * var(--c) * var(--u)); } :is(.packs.board.money, .pad-money) .geld.c2 { width: calc(18.75 * 1.7 * var(--c) * var(--u)); } :is(.packs.board.money, .pad-money) .geld.c5 { width: calc(21.25 * 1.7 * var(--c) * var(--u)); } :is(.packs.board.money, .pad-money) .geld.c10 { width: calc(19.75 * 1.7 * var(--c) * var(--u)); } :is(.packs.board.money, .pad-money) .geld.c20 { width: calc(22.25 * 1.7 * var(--c) * var(--u)); } :is(.packs.board.money, .pad-money) .geld.c50 { width: calc(24.25 * 1.7 * var(--c) * var(--u)); } 
:is(.packs.board.money, .pad-money)[data-unit="c"] .geld.g1 { width: calc(23.25 * 1.7 * var(--c) * var(--u)); }
:is(.packs.board.money, .pad-money) .geld.cent b, :is(.packs.board.money, .pad-money)[data-unit="c"] .geld.g1 b { font-size: calc(32 * var(--u)); }

/* ---------- the start screen: a board with the players, one tap selects, "Spelen" starts ---------- */
.home-board { position: relative; }
.profile-list { max-height: min(46vh, 330px); overflow-y: auto; padding: 4px; margin: -4px; }
.profile-btn { width: 100%; font: inherit; color: inherit; }
.profile-btn.sel { background: #ffe9a3; box-shadow: 0 0 0 3px var(--sun), 0 4px 0 var(--soft-2); }
.profile-btn .av, .av-btn .av { display: grid; place-items: center; border-radius: 50%; background: var(--avc, #6cbf5a); overflow: hidden; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(0, 0, 0, .25); }
.profile-btn .av .doodle, .av-btn .av .doodle { width: 100%; height: 100%; object-fit: contain; transform: scale(1.18) translateY(6%); }
.profile-btn .pill.edit { background: var(--paper); }
.home-actions { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.home-actions[hidden], .new-profile[hidden], .profile-list[hidden] { display: none; }
.home-actions .btn.ghost { font-size: 1rem; padding: 9px 12px; }
.home-actions .btn.go { background: linear-gradient(180deg, #7ed957, #3fae2a); color: #fff; box-shadow: 0 5px 0 #1f6b17; text-shadow: 0 2px 0 rgba(0, 60, 0, .45); font-size: 1.6rem; padding: 12px 34px; border-radius: 999px; }
.home-actions .btn.go:active { box-shadow: 0 1px 0 #1f6b17; }
.home-board[data-mode="manage"] .home-actions { grid-template-columns: 1fr; justify-items: center; }
.avatar-pick { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.av-btn { border: 0; background: none; padding: 3px; border-radius: 50%; cursor: pointer; aspect-ratio: 1; }
.av-btn .av { width: 100%; height: 100%; }
.av-btn.sel { box-shadow: 0 0 0 4px var(--sun), 0 0 12px 3px rgba(255, 190, 40, .8); }
.new-profile input { width: 100%; }
@media (max-width: 560px) {
  .home-actions { grid-template-columns: 1fr 1fr; }
  .home-actions .btn.go { grid-column: 1 / -1; grid-row: 1; justify-self: center; }
  .avatar-pick { grid-template-columns: repeat(4, 1fr); max-width: 300px; margin-inline: auto; }
}

.profile-btn .pill .ster { display: none; }

.hero .ribbon { display: none; }

.fam-ic { width: 1.5em; height: 1.1em; vertical-align: -.18em; fill: currentColor; }

/* ---------- a very wide screen: the map keeps its shape too ----------
   The map is cut by 7 % at most (top and bottom); beyond that it stays as it is, in the middle, and the same picture,
   soft, fills the sides. The buttons and signs stay on the map. */
#scr-map.full-map { --band: max(0px, calc((100cqw - 100cqh * 1.6 * 1.07) / 2));
  --side-l: calc(var(--band) + max(var(--pad), env(safe-area-inset-left, 0px))); --side-r: calc(var(--band) + max(var(--pad), env(safe-area-inset-right, 0px)));
  --pad: clamp(10px, min(1.8cqw, 2.9cqh), 24px); background: #2c2415; }
#scr-map.full-map::before { content: ""; position: absolute; inset: -30px; background: var(--map-img) center / cover no-repeat; filter: blur(22px) saturate(1.05) brightness(.7); }
#scr-map.full-map .map-art { left: var(--band); right: var(--band); box-shadow: 0 0 40px 10px rgba(0, 0, 0, .35);
  --side-l: max(var(--pad), env(safe-area-inset-left, 0px)); --side-r: max(var(--pad), env(safe-area-inset-right, 0px)); }
#scr-map.full-map .gate { width: min(600px, calc(100% - 2 * var(--pad) - 2 * var(--band))); }
/* the map gets its side bands at the same screen shape as every other screen (16:9 plus 7 %), not earlier */
#scr-map.full-map { --band: max(0px, calc((100cqw - 100cqh * 16 / 9 * 1.07) / 2)); }

/* ---------- paying and giving change: the till (or the wallet) lies where the number keys were ---------- */
.pad-money { display: none; }
#pad.lay:not(.tap) .pad-money { display: flex; grid-column: 1 / -1; grid-row: 1 / span 3; align-items: stretch; --u: .5px; --c: 2.2; }
#pad.lay button[data-k]:not(.del):not(.go) { display: none; }
.pad-money .beurs { flex: 1; align-content: center; }
.pad-money .geld { cursor: pointer; }
/* in the shop the child is the shopkeeper: only the customer is on the screen */
#scr-play.shop-art #actorBram { display: none; }
.pad-money .geld { flex: none; }

/* paying and giving change: no "wis" and no check button either. A tap on a piece on the counter takes it back, and the
   game looks as soon as the amount is there. */
#pad.lay button[data-k] { display: none; }
.kassa-scherm { display: none; }

/* the check button is part of the till (and of the wallet); "wis" is not needed: tap a piece on the counter to take it back */
.geld-ok { flex: none; width: 54px; height: 44px; margin-left: 8px; border: 0; border-radius: 12px; background: var(--leaf, #4caf50); box-shadow: 0 4px 0 var(--leaf-dark, #2e7d32); cursor: pointer; }
.geld-ok:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--leaf-dark, #2e7d32); }
.geld-ok svg { width: 60%; height: 60%; fill: none; stroke: #fff; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
#pad.lay button.geld-ok[data-k] { display: block; opacity: 1; pointer-events: auto; }

/* ---------- the sea worlds: a drawing on the table (.packs.board.fig, made in forms.js) ---------- */
.scene.no-help .packs.board.fig { visibility: visible; }
.packs.board.fig { flex-direction: column; flex-wrap: nowrap; align-items: center; gap: 8px; }
.packs.board.fig svg.fig { width: clamp(230px, 60vw, 420px); height: auto; background: rgba(255, 253, 242, .9); border: 2px solid rgba(74, 42, 16, .55); border-radius: 16px; box-shadow: 0 4px 0 rgba(0, 0, 0, .18); animation: cardin .3s ease-out; }
.packs.board.fig svg.fig text { font-family: var(--font-display); font-weight: 700; }
.packs.board.fig.hint svg.fig { box-shadow: 0 0 0 3px var(--sun), 0 0 12px 2px rgba(255, 201, 60, .8); }
.keuze { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.keuze button { font: inherit; font-family: var(--font-display); font-weight: 800; font-size: 20px; padding: 8px 20px; border-radius: 14px; border: 3px solid #2f5d8a; background: #dcefff; color: #173a5c; cursor: pointer; box-shadow: 0 3px 0 rgba(0, 0, 0, .25); }
.keuze button:active { transform: translateY(2px); box-shadow: none; }
/* a fraction: one above the other with a line between */
.frac { display: inline-flex; flex-direction: column; align-items: center; gap: 10px; position: relative; vertical-align: middle; }
.frac::after { content: ""; position: absolute; left: -5px; right: -5px; top: 50%; height: 3px; margin-top: -1.5px; background: currentColor; border-radius: 2px; }
.frac b { font-size: .62em; line-height: 1; }
.frac .box { margin: 0; }
@media (max-height: 559px), (max-width: 859px) { .packs.board.fig svg.fig { width: min(52vw, 300px); } .keuze button { font-size: 15px; padding: 5px 12px; } }

/* ---------- the letters in a bottle (story book), the Boat on the shipyard, the hiccup wave ---------- */
.book-item .av.fles { display: grid; place-items: center; font-size: 26px; }
.brief { position: relative; margin: 8px auto; max-width: 30ch; padding: 22px 20px; background: #fdf3d3; border: 2px solid #c9a86a; border-radius: 6px 14px 8px 16px; box-shadow: 0 4px 10px rgba(0, 0, 0, .18); transform: rotate(-1.5deg); overflow: hidden; }
.brief p { margin: 0; font-family: "Comic Sans MS", "Segoe Print", var(--font-display), cursive; font-size: 1.35rem; line-height: 1.5; color: #2b4a7a; }
.brief.nat1::after, .brief.nat2::after, .brief.nat3::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 82% 78%, rgba(88, 150, 210, .32) 0 14%, transparent 22%), radial-gradient(circle at 12% 20%, rgba(88, 150, 210, .22) 0 9%, transparent 16%); }
.brief.nat2::after { background: radial-gradient(circle at 80% 72%, rgba(88, 150, 210, .4) 0 20%, transparent 30%), radial-gradient(circle at 14% 24%, rgba(88, 150, 210, .32) 0 14%, transparent 22%), radial-gradient(circle at 50% 96%, rgba(88, 150, 210, .3) 0 16%, transparent 26%); }
.brief.nat3::after { background: radial-gradient(ellipse at 72% 74%, rgba(60, 120, 190, .62) 0 34%, transparent 50%), radial-gradient(circle at 12% 18%, rgba(88, 150, 210, .36) 0 15%, transparent 24%); }
.brief.nat2 p, .brief.nat3 p { text-shadow: 0 0 2px rgba(43, 74, 122, .55); }
.brief.leeg { background: #efe6cc; transform: none; text-align: center; opacity: .7; }
.brief-note { text-align: center; font-size: .95rem; opacity: .75; margin: 10px 0 0; }
.village .werfboot { height: 64px; width: auto; margin-left: auto; }
.hikgolf { position: absolute; left: 0; right: 0; top: 22%; height: 15%; z-index: 0; pointer-events: none; opacity: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 60' preserveAspectRatio='none'%3E%3Cpath d='M0 60 C40 60 60 8 120 8 C180 8 200 60 240 60 Z' fill='%2358b4e6'/%3E%3Cpath d='M30 52 C55 40 70 14 120 12' fill='none' stroke='%23fff' stroke-width='5' stroke-linecap='round' opacity='.8'/%3E%3C/svg%3E") center / 42% 100% no-repeat; }
.scene.hik .hikgolf { animation: hikgolf 3.4s ease-in-out; }
.scene.hik .packs, .scene.hik .actor, .scene.hik .fred { animation: hikbob 1.5s ease-in-out .9s; }
@keyframes hikgolf { 0% { opacity: 0; transform: translateX(-70%) scaleY(.4); } 15% { opacity: .9; } 50% { transform: translateX(0) scaleY(1); } 85% { opacity: .9; } 100% { opacity: 0; transform: translateX(70%) scaleY(.4); } }
@keyframes hikbob { 0%, 100% { translate: 0 0; } 35% { translate: 0 -2.2%; } 70% { translate: 0 1%; } }
@media (prefers-reduced-motion: reduce) { .scene.hik .hikgolf, .scene.hik .packs, .scene.hik .actor, .scene.hik .fred { animation: none; } }

/* ---------- the shipyard: making the parts (a tap on the ruler saws; pieces to lay) and the Boat in the corner ---------- */
.packs.board.fig svg .tik { cursor: pointer; }
.packs.board.fig svg .tik:hover { fill: rgba(217, 72, 47, .22); }
.rek { display: flex; gap: 10px; justify-content: center; align-items: flex-end; flex-wrap: wrap; }
.rek button { font: inherit; font-family: var(--font-display); font-weight: 800; font-size: 17px; min-width: 52px; padding: 8px 12px; border-radius: 10px; border: 3px solid #4a2a10; background: #eaa64a; color: #3a1f0a; cursor: pointer; box-shadow: 0 3px 0 rgba(0, 0, 0, .28); }
.rek button:active { transform: translateY(2px); box-shadow: none; }
.rek-mast .st100 { min-width: 120px; } .rek-mast .st50 { min-width: 78px; }
.rek-lading button { background: #8d99ae; color: #fff; border-radius: 8px 8px 12px 12px; }
.rek-ton button { background: #58b4e6; color: #0d3552; border-radius: 6px 6px 16px 16px; }
.play .topbar { position: relative; }
.bouw { position: absolute; right: 0; top: calc(100% + 8px); width: clamp(70px, 13vw, 150px); z-index: 4; pointer-events: none; background: rgba(255, 253, 242, .85); border: 2px solid rgba(74, 42, 16, .55); border-radius: 12px; padding: 3px; }
.bouw .werfboot { display: block; width: 100%; height: auto; }
@media (max-height: 559px), (max-width: 859px) { .rek button { font-size: 13px; padding: 5px 8px; min-width: 40px; } .rek-mast .st100 { min-width: 80px; } .rek-mast .st50 { min-width: 56px; } .bouw { display: none; } }
/* sawing and laying pieces: nothing to type, so only "wis" and the green key, side by side on a small board */
#pad.rekpad button[data-k]:not([data-k="del"]):not([data-k="ok"]) { display: none; }
#pad.rekpad { grid-template-columns: 1fr 1fr; width: min(100%, 340px); margin-inline: auto; }
.packs.board.fig.fig-zaag svg.fig { width: clamp(260px, 78vw, 560px); }
.rek-ruim button { background: #f3d9a6; min-width: 60px; }
.map-boot { position: absolute; left: 2%; top: 16%; width: 13%; padding: .5%; background: #fff8e6; border: 3px solid #6a4020; border-radius: 10px; box-shadow: 0 4px 0 rgba(74, 42, 16, .35); pointer-events: none; rotate: -3deg; }
.map-boot .werfboot { display: block; width: 100%; height: auto; }
/* sawing: a tap elsewhere on the ruler moves the saw, so there is no "wis": only the green key */
#pad.rekpad.zaagpad button[data-k="del"] { display: none; }
#pad.rekpad.zaagpad { grid-template-columns: 1fr; width: min(100%, 200px); }
#pad.zaagpad button[data-k="ok"] { font-size: 1.3rem; white-space: nowrap; padding-inline: 14px; }
#pad.rekpad.zaagpad { width: min(100%, 240px); }
/* the saw bench: plank, ruler and circular saw lie on the table itself, without a card */
.packs.board.fig.fig-zaag svg.fig { background: none; border: 0; box-shadow: none; overflow: visible; touch-action: none; user-select: none; }
.packs.board.fig svg.fig.geschilderd { background: none; border: 0; box-shadow: none; overflow: visible; }
.packs.board.fig svg .zaagje { cursor: grab; }
.packs.board.fig svg.zaag .tik:hover { fill: transparent; }
.packs.board.fig svg .zaagje.geparkeerd .zaaglijn, .packs.board.fig svg .zaagje.geparkeerd .zaagnr { display: none; }
.packs.board.fig svg .zaagje.geparkeerd .zaagkop { animation: zaagwenk 1.6s ease-in-out infinite; }
.packs.board.fig svg .zaagblad { transform-box: fill-box; transform-origin: center; }
.packs.zagen svg .zaagblad { animation: zaagdraai .25s linear infinite; }
.packs.zagen svg .zaagkop { animation: zagen 1.2s ease-in-out forwards; }
@keyframes zaagdraai { to { rotate: 360deg; } }
.packs.zagen svg.zaag { animation: zaagtril .09s linear infinite; }
@keyframes zaagtril { 50% { translate: 0 1px; } }
@keyframes zagen { 0% { translate: 0 0; } 70%, 100% { translate: 0 46px; } }
@keyframes zaagwenk { 0%, 100% { translate: 0 0; } 50% { translate: -7px 0; } }
@media (prefers-reduced-motion: reduce) { .packs.zagen svg .zaagkop, .packs.board.fig svg .zaagje.geparkeerd .zaagkop { animation: none; } }
.packs.zagen svg.geschilderd .zaagkop { animation-name: zagendiep; }
@keyframes zagendiep { 0% { translate: 0 0; } 70%, 100% { translate: 0 40px; } }

/* =====================================================================================
   PRENTENBOEK: warm wood, parchment and sunshine, to match the painted backgrounds.
   Everything below overrides the base styles above; the layout itself stays the same.
   ===================================================================================== */
:root {
  --sky: #bfe6fb;
  --paper: #fff6e2;
  --ink: #3b2614;
  --muted: #80603f;
  --soft: #f7e7c6;
  --soft-2: #d9b685;
  --sun: #ffc534;
  --sun-dark: #c9781a;
  --tomato: #e8584f;
  --leaf: #58b947;
  --leaf-light: #7fd06a;
  --leaf-dark: #2f7f2a;
  --water: #3aa9e6;
  --water-light: #69c3f0;
  --water-dark: #1d74b3;
  --wood: #b06f35;
  --wood-light: #d39552;
  --wood-dark: #6e4119;
  --line: #6e4119;
  --grain: repeating-linear-gradient(176deg, rgba(255,255,255,.07) 0 3px, transparent 3px 11px, rgba(60,30,5,.08) 11px 13px, transparent 13px 22px);
  --wood-bg: var(--grain), linear-gradient(180deg, #c98c4c, #a8692f);
  --wood-bg-dark: var(--grain), linear-gradient(180deg, #9a5f2c, #77461d);
  --parchment: radial-gradient(120% 90% at 50% 0%, #fffaf0 0%, #fdf0d4 70%, #f6e2b8 100%);
  --shadow: 0 6px 0 rgba(78, 45, 15, .35), 0 16px 28px -14px rgba(60, 30, 5, .55);
  --shadow-sm: 0 4px 0 rgba(78, 45, 15, .3), 0 8px 16px -10px rgba(60, 30, 5, .5);
  --r: 22px;
}
body { background-color: #9fd3ef; color: var(--ink); }

/* parchment boards with a wooden frame */
.panel, .village, .q-card, .chapter-panel, .done-panel, .map-caption, .book-spread, .bubble,
.badge, .stop button, .land-for, .land-how, .land-worlds, .land-faq, .land-end {
  background: var(--parchment);
  border: 4px solid var(--line);
  box-shadow: inset 0 0 0 3px #e8c48c, var(--shadow);
}
.panel h2, .panel h3 { color: var(--wood-dark); }
.hint-text, .hint { color: var(--muted); }

/* buttons: sunny yellow with a brown outline, like a sticker on a wooden sign */
.btn {
  background: linear-gradient(180deg, #ffd65a, #ffb627);
  color: var(--ink);
  border: 3px solid var(--line);
  box-shadow: 0 5px 0 var(--line), 0 10px 16px -8px rgba(60, 30, 5, .5);
  text-shadow: 0 1px 0 rgba(255,255,255,.5);
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--line); }
.btn.ghost { background: var(--parchment); box-shadow: 0 5px 0 var(--line); }
.btn.ghost:active { box-shadow: 0 1px 0 var(--line); }
.btn.danger { background: linear-gradient(180deg, #f2766d, #d9473f); color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.25); }

/* round wooden icon buttons */
.icon-btn {
  background: var(--wood-bg);
  color: #fff6e2;
  border: 3px solid var(--line);
  box-shadow: 0 4px 0 var(--line), 0 8px 14px -8px rgba(60, 30, 5, .6);
  border-radius: 50%;
}
.icon-btn:active { box-shadow: 0 1px 0 var(--line); }
.icon-btn.lang-btn { background: var(--parchment); }
.pill { background: linear-gradient(180deg, #ffd65a, #ffb627); border: 2px solid var(--line); color: var(--ink); }

/* titles on the painted background: cream letters with a brown edge */
/* titles on the painted background: cream letters with a smooth brown edge (a real outline drawn under the letters,
   not four shadows, which left bumps at the corners) */
.topbar .who { color: #fff8e6; -webkit-text-stroke: 4px var(--line); paint-order: stroke fill; text-shadow: 0 3px 0 var(--line), 0 5px 8px rgba(0, 0, 0, .35); }
.topbar .who .pill { -webkit-text-stroke: 0; text-shadow: none; }

/* the big logo */
.hero h1, .land-logo b {
  color: #ffc23d;
  -webkit-text-stroke: 2px var(--line);
  paint-order: stroke fill;
  text-shadow: 0 5px 0 var(--line), 0 10px 18px rgba(0,0,0,.35);
  letter-spacing: .01em;
}
.hero h1 small { -webkit-text-stroke: 0; color: #fff8e6; text-shadow: 0 2px 0 var(--line), 0 2px 6px rgba(0,0,0,.5); }

/* players */
.profile-btn { background: var(--parchment); border: 3px solid var(--line); box-shadow: 0 4px 0 var(--line); }
.profile-btn:active { box-shadow: 0 1px 0 var(--line); }

/* worlds as wooden signs */
.world-tab {
  background: var(--wood-bg);
  color: #fff6e2;
  border: 3px solid var(--line);
  box-shadow: 0 5px 0 var(--line);
  text-shadow: 0 2px 0 rgba(60, 30, 5, .6);
}
.world-tab[aria-selected="true"] { background: var(--grain), linear-gradient(180deg, #ffd65a, #ffb627); color: var(--ink); text-shadow: none; box-shadow: 0 5px 0 var(--line); }
.world-tab.locked { background: var(--grain), linear-gradient(180deg, #b9ab98, #948571); }

.village .lbl { color: var(--wood-dark); }
.village .book-btn { border: 3px solid var(--line); box-shadow: 0 4px 0 var(--line); background: linear-gradient(180deg, #ffd65a, #ffb627); }

/* the path (when there is no map) */
.trail::before { background: repeating-linear-gradient(180deg, #e8c48c 0 18px, #d6aa6b 18px 26px); box-shadow: 0 0 0 3px var(--line); }
.stop.current button { background: var(--grain), linear-gradient(180deg, #ffd65a, #ffb627); }
.stop button:disabled { background: #e9dcc6; opacity: .85; }


/* chapter: bridges on a board */
.bridge-btn { background: #fffaf0; border: 3px solid var(--soft-2); box-shadow: 0 4px 0 var(--soft-2); }
.bridge-btn.next { background: var(--grain), linear-gradient(180deg, #ffd65a, #ffb627); border-color: var(--line); box-shadow: 0 4px 0 var(--line); }
.bridge-btn.done { border-color: var(--leaf); }

/* story: a comic speech balloon */
.story-place {
  background: var(--wood-bg); color: #fff6e2; border: 3px solid var(--line);
  box-shadow: 0 4px 0 var(--line); text-shadow: 0 2px 0 rgba(60,30,5,.6); padding: 4px 22px; border-radius: 12px;
}
.bubble { border-radius: 30px; background: #fffdf6; }
.bubble::before { border-bottom-color: var(--line); top: -16px; border-width: 16px; margin-left: -16px; }
.bubble::after { content: ""; position: absolute; top: -9px; left: 50%; margin-left: -11px; border: 11px solid transparent; border-top: 0; border-bottom-color: #fffdf6; }
.speaker-name { color: var(--wood-dark); }
.bubble p { color: var(--ink); }

/* the play screen */
.scene { border: 5px solid var(--line); box-shadow: inset 0 0 0 3px #e8c48c, var(--shadow); }
.bank { background: linear-gradient(180deg, #8ad36d 0 14px, #5cb648 14px 70%, #4c9a3a 100%); }
.bank.left { box-shadow: 6px 0 0 #b8a07c, 10px 0 0 #8f7a5a; }
.bank.right { box-shadow: -6px 0 0 #b8a07c, -10px 0 0 #8f7a5a; }
.water { background: linear-gradient(180deg, #5ec2f0 0%, #2f9ad6 100%); }
.q-card { background: var(--parchment); }
.sum .op { color: #a88a64; }
.progress i { background: rgba(255, 246, 226, .9); box-shadow: inset 0 -3px 0 var(--soft-2), 0 0 0 2px var(--line); }
.progress i.ok { background: var(--wood); }
.progress i.now { background: #ffd65a; }

/* keypad: a wooden board, two rows of five, wis and ✓ on the right */
.pad-card { background: var(--wood-bg-dark); border: 4px solid var(--line); box-shadow: inset 0 0 0 3px #b98048, var(--shadow); }
.pad { grid-template-columns: repeat(5, 1fr) 1.25fr; grid-template-areas: "k1 k2 k3 k4 k5 del" "k6 k7 k8 k9 k0 ok"; gap: 8px; }
.pad [data-k="1"] { grid-area: k1; } .pad [data-k="2"] { grid-area: k2; } .pad [data-k="3"] { grid-area: k3; }
.pad [data-k="4"] { grid-area: k4; } .pad [data-k="5"] { grid-area: k5; } .pad [data-k="6"] { grid-area: k6; }
.pad [data-k="7"] { grid-area: k7; } .pad [data-k="8"] { grid-area: k8; } .pad [data-k="9"] { grid-area: k9; }
.pad [data-k="0"] { grid-area: k0; } .pad [data-k="del"] { grid-area: del; } .pad [data-k="ok"] { grid-area: ok; }
.pad button[data-k] { height: 62px; border: 3px solid var(--line); border-radius: 14px; }
.pad button[data-k="ok"] { background: linear-gradient(180deg, #6fd35b, #3f9e33); }
.pad button[data-k="del"] { background: linear-gradient(180deg, #f2766d, #d9473f); }
@media (min-width: 860px) and (orientation: landscape) {
  .pad { grid-template-columns: repeat(3, 1fr); grid-template-areas: "k1 k2 k3" "k4 k5 k6" "k7 k8 k9" "del k0 ok"; }
  .pad button[data-k] { height: 80px; }
}

/* bridge built */
.done-panel h2 { color: var(--wood-dark); }

/* medals */
.badge .ic { box-shadow: 0 0 0 3px var(--line), 0 4px 0 var(--line); }
.badge.locked { background: #efe3cc; }

/* the story book: a leather-bound book with parchment pages */
.book-tab { background: var(--wood-bg); color: #fff6e2; border: 3px solid var(--line); box-shadow: 0 4px 0 var(--line); text-shadow: 0 2px 0 rgba(60,30,5,.6); }
.book-tab[aria-selected="true"] { background: var(--grain), linear-gradient(180deg, #ffd65a, #ffb627); color: var(--ink); text-shadow: none; box-shadow: 0 4px 0 var(--line); }
.book-spread { border: 10px solid #7a3b1c; box-shadow: inset 0 0 0 3px #e8c48c, 0 6px 0 #4d220c, 0 18px 30px -14px rgba(0,0,0,.6); }
.book-list { border-right: 3px solid rgba(110, 65, 25, .25); background: linear-gradient(90deg, transparent 85%, rgba(110, 65, 25, .12)); }
.book-item[aria-current="true"] { background: linear-gradient(180deg, #ffd65a, #ffb627); box-shadow: 0 3px 0 var(--line); }
.who-detail h2 { color: var(--wood-dark); }
.book-page .line p { background: #fffdf6; border: 2px solid #e8c48c; }

/* parent corner tabs */
.tab { background: var(--soft); border: 3px solid var(--soft-2); }
.tab[aria-selected="true"] { background: linear-gradient(180deg, #ffd65a, #ffb627); border-color: var(--line); box-shadow: 0 3px 0 var(--line); }
.stat { background: #fffaf0; border: 2px solid #e8c48c; }

/* phones: a little tighter so everything still fits */
@media (max-width: 480px) {
  .panel, .village, .q-card, .chapter-panel, .done-panel, .map-caption, .bubble, .land-for, .land-how, .land-worlds, .land-faq, .land-end { border-width: 3px; }
  .pad { gap: 6px; }
  .pad button[data-k] { height: 54px; font-size: 1.7rem; border-width: 2px; }
  .pad button[data-k="del"] { font-size: 1rem; }
  .icon-btn { width: 44px; height: 44px; font-size: 1.15rem; }
  .scene { border-width: 3px; }
  .bank.left { box-shadow: 4px 0 0 #b8a07c; }
  .bank.right { box-shadow: -4px 0 0 #b8a07c; }
  .plank { width: clamp(14px, 4.6vw, 30px); }
  .bridge, .raft, .dock { gap: 2px; }
}


/* the play scene painted by the theme (scenes/...): our banks and water become see-through */
.scene.has-art { background: var(--scene-img) center 62% / cover no-repeat; }
.scene.has-art .bank, .scene.has-art .water { background: transparent; box-shadow: none; }
.scene.has-art .water::before, .scene.has-art .water::after { display: none; }
.scene.has-art.no-help .water { background: rgba(255, 255, 255, .28); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.scene.has-art .actor .doodle { filter: drop-shadow(0 6px 4px rgba(0, 0, 0, .35)); }
/* the painted friends (characters/) are already cut looking left, at Bram: the game's mirror is only for its own drawings */
.actor.friend.flip img.doodle { transform: none; }
/* bridge: thick sunny planks on a wooden beam, empty places as see-through "ghost planks" */
.scene .bridge { background: var(--wood-bg-dark); border: 3px solid var(--line); border-radius: 10px; box-shadow: 0 6px 0 var(--line), 0 18px 18px -10px rgba(0, 30, 60, .45); }
.scene .bridge::before { background:
    linear-gradient(#c98c4c, #c98c4c) 0 0 / 100% 6px no-repeat,
    repeating-linear-gradient(90deg, #8a5426 0 8px, transparent 8px 52px) 0 0 / 100% 100% no-repeat; }
.scene .plank { border-radius: 5px; }
.scene .plank.empty { background: rgba(220, 245, 255, .45); border: 2px solid rgba(255, 255, 255, .9); box-shadow: inset 0 0 10px rgba(255, 255, 255, .6); }
.scene .plank.a, .scene .plank.given { background: var(--grain), linear-gradient(180deg, #e2a660, #b5733a); box-shadow: inset 0 -4px 0 rgba(80, 40, 10, .3), 0 0 0 2px var(--line); }
.scene .plank.b { background: var(--grain), linear-gradient(180deg, #ffd07a, #f29b2c); box-shadow: inset 0 -4px 0 rgba(160, 80, 0, .3), 0 0 0 2px var(--line); }
.scene .raft { background: var(--wood-bg); border: 3px solid var(--line); border-radius: 50% / 22%; box-shadow: 0 5px 0 var(--line), 0 14px 14px -8px rgba(0, 30, 60, .5); padding-inline: 16px; }
.scene .dock { background: var(--wood-bg-dark); border: 3px solid var(--line); box-shadow: 0 5px 0 var(--line); }
.mist-note { border: 2px solid var(--line); background: #fff6e2 !important; }

/* ===== play screen on tablets and computers (landscape): the painted river fills a 16:9 stage,
         the sum hangs on a sign at the top, the keypad lies on a plank at the bottom ===== */
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art { display: grid; grid-template-columns: 1fr; grid-template-rows: auto auto; grid-template-areas: "top" "stage"; row-gap: 8px; max-width: none; }
  #scr-play.has-art > .topbar { grid-area: top; }
  #scr-play.has-art .play-main { display: contents; }
  #scr-play.has-art .scene, #scr-play.has-art .q-card, #scr-play.has-art .pad-card { grid-area: stage; }
  #scr-play.has-art .scene {
    container-type: size; justify-self: center;
    width: min(100%, calc((100vh / var(--zoom, 1) - 110px) * 16 / 9)); aspect-ratio: 16 / 9; height: auto; min-height: 0;
    --bankw: 16cqw; --actor: clamp(70px, 19cqh, 150px);
    border-radius: 26px;
  }
  /* the bridge between the posts, a little above the middle; the raft right under it */
  #scr-play.has-art .water { justify-content: flex-start; padding: 40cqh 0 0; gap: 3cqh; }
  #scr-play.has-art .bridge { margin: 0 -1cqw; }
  #scr-play.has-art .plank { width: clamp(22px, 4.4cqw, 44px); height: clamp(40px, 9cqh, 64px); }
  #scr-play.has-art .bundle { width: clamp(24px, 4.4cqw, 44px); height: clamp(42px, 9cqh, 64px); }
  /* the sign with the sum, top centre: kept low enough to leave the bridge free */
  #scr-play.has-art .q-card {
    align-self: start; justify-self: center; z-index: 5; margin-top: 1.4%;
    width: min(60%, 680px); max-height: 44cqh; padding: 6px 18px 8px; gap: 2px;
    background: var(--grain), linear-gradient(180deg, #f6d8a6, #e8bd7c);
    border: 4px solid var(--line); border-radius: 18px;
    box-shadow: inset 0 0 0 3px #f9e4bf, 0 6px 0 var(--line), 0 16px 24px -12px rgba(0,0,0,.5);
  }
  #scr-play.has-art .sum { font-size: clamp(2rem, 4.6vh, 3.1rem); }
  #scr-play.has-art .sum.has-split { padding-bottom: 64px; }
  #scr-play.has-art .split svg { height: 22px; width: 90px; }
  #scr-play.has-art .split .box { font-size: 1.55rem; }
  #scr-play.has-art .split .boxes { gap: 16px; }
  #scr-play.has-art .step-label { font-size: .72rem; }
  #scr-play.has-art .question { font-size: 1.02rem; line-height: 1.25; }
  #scr-play.has-art .q-card .feedback:empty { display: none; }
  /* the keypad on a long plank, bottom centre: two rows of five */
  #scr-play.has-art .pad-card {
    align-self: end; justify-self: center; z-index: 5; margin-bottom: 1.6%; position: static;
    width: min(74%, 820px); padding: 10px 12px;
  }
  #scr-play.has-art .pad { grid-template-columns: repeat(5, 1fr) 1.25fr; grid-template-areas: "k1 k2 k3 k4 k5 del" "k6 k7 k8 k9 k0 ok"; gap: 8px; }
  #scr-play.has-art .pad button[data-k] { height: clamp(50px, 7.4vh, 70px); font-size: 2rem; }
  /* Fred swims just above the keypad, the gags stay in the water */
  #scr-play.has-art .fred { bottom: 30cqh; right: calc(var(--bankw) + 2cqw); width: clamp(50px, 8cqh, 72px); height: clamp(50px, 8cqh, 72px); }
  #scr-play.has-art .fred-say { bottom: calc(30cqh + 50px); }
  #scr-play.has-art .scene.no-help .water { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
  #scr-play.has-art .mist-note { top: auto; bottom: 34cqh; }
}

/* two broad planks lead from each bank down onto the bridge, like in the drawing */
.scene.has-art .bank::after {
  content: ""; position: absolute; top: calc(var(--deck, 0px) - 6px); height: clamp(16px, 5cqh, 30px); width: 70%;
  background: var(--grain), linear-gradient(180deg, #d79a58, #a8662f); border: 3px solid var(--line); border-radius: 6px;
  box-shadow: 0 5px 0 var(--line); z-index: 2;
}
.scene.has-art .bank.left::after { right: -8px; transform-origin: right center; transform: rotate(9deg); }
.scene.has-art .bank.right::after { left: -8px; transform-origin: left center; transform: rotate(-9deg); }
.scene.has-art.no-help .bank::after { display: none; }

/* ===== painted parts (ui/): planks, bundles, raft, bridge, ramps, sign, keys ===== */
.scene .plank.a, .scene .plank.given, .scene .plank.b, .scene .plank.empty {
  background: url("ui/plank.webp") center / 100% 100% no-repeat; border: 0; border-radius: 0; box-shadow: none;
  filter: drop-shadow(0 3px 2px rgba(60, 30, 5, .35));
}
/* the second number: the same plank, painted orange */
.scene .plank.b { filter: sepia(.35) saturate(2.1) hue-rotate(-12deg) brightness(1.18) drop-shadow(0 3px 2px rgba(60, 30, 5, .35)); }
/* an empty place: a pale see-through plank */
.scene .plank.empty { filter: grayscale(1) brightness(2.2); opacity: .45; }
.scene .plank.hint { filter: drop-shadow(0 0 6px #ffd23f) drop-shadow(0 0 3px #ffd23f); }
.scene .bundle { background: url("ui/bundel.webp") center / 100% 100% no-repeat; box-shadow: none; border-radius: 0; filter: drop-shadow(0 3px 2px rgba(60, 30, 5, .35)); }
.scene .bundle::after { display: none; }
.scene .bundle.b { filter: sepia(.35) saturate(2.1) hue-rotate(-12deg) brightness(1.18) drop-shadow(0 3px 2px rgba(60, 30, 5, .35)); }
/* a hint on a bundle: a warm glow around the bundle itself (not around its box) */
.scene .bundle.hint { box-shadow: none; filter: drop-shadow(0 0 6px #ffd23f) drop-shadow(0 0 3px #ffd23f) !important; }
/* the raft: logs under the row of planks */
.scene .raft { background: url("ui/vlot.webp") center bottom / 100% 62% no-repeat; border: 0; border-radius: 0; box-shadow: none; padding: 0 18px 22px; }
/* the bridge: its wooden side with posts and a rope railing, the planks rest on top */
.scene .bridge {
  background: none; box-shadow: none; border-radius: 0;
  border-style: solid; border-color: transparent; border-width: 0 34px;
  border-image: url("ui/brugzijde.webp") 0 150 0 150 fill / 0 34px stretch;
  padding: 6px 4px 30px; align-items: flex-end;
}
.scene .bridge::before, .scene .bridge::after { display: none; }
/* ramps from the banks */
.scene.has-art .bank::after {
  background: url("ui/oprit.webp") center / contain no-repeat; border: 0; box-shadow: none; border-radius: 0;
  width: 120%; height: auto; aspect-ratio: 495 / 368; top: calc(var(--deck, 0px) - 30%); transform: none;
}
.scene.has-art .bank.left::after { right: -38%; }
.scene.has-art .bank.right::after { left: -38%; transform: scaleX(-1); }
/* the sum on a wooden sign, the keypad on a plank */
.q-card { background: none !important; border: 0 !important; box-shadow: none !important;
  border-image: url("ui/bord.webp") 70 fill / 30px stretch !important; border-style: solid; border-width: 30px; }
.pad-card { background: none !important; border: 0 !important; box-shadow: none !important;
  border-image: url("ui/onderlegger.webp") 60 fill / 22px stretch !important; border-style: solid; border-width: 22px; }
.pad button[data-k] { background: url("ui/toets.webp") center / 100% 100% no-repeat !important; border: 0 !important; box-shadow: none !important; color: #5a3a1e; }
.pad button[data-k]:active { transform: translateY(3px); filter: brightness(.95); }
.pad button[data-k="del"] { background-image: url("ui/toets-rood.webp") !important; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.pad button[data-k="ok"] { background-image: url("ui/toets-groen.webp") !important; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.25); }
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art .plank { width: 5.9cqh; height: 13cqh; }
  #scr-play.has-art .bundle { width: 9.6cqh; height: 13cqh; }
  #scr-play.has-art .bridge { border-width: 0 6cqh; border-image-width: 0 6cqh; padding: 0 0.6cqh 5cqh; }
  #scr-play.has-art .water { padding-top: 37cqh; gap: 1.5cqh; }
  #scr-play.has-art .q-card { padding: 2px 18px 12px; border-width: 22px; border-image-width: 22px !important; max-height: 44cqh; }
  #scr-play.has-art .pad-card { padding: 0; border-width: 18px; border-image-width: 18px !important; }
}
/* bridge side as one picture (no slicing), ramps left out: the posts of the bridge meet the posts on the banks */
.scene .bridge { border: 0 !important; border-image: none !important; background: url("ui/brugzijde.webp") center bottom / 100% 100% no-repeat !important; padding: 0 9% 13% !important; }
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art .bridge { padding: 0 9% 6.5cqh !important; margin: 0 -2cqw; }
}
.scene.has-art .bank::after { display: none; }
.scene .raft { background-size: 100% 58%; padding-bottom: 16px; }
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art .raft { background-size: 100% 8cqh; padding: 0 2.5cqh 3.2cqh; }
}

/* ===== flat boards like in the drawing: a walkway of boards seen from slightly above ===== */
.scene .plank { width: clamp(17px, 5.2vw, 36px); height: clamp(17px, 5.2vw, 36px); }
.scene .bridge { background: linear-gradient(transparent 70%, rgba(70, 40, 15, .55) 70% 88%, transparent 88%) !important; padding: 0 2px 2px !important; gap: 2px; }
.scene .bridge .plank:nth-child(5) { margin-right: 10px; }
.scene .raft { background: url("ui/vlot.webp") center / 100% 100% no-repeat !important; padding: 10px 16px 14px !important; gap: 2px; }
.scene .plank.empty { filter: grayscale(1) brightness(2.4) drop-shadow(0 0 1px rgba(255,255,255,.9)); opacity: .5; }
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art .plank { width: 9.8cqh; height: 10.3cqh; }
  #scr-play.has-art .bridge { padding: 0 0 0.6cqh !important; margin: 0 -1.5cqw; }
  #scr-play.has-art .water { padding-top: 40cqh; gap: 3cqh; }
  #scr-play.has-art .raft { padding: 1.6cqh 3cqh 2.6cqh !important; }
}
/* empty places: light blue "glass" boards, like in the drawing */
.scene .plank.empty { filter: brightness(1.7) sepia(1) hue-rotate(165deg) saturate(1.4) drop-shadow(0 0 2px rgba(255,255,255,.95)); opacity: .62; }
/* a beam under the boards, visible between them */
.scene .bridge { background: linear-gradient(180deg, transparent 58%, #7a4a20 58%, #94602e 74%, #5e3815 80%, transparent 80%) !important; }
.scene .plank.empty { opacity: .85; filter: brightness(1.9) sepia(1) hue-rotate(165deg) saturate(1.6) drop-shadow(0 0 2px #fff) drop-shadow(0 0 1px #fff); }

/* ===== boards straightened to one flat side view, so the bridge reads as one walkway ===== */
.scene .plank { width: clamp(20px, 6.4vw, 44px); height: clamp(12px, 3.9vw, 27px); filter: none; }
.scene .plank.b { filter: sepia(.35) saturate(2.1) hue-rotate(-12deg) brightness(1.18); }
.scene .plank.empty { opacity: .8; filter: brightness(1.9) sepia(1) hue-rotate(165deg) saturate(1.6) drop-shadow(0 0 1.5px #fff); }
.scene .bridge { gap: 3px; background: linear-gradient(180deg, transparent 45%, #6b3f18 45%, #8a5728 75%, transparent 75%) !important; padding: 0 3px !important; }
.scene .bridge .plank:nth-child(5) { margin-right: 9px; }
.scene .raft { background: url("ui/vlot.webp") center / 100% 100% no-repeat !important; padding: 4% 6% 9% !important; gap: 3px; align-items: center; }
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art .plank { width: 10.5cqh; height: 6.4cqh; }
  #scr-play.has-art .bridge { padding: 0 0.5cqh !important; margin: 0 -1.5cqw; }
  #scr-play.has-art .water { padding-top: 44cqh; gap: 6cqh; }
  #scr-play.has-art .raft { padding: 1.4cqh 3.2cqh 3.4cqh !important; }
}

/* ===== landing page: text that lies on the painted background ===== */
.land-hero h1 {
  color: #ffc23d; -webkit-text-stroke: 2.5px var(--line); paint-order: stroke fill;
  text-shadow: 0 5px 0 var(--line), 0 10px 22px rgba(0, 0, 0, .45); letter-spacing: .01em;
}
.land-hero .lead {
  background: rgba(255, 248, 232, .94); color: var(--ink); border: 3px solid var(--line); border-radius: 18px;
  padding: 12px 20px; box-shadow: 0 5px 0 var(--line), 0 14px 24px -12px rgba(0, 0, 0, .5); font-weight: 700; max-width: 46ch;
}
.badges-row li { background: rgba(255, 248, 232, .95); border: 2px solid var(--line); color: var(--ink); }
.land-logo b { font-size: 1.6rem; }

/* ===== the map: full screen, with wooden buttons and signs on top, like in the drawing ===== */
#scr-map.full-map { --ico-edge: #3d220b; }
#scr-map.full-map .topbar > .icon-btn, .map-cast .cast-more {
  background: linear-gradient(180deg, rgba(255, 230, 190, .16), rgba(60, 30, 5, .14)), url("ui/onderlegger.webp") 50% 50% / auto 320%;
  color: #fff1d0; border: 3px solid #3d220b;
  box-shadow: inset 0 3px 0 rgba(255, 222, 165, .5), inset 0 -4px 0 rgba(50, 25, 5, .35), 0 4px 0 #3d220b, 0 9px 12px -6px rgba(0, 0, 0, .55);
}
#scr-map.full-map .topbar > .icon-btn:active, .map-cast .cast-more:active { transform: translateY(3px); box-shadow: inset 0 3px 0 rgba(255, 222, 165, .5), 0 1px 0 #3d220b; }
.map-cast .cast-more { border-radius: 50%; }
/* the worlds: dark wooden signs with cream letters, a closed world is grey stone */
#scr-map.full-map .world-tab { background: none; border: 0; box-shadow: none; isolation: isolate; color: #fff3d8;
  -webkit-text-stroke: 5px #3d220b; paint-order: stroke fill; text-shadow: 0 3px 0 #3d220b; letter-spacing: .01em; }
#scr-map.full-map .world-tab::before { content: ""; position: absolute; inset: 0; z-index: -1; border: 16px solid transparent;
  border-image: url("ui/onderlegger.webp") 60 fill / 16px stretch; filter: brightness(.7) saturate(1.2) drop-shadow(0 4px 0 #3d220b) drop-shadow(0 8px 8px rgba(0, 0, 0, .35)); }
#scr-map.full-map .world-tab:not([aria-selected="true"]):not(.locked)::before { filter: brightness(.95) drop-shadow(0 4px 0 #3d220b) drop-shadow(0 8px 8px rgba(0, 0, 0, .35)); }
#scr-map.full-map .world-tab.locked { color: #f2f3f5; -webkit-text-stroke-color: #5d6168; text-shadow: 0 3px 0 #5d6168; }
#scr-map.full-map .world-tab.locked::before { filter: grayscale(1) brightness(1.12) contrast(.85) drop-shadow(0 4px 0 #5d6168) drop-shadow(0 8px 8px rgba(0, 0, 0, .3)); }
#scr-map.full-map .world-tab:active { transform: translateY(3px); }
#scr-map.full-map .world-tab .wt-badge { border-color: #6cbf3c; box-shadow: 0 0 0 3px #2f6a19, 0 5px 6px rgba(0, 0, 0, .4); }
/* the menu under the gear: a parchment sign with wooden buttons */
#scr-map.full-map .top-actions, #scr-map.full-map .lang-menu { background: none; box-shadow: none; border: 24px solid transparent; padding: 0;
  border-image: url("ui/bord.webp") 70 fill / 24px stretch; filter: drop-shadow(0 6px 0 rgba(61, 34, 11, .6)) drop-shadow(0 14px 16px rgba(0, 0, 0, .4)); }
#scr-map.full-map .top-actions .icon-btn { border-radius: 14px; }
#scr-map.full-map .top-actions .btn-lbl { color: #fff3d8; text-shadow: 0 2px 0 #3d220b, 1px 0 0 #3d220b, -1px 0 0 #3d220b; }
/* the chapter where you are: the cream sign with nails, a green play button */
.map-sign { background: none; box-shadow: none; border-radius: 0; border: 22px solid transparent; padding: 0 2px 0 6px;
  border-image: url("ui/bord.webp") 70 fill / 22px stretch; filter: drop-shadow(0 5px 0 rgba(61, 34, 11, .7)) drop-shadow(0 12px 12px rgba(0, 0, 0, .35)); }
.map-sign .t { color: #4a2a10; }
.map-sign .go { background: url("ui/toets-groen.webp") center / 100% 100% no-repeat; box-shadow: none; border-radius: 0; }
/* the road to the next world */
.spot .go { background: var(--grain), linear-gradient(180deg, #5ec2f0, #2f9ad6); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line); text-shadow: 0 1px 0 rgba(0, 0, 0, .3); }
/* a closed world: its map behind the list of what is still needed */
#scr-map.full-map .gate { box-shadow: inset 0 0 0 3px #e8c48c, 0 6px 0 rgba(61, 34, 11, .6), 0 20px 40px -10px rgba(0, 0, 0, .6); }

/* how much of the river is cut off at each side, worked out once on the scene (see below) */
@property --crop { syntax: "<length>"; inherits: true; initial-value: 0px; }

/* ===== the play screen on tablets and computers: the painted river fills the whole screen,
         the back button and the progress lie on top, the sum on a sign, the keypad on a plank ===== */
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art {
    position: fixed; inset: 0; z-index: 2; display: block; max-width: none; margin: 0; overflow: hidden; container-type: size;
    /* the river is a 16:9 picture: it covers the screen, but on squarer screens it is cut at most a little at the sides */
    --sw: max(100cqw, min(100cqh * 16 / 9, 100cqw * 1.12));
    --sh: calc(var(--sw) * 9 / 16);
    --edge: max(10px, calc((100cqh - var(--sh)) / 2 + var(--sh) * .016));
    background: #3d9ad3;
  }
  /* what is left above and below the river on a squarer screen: the same picture, soft */
  #scr-play.has-art::before { content: ""; position: absolute; inset: -30px; background: var(--scene-img) center / cover no-repeat; filter: blur(16px) saturate(1.1) brightness(.95); }
  #scr-play.has-art .scene {
    position: absolute; left: 50%; top: 50%; width: var(--sw); height: var(--sh); aspect-ratio: auto; transform: translate(-50%, -50%);
    border: 0; border-radius: 0; box-shadow: none;
  }
  #scr-play.has-art > .topbar { position: absolute; z-index: 6; top: max(12px, env(safe-area-inset-top, 0px)); left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px));
    align-items: flex-start; pointer-events: none; }
  #scr-play.has-art > .topbar > * { pointer-events: auto; }
  #scr-play.has-art > .topbar .who { flex: 0 1 auto; max-width: calc(50cqw - min(26cqw, 320px) - 96px); font-size: 1.15rem; line-height: 1.15; }
  #scr-play.has-art > .topbar .who strong { white-space: normal; overflow: visible; text-wrap: balance; }
  #scr-play.has-art > .topbar .progress { margin-left: auto; max-width: calc(50cqw - min(26cqw, 320px) - 30px); }
  #scr-play.has-art > .topbar .icon-btn {
    width: 56px; height: 56px; border-radius: 28%; color: #fff1d0; border: 3px solid #3d220b;
    background: linear-gradient(180deg, rgba(255, 230, 190, .16), rgba(60, 30, 5, .14)), url("ui/onderlegger.webp") 50% 50% / auto 320%;
    box-shadow: inset 0 3px 0 rgba(255, 222, 165, .5), inset 0 -4px 0 rgba(50, 25, 5, .35), 0 4px 0 #3d220b, 0 9px 12px -6px rgba(0, 0, 0, .55);
    font-size: 1.6rem; font-weight: 700; text-shadow: 0 2px 0 #3d220b;
  }
  /* the sign with the sum at the top, the keypad at the bottom: always on the screen, never cut off */
  /* the sign hangs at the top of the screen (on a squarer screen also over the soft band above the river), so it covers
     as little of the river as possible */
  #scr-play.has-art .q-card { position: absolute; z-index: 5; top: max(10px, calc(var(--sh) * .016)); left: 50%; transform: translateX(-50%); width: min(52cqw, 640px); margin: 0; }
  #scr-play.has-art .pad-card { position: absolute; z-index: 5; bottom: var(--edge); left: 50%; transform: translateX(-50%); width: min(74cqw, 820px); margin: 0; }
  /* Bram and the friend always stand on the banks at the height of the bridge,
     and move in a little when the sides of the river are cut off on a squarer screen */
  #scr-play.has-art .scene { --crop: max(0px, calc((var(--sw) - 100cqw) / 2)); }
  #scr-play.has-art .actor { top: calc(44cqh - var(--actor) + 10px); left: max(calc(var(--bankw) / 2), calc(var(--crop) + var(--actor) / 2 + 1cqw)); }
  #scr-play.has-art .actor.friend { left: min(calc(100% - var(--bankw) / 2), calc(100% - var(--crop) - var(--actor) / 2 - 1cqw)); }
  #scr-play.has-art .scene.cross #actorBram { left: calc(100% - var(--bankw) - 26px); }
  #scr-play.has-art .gag .front { display: none; }
  /* messages (a new medal) top right, never over the keypad */
  body:has(#scr-play.has-art:not([hidden])) .toasts { top: 84px; bottom: auto; left: auto; right: max(16px, env(safe-area-inset-right, 0px)); align-items: flex-end; }
  /* the jokes in the water and Fred: just above the keypad */
  /* the gags float IN the water: the bottom edge of their box is the water line, a little above the keypad; what lies
     under it is gone and the last bit above it fades, as if seen through the water. Nothing is hidden by the keypad. */
  /* the note lies where the bridge would be (its planks are hidden in this mode), so the gags have the water under it */
  #scr-play.has-art .scene.no-help .mist-note { top: 47cqh; bottom: auto; }
  #scr-play.has-art .scene.no-help .water > .gag { bottom: calc(var(--under, 0px) + 3cqh); overflow: hidden;
    -webkit-mask-image: linear-gradient(0deg, transparent 0, rgba(0, 0, 0, .5) 6px, #000 14px); mask-image: linear-gradient(0deg, transparent 0, rgba(0, 0, 0, .5) 6px, #000 14px); }
  #scr-play.has-art .fred { bottom: calc(var(--under, 30cqh) + 2cqh); }
  #scr-play.has-art .fred-say { bottom: calc(var(--under, 30cqh) + 2cqh + 50px); }
  /* Fred swims in the river: the lower part of the fish is under water, with rings of ripples where he comes
     through the surface. When he jumps (tap him) he comes out of the water completely. */
  /* the mask is twice as high as Fred and slides: normally the water line lies at 60-85 % of him, during a jump the
     opaque top half covers him completely */
  #scr-play.has-art .fred .doodle {
    -webkit-mask-image: linear-gradient(180deg, #000 0 65%, rgba(0, 0, 0, .5) 69%, rgba(0, 0, 0, .14) 73.5%, transparent 77.5%);
    mask-image: linear-gradient(180deg, #000 0 65%, rgba(0, 0, 0, .5) 69%, rgba(0, 0, 0, .14) 73.5%, transparent 77.5%);
    -webkit-mask-size: 100% 200%; mask-size: 100% 200%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-position: 0 70%; mask-position: 0 70%; }
  #scr-play.has-art .fred::before, #scr-play.has-art .fred::after { content: ""; position: absolute; left: 2%; right: 2%; top: 61%; height: 15%;
    border-radius: 50%; border: 2px solid rgba(255, 255, 255, .75); pointer-events: none; }
  #scr-play.has-art .fred::before { box-shadow: inset 0 0 5px rgba(255, 255, 255, .45); }
  #scr-play.has-art .fred::after { animation: fredRing 2.6s ease-out infinite; }
  /* the jump (the class stays after it, so everything here runs once and ends the way it started) */
  #scr-play.has-art .fred.jump .doodle { animation: fredOut .7s ease-out; }
  #scr-play.has-art .fred.jump::before { animation: fredRingsOff .7s; }
  #scr-play.has-art .fred.jump::after { animation: fredRing 2.6s ease-out infinite, fredRingsOff .7s; }
}
@keyframes fredRing { 0% { transform: scale(.85); opacity: .9; } 100% { transform: scale(1.45, 1.6); opacity: 0; } }
@keyframes fredOut { 0% { -webkit-mask-position: 0 70%; mask-position: 0 70%; } 12%, 84% { -webkit-mask-position: 0 0; mask-position: 0 0; }
  100% { -webkit-mask-position: 0 70%; mask-position: 0 70%; } }
@keyframes fredRingsOff { 0% { opacity: 1; } 8%, 90% { opacity: 0; } 100% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #scr-play.has-art .fred::after { animation: none; opacity: 0; } }
#scr-map.full-map .top-actions .icon-btn.lang-btn { background: var(--wood-bg); }

/* ===== chapter: the painted place fills the screen; the three bridges are wooden signs standing on it ===== */
#scr-chapter {
  position: fixed; inset: 0; z-index: 2; max-width: none; margin: 0; container-type: size; overflow-y: auto; overscroll-behavior: contain;
  --u: min(1cqw, 1.6cqh); --btn: clamp(46px, calc(var(--u) * 6.4), 64px); --ico-edge: #3d220b;
  --top: max(clamp(10px, 1.8cqw, 24px), env(safe-area-inset-top, 0px));
  padding: calc(var(--top) + var(--btn) + 12px) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; align-items: center; justify-content: safe center;
}
#scr-play.has-art { --ico-edge: #3d220b; }
/* top: back, the name of the place on a dark wooden sign, the story */
#scr-chapter > .topbar, #scr-badges > .topbar, #scr-book > .topbar { position: absolute; z-index: 5; top: var(--top); left: max(clamp(10px, 1.8cqw, 24px), env(safe-area-inset-left, 0px)); right: max(clamp(10px, 1.8cqw, 24px), env(safe-area-inset-right, 0px)); gap: calc(var(--btn) * .3); }
#scr-chapter .topbar .icon-btn, #scr-play.has-art > .topbar .icon-btn, #scr-badges .topbar .icon-btn, #scr-book .topbar .icon-btn, #scr-book .book-nav .icon-btn {
  width: var(--btn, 56px); height: var(--btn, 56px); border-radius: 28%; color: #fff1d0; border: 3px solid #3d220b; font-size: calc(var(--btn, 56px) * .46);
  background: linear-gradient(180deg, rgba(255, 230, 190, .16), rgba(60, 30, 5, .14)), url("ui/onderlegger.webp") 50% 50% / auto 320%;
  box-shadow: inset 0 3px 0 rgba(255, 222, 165, .5), inset 0 -4px 0 rgba(50, 25, 5, .35), 0 4px 0 #3d220b, 0 9px 12px -6px rgba(0, 0, 0, .55);
}
#scr-chapter .topbar .icon-btn:active, #scr-play.has-art > .topbar .icon-btn:active, #scr-badges .topbar .icon-btn:active, #scr-book .topbar .icon-btn:active, #scr-book .book-nav .icon-btn:active { transform: translateY(3px); box-shadow: inset 0 3px 0 rgba(255, 222, 165, .5), 0 1px 0 #3d220b; }
#scr-chapter .topbar .who, #scr-badges .topbar .who, #scr-book .topbar .who { flex: 0 1 auto; min-width: 0; position: relative; isolation: isolate; height: calc(var(--btn) * .86); padding: 0 1.1em;
  font-size: clamp(1.05rem, calc(var(--btn) * .42), 1.6rem); color: #fff3d8; -webkit-text-stroke: 5px #3d220b; paint-order: stroke fill; text-shadow: 0 3px 0 #3d220b; }
#scr-chapter .topbar .who::before, #scr-badges .topbar .who::before, #scr-book .topbar .who::before { content: ""; position: absolute; inset: 0; z-index: -1; border: 16px solid transparent;
  border-image: url("ui/onderlegger.webp") 60 fill / 16px stretch; filter: brightness(.7) saturate(1.2) drop-shadow(0 4px 0 #3d220b) drop-shadow(0 8px 8px rgba(0, 0, 0, .35)); }
#scr-chapter .topbar .who strong, #scr-badges .topbar .who strong, #scr-book .topbar .who strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#scr-chapter .topbar .top-actions, #scr-badges .topbar .top-actions, #scr-book .topbar .top-actions { margin-left: auto; }

/* the panel itself is see-through: the friend with what to do, and the three signs under it */
#scr-chapter .chapter-panel { background: none; border: 0; box-shadow: none; padding: 0; width: min(100%, 1000px); gap: clamp(12px, 2.4cqh, 26px); align-items: center; }
#scr-chapter .chapter-head { gap: 0; align-items: center; max-width: min(100%, 720px); }
#scr-chapter .chapter-friend { width: clamp(76px, 16cqh, 140px); height: clamp(76px, 16cqh, 140px); padding: 3px; border-radius: 50%; position: relative; z-index: 1;
  background: radial-gradient(circle at 50% 35%, #fffcee, #ffe7a3); border: 4px solid #ffc534; box-shadow: 0 0 0 3px #8a4b12, 0 6px 10px rgba(0, 0, 0, .35); }
#scr-chapter .chapter-head p { position: relative; margin-left: 18px; padding: 12px 20px; border-radius: 22px; background: #fffdf6; border: 3px solid var(--line);
  box-shadow: 0 5px 0 rgba(61, 34, 11, .6), 0 12px 18px -8px rgba(0, 0, 0, .5); font-weight: 700; font-size: clamp(1rem, calc(var(--u) * 2.1), 1.3rem); line-height: 1.3; color: var(--ink); }
#scr-chapter .chapter-head p::before { content: ""; position: absolute; left: -15px; top: 50%; margin-top: -11px; border: 11px solid transparent; border-left: 0; border-right: 15px solid var(--line); }
#scr-chapter .chapter-head p::after { content: ""; position: absolute; left: -10px; top: 50%; margin-top: -8px; border: 8px solid transparent; border-left: 0; border-right: 11px solid #fffdf6; }

/* three wooden signs next to each other */
#scr-chapter .bridges { width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 2.4cqw, 30px); }
#scr-chapter .bridge-btn {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(6px, 1.4cqh, 12px); text-align: center;
  min-height: clamp(150px, 30cqh, 250px); padding: 6px 8px 10px; border-radius: 0; color: var(--ink);
  background: none !important; box-shadow: none !important; border: 24px solid transparent; border-image: url("ui/bord.webp") 70 fill / 24px stretch;
  filter: drop-shadow(0 6px 0 rgba(61, 34, 11, .7)) drop-shadow(0 14px 14px rgba(0, 0, 0, .35)); transition: transform .12s;
  will-change: transform;   /* its own layer: lifting it on hover is then done without redrawing the shadow */
}
#scr-chapter .bridge-btn .mini-bridge, #scr-chapter .bridge-btn .stars-sm { display: none; }
#scr-chapter .bridge-btn .n { order: 1; flex: none; font-size: clamp(1.3rem, calc(var(--u) * 3.2), 2rem); color: #4a2a10; }
#scr-chapter .bridge-btn .n small { font-family: var(--font-display); font-weight: 600; font-size: .5em; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
/* the little bridge: two planks for every star, on a beam above the water */
#scr-chapter .bridge-btn .bb-planks { order: 2; display: flex; gap: 3px; padding: 10px 10px 14px; border-radius: 12px;
  background: linear-gradient(180deg, transparent 0 34%, #6b3f18 34% 62%, transparent 62%), linear-gradient(180deg, #8fd6f6, #3aa9e6); box-shadow: inset 0 0 0 2px rgba(61, 34, 11, .35); }
#scr-chapter .bridge-btn .bb-planks i { width: clamp(16px, calc(var(--u) * 3), 30px); aspect-ratio: 300 / 182; background: url("ui/plank.webp") center / 100% 100% no-repeat;
  filter: brightness(1.9) sepia(1) hue-rotate(165deg) saturate(1.6) drop-shadow(0 0 1.5px #fff); opacity: .75; }
#scr-chapter .bridge-btn .bb-planks i.on { filter: drop-shadow(0 2px 1px rgba(60, 30, 5, .4)); opacity: 1; }
#scr-chapter .bridge-btn .bb-planks i:nth-child(2n) { margin-right: 4px; }
#scr-chapter .bridge-btn .bb-planks i:last-child { margin-right: 0; }
#scr-chapter .bridge-btn .bb-stars { order: 3; display: flex; align-items: flex-end; }
#scr-chapter .bridge-btn .bb-stars svg { width: clamp(26px, calc(var(--u) * 4.4), 44px); height: auto; filter: drop-shadow(0 2px 1px rgba(60, 30, 5, .4)); }
#scr-chapter .bridge-btn .bb-stars svg:nth-child(2) { width: clamp(32px, calc(var(--u) * 5.4), 54px); margin: 0 -2px 8px; }
/* "2 stars needed" as a ribbon on the corner */
#scr-chapter .bridge-btn .need { position: absolute; top: -30px; right: -24px; z-index: 2; transform: rotate(6deg); background: #e8584f; color: #fff; border: 3px solid #7a1f17;
  box-shadow: 0 3px 0 #7a1f17; text-shadow: 0 1px 0 rgba(0, 0, 0, .3); }
/* the bridge to play now: glowing, with a green play button */
#scr-chapter .bridge-btn.next { filter: drop-shadow(0 0 10px rgba(255, 214, 90, .95)) drop-shadow(0 6px 0 rgba(61, 34, 11, .7)) drop-shadow(0 14px 14px rgba(0, 0, 0, .35)); transform: translateY(-6px); }
#scr-chapter .bridge-btn .bb-play { order: 4; display: grid; place-items: center; width: clamp(44px, calc(var(--u) * 6.4), 64px); aspect-ratio: 1; 
  background: url("ui/toets-groen.webp") center / 100% 100% no-repeat; animation: playBob 1.6s ease-in-out infinite; }
@keyframes playBob { 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { #scr-chapter .bridge-btn .bb-play { animation: none; } }
#scr-chapter .bridge-btn .bb-play svg { width: 56%; height: auto; }
#scr-chapter .bridge-btn:not(:disabled):hover { transform: translateY(-4px); }
#scr-chapter .bridge-btn:not(:disabled):active { transform: translateY(2px); }
/* a bridge that is still closed: grey, with a padlock */
#scr-chapter .bridge-btn:disabled { opacity: 1; filter: grayscale(.85) brightness(.92) drop-shadow(0 6px 0 rgba(61, 34, 11, .5)) drop-shadow(0 14px 14px rgba(0, 0, 0, .3)); }
#scr-chapter .bridge-btn .bb-lock { position: absolute; z-index: 2; left: 50%; top: 52%; width: clamp(40px, calc(var(--u) * 6), 64px); transform: translate(-50%, -50%); filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .4)); }
#scr-chapter .bridge-btn .bb-lock svg { display: block; width: 100%; height: auto; }
#scr-chapter .chap-note { max-width: 680px; text-align: center; background: #fffdf6; border: 3px solid var(--line); border-radius: 16px; box-shadow: 0 5px 0 rgba(61, 34, 11, .6); }

/* a phone held upright: the signs under each other, as rows */
@media (max-width: 600px) {
  #scr-chapter .bridges { grid-template-columns: 1fr; gap: 12px; }
  #scr-chapter .bridge-btn { min-height: 0; flex-direction: row; justify-content: space-between; text-align: left; border-width: 18px; border-image-width: 18px; padding: 0 4px; }
  #scr-chapter .bridge-btn .n { order: 1; flex: 1; font-size: 1.3rem; }
  #scr-chapter .bridge-btn .bb-planks { display: none; }
  #scr-chapter .bridge-btn .bb-stars { order: 2; }
  #scr-chapter .bridge-btn .bb-stars svg { width: 24px; } #scr-chapter .bridge-btn .bb-stars svg:nth-child(2) { width: 30px; margin-bottom: 4px; }
  #scr-chapter .bridge-btn .bb-play { order: 3; margin: 0 0 0 6px; width: 44px; }
  #scr-chapter .bridge-btn .bb-lock { left: auto; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; }
  #scr-chapter .bridge-btn .need { top: -22px; right: 64px; font-size: .8rem; }
  #scr-chapter .chapter-head p { font-size: .98rem; padding: 10px 14px; }
}
/* low screens (a phone on its side): a smaller friend, lower signs */
@media (max-height: 480px) {
  #scr-chapter .bridge-btn { min-height: 0; border-width: 16px; border-image-width: 16px; gap: 4px; }
  #scr-chapter .bridge-btn .n { font-size: 1.15rem; }
  #scr-chapter .bridge-btn .bb-play { width: 40px; }
}

/* ===== keypad on the full-screen play screen: room between the keys and the edge of the board,
         and a little extra room between the numbers and the wis / ✓ keys ===== */
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art .pad-card { padding: clamp(8px, 1.7cqh, 18px) clamp(10px, 1.6cqw, 24px) !important; width: min(76cqw, 860px); }
  #scr-play.has-art .pad { grid-template-columns: repeat(5, 1fr) .3fr 1.35fr; grid-template-areas: "k1 k2 k3 k4 k5 . del" "k6 k7 k8 k9 k0 . ok";
    gap: clamp(6px, 1.2cqh, 12px) clamp(6px, .9cqw, 12px); }
  #scr-play.has-art .pad button[data-k] { height: clamp(46px, 6.8vh, 64px); }
}

/* the painted backgrounds have their own clouds: no flat cartoon clouds drifting over them
   (in the Mistbos they were invisible but still moving, and Chromium left smears on the wooden signs) */
#backdrop .clouds { display: none; }

/* ===== wooden frames: one picture stretched over the whole box (the same in every browser, no seams between
         9-slice pieces), with the screws as separate little pictures in the corners so they never get stretched.
         bord-2x1 / bord-1x1 / onderlegger-hoog are the same boards made taller by repeating their middle rows. ===== */
.q-card { border: 0 !important; border-image: none !important; box-shadow: none !important; filter: none !important;
  background: url("ui/schroef.webp") left 3.2% top 6.5% / 2.6% auto no-repeat, url("ui/schroef.webp") right 2.9% top 6.3% / 2.6% auto no-repeat,
    url("ui/schroef.webp") left 3.7% bottom 4% / 2.6% auto no-repeat, url("ui/schroef.webp") right 4% bottom 4% / 2.6% auto no-repeat,
    url("ui/bord-2x1.webp") center / 100% 100% no-repeat !important;
  padding: max(16px, 3.2%) max(26px, 6%) max(18px, 3.6%) !important; }
#scr-chapter .bridge-btn { border: 0 !important; border-image: none !important;
  background: url("ui/schroef.webp") left 3.2% top 3.2% / 2.6% auto no-repeat, url("ui/schroef.webp") right 2.9% top 3.1% / 2.6% auto no-repeat,
    url("ui/schroef.webp") left 3.7% bottom 2% / 2.6% auto no-repeat, url("ui/schroef.webp") right 4% bottom 2% / 2.6% auto no-repeat,
    url("ui/bord-1x1.webp") center / 100% 100% no-repeat !important;
  padding: max(16px, 7%) max(12px, 5%) max(16px, 7%) !important; }
.map-sign { border: 0 !important; border-image: none !important;
  background: url("ui/schroef.webp") left 3.2% top 15% / 2.6% auto no-repeat, url("ui/schroef.webp") right 2.9% top 15% / 2.6% auto no-repeat,
    url("ui/schroef.webp") left 3.7% bottom 9% / 2.6% auto no-repeat, url("ui/schroef.webp") right 4% bottom 9% / 2.6% auto no-repeat,
    url("ui/bord-leeg.webp") center / 100% 100% no-repeat !important;
  padding: 16px 20px 16px 26px !important; }
#scr-map.full-map .top-actions, #scr-map.full-map .lang-menu { border: 0 !important; border-image: none !important; padding: 22px !important;
  background: url("ui/bord-1x1.webp") center / 100% 100% no-repeat !important; }
.pad-card { border: 0 !important; border-image: none !important; box-shadow: none !important; filter: none !important;
  background: url("ui/onderlegger-hoog.webp") center / 100% 100% no-repeat !important; padding: 18px !important; }
#scr-map.full-map .world-tab::before, #scr-chapter .topbar .who::before { border: 0 !important; border-image: none !important;
  background: url("ui/onderlegger.webp") center / 100% 100% no-repeat; }
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  /* the sign over the river must stay above the bridge: a little less room above and below the text */
  #scr-play.has-art .q-card { padding: max(10px, 2.2%) max(24px, 5%) max(12px, 2.4%) !important; }
  #scr-play.has-art .pad-card { background: url("ui/onderlegger.webp") center / 100% 100% no-repeat !important;
    padding: clamp(14px, 2.8cqh, 28px) clamp(18px, 2.6cqw, 32px) !important; }
}
@media (max-width: 600px) {
  #scr-chapter .bridge-btn { padding: 12px 16px !important;
    background: url("ui/schroef.webp") left 3.2% top 15% / 2.6% auto no-repeat, url("ui/schroef.webp") right 2.9% top 15% / 2.6% auto no-repeat,
    url("ui/schroef.webp") left 3.7% bottom 9% / 2.6% auto no-repeat, url("ui/schroef.webp") right 4% bottom 9% / 2.6% auto no-repeat,
      url("ui/bord-leeg.webp") center / 100% 100% no-repeat !important; }
}

/* ===== no CSS filters on boards that sit over the background: Chromium (with the zoom on big screens) sometimes leaves
         smears of a filtered box behind. Shadows are box-shadows on a rounded box, the darker wood is its own picture. ===== */
#scr-chapter .bridge-btn { filter: none !important; will-change: auto !important; border-radius: 14px !important;
  box-shadow: 0 6px 0 rgba(61, 34, 11, .7), 0 16px 16px -6px rgba(0, 0, 0, .4) !important; }
#scr-chapter .bridge-btn.next { box-shadow: 0 0 0 3px rgba(255, 214, 90, .8), 0 0 24px 6px rgba(255, 214, 90, .75),
  0 6px 0 rgba(61, 34, 11, .7), 0 16px 16px -6px rgba(0, 0, 0, .4) !important; }
#scr-chapter .bridge-btn:disabled { filter: grayscale(.85) brightness(.92) !important; }
.map-sign { filter: none !important; border-radius: 12px !important; box-shadow: 0 5px 0 rgba(61, 34, 11, .7), 0 12px 12px -4px rgba(0, 0, 0, .35) !important; }
#scr-map.full-map .top-actions, #scr-map.full-map .lang-menu { filter: none !important; border-radius: 18px !important;
  box-shadow: 0 6px 0 rgba(61, 34, 11, .6), 0 14px 16px -4px rgba(0, 0, 0, .4) !important; }
#scr-chapter .topbar .who::before, #scr-map.full-map .world-tab[aria-selected="true"]::before, #scr-badges .topbar .who::before, #scr-book .topbar .who::before {
  filter: none !important; background-image: url("ui/onderlegger-donker.webp") !important; border-radius: 12px;
  box-shadow: 0 4px 0 #3d220b, 0 8px 8px -2px rgba(0, 0, 0, .35); }
#scr-map.full-map .world-tab:not([aria-selected="true"]):not(.locked)::before { filter: none !important; border-radius: 12px;
  box-shadow: 0 4px 0 #3d220b, 0 8px 8px -2px rgba(0, 0, 0, .35); }

/* ===== the sticker album, like a football sticker album: glossy printed pages (the painted places), a banner with the
         subject, numbered spots; a sticker is a little card with sun rays, glued in a bit crooked. The shiny ones glitter. ===== */
#scr-badges { position: fixed; inset: 0; z-index: 2; max-width: none; margin: 0; container-type: size; overflow-y: auto; overscroll-behavior: contain;
  --u: min(1cqw, 1.6cqh); --btn: clamp(46px, calc(var(--u) * 6.4), 64px); --ico-edge: #3d220b;
  --top: max(clamp(10px, 1.8cqw, 24px), env(safe-area-inset-top, 0px));
  padding: calc(var(--top) + var(--btn) + 16px) max(16px, env(safe-area-inset-right, 0px)) max(20px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; align-items: center; }
#scr-badges .topbar .who .pill { -webkit-text-stroke: 0; text-shadow: none; color: var(--ink); font-size: .62em; margin-left: .6em; padding: 1px 10px; }
/* the album lies on a painted wooden table (ui/tafel.webp), so the printed pages are the only pictures on the screen */
#scr-badges { max-width: none !important; background:
    radial-gradient(ellipse at 50% 45%, transparent 60%, rgba(30, 14, 4, .3) 100%),
    url("ui/tafel.webp") center / cover no-repeat, #b0692e; }
#scr-badges .sticker-book { width: min(100%, 1180px); flex: none; background: none; box-shadow: none; padding: 0; }
#scr-badges .album { display: grid; grid-template-columns: 1fr; gap: 0; }
/* every page lies in the same spot (the pages that are not open are there too, invisible), so the album is always as
   high as its highest page and the buttons under it never move when you turn a page */
#scr-badges .album-page { grid-area: 1 / 1; }
#scr-badges .album-page[hidden] { display: block !important; visibility: hidden; }
#scr-badges .album-page[hidden] * { animation: none !important; }
/* a page: slightly aged paper, with the painted place printed on it inside a narrow paper margin */
#scr-badges .album-page { --sec: #ffb627; --sec2: #fff1b8; --m: clamp(8px, 1.2cqw, 15px); position: relative; overflow: hidden; isolation: isolate;
  border-radius: 8px; padding: clamp(70px, 9.6cqh, 92px) clamp(20px, 2.8cqw, 36px) clamp(32px, 4cqh, 44px);
  background: radial-gradient(ellipse 80% 75% at 50% 48%, transparent 55%, rgba(125, 88, 40, .24) 100%),
    repeating-linear-gradient(0deg, rgba(120, 90, 50, .035) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(120, 90, 50, .03) 0 1px, transparent 1px 4px), #f6eed9;
  box-shadow: 0 12px 26px -10px rgba(0, 0, 0, .6); }
#scr-badges .album-page::before { content: ""; position: absolute; z-index: -1; inset: var(--m); border-radius: 4px; pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, transparent 60%, rgba(95, 62, 25, .26) 100%), linear-gradient(rgba(255, 244, 222, .08), rgba(255, 244, 222, .08)),
    var(--page) center / cover no-repeat, #bfe6fb;
  box-shadow: 0 0 0 1px rgba(95, 62, 25, .22); }
#scr-badges .album-page[data-sec="start"] { --page: url("backdrops/beverdorp.webp"); --sec: #ffb627; --sec2: #fff1b8; }
#scr-badges .album-page[data-sec="count"] { --page: url("backdrops/night.webp"); --sec: #9a6bf0; --sec2: #efe2ff; }
#scr-badges .album-page[data-sec="w1"] { --page: url("backdrops/tienland.webp"); --sec: #4cbb3c; --sec2: #e3ffd8; }
#scr-badges .album-page[data-sec="w2"] { --page: url("backdrops/honderdstad.webp"); --sec: #2f9ad6; --sec2: #dcf3ff; }
#scr-badges .album-page[data-sec="extra"] { --page: url("backdrops/oefenvijver.webp"); --sec: #e8584f; --sec2: #ffe2df; }
@media (orientation: landscape) and (min-width: 860px) {
  /* an open album: a cloth hard cover, two thick stacks of pages that meet in the middle, where the pages curve down
     into the fold and are sewn together */
  #scr-badges .album { grid-template-columns: 1fr 1fr; position: relative; padding: 16px 22px 24px; border-radius: 16px;
    background: linear-gradient(90deg, transparent calc(50% - 26px), rgba(10, 20, 35, .5) calc(50% - 5px), rgba(170, 205, 240, .25) 50%, rgba(10, 20, 35, .5) calc(50% + 5px), transparent calc(50% + 26px)),
      repeating-linear-gradient(45deg, rgba(255, 255, 255, .045) 0 1px, transparent 1px 4px),
      repeating-linear-gradient(-45deg, rgba(0, 0, 0, .06) 0 1px, transparent 1px 4px),
      linear-gradient(180deg, #44739f, #2c5179);
    box-shadow: inset 0 0 0 2px rgba(190, 220, 250, .3), inset 0 -3px 0 rgba(10, 20, 35, .45), 0 4px 0 #1c3350, 0 24px 32px -12px rgba(0, 0, 0, .7); }
  /* the stack of pages under the open pages, on the outer side and at the bottom */
  #scr-badges .album-page:nth-child(odd) { grid-column: 1; border-radius: 8px 2px 2px 8px;
    box-shadow: -1.5px 1.5px 0 #f1e7cf, -3px 3px 0 #d8c8a5, -4.5px 4.5px 0 #f3eadb, -6px 6px 0 #d2c19c, -7.5px 7.5px 0 #efe4ca, -9px 9px 0 #c6b38c,
      -10.5px 10.5px 0 #ebdfc2, -12px 12px 0 #bea984, 0 16px 22px -8px rgba(0, 0, 0, .6); }
  #scr-badges .album-page:nth-child(even) { grid-column: 2; border-radius: 2px 8px 8px 2px;
    box-shadow: 1.5px 1.5px 0 #f1e7cf, 3px 3px 0 #d8c8a5, 4.5px 4.5px 0 #f3eadb, 6px 6px 0 #d2c19c, 7.5px 7.5px 0 #efe4ca, 9px 9px 0 #c6b38c,
      10.5px 10.5px 0 #ebdfc2, 12px 12px 0 #bea984, 0 16px 22px -8px rgba(0, 0, 0, .6); }
  /* the print reaches a little further into the fold than to the outer edge */
  #scr-badges .album-page:nth-child(odd)::before { inset: var(--m) calc(var(--m) * .5) var(--m) var(--m); }
  #scr-badges .album-page:nth-child(even)::before { inset: var(--m) var(--m) var(--m) calc(var(--m) * .5); }
  /* the fold: each page bulges up a little (a soft light band) before it curves down into the middle (shadow) */
  #scr-badges .album-page::after { content: ""; position: absolute; top: 0; bottom: 0; width: 20%; z-index: 3; pointer-events: none; }
  #scr-badges .album-page:nth-child(odd)::after { right: 0;
    background: linear-gradient(90deg, rgba(255, 250, 235, 0), rgba(255, 250, 235, .2) 34%, rgba(255, 250, 235, 0) 52%,
      rgba(60, 35, 10, .16) 68%, rgba(50, 28, 8, .44) 87%, rgba(35, 18, 4, .8)); }
  #scr-badges .album-page:nth-child(even)::after { left: 0;
    background: linear-gradient(270deg, rgba(255, 250, 235, 0), rgba(255, 250, 235, .2) 34%, rgba(255, 250, 235, 0) 52%,
      rgba(60, 35, 10, .16) 68%, rgba(50, 28, 8, .44) 87%, rgba(35, 18, 4, .8)); }
  /* the seam in the middle: a dark line with the holes of the binding thread */
  #scr-badges .album::before { content: ""; position: absolute; z-index: 4; top: 16px; bottom: 24px; left: calc(50% - 4px); width: 8px; pointer-events: none;
    background: radial-gradient(circle at 50% 50%, rgba(40, 22, 6, .85) 0 1.7px, rgba(235, 220, 190, .5) 2.2px, transparent 3px) 0 10px / 8px 44px repeat-y,
      linear-gradient(90deg, transparent 3px, rgba(30, 15, 3, .55) 3px 5px, transparent 5px); }
  /* the page number sits on the outer corner */
  #scr-badges .album-page:nth-child(odd) .album-pno { right: auto; left: 18px; }
}
/* the banner with the subject */
#scr-badges .album-title { position: absolute; top: clamp(12px, 2cqh, 18px); left: 50%; transform: translateX(-50%) rotate(-1.5deg); margin: 0;
  padding: .2em 1.1em .25em; white-space: nowrap; border-radius: 10px; font-size: clamp(1.25rem, 2.3cqw, 1.8rem);
  background: linear-gradient(180deg, color-mix(in srgb, var(--sec) 70%, #fff), var(--sec)); border: 3px solid #3d220b; color: #fff;
  -webkit-text-stroke: 5px #3d220b; paint-order: stroke fill; box-shadow: 0 4px 0 #3d220b, 0 10px 14px -6px rgba(0, 0, 0, .5); }
#scr-badges .album-pno { position: absolute; bottom: 8px; right: 14px; padding: 0 8px; border-radius: 999px; background: rgba(255, 255, 255, .85);
  font-family: var(--font-display); font-weight: 600; font-size: .85rem; color: var(--ink); }
#scr-badges .badge-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 2cqh, 20px) clamp(10px, 1.6cqw, 18px); }
#scr-badges .badge { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; background: none !important; border: 0 !important; box-shadow: none !important; }
/* the spot printed on the page */
#scr-badges .badge .slot { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1; border-radius: 12px;
  max-width: clamp(90px, calc((100cqh - 400px) / 3), 150px);   /* a whole spread fits on the screen where it can */
  background: rgba(255, 255, 255, .78); border: 3px dashed rgba(61, 34, 11, .38); }
#scr-badges .badge .no { display: block; position: absolute; top: 4px; left: 8px; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.4rem, 2.6cqw, 2.1rem); line-height: 1; color: rgba(61, 34, 11, .3); }
#scr-badges .badge.locked .ic { display: none; }
#scr-badges .badge .d { display: none; }
#scr-badges .badge.locked .d { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; margin: 24% 8% 0; text-align: center;
  font-size: clamp(.62rem, .95cqw, .8rem); line-height: 1.22; color: rgba(61, 34, 11, .72); }
/* the sticker: a card with sun rays in the colour of the page, a white paper edge, glued a bit crooked */
#scr-badges .badge:not(.locked) .slot { border: 0; transform: rotate(var(--r, 0deg));
  background: repeating-conic-gradient(from 0deg at 50% 55%, rgba(255, 255, 255, .22) 0 9deg, transparent 9deg 18deg),
    radial-gradient(circle at 50% 50%, var(--sec2), var(--sec) 80%);
  box-shadow: 0 0 0 5px #fff, 0 0 0 6px rgba(61, 34, 11, .25), 0 9px 12px 2px rgba(0, 0, 0, .35); }
#scr-badges .badge:not(.locked) .no { top: auto; bottom: 4px; left: 6px; font-size: .78rem; color: rgba(255, 255, 255, .9); text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
#scr-badges .badge:not(.locked) .ic { width: 84%; height: 84%; display: grid; place-items: center; background: none; box-shadow: none; border-radius: 0;
  font-size: clamp(2.6rem, 5.4cqw, 4.2rem); transform: none; filter: none; opacity: 1; }
#scr-badges .badge .sticker-img { width: 100%; height: 100%; }
/* the shiny stickers: a glint that passes over them now and then */
#scr-badges .badge.glitter:not(.locked) .slot { overflow: hidden; }
#scr-badges .badge.glitter:not(.locked) .slot::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(115deg, transparent 25%, rgba(255, 255, 255, .7) 38%, rgba(255, 170, 255, .4) 45%, rgba(150, 240, 255, .4) 52%, transparent 64%) 0 0 / 260% 100% no-repeat;
  animation: glint 3.6s ease-in-out infinite; }
@keyframes glint { 0% { background-position: 130% 0; } 55%, 100% { background-position: -50% 0; } }
@media (prefers-reduced-motion: reduce) { #scr-badges .badge.glitter .slot::after { animation: none; } }
/* the name, printed under the spot */
#scr-badges .badge .t { max-width: 100%; margin: 0; padding: 2px 9px; border-radius: 8px; background: rgba(255, 255, 255, .9); color: var(--ink);
  font-size: clamp(.78rem, 1.25cqw, 1rem); line-height: 1.15; text-align: center; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); }
#scr-badges .badge.locked .t { opacity: .85; }
/* turning the pages */
#scr-badges .album-nav { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: clamp(12px, 2cqh, 20px);
  position: sticky; bottom: max(10px, env(safe-area-inset-bottom, 0px)); z-index: 6; }   /* always in reach, also when the page is taller than the screen */
#scr-badges .album-nav .icon-btn { width: var(--btn); height: var(--btn); border-radius: 50%; color: #fff1d0; border: 3px solid #3d220b; font-size: calc(var(--btn) * .6); font-weight: 700;
  line-height: 1; padding-bottom: .12em; background: linear-gradient(180deg, rgba(255, 230, 190, .16), rgba(60, 30, 5, .14)), url("ui/onderlegger.webp") 50% 50% / auto 320%;
  box-shadow: inset 0 3px 0 rgba(255, 222, 165, .5), 0 4px 0 #3d220b, 0 9px 12px -6px rgba(0, 0, 0, .55); }
#scr-badges .album-nav .icon-btn:disabled { opacity: .35; }
#scr-badges #albumPos { min-width: 4ch; text-align: center; font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; color: #fff;
  -webkit-text-stroke: 4px #3d220b; paint-order: stroke fill; }
@media (max-width: 600px) { #scr-badges .badge-grid { gap: 12px 8px; } #scr-badges .album-page { padding-inline: 10px; } }

/* a new sticker (message, and the list on the "bridge built" screen) looks like a sticker too */
.toast .ic, .badge-row .ic { background: radial-gradient(circle at 40% 30%, #fffbe6, #ffe48a 55%, #f7bf3a); border-radius: 50%; transform: rotate(-6deg);
  box-shadow: 0 0 0 2px #463c3c, 0 0 0 6px #fff, 0 4px 8px 4px rgba(60, 30, 5, .25); display: grid; place-items: center; }
.badge-row .ic { width: 52px; height: 52px; flex: none; font-size: 1.7rem; }

/* ===== the story book: a hardcover book lying open on the wooden table, like the sticker album. Paper tabs stick out at
         the top (who is who / the story so far); the left page lists, the right page tells. ===== */
#scr-book { position: fixed; inset: 0; z-index: 2; max-width: none !important; margin: 0; container-type: size; overflow: hidden;
  --u: min(1cqw, 1.6cqh); --btn: clamp(46px, calc(var(--u) * 6.4), 64px); --ico-edge: #3d220b;
  --top: max(clamp(10px, 1.8cqw, 24px), env(safe-area-inset-top, 0px));
  padding: calc(var(--top) + var(--btn) + 10px) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; align-items: center;
  background: radial-gradient(ellipse at 50% 45%, transparent 60%, rgba(30, 14, 4, .3) 100%), url("ui/tafel.webp") center / cover no-repeat, #b0692e; }
#scr-book .book { width: min(100%, 1180px); flex: 1; min-height: 0; display: flex; flex-direction: column; }
/* the tabs: paper index tabs sticking out above the pages, the open one in front and a little taller */
#scr-book .book-tabs { display: flex; gap: 6px; margin: 0 0 -6px; padding: 0 clamp(24px, 4cqw, 60px); position: relative; z-index: 2; }
#scr-book .book-tab { flex: 0 1 auto; min-width: clamp(130px, 16cqw, 220px); padding: .45em 1.3em .7em; border: 3px solid #3d220b; border-bottom: 0;
  border-radius: 14px 14px 0 0; font-size: clamp(1rem, 1.6cqw, 1.3rem); color: #5a3510; text-shadow: none; cursor: pointer;
  background: linear-gradient(180deg, #f3dca8, #dcbd83); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .45); transform: translateY(6px); }
#scr-book .book-tab[aria-selected="true"] { background: linear-gradient(180deg, #ffe07a, #ffc23d); color: #3d220b; transform: none; padding-bottom: .95em; }
#scr-book .book-tab[data-tab="story"][aria-selected="true"] { background: linear-gradient(180deg, #bfe8ff, #7cc8f2); }
/* the cover and the two pages */
#scr-book .book-spread { flex: 1; min-height: 0; position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  padding: 14px 20px 22px; border: 0 !important; border-radius: 16px; overflow: visible;
  background: linear-gradient(90deg, transparent calc(50% - 20px), rgba(10, 25, 12, .5) calc(50% - 4px), rgba(190, 230, 170, .22) 50%, rgba(10, 25, 12, .5) calc(50% + 4px), transparent calc(50% + 20px)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .04) 0 1px, transparent 1px 4px), linear-gradient(180deg, #3f7a45, #2a5631) !important;
  box-shadow: inset 0 0 0 2px rgba(190, 240, 170, .3), inset 0 -3px 0 rgba(10, 25, 12, .45), 0 4px 0 #173a1d, 0 24px 32px -12px rgba(0, 0, 0, .7) !important; }
#scr-book .book-list, #scr-book .book-page { position: relative; min-height: 0; max-height: none; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  scrollbar-color: rgba(110, 70, 30, .45) transparent; border: 0 !important;
  background-color: #f6eed9 !important; }
/* paper, a darker edge, and the fold: each page curves down into the middle of the book */
#scr-book .book-list { border-radius: 8px 2px 2px 8px; padding: 16px 14px 18px;
  background-image: linear-gradient(90deg, rgba(255, 250, 235, 0) 86%, rgba(255, 250, 235, .25) 90%, rgba(60, 35, 10, .14) 95%, rgba(40, 20, 5, .42)),
    radial-gradient(ellipse 85% 80% at 50% 48%, transparent 60%, rgba(125, 88, 40, .2) 100%) !important;
  box-shadow: -1.5px 1.5px 0 #f1e7cf, -3px 3px 0 #d8c8a5, -4.5px 4.5px 0 #f3eadb, -6px 6px 0 #d2c19c, -7.5px 7.5px 0 #efe4ca, -9px 9px 0 #c6b38c; }
#scr-book .book-page { border-radius: 2px 8px 8px 2px; padding: clamp(16px, 2.4cqh, 26px) clamp(22px, 3cqw, 40px) 0 clamp(26px, 3.4cqw, 46px); gap: 14px;
  background-image: linear-gradient(270deg, rgba(255, 250, 235, 0) 86%, rgba(255, 250, 235, .25) 90%, rgba(60, 35, 10, .14) 95%, rgba(40, 20, 5, .42)),
    radial-gradient(ellipse 85% 80% at 50% 48%, transparent 60%, rgba(125, 88, 40, .2) 100%) !important;
  box-shadow: 1.5px 1.5px 0 #f1e7cf, 3px 3px 0 #d8c8a5, 4.5px 4.5px 0 #f3eadb, 6px 6px 0 #d2c19c, 7.5px 7.5px 0 #efe4ca, 9px 9px 0 #c6b38c; }
/* the list: in the story, one line per part with its face; "who is who" is a page of portraits, like a class photo */
#scr-book .book-item { border-radius: 12px; color: #4a2c0e; }
#scr-book .book-item:hover { background: rgba(255, 210, 90, .22); }
#scr-book .book-item[aria-current="true"] { background: linear-gradient(180deg, #ffe07a, #ffc23d) !important; box-shadow: 0 0 0 2px #3d220b, 0 3px 0 #3d220b !important; }
#scr-book .book-item .av { width: 48px; height: 48px; }
#scr-book .book-item .av .doodle { width: 100%; height: 100%; object-fit: contain; }
#scr-book[data-tab="who"] .book-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: start; gap: 10px 6px; }
#scr-book[data-tab="who"] .book-item { flex-direction: column; gap: 2px; padding: 6px 4px 8px; text-align: center; }
#scr-book[data-tab="who"] .book-item .av { width: min(100%, clamp(56px, 8.4cqh, 92px)); height: auto; aspect-ratio: 1; }
#scr-book[data-tab="who"] .book-item .t { font-size: clamp(.78rem, 1.15cqw, .95rem); }
#scr-book .book-item.unmet .av { filter: brightness(0); opacity: .22; }
/* "who is who": the friend big, the name on a ribbon, what they are like, where you meet them, a few of their faces */
#scr-book .who-detail { gap: 10px; padding: 0 0 6px; justify-content: center; }
#scr-book .who-detail .av { width: clamp(150px, 34cqh, 300px); }
#scr-book .who-detail .av .doodle { width: 100%; height: 100%; object-fit: contain; }
#scr-book .book-page .who-detail h2 { position: relative; margin: 0; padding: .15em 1.3em .22em; font-size: clamp(1.4rem, 2.6cqw, 2.1rem); color: #fff;
  background: linear-gradient(180deg, #ffd65a, #ffb627); border: 3px solid #3d220b; border-radius: 10px; transform: rotate(-1.5deg);
  -webkit-text-stroke: 5px #3d220b; paint-order: stroke fill; box-shadow: 0 4px 0 #3d220b, 0 10px 14px -6px rgba(0, 0, 0, .45); }
#scr-book .book-page .who-detail.unmet h2 { background: linear-gradient(180deg, #d9d2c4, #b8ad99); }
#scr-book .who-detail p { color: #4a2c0e; font-size: clamp(1.05rem, 1.7cqw, 1.3rem); }
#scr-book .who-detail .who-place { font-family: var(--font-display); font-weight: 600; font-size: 1rem; color: #7a5228; }
#scr-book .who-detail .who-place::before { content: ""; display: inline-block; width: .8em; height: .8em; margin-right: .4em; vertical-align: -.05em;
  border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: #e8553d; box-shadow: inset 0 0 0 .22em #f6eed9; }
#scr-book .who-faces { display: flex; gap: clamp(6px, 1.2cqw, 16px); justify-content: center; margin-top: 2px; }
#scr-book .who-faces .face { width: clamp(52px, 9cqh, 84px); aspect-ratio: 1; transform: rotate(var(--r, 0deg)); }
#scr-book .who-faces .face:nth-child(1) { --r: -6deg; } #scr-book .who-faces .face:nth-child(2) { --r: 4deg; }
#scr-book .who-faces .face:nth-child(3) { --r: -3deg; } #scr-book .who-faces .face:nth-child(4) { --r: 7deg; }
#scr-book .who-faces .doodle { width: 100%; height: 100%; object-fit: contain; }
/* the story so far: what everybody said, like a picture book */
#scr-book .book-page h2 { color: #4a2c0e; font-size: clamp(1.3rem, 2.2cqw, 1.8rem); }
#scr-book .book-page .line .av { width: 46px; height: 46px; }
#scr-book .book-page .line .av .doodle { width: 100%; height: 100%; object-fit: contain; }
#scr-book .book-page .line p { background: #fffdf6; border: 2px solid #e2c48f; border-radius: 4px 16px 16px 16px; color: #3b250d; font-size: clamp(1rem, 1.4cqw, 1.15rem); }
#scr-book .book-page .line p b { color: #9a6a33; }
#scr-book .book-page > .btn { border: 3px solid #3d220b; box-shadow: 0 3px 0 #3d220b; background: linear-gradient(180deg, #ffe07a, #ffc23d); color: #3d220b; }
/* turning the pages: always at the bottom of the page, also when there is a lot to read */
#scr-book .book-nav { position: sticky; bottom: 0; margin: auto calc(-1 * clamp(22px, 3cqw, 40px)) 0 calc(-1 * clamp(26px, 3.4cqw, 46px)); padding: 10px 0 12px;
  background: linear-gradient(180deg, rgba(246, 238, 217, 0), #f6eed9 30%); color: #7a5228; font-family: var(--font-display); }
#scr-book .book-nav .icon-btn { width: calc(var(--btn) * .8); height: calc(var(--btn) * .8); font-size: calc(var(--btn) * .5); font-weight: 700; line-height: 1; padding-bottom: .12em; }
#scr-book .book-nav .icon-btn:disabled { opacity: .35; }
/* a phone held upright, or a narrow screen: one page, the list as a strip at the top of it */
@media (max-width: 760px), (orientation: portrait) {
  #scr-book .book-tabs { padding: 0 10px; }
  #scr-book .book-tab { flex: 1; min-width: 0; padding-inline: .6em; }
  #scr-book .book-spread { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); padding: 10px 10px 14px; background-image: none !important;
    background-color: #2f6236 !important; }
  #scr-book .book-list, #scr-book[data-tab="who"] .book-list { display: flex; flex-direction: row; overflow-x: auto; overflow-y: hidden; gap: 4px; padding: 8px;
    border-radius: 8px 8px 0 0; background-image: none !important; box-shadow: none; border-bottom: 2px dashed rgba(110, 65, 25, .3) !important; }
  #scr-book .book-item, #scr-book[data-tab="who"] .book-item { flex-direction: column; flex: none; width: 84px; gap: 2px; padding: 6px 4px; text-align: center; }
  #scr-book .book-item .av, #scr-book[data-tab="who"] .book-item .av { width: 56px; height: 56px; }
  #scr-book .book-item .t { font-size: .78rem; }
  #scr-book .book-page { border-radius: 0 0 8px 8px; padding: 14px 16px 0; background-image: none !important; box-shadow: none; }
  #scr-book .book-nav { margin-inline: -16px; }
  #scr-book .who-detail .av { width: clamp(140px, 30cqh, 240px); }
}

/* ===== the gags in the water, painted (props/): a little bigger than the drawings, so they read on the painted river,
         and sunk a little into the water (the water line is the bottom of the gag box) ===== */
.scene.has-art .g-boat { width: clamp(96px, 8cqw, 180px); bottom: calc(-.07 * clamp(96px, 8cqw, 180px)); }
.scene.has-art .g-duck { width: clamp(118px, 8.6cqw, 200px); bottom: calc(-.12 * clamp(118px, 8.6cqw, 200px)); }
.scene.has-art .g-bonk { width: clamp(44px, 3.2cqw, 74px); bottom: clamp(74px, 6cqw, 140px); left: calc(33% + clamp(58px, 4.6cqw, 110px)); }
.scene.has-art .gag-boat .g-bub { bottom: 14px; }
.scene.has-art .g-scope { width: clamp(56px, 4.2cqw, 96px); bottom: -4px; }
.scene.has-art .g-gull { width: clamp(80px, 6.6cqw, 150px); bottom: calc(-.12 * clamp(80px, 6.6cqw, 150px)); }
.scene.has-art .g-boot { width: 58%; right: -28%; top: 34%; }
.scene.has-art .g-splash { width: clamp(90px, 6.6cqw, 150px); bottom: -6px; }
.scene.has-art .g-tub { width: clamp(170px, 11cqw, 250px); bottom: calc(-.12 * clamp(170px, 11cqw, 250px)); }
.scene.has-art .g-tub .frog { width: 50%; left: 24%; top: -18%; }
.scene.has-art .gag-tub .g-bub { left: 45%; }
.scene.has-art .g-shark { width: clamp(90px, 6.6cqw, 150px); bottom: calc(-.84 * clamp(90px, 6.6cqw, 150px)); }
/* a ring of ripples where a floating thing lies in the water */
.scene.has-art .g-boat::after, .scene.has-art .g-duck::after, .scene.has-art .g-tub::after, .scene.has-art .g-gull::after {
  content: ""; position: absolute; left: 4%; right: 4%; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .7);
  box-shadow: inset 0 0 5px rgba(255, 255, 255, .4); pointer-events: none; }
.scene.has-art .g-boat::after { bottom: 10px; }
.scene.has-art .g-duck::after { bottom: 15px; }
.scene.has-art .g-tub::after { bottom: 22px; }
.scene.has-art .g-gull::after { bottom: 10px; left: 18%; right: 18%; }

/* ===== the bridge on the river with two landing stages (scenes/wereld1):
         ten complete planks with their sides (ui/plank-01 ... plank-10), each drawn for its own spot, levelled and scaled
         so its front edge fits the spot; planks nearer the middle lie on top. A missing plank = clean water.
         Positions in % of the 16:9 picture (generated from planks.json). ===== */
.scene.has-art .bridge .plank:nth-child(1) { background-image: url("ui/plank-01.webp") !important; }
.scene.has-art .bridge .plank:nth-child(2) { background-image: url("ui/plank-02.webp") !important; }
.scene.has-art .bridge .plank:nth-child(3) { background-image: url("ui/plank-03.webp") !important; }
.scene.has-art .bridge .plank:nth-child(4) { background-image: url("ui/plank-04.webp") !important; }
.scene.has-art .bridge .plank:nth-child(5) { background-image: url("ui/plank-05.webp") !important; }
.scene.has-art .bridge .plank:nth-child(6) { background-image: url("ui/plank-06.webp") !important; }
.scene.has-art .bridge .plank:nth-child(7) { background-image: url("ui/plank-07.webp") !important; }
.scene.has-art .bridge .plank:nth-child(8) { background-image: url("ui/plank-08.webp") !important; }
.scene.has-art .bridge .plank:nth-child(9) { background-image: url("ui/plank-09.webp") !important; }
.scene.has-art .bridge .plank:nth-child(10) { background-image: url("ui/plank-10.webp") !important; }
.scene.has-art .plank { background-size: 100% 100% !important; background-position: center !important; background-repeat: no-repeat !important;
  border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
.scene.has-art .plank.a, .scene.has-art .plank.given { filter: none; }
.scene.has-art .plank.hint { filter: drop-shadow(0 0 6px #ffd23f) drop-shadow(0 0 3px #ffd23f) !important; }
.scene.has-art .plank.empty.hint { filter: brightness(1.9) sepia(1) hue-rotate(165deg) saturate(1.6) drop-shadow(0 0 6px #ffd23f) drop-shadow(0 0 3px #ffd23f) !important; }
/* the planks of the second number: sunny yellow with a thin white rim, so they stand out on the raft and on the bridge */
.scene.has-art .plank.b { filter: sepia(.6) saturate(3) hue-rotate(5deg) brightness(1.3) drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 1.5px #fff)
  drop-shadow(0 .3cqh .3cqh rgba(0, 0, 0, .35)); }
.scene.has-art .plank.b.hint { filter: sepia(.6) saturate(3) hue-rotate(5deg) brightness(1.3) drop-shadow(0 0 6px #ffd23f) drop-shadow(0 0 3px #ffd23f) !important; }
/* raft and dock: the two straightest planks from the middle of the bridge, taking turns (the thinner originals:
   the bridge planks are thicker, so their front reaches the beam of the landing stages) */
.scene.has-art .raft .plank:nth-child(odd), .scene.has-art .dock .plank:nth-child(odd) { background-image: url("ui/vlotplank-a.webp") !important; }
.scene.has-art .raft .plank:nth-child(even), .scene.has-art .dock .plank:nth-child(even) { background-image: url("ui/vlotplank-b.webp") !important; }
/* the chapter signs: the bridge in miniature, a piece of the river with the real planks; missing planks are glass */
#scr-chapter .bridge-btn .bb-planks { position: relative; display: block; width: 100%; max-width: 320px; aspect-ratio: 3.743;
  padding: 0; gap: 0; border-radius: 12px; overflow: hidden;
  background: var(--scene-img) 50% 48.39% / 125.0% auto no-repeat, #5ec2f0;
  box-shadow: inset 0 0 0 2px rgba(61, 34, 11, .5), 0 2px 0 rgba(255, 255, 255, .7); }
#scr-chapter .bridge-btn .bb-planks i { position: absolute; margin: 0 !important; aspect-ratio: auto; background-size: 100% 100%; background-repeat: no-repeat;
  filter: brightness(1.9) sepia(1) hue-rotate(165deg) saturate(1.6); opacity: .75; }
#scr-chapter .bridge-btn .bb-planks i.on { filter: none; opacity: 1; }
#scr-chapter .bridge-btn .bb-planks i:nth-child(1) { left: 7.50%; top: 43.54%; width: 11.03%; height: 25.73%; z-index: 1; background-image: url("ui/plank-01.webp"); }
#scr-chapter .bridge-btn .bb-planks i:nth-child(2) { left: 16.06%; top: 43.54%; width: 10.28%; height: 25.73%; z-index: 2; background-image: url("ui/plank-02.webp"); }
#scr-chapter .bridge-btn .bb-planks i:nth-child(3) { left: 24.62%; top: 43.54%; width: 9.49%; height: 25.73%; z-index: 3; background-image: url("ui/plank-03.webp"); }
#scr-chapter .bridge-btn .bb-planks i:nth-child(4) { left: 33.18%; top: 43.54%; width: 8.75%; height: 25.73%; z-index: 4; background-image: url("ui/plank-04.webp"); }
#scr-chapter .bridge-btn .bb-planks i:nth-child(5) { left: 41.74%; top: 43.54%; width: 7.96%; height: 25.73%; z-index: 5; background-image: url("ui/plank-05.webp"); }
#scr-chapter .bridge-btn .bb-planks i:nth-child(6) { left: 50.26%; top: 43.54%; width: 7.96%; height: 25.73%; z-index: 5; background-image: url("ui/plank-06.webp"); }
#scr-chapter .bridge-btn .bb-planks i:nth-child(7) { left: 58.07%; top: 43.54%; width: 8.71%; height: 25.73%; z-index: 4; background-image: url("ui/plank-07.webp"); }
#scr-chapter .bridge-btn .bb-planks i:nth-child(8) { left: 65.85%; top: 43.54%; width: 9.49%; height: 25.73%; z-index: 3; background-image: url("ui/plank-08.webp"); }
#scr-chapter .bridge-btn .bb-planks i:nth-child(9) { left: 73.62%; top: 43.54%; width: 10.28%; height: 25.73%; z-index: 2; background-image: url("ui/plank-09.webp"); }
#scr-chapter .bridge-btn .bb-planks i:nth-child(10) { left: 81.44%; top: 43.54%; width: 11.06%; height: 25.73%; z-index: 1; background-image: url("ui/plank-10.webp"); }
@media (max-width: 600px) { #scr-chapter .bridge-btn .bb-planks { display: none; } }
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art .scene { background-size: 100% 100%; }
  /* the bridge row covers the whole scene; every plank on its own spot */
  #scr-play.has-art .bridge { position: absolute; left: calc(-1 * var(--bankw)); top: 0; width: 100cqw; height: 100cqh; display: block;
    margin: 0 !important; padding: 0 !important; border: 0 !important; background: none !important; pointer-events: none; }
  #scr-play.has-art .bridge .plank { position: absolute; margin: 0 !important; }
  #scr-play.has-art .bridge .plank:nth-child(1) { left: 15.999cqw; top: 46.546cqh; width: 8.822cqw; height: 9.777cqh; z-index: 1; }
  #scr-play.has-art .bridge .plank:nth-child(2) { left: 22.847cqw; top: 46.546cqh; width: 8.224cqw; height: 9.777cqh; z-index: 2; }
  #scr-play.has-art .bridge .plank:nth-child(3) { left: 29.695cqw; top: 46.546cqh; width: 7.596cqw; height: 9.777cqh; z-index: 3; }
  #scr-play.has-art .bridge .plank:nth-child(4) { left: 36.543cqw; top: 46.546cqh; width: 6.998cqw; height: 9.777cqh; z-index: 4; }
  #scr-play.has-art .bridge .plank:nth-child(5) { left: 43.391cqw; top: 46.546cqh; width: 6.370cqw; height: 9.777cqh; z-index: 5; }
  #scr-play.has-art .bridge .plank:nth-child(6) { left: 50.209cqw; top: 46.546cqh; width: 6.370cqw; height: 9.777cqh; z-index: 5; }
  #scr-play.has-art .bridge .plank:nth-child(7) { left: 56.459cqw; top: 46.546cqh; width: 6.968cqw; height: 9.777cqh; z-index: 4; }
  #scr-play.has-art .bridge .plank:nth-child(8) { left: 62.679cqw; top: 46.546cqh; width: 7.596cqw; height: 9.777cqh; z-index: 3; }
  #scr-play.has-art .bridge .plank:nth-child(9) { left: 68.900cqw; top: 46.546cqh; width: 8.224cqw; height: 9.777cqh; z-index: 2; }
  #scr-play.has-art .bridge .plank:nth-child(10) { left: 75.150cqw; top: 46.546cqh; width: 8.852cqw; height: 9.777cqh; z-index: 1; }
  /* splitting (no bridge to fill): the planks to split lie on the bridge itself, not on a raft in the water */
  #scr-play.has-art .scene[data-kind="split"] .raft-wrap { position: absolute; left: calc(-1 * var(--bankw)); top: 0; width: 100cqw; height: 100cqh;
    margin: 0; padding: 0; animation: none; pointer-events: none; }
  #scr-play.has-art .scene[data-kind="split"] .raft { position: absolute; inset: 0; display: block; margin: 0; padding: 0 !important; border: 0;
    background: none !important; box-shadow: none; min-width: 0; min-height: 0; }
  #scr-play.has-art .scene[data-kind="split"] .raft .plank { position: absolute; margin: 0 !important; }
  /* the part that was found: plain wood like the rest (the see-through planks already showed which part it was) */
  #scr-play.has-art .scene[data-kind="split"] .raft .plank.b { filter: none; }
  #scr-play.has-art .scene[data-kind="split"] .raft .plank:nth-child(1) { left: 15.999cqw; top: 46.546cqh; width: 8.822cqw; height: 9.777cqh; z-index: 1; background-image: url("ui/plank-01.webp") !important; }
  #scr-play.has-art .scene[data-kind="split"] .raft .plank:nth-child(2) { left: 22.847cqw; top: 46.546cqh; width: 8.224cqw; height: 9.777cqh; z-index: 2; background-image: url("ui/plank-02.webp") !important; }
  #scr-play.has-art .scene[data-kind="split"] .raft .plank:nth-child(3) { left: 29.695cqw; top: 46.546cqh; width: 7.596cqw; height: 9.777cqh; z-index: 3; background-image: url("ui/plank-03.webp") !important; }
  #scr-play.has-art .scene[data-kind="split"] .raft .plank:nth-child(4) { left: 36.543cqw; top: 46.546cqh; width: 6.998cqw; height: 9.777cqh; z-index: 4; background-image: url("ui/plank-04.webp") !important; }
  #scr-play.has-art .scene[data-kind="split"] .raft .plank:nth-child(5) { left: 43.391cqw; top: 46.546cqh; width: 6.370cqw; height: 9.777cqh; z-index: 5; background-image: url("ui/plank-05.webp") !important; }
  #scr-play.has-art .scene[data-kind="split"] .raft .plank:nth-child(6) { left: 50.209cqw; top: 46.546cqh; width: 6.370cqw; height: 9.777cqh; z-index: 5; background-image: url("ui/plank-06.webp") !important; }
  #scr-play.has-art .scene[data-kind="split"] .raft .plank:nth-child(7) { left: 56.459cqw; top: 46.546cqh; width: 6.968cqw; height: 9.777cqh; z-index: 4; background-image: url("ui/plank-07.webp") !important; }
  #scr-play.has-art .scene[data-kind="split"] .raft .plank:nth-child(8) { left: 62.679cqw; top: 46.546cqh; width: 7.596cqw; height: 9.777cqh; z-index: 3; background-image: url("ui/plank-08.webp") !important; }
  #scr-play.has-art .scene[data-kind="split"] .raft .plank:nth-child(9) { left: 68.900cqw; top: 46.546cqh; width: 8.224cqw; height: 9.777cqh; z-index: 2; background-image: url("ui/plank-09.webp") !important; }
  #scr-play.has-art .scene[data-kind="split"] .raft .plank:nth-child(10) { left: 75.150cqw; top: 46.546cqh; width: 8.852cqw; height: 9.777cqh; z-index: 1; background-image: url("ui/plank-10.webp") !important; }
  /* the raft (ui/vlot2.webp, 2140 x 436) lies in the water under the bridge: the lower part of the logs fades into the
     water. Its planks lie on the deck, five in a row; more planks are stacked on top as a second layer. */
  /* vertically the raft (with two layers of planks on it) sits in the middle between the bottom of the bridge (56.3 %)
     and the top of the keypad (the game sets --under: how far the keypad reaches over the water):
     the stack of planks reaches 1.38cqw above the raft picture, and the raft is seen down to 92 % of its picture */
  #scr-play.has-art .scene:not([data-kind="split"]) .raft-wrap { position: absolute; left: calc(31cqw - var(--bankw));
    top: calc(78.2cqh - var(--under, 22cqh) / 2 - 2.87cqw - 2px);   /* -2px: it bobs 0 to 4px down */
    width: 38cqw; height: calc(38cqw * 436 / 2140); margin: 0; padding: 0; z-index: 2; background: none; animation-duration: 4s; }
  /* only the raft picture fades into the water (a mask on the whole raft would also cut off the top of the tall
     bundles that stand on it) */
  #scr-play.has-art .scene:not([data-kind="split"]) .raft-wrap::before { content: ""; position: absolute; inset: 0;
    background: url("ui/vlot2.webp") center / 100% 100% no-repeat;
    -webkit-mask-image: linear-gradient(180deg, #000 0 77%, rgba(0, 0, 0, .55) 85%, rgba(0, 0, 0, .18) 93%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 0 77%, rgba(0, 0, 0, .55) 85%, rgba(0, 0, 0, .18) 93%, transparent 100%); }
  #scr-play.has-art .scene:not([data-kind="split"]) .raft { position: absolute; left: 10%; right: 10%; bottom: 27%; display: flex;
    flex-wrap: wrap-reverse; justify-content: center; align-items: flex-end; gap: 0 .4cqw !important; margin: 0; padding: 0 !important;
    border: 0; background: none !important; box-shadow: none; min-width: 0; min-height: 0; }
  #scr-play.has-art .scene:not([data-kind="split"]) .raft .plank { width: 5.4cqw; height: calc(5.4cqw * 165 / 213); flex: none;
    margin: calc(-5.4cqw * 165 / 213 * .32) 0 0 !important; }
  /* Honderdstad: the bundles of ten (the tens that are already there) float in the water right behind the bridge, in one
     row, their lower part under water; the loose planks and the bundles to add lie on the raft in front */
  #scr-play.has-art .dock { --top: max(36cqh, calc(var(--signb, 0px) + 6px)); position: absolute; left: calc(50cqw - var(--bankw)); top: var(--top); transform: translateX(-50%);
    display: flex; flex-wrap: nowrap; align-items: flex-end; justify-content: center; gap: .5cqw !important; width: max-content; max-width: 70cqw;
    min-height: 0; margin: 0; padding: 0 !important; border: 0 !important; border-radius: 0; background: none !important; box-shadow: none !important; z-index: 0; }
  /* as tall as fits between the sign and the bridge (their feet are behind the bridge) */
  #scr-play.has-art .dock .bundle { width: auto; height: clamp(6cqh, calc(48.5cqh - var(--top)), 12.5cqh); aspect-ratio: 263 / 358; flex: none;
    -webkit-mask-image: linear-gradient(180deg, #000 0 76%, rgba(0, 0, 0, .45) 86%, transparent 97%);
    mask-image: linear-gradient(180deg, #000 0 76%, rgba(0, 0, 0, .45) 86%, transparent 97%); }
  #scr-play.has-art .dock .plank { width: 4.6cqw; height: 5.6cqh; }
  /* tens and units: the loose planks lie on the raft in plain wood, like the raft itself: a thin light edge and a shadow
     make them stand out, so they can be counted */
  #scr-play.has-art .scene[data-kind="te"] .raft .plank.a { filter: brightness(1.12) drop-shadow(0 0 1.5px #fff8e0) drop-shadow(0 0 1.5px #fff8e0)
    drop-shadow(0 .4cqh .4cqh rgba(40, 20, 5, .45)); }
  /* Bram and the friend stand on the landing stages, a step towards the bridge, behind the front post (it is nearer
     to us): the two front posts (ui/paal-links, ui/paal-rechts, cut from the picture) lie over them again */
  #scr-play.has-art .actor { top: calc(50cqh - var(--actor)); left: max(12.5cqw, calc(var(--crop) + var(--actor) / 2 + 1cqw)); }
  #scr-play.has-art .actor.friend { left: min(87.5cqw, calc(100% - var(--crop) - var(--actor) / 2 - 1cqw)); }
  #scr-play.has-art .scene::before, #scr-play.has-art .scene::after { content: ""; position: absolute; z-index: 4; pointer-events: none;
    background: center / 100% 100% no-repeat; }
  #scr-play.has-art .scene::before { left: 1.316cqw; top: 42.242cqh; width: 6.130cqw; height: 18.916cqh;
    background-image: url("ui/paal-links.webp"); }
  #scr-play.has-art .scene::after { left: 92.464cqw; top: 42.295cqh; width: 6.190cqw; height: 18.863cqh;
    background-image: url("ui/paal-rechts.webp"); }
  /* the other river pictures (the harbour of Honderdstad, the Mistbos) have the same landing stages, painted again:
     their own posts */
  #scr-play.has-art .scene[data-art="wereld2"]::before { background-image: url("ui/paal-links-wereld2.webp"); }
  #scr-play.has-art .scene[data-art="wereld2"]::after { background-image: url("ui/paal-rechts-wereld2.webp"); }
  #scr-play.has-art .scene[data-art="mistbos"]::before { background-image: url("ui/paal-links-mistbos.webp"); }
  #scr-play.has-art .scene[data-art="mistbos"]::after { background-image: url("ui/paal-rechts-mistbos.webp"); }
  #scr-play.has-art .scene[data-art="beverdorp"]::before { background-image: url("ui/paal-links-beverdorp.webp"); }
  #scr-play.has-art .scene[data-art="beverdorp"]::after { background-image: url("ui/paal-rechts-beverdorp.webp"); }
  #scr-play.has-art .scene[data-art="kiezelbeek"]::before { background-image: url("ui/paal-links-kiezelbeek.webp"); }
  #scr-play.has-art .scene[data-art="kiezelbeek"]::after { background-image: url("ui/paal-rechts-kiezelbeek.webp"); }
  #scr-play.has-art .scene[data-art="negenbrug"]::before { background-image: url("ui/paal-links-negenbrug.webp"); }
  #scr-play.has-art .scene[data-art="negenbrug"]::after { background-image: url("ui/paal-rechts-negenbrug.webp"); }
  #scr-play.has-art .scene[data-art="wilderivier"]::before { background-image: url("ui/paal-links-wilderivier.webp"); }
  #scr-play.has-art .scene[data-art="wilderivier"]::after { background-image: url("ui/paal-rechts-wilderivier.webp"); }
  #scr-play.has-art .scene[data-art="waterval"]::before { background-image: url("ui/paal-links-waterval.webp"); }
  #scr-play.has-art .scene[data-art="waterval"]::after { background-image: url("ui/paal-rechts-waterval.webp"); }
  #scr-play.has-art .scene[data-art="springweide"]::before { background-image: url("ui/paal-links-springweide.webp"); }
  #scr-play.has-art .scene[data-art="springweide"]::after { background-image: url("ui/paal-rechts-springweide.webp"); }
  #scr-play.has-art .scene[data-art="bundelfabriek"]::before { background-image: url("ui/paal-links-bundelfabriek.webp"); }
  #scr-play.has-art .scene[data-art="bundelfabriek"]::after { background-image: url("ui/paal-rechts-bundelfabriek.webp"); }
  #scr-play.has-art .scene[data-art="krabbenstrand"]::before { background-image: url("ui/paal-links-krabbenstrand.webp"); }
  #scr-play.has-art .scene[data-art="krabbenstrand"]::after { background-image: url("ui/paal-rechts-krabbenstrand.webp"); }
  #scr-play.has-art .scene[data-art="vollerij"]::before { background-image: url("ui/paal-links-vollerij.webp"); }
  #scr-play.has-art .scene[data-art="vollerij"]::after { background-image: url("ui/paal-rechts-vollerij.webp"); }
  #scr-play.has-art .scene[data-art="honderdbrug"]::before { background-image: url("ui/paal-links-honderdbrug.webp"); }
  #scr-play.has-art .scene[data-art="honderdbrug"]::after { background-image: url("ui/paal-rechts-honderdbrug.webp"); }
  #scr-play.has-art .scene[data-art="monashaven"]::before { background-image: url("ui/paal-links-monashaven.webp"); }
  #scr-play.has-art .scene[data-art="monashaven"]::after { background-image: url("ui/paal-rechts-monashaven.webp"); }
  #scr-play.has-art .scene.cross #actorBram { left: calc(90cqw - var(--actor) * .8); }
}


/* ---------- Tiendorp at night: the river pictures after dark (scenes/<name>-nacht.webp) ---------- */
/* the front posts, cut from the night pictures */
#scr-play.has-art .scene.night-art::before { background-image: url("ui/paal-links-nacht.webp"); }
#scr-play.has-art .scene.night-art::after { background-image: url("ui/paal-rechts-nacht.webp"); }
#scr-play.has-art .scene.night-art[data-art="beverdorp"]::before { background-image: url("ui/paal-links-beverdorp-nacht.webp"); }
#scr-play.has-art .scene.night-art[data-art="beverdorp"]::after { background-image: url("ui/paal-rechts-beverdorp-nacht.webp"); }
#scr-play.has-art .scene.night-art[data-art="kiezelbeek"]::before { background-image: url("ui/paal-links-kiezelbeek-nacht.webp"); }
#scr-play.has-art .scene.night-art[data-art="kiezelbeek"]::after { background-image: url("ui/paal-rechts-kiezelbeek-nacht.webp"); }
#scr-play.has-art .scene.night-art[data-art="negenbrug"]::before { background-image: url("ui/paal-links-negenbrug-nacht.webp"); }
#scr-play.has-art .scene.night-art[data-art="negenbrug"]::after { background-image: url("ui/paal-rechts-negenbrug-nacht.webp"); }
#scr-play.has-art .scene.night-art[data-art="mistbos"]::before { background-image: url("ui/paal-links-mistbos-nacht.webp"); }
#scr-play.has-art .scene.night-art[data-art="mistbos"]::after { background-image: url("ui/paal-rechts-mistbos-nacht.webp"); }
#scr-play.has-art .scene.night-art[data-art="wilderivier"]::before { background-image: url("ui/paal-links-wilderivier-nacht.webp"); }
#scr-play.has-art .scene.night-art[data-art="wilderivier"]::after { background-image: url("ui/paal-rechts-wilderivier-nacht.webp"); }
#scr-play.has-art .scene.night-art[data-art="waterval"]::before { background-image: url("ui/paal-links-waterval-nacht.webp"); }
#scr-play.has-art .scene.night-art[data-art="waterval"]::after { background-image: url("ui/paal-rechts-waterval-nacht.webp"); }
/* planks, raft and friends in moonlight: a little darker and cooler than by day, still easy to count;
   the planks he is going to eat keep their orange glow */
.scene.has-art.night-art .plank.a, .scene.has-art.night-art .plank.given { filter: brightness(.74) saturate(.8) hue-rotate(-8deg) !important; }
.scene.has-art.night-art .plank.a.hint, .scene.has-art.night-art .plank.given.hint { filter: brightness(.8) saturate(.8) drop-shadow(0 0 6px #ffd23f) drop-shadow(0 0 3px #ffd23f) !important; }
.scene.has-art.night-art .raft-wrap::before { filter: brightness(.66) saturate(.75); }
/* a few planks and no bridge (laid out like splitting): the ones he is going to eat glow orange there too */
#scr-play.has-art .scene[data-kind="split"] .raft .plank.b.eat { filter: sepia(.6) saturate(3) hue-rotate(5deg) brightness(1.3) drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 1.5px #fff) !important; }
#scr-play.has-art .scene[data-kind="split"] .raft .plank.b.eat.hint { filter: sepia(.6) saturate(3) hue-rotate(5deg) brightness(1.3) drop-shadow(0 0 6px #ffd23f) drop-shadow(0 0 3px #ffd23f) !important; }
.scene.has-art.night-art .actor:not(.shadow) .doodle, .scene.has-art.night-art .fred .doodle { filter: brightness(.86) saturate(.88); }
.scene.has-art.night-art .plank.empty.gone { opacity: .5; }
/* the Nibbler as a shadow (a little clearer every night), with a pale moonlit edge */
.scene.has-art .actor.shadow .doodle { filter: brightness(var(--seen, 0)) saturate(.7) drop-shadow(0 0 5px rgba(190, 210, 255, .6)); }
/* the world chooser: a sheet of parchment with a wooden edge */
.world-menu { background: var(--grain), linear-gradient(180deg, #fff3d8, #f6dfb1); border: 5px solid #8a5a2b; box-shadow: 0 0 0 100vmax rgba(20, 24, 40, .5), 0 0 0 3px #3d220b, 0 14px 24px rgba(0, 0, 0, .45); }
.world-card { background: #fffaf0; border-color: #c9a36a; box-shadow: 0 4px 0 #8a5a2b; color: var(--ink); }
.world-card.current { border-color: #ffb627; box-shadow: 0 4px 0 #8a5a2b, 0 0 0 3px #ffd65a; }
#scr-map.full-map .world-tab.wt-toggle .wt-sky { filter: drop-shadow(0 2px 0 rgba(61, 34, 11, .6)); }
/* Knabbel's journey: a bundle that was eaten or opened is a pale ghost; the ones he is going to eat glow orange */
.scene .bundle.gone { opacity: .32; filter: grayscale(1) brightness(1.7) drop-shadow(0 0 2px #fff); }
.scene .bundle.b.eat { box-shadow: none; filter: sepia(.6) saturate(3) hue-rotate(5deg) brightness(1.25) drop-shadow(0 0 2px #fff) drop-shadow(0 3px 2px rgba(60, 30, 5, .35)); }
.scene .bundle.b.eat.hint { filter: sepia(.6) saturate(3) hue-rotate(5deg) brightness(1.25) drop-shadow(0 0 6px #ffd23f) drop-shadow(0 0 3px #ffd23f) !important; }

/* Knabbel's journey: the front posts of its six river pictures */
  #scr-play.has-art .scene[data-art="riviermond"]::before { background-image: url("ui/paal-links-riviermond.webp"); }
  #scr-play.has-art .scene[data-art="riviermond"]::after { background-image: url("ui/paal-rechts-riviermond.webp"); }
  #scr-play.has-art .scene[data-art="rietmoeras"]::before { background-image: url("ui/paal-links-rietmoeras.webp"); }
  #scr-play.has-art .scene[data-art="rietmoeras"]::after { background-image: url("ui/paal-rechts-rietmoeras.webp"); }
  #scr-play.has-art .scene[data-art="zaagmolen"]::before { background-image: url("ui/paal-links-zaagmolen.webp"); }
  #scr-play.has-art .scene[data-art="zaagmolen"]::after { background-image: url("ui/paal-rechts-zaagmolen.webp"); }
  #scr-play.has-art .scene[data-art="kloof"]::before { background-image: url("ui/paal-links-kloof.webp"); }
  #scr-play.has-art .scene[data-art="kloof"]::after { background-image: url("ui/paal-rechts-kloof.webp"); }
  #scr-play.has-art .scene[data-art="stompenveld"]::before { background-image: url("ui/paal-links-stompenveld.webp"); }
  #scr-play.has-art .scene[data-art="stompenveld"]::after { background-image: url("ui/paal-rechts-stompenveld.webp"); }
  #scr-play.has-art .scene[data-art="honderdbomenbos"]::before { background-image: url("ui/paal-links-honderdbomenbos.webp"); }
  #scr-play.has-art .scene[data-art="honderdbomenbos"]::after { background-image: url("ui/paal-rechts-honderdbomenbos.webp"); }

/* ---------- the plank factory (world 5): packs of planks, and the card box ---------- */
.packs { display: flex; flex-wrap: wrap; justify-content: center; align-content: center; align-items: center; gap: 8px 10px; margin: auto; max-width: min(100%, 420px); padding: 4px; }
.packs[hidden] { display: none; }
.packs .brk { flex-basis: 100%; height: 0; }
.scene.no-help .packs:not(.card) { visibility: hidden; }
.pack { display: grid; grid-template-columns: repeat(var(--cols, 5), auto); gap: 2px; padding: 4px 5px; border-radius: 8px; background: #6f4423; border: 3px solid var(--tc, #fff);
  box-shadow: 0 3px 0 #573419, 0 5px 8px rgba(0, 0, 0, .22); animation: packin .35s ease-out backwards; }
.pack:nth-child(2) { animation-delay: .05s; } .pack:nth-child(3) { animation-delay: .1s; } .pack:nth-child(4) { animation-delay: .15s; } .pack:nth-child(5) { animation-delay: .2s; }
.pack:nth-child(n+6) { animation-delay: .25s; }
.pack i { display: block; width: clamp(6px, 1.7vw, 9px); height: clamp(15px, 4.2vw, 22px); border-radius: 2px; background: linear-gradient(90deg, var(--plank2-light) 0 30%, var(--plank2) 30% 100%); }
.pack.hint { box-shadow: 0 0 0 3px var(--sun), 0 0 12px 2px rgba(255, 201, 60, .8); }
@keyframes packin { from { transform: translateY(-14px) scale(.8); opacity: 0; } }
.flashcard { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: min(64vw, 250px); padding: 20px 26px 14px; border-radius: 16px;
  background: #fffdf6; border: 5px solid var(--tc, #fff); box-shadow: 0 6px 0 rgba(0, 0, 0, .18), 0 10px 18px rgba(0, 0, 0, .2); transform: rotate(-2deg); animation: cardin .3s ease-out; }
.flashcard b { font-family: var(--font-display); font-size: clamp(34px, 10vw, 54px); line-height: 1.1; color: #33415c; white-space: nowrap; }
.flashcard small { font-weight: 700; font-size: 13px; color: #fff; text-shadow: 0 0 2px #1c2333, 0 0 2px #1c2333, 0 1px 2px #1c2333; background: var(--tc, #eee); padding: 2px 10px; border-radius: 99px; }
.packs.card.turned .flashcard { transform: rotate(1deg); background: #f2ffe8; animation: cardturn .4s ease-out; }
@keyframes cardin { from { transform: translateY(-30px) rotate(-8deg); opacity: 0; } }
@keyframes cardturn { 0% { transform: rotate(-2deg) scaleX(1); } 50% { transform: rotate(0) scaleX(.05); } 100% { transform: rotate(1deg) scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .pack, .flashcard, .packs.card.turned .flashcard { animation: none; } }
/* on the map: how many cards wait today */
.spot .due { position: absolute; left: calc(50% + 1.6cqw); bottom: calc(40% + 3cqw); min-width: 2.3cqw; height: 2.3cqw; padding: 0 .5cqw; border-radius: 99px; display: grid; place-items: center;
  background: #e8453c; color: #fff; font-weight: 800; font-size: 1.4cqw; line-height: 1; border: .22cqw solid #fff; box-shadow: 0 .2cqw .4cqw rgba(0, 0, 0, .35); }
/* parents' corner */
.cards-info { margin-top: 14px; }
.cards-info h3 { margin: 0 0 6px; font-size: 1rem; }
.cards-info p { margin: 4px 0; font-size: .92rem; }
.cards-info .tc { display: inline-block; width: .85em; height: .85em; border-radius: 3px; margin-right: 6px; border: 1px solid rgba(0, 0, 0, .25); vertical-align: -1px; }

/* picture book look: wooden crates of planks, a paper card */
.scene.has-art .pack { background: linear-gradient(180deg, #8a5a30, #6a4020); box-shadow: 0 0 0 2px var(--line), 0 5px 6px rgba(40, 20, 5, .4); }
.scene.has-art .pack i { background: var(--grain), linear-gradient(180deg, #ffd07a, #f29b2c); box-shadow: 0 0 0 1px rgba(80, 40, 10, .55); }
.scene.has-art .flashcard { background: #fff8e6; box-shadow: 0 0 0 2px var(--line), 0 8px 12px rgba(40, 20, 5, .4); }
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art .packs { position: absolute; left: 50%; top: 52cqh; transform: translate(-50%, -50%); margin: 0; max-width: 60cqw; width: max-content; gap: 1.8cqh 1.2cqw; }
  #scr-play.has-art .pack { padding: .8cqh .9cqh; gap: .45cqh; border-width: .6cqh; border-radius: 1.4cqh; }
  #scr-play.has-art .pack i { width: 2.3cqh; height: 6cqh; border-radius: .5cqh; }
  #scr-play.has-art .flashcard b { font-size: 11cqh; }
}

/* painted crates: one per table (the rim has the table's colour), stretched around the planks; one painted plank */
.scene.has-art .pack { background: none; box-shadow: none; border-radius: 0; padding: 0 1px; gap: 1px; border: 8px solid transparent;
  border-image: url("ui/krat-1.webp") 71 fill / 8px stretch; filter: drop-shadow(0 4px 3px rgba(40, 20, 5, .4)); }
.scene.has-art .packs[data-table="2"] .pack { border-image-source: url("ui/krat-2.webp"); }
.scene.has-art .packs[data-table="3"] .pack { border-image-source: url("ui/krat-3.webp"); }
.scene.has-art .packs[data-table="4"] .pack { border-image-source: url("ui/krat-4.webp"); }
.scene.has-art .packs[data-table="5"] .pack { border-image-source: url("ui/krat-5.webp"); }
.scene.has-art .packs[data-table="6"] .pack { border-image-source: url("ui/krat-6.webp"); }
.scene.has-art .packs[data-table="7"] .pack { border-image-source: url("ui/krat-7.webp"); }
.scene.has-art .packs[data-table="8"] .pack { border-image-source: url("ui/krat-8.webp"); }
.scene.has-art .packs[data-table="9"] .pack { border-image-source: url("ui/krat-9.webp"); }
.scene.has-art .packs[data-table="10"] .pack { border-image-source: url("ui/krat-10.webp"); }
.scene.has-art .pack i { background: url("ui/pakplank.webp") center / 100% 100% no-repeat; box-shadow: none; border-radius: 0; }
.scene.has-art .pack.hint { box-shadow: none; filter: drop-shadow(0 0 5px #ffd23f) drop-shadow(0 0 3px #ffd23f); }
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art .pack { padding: 0 .3cqh; gap: .3cqh; border-width: 2.4cqh; border-image-width: 2.4cqh; border-radius: 0; }
  #scr-play.has-art .pack i { width: 2.5cqh; height: 6.6cqh; border-radius: 0; }
}
/* small screens (a phone on its side): the crates stay inside the little river */
@media (max-height: 559px), (max-width: 859px) {
  .scene.has-art .packs { gap: 5px 7px; margin: auto; }
  .scene.has-art .pack i { width: 7px; height: 17px; }
}
/* the chapter signs of the plank factory: three crates on the water, one filled per star */
#scr-chapter .bridge-btn.orders .bb-planks { display: flex; align-items: center; justify-content: center; gap: 5%; }
#scr-chapter .bridge-btn.orders .bb-planks i { position: static !important; width: 20% !important; height: auto !important; aspect-ratio: 200 / 197; margin: 0 !important;
  background: url("ui/krat-vol-10.webp") center / 100% 100% no-repeat; filter: grayscale(1) brightness(1.7); opacity: .5; }
#scr-chapter .bridge-btn.orders .bb-planks i.on { filter: drop-shadow(0 2px 2px rgba(40, 20, 5, .45)); opacity: 1; }
#scr-chapter .bridge-btn.orders[data-table="1"] .bb-planks i { background-image: url("ui/krat-vol-1.webp"); }
#scr-chapter .bridge-btn.orders[data-table="2"] .bb-planks i { background-image: url("ui/krat-vol-2.webp"); }
#scr-chapter .bridge-btn.orders[data-table="3"] .bb-planks i { background-image: url("ui/krat-vol-3.webp"); }
#scr-chapter .bridge-btn.orders[data-table="4"] .bb-planks i { background-image: url("ui/krat-vol-4.webp"); }
#scr-chapter .bridge-btn.orders[data-table="5"] .bb-planks i { background-image: url("ui/krat-vol-5.webp"); }
#scr-chapter .bridge-btn.orders[data-table="6"] .bb-planks i { background-image: url("ui/krat-vol-6.webp"); }
#scr-chapter .bridge-btn.orders[data-table="7"] .bb-planks i { background-image: url("ui/krat-vol-7.webp"); }
#scr-chapter .bridge-btn.orders[data-table="8"] .bb-planks i { background-image: url("ui/krat-vol-8.webp"); }
#scr-chapter .bridge-btn.orders[data-table="9"] .bb-planks i { background-image: url("ui/krat-vol-9.webp"); }

/* ---------- a workshop floor instead of a river (.scene.dry): the plank factory ---------- */
.scene.dry .water::before, .scene.dry .water::after { display: none; }
.scene.has-art.dry .bank::after { display: none; }
.scene.has-art.dry.no-help .water { background: rgba(255, 248, 230, .5); }
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  /* no landing stages, so no front posts over the picture */
  #scr-play.has-art .scene.dry::before, #scr-play.has-art .scene.dry::after { display: none; }
  #scr-play.has-art .scene.dry.no-help .water { background: transparent; }
  /* the two stand on the floor, left and right of the loading table, a little bigger than on the landing stages */
  #scr-play.has-art .scene.dry { --actor: clamp(110px, 33cqh, 260px); }
  #scr-play.has-art .scene.dry .actor { top: calc(68cqh - var(--actor)); left: 11.5cqw; }
  #scr-play.has-art .scene.dry .actor.friend { left: 88.5cqw; }
  /* Knabbel and Mama are already big here: a little bigger than the others is enough, and a step to the side */
  #scr-play.has-art .scene.dry .actor.giant .doodle { transform: scale(1.15); }
  #scr-play.has-art .scene.dry .actor.giant.flip .doodle, #scr-play.has-art .scene.dry #actorBram.giant.other img.doodle { transform: scale(-1.15, 1.15); }
  #scr-play.has-art .scene.dry .actor.friend.giant { left: 89.5cqw; }
  /* the crates lie on the table: a little smaller, so two rows of five fit on it */
  #scr-play.has-art .scene.dry .packs { top: 54cqh; max-width: 54cqw; gap: calc(var(--k, 1) * 1.6cqh) calc(var(--k, 1) * 1.8cqh); }
  #scr-play.has-art .scene.dry .pack { border-width: calc(var(--k, 1) * 2cqh); border-image-width: calc(var(--k, 1) * 2cqh); gap: calc(var(--k, 1) * .3cqh); }
  /* a white edge around each crate: orange, yellow and brown rims would vanish against the wooden table */
  #scr-play.has-art .scene.dry .pack { outline: calc(var(--k, 1) * .45cqh) solid #fffdf2; outline-offset: calc(var(--k, 1) * -.25cqh); border-radius: calc(var(--k, 1) * 1.1cqh);
    filter: drop-shadow(0 .7cqh .5cqh rgba(40, 20, 5, .55)); }
  #scr-play.has-art .scene.dry .pack i { width: calc(var(--k, 1) * 2.1cqh); height: calc(var(--k, 1) * 5.5cqh); }
  #scr-play.has-art .scene.dry .flashcard { transform: rotate(-2deg) scale(.9); }
}
/* Fred has no river here: he sits in a wooden tub of water on the table */
#scr-play.has-art .scene.dry .fred::before, #scr-play.has-art .scene.dry .fred::after { content: ""; position: absolute; left: -22%; right: -22%; top: 52%; bottom: -74%; height: auto;
  border: 0; border-radius: 0; box-shadow: none; animation: none !important; opacity: 1; background: center / 100% 100% no-repeat; pointer-events: none; }
#scr-play.has-art .scene.dry .fred::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 72'%3E%3Cellipse cx='50' cy='18' rx='45' ry='13' fill='%238a5a2e' stroke='%234a2a10' stroke-width='3'/%3E%3Cellipse cx='50' cy='19' rx='39' ry='9.5' fill='%2363c4ef'/%3E%3Cpath d='M22 17 q8 -4 16 0 M58 22 q9 -4 18 0' fill='none' stroke='%23fff' stroke-opacity='.7' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); z-index: -1; }
#scr-play.has-art .scene.dry .fred::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 72'%3E%3Cpath d='M5 18 Q50 44 95 18 L87 60 Q50 74 13 60 Z' fill='%23d39a57' stroke='%234a2a10' stroke-width='3' stroke-linejoin='round'/%3E%3Cpath d='M27 30 L31 66 M50 32 V69 M73 30 L69 66' stroke='%239a6a35' stroke-width='2' fill='none'/%3E%3Cpath d='M8 32 Q50 56 92 32 M11 50 Q50 70 89 50' fill='none' stroke='%238d949c' stroke-width='5'/%3E%3Cpath d='M8 32 Q50 56 92 32 M11 50 Q50 70 89 50' fill='none' stroke='%234a2a10' stroke-width='1' transform='translate%280 3%29'/%3E%3C/svg%3E"); z-index: 2; }
#scr-play.has-art .scene.dry .fred { isolation: isolate; }
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art .scene.dry .fred { bottom: 59cqh; right: 21.5cqw; }
  /* his bubble: to the left of the tub, over the back of the table (above him it would hide behind the sign) */
  #scr-play.has-art .scene.dry .fred-say { right: calc(21.5cqw + 11cqh); bottom: 60cqh; z-index: 7; max-width: 40cqw; }
}

/* ---------- the clock tower and the plank shop: a clock, or money, on the table (.packs.board) ---------- */
.packs.board { gap: 14px 18px; max-width: min(100%, 520px); }
.scene[data-board] .mist-note, .scene[data-board="clock"].no-help .mist-note { display: none; }
.scene[data-board="money"].no-help .mist-note { display: block; }
.scene.no-help .packs.board.clock { visibility: visible; }
.scene.no-help .packs.board.clock .num { display: none; }
/* the clock */
.dial { width: clamp(150px, 46vw, 230px); height: auto; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .28)); animation: cardin .3s ease-out; }
.dial .rim { fill: #8a5a30; stroke: #4a2a10; stroke-width: 3; }
.dial .face { fill: #fffdf2; stroke: #4a2a10; stroke-width: 2; }
.dial .tk { stroke: #9aa3b5; stroke-width: 1.5; }
.dial .tk.big { stroke: #33415c; stroke-width: 3.5; }
.dial .num { font-family: var(--font-display); font-weight: 700; font-size: 21px; text-anchor: middle; fill: #33415c; }
.dial .hand { stroke-linecap: round; }
.dial .hand.hour { stroke: #c0392b; stroke-width: 9; }
.dial .hand.min { stroke: #2b6cb0; stroke-width: 5.5; }
.dial .pin { fill: #33415c; }
.packs.board.clock.hint .hand { filter: drop-shadow(0 0 4px #ffc93c) drop-shadow(0 0 2px #ffc93c); }
/* the sentence around the answer box: "half [ ]", "[ ] uur" */
.sum .w { font-size: .62em; font-weight: 700; color: #33415c; align-self: center; }
/* money: coins of 1 and 2, notes of 5, 10, 20, 50 and 100 */
.stapel { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 10px; }
.geld { display: grid; place-items: center; flex: none; font-family: var(--font-display); color: #26324a; box-shadow: 0 3px 0 rgba(0, 0, 0, .28), 0 5px 8px rgba(0, 0, 0, .2); animation: packin .3s ease-out backwards; }
.geld b { font-size: clamp(17px, 4.6vw, 24px); line-height: 1; }
.geld.munt { width: clamp(40px, 10.5vw, 54px); aspect-ratio: 1; border-radius: 50%; }
.geld.g1 { background: radial-gradient(circle, #e8ebf0 0 54%, #f2c744 56% 100%); border: 2px solid #9a6a10; }
.geld.g2 { background: radial-gradient(circle, #f2c744 0 54%, #e8ebf0 56% 100%); border: 2px solid #7d8590; width: clamp(45px, 11.5vw, 60px); }
.geld.brief { width: clamp(78px, 21vw, 108px); aspect-ratio: 1.85; border-radius: 6px; border: 2px solid rgba(0, 0, 0, .35); position: relative; }
.geld.brief::before { content: "€"; position: absolute; left: 6px; top: 3px; font-size: 12px; font-weight: 700; opacity: .6; }
.geld.brief::after { content: ""; position: absolute; right: 7%; top: 16%; bottom: 16%; width: 20%; border-radius: 40%; background: rgba(255, 255, 255, .4); }
.geld.g5 { background: linear-gradient(135deg, #dfe4ea, #aab4c0); }
.geld.g10 { background: linear-gradient(135deg, #ffc9c9, #f47a7a); }
.geld.g20 { background: linear-gradient(135deg, #c5dcff, #6fa4f2); }
.geld.g50 { background: linear-gradient(135deg, #ffe0b0, #f5a23c); }
.geld.g100 { background: linear-gradient(135deg, #c8f2c2, #62c466); }
.packs.board.money.hint .geld { box-shadow: 0 0 0 3px var(--sun), 0 0 10px 2px rgba(255, 201, 60, .8); }
.prijs { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.prijs small { font-weight: 800; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: #fff; text-shadow: 0 1px 2px #1c2333, 0 0 3px #1c2333; }
.kaartje { display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; border-radius: 10px; background: #fffdf2; border: 2px solid #4a2a10; box-shadow: 0 4px 0 rgba(0, 0, 0, .25); transform: rotate(-3deg); }
.kaartje i { width: 14px; height: 38px; border-radius: 3px; background: linear-gradient(90deg, var(--plank2-light) 0 30%, var(--plank2) 30% 100%); box-shadow: 0 0 0 1.5px #6a4020; }
.kaartje b { font-family: var(--font-display); font-size: clamp(20px, 5.4vw, 28px); color: #26324a; white-space: nowrap; }
.packs .plus { font-family: var(--font-display); font-size: 30px; font-weight: 700; color: #fff; text-shadow: 0 2px 3px #1c2333; align-self: flex-end; margin-bottom: 10px; }
/* the chapter signs of these worlds: three clocks, or three coins (one coloured in per star) */
.bridge-btn.signs-klok .mini-bridge, .bridge-btn.signs-geld .mini-bridge { display: none; }

#scr-chapter .bridge-btn.orders.signs-klok .bb-planks i { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Ccircle cx='20' cy='20' r='18' fill='%23fffdf2' stroke='%236a4020' stroke-width='4'/%3E%3Cpath d='M20 20V9M20 20l7 4' stroke='%2333415c' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") !important; aspect-ratio: 1; width: 17% !important; }
#scr-chapter .bridge-btn.orders.signs-geld .bb-planks i { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Ccircle cx='20' cy='20' r='18' fill='%23f2c744' stroke='%239a6a10' stroke-width='3'/%3E%3Ccircle cx='20' cy='20' r='11' fill='%23dfe3ea' stroke='%239a6a10' stroke-width='1.5'/%3E%3Ctext x='20' y='26' font-size='15' font-weight='700' text-anchor='middle' fill='%2333415c' font-family='sans-serif'%3E1%3C/text%3E%3C/svg%3E") !important; aspect-ratio: 1; width: 17% !important; }
.scene.has-art .kaartje i { background: url("ui/pakplank.webp") center / 100% 100% no-repeat; box-shadow: none; }
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art .scene.dry .packs.board { top: 52cqh; max-width: 52cqw; gap: 2cqh 2.4cqh; }
  #scr-play.has-art .dial { width: 37cqh; }
  #scr-play.has-art .dial .num { font-size: 22px; }
  #scr-play.has-art .stapel { gap: 1.6cqh 1.8cqh; }
  #scr-play.has-art .kaartje { padding: 1.4cqh 2.6cqh 1.4cqh 1.8cqh; gap: 1.6cqh; }
  #scr-play.has-art .kaartje i { width: 2.6cqh; height: 7cqh; }
  #scr-play.has-art .kaartje b { font-size: 5.4cqh; }
  #scr-play.has-art .prijs small { font-size: 2.3cqh; }
  #scr-play.has-art .packs .plus { font-size: 6cqh; margin-bottom: 2cqh; }
  #scr-play.has-art .sum .w { font-size: .6em; }
}

/* the sticker book: a picture and a colour for every page */
#scr-badges .album-page[data-sec="trouw"] { --page: url("backdrops/kiezelbeek.webp"); --sec: #f08c2e; --sec2: #ffe9cf; }
#scr-badges .album-page[data-sec="meester"] { --page: url("backdrops/waterval.webp"); --sec: #d4a017; --sec2: #fff3c4; }
#scr-badges .album-page[data-sec="w3"] { --page: url("backdrops/night.webp"); --sec: #5b6fd6; --sec2: #e0e6ff; }
#scr-badges .album-page[data-sec="w4"] { --page: url("scenes/honderdbomenbos.webp"); --sec: #3fa66a; --sec2: #dcf7e6; }
#scr-badges .album-page[data-sec="w5"] { --page: url("scenes/tweelingzagerij.webp"); --sec: #d9822b; --sec2: #ffe8cc; }
#scr-badges .album-page[data-sec="w6"] { --page: url("scenes/tweelingzagerij-nacht.webp"); --sec: #4a5fb5; --sec2: #dfe5ff; }
#scr-badges .album-page[data-sec="w7"] { --page: url("scenes/wereld7.webp"); --sec: #c0392b; --sec2: #ffe0db; }
#scr-badges .album-page[data-sec="w8"] { --page: url("scenes/wereld8.webp"); --sec: #1f9e8f; --sec2: #d6f5f0; }
#scr-badges .album-page[data-sec="tafels"] { --page: url("scenes/achtbaan.webp"); --sec: #8e5bd0; --sec2: #eee0ff; }
#scr-badges .album-page[data-sec="count"] { --page: url("backdrops/springweide.webp"); }
/* small screens: the clock and the money fit the little scene */
@media (max-height: 559px), (max-width: 859px) {
  .scene.has-art .dial, .scene .dial { width: min(40vw, 150px); }
  .packs.board { gap: 6px 10px; }
  .kaartje { padding: 4px 9px 4px 7px; } .kaartje i { height: 26px; width: 10px; } .kaartje b { font-size: 18px; } .prijs small { font-size: 10px; }
}
@media (orientation: landscape) and (max-height: 480px) { .scene.has-art .dial, .scene .dial { width: min(36vh, 130px); } }
#scr-badges .album-page[data-sec="tafels2"] { --page: url("scenes/dubbelzaag-nacht.webp"); --sec: #495057; --sec2: #e6e8eb; }

/* ---------- money that looks like euros: the real colours, and the real sizes in proportion ----------
   --u = the size of one millimetre. Notes: 5 = 120 x 62 mm, 10 = 127 x 67, 20 = 133 x 72, 50 = 140 x 77, 100 = 147 x 77.
   Coins: 1 euro = 23.25 mm, 2 euro = 25.75 mm, drawn 1.8 x as big (--c), or no finger could tap them. */
.packs.board.money { --u: clamp(.5px, .16vw, .72px); --c: 1.8; }
:is(.packs.board.money, .pad-money) .geld.brief { width: calc(var(--mmw) * var(--u)); height: calc(var(--mmh) * var(--u)); aspect-ratio: auto; border-radius: calc(4 * var(--u)); border: calc(1.6 * var(--u)) solid rgba(40, 40, 40, .45);
  background: linear-gradient(100deg, rgba(255, 255, 255, .55) 0 7%, transparent 7% 100%), radial-gradient(circle at 78% 50%, rgba(255, 255, 255, .5) 0 22%, transparent 23%), linear-gradient(135deg, var(--n1), var(--n2)); }
:is(.packs.board.money, .pad-money) .geld.g5 { --mmw: 120; --mmh: 62; --n1: #d9dcd3; --n2: #a9b0a4; }
:is(.packs.board.money, .pad-money) .geld.g10 { --mmw: 127; --mmh: 67; --n1: #f6c1b8; --n2: #e0796c; }
:is(.packs.board.money, .pad-money) .geld.g20 { --mmw: 133; --mmh: 72; --n1: #c3d6f2; --n2: #6f97d3; }
:is(.packs.board.money, .pad-money) .geld.g50 { --mmw: 140; --mmh: 77; --n1: #fbd9a4; --n2: #ee9a3a; }
:is(.packs.board.money, .pad-money) .geld.g100 { --mmw: 147; --mmh: 77; --n1: #cfe8b4; --n2: #7fbf5e; }
:is(.packs.board.money, .pad-money) .geld.brief b { position: absolute; left: 14%; bottom: 6%; font-size: calc(30 * var(--u)); }
:is(.packs.board.money, .pad-money) .geld.brief::before { content: attr(data-x) "EURO"; left: auto; right: 6%; top: 8%; font-size: calc(9 * var(--u)); letter-spacing: .08em; opacity: .7; }
/* the arch of a bridge, as on the real notes */
:is(.packs.board.money, .pad-money) .geld.brief::after { right: 13%; left: 57%; top: 38%; bottom: 16%; width: auto; border-radius: 50% 50% 0 0 / 100% 100% 0 0; background: none; border: calc(3 * var(--u)) solid rgba(40, 40, 60, .4); border-bottom: 0; }
:is(.packs.board.money, .pad-money) .geld.munt { width: calc(23.25 * var(--c) * var(--u)); border-width: calc(1.4 * var(--u)); position: relative; }
:is(.packs.board.money, .pad-money) .geld.g2 { width: calc(25.75 * var(--c) * var(--u)); }
:is(.packs.board.money, .pad-money) .geld.g1 { background: radial-gradient(circle, #eceef2 0 56%, #e9c45a 58% 100%); border-color: #94700f; }
:is(.packs.board.money, .pad-money) .geld.g2 { background: radial-gradient(circle, #eccb62 0 56%, #e4e7ec 58% 100%); border-color: #7d8590; }
:is(.packs.board.money, .pad-money) .geld.munt b { font-size: calc(21 * var(--u)); }
:is(.packs.board.money, .pad-money) .geld.munt::after { content: "€"; position: absolute; right: 23%; bottom: 20%; font-size: calc(8 * var(--u)); font-weight: 700; opacity: .65; }
/* paying: the counter above, the purse below */
.packs.board.money.lay { --u: clamp(.42px, .13vw, .6px); flex-direction: column; flex-wrap: nowrap; gap: 8px; align-items: stretch; }
.toonbank { display: flex; gap: 10px; align-items: stretch; justify-content: center; }
.bon { display: flex; gap: 8px; align-items: flex-end; }
.gelegd { flex: 1; min-width: 46%; min-height: calc(92 * var(--u)); display: flex; flex-direction: column; gap: 3px; padding: 4px 8px 6px; border-radius: 12px; border: 2px dashed rgba(255, 255, 255, .85); background: rgba(40, 25, 10, .28); }
.gelegd small, .beurs::before { font-weight: 800; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: #fff; text-shadow: 0 1px 2px #1c2333; }
.gelegd .stapel { flex: 1; gap: 4px 5px; }
.gelegd em { font-style: normal; font-weight: 700; font-size: 13px; color: rgba(255, 255, 255, .85); }
.beurs { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; justify-content: center; padding: 6px 8px; border-radius: 12px; background: rgba(255, 253, 242, .9); box-shadow: 0 3px 0 rgba(0, 0, 0, .22); }
button.geld { cursor: pointer; font: inherit; font-family: var(--font-display); padding: 0; animation: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.beurs button.geld:active { transform: translateY(2px) scale(.96); }
.gelegd button.geld { animation: packin .2s ease-out; }
.sum .box.lay { display: none; }
/* nothing to type while paying: only "wis" (take the last piece back) and the check */
#pad.lay button[data-k]:not(.del):not(.go) { opacity: .22; pointer-events: none; }
@media (max-height: 559px), (max-width: 859px) { :is(.packs.board.money, .pad-money) .geld.brief { width: calc(var(--mmw) * var(--u)); } .packs.board.money { --u: .44px; } .packs.board.money.lay { --u: .46px; --c: 2.2; gap: 4px; } .gelegd small { font-size: 9px; } }

@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art .packs.board.money { --u: .135cqh; }
  #scr-play.has-art .packs.board.money.lay { --u: .112cqh; --c: 2.5; top: 54.5cqh; width: 52cqw; max-width: 52cqw; gap: 1cqh; }
  #scr-play.has-art .beurs { gap: 1cqh 1.2cqh; padding: .8cqh 1cqh 1cqh; }
  #scr-play.has-art .gelegd { min-height: calc(84 * var(--u)); }
  #scr-play.has-art .geld.brief b { font-size: calc(30 * var(--u)); } #scr-play.has-art .geld.munt b { font-size: calc(21 * var(--u)); }
  #scr-play.has-art .gelegd small { font-size: 1.9cqh; } #scr-play.has-art .gelegd em { font-size: 2.2cqh; }
  #scr-play.has-art .packs.lay .kaartje { padding: .8cqh 1.6cqh .8cqh 1.2cqh; } #scr-play.has-art .packs.lay .kaartje b { font-size: 3.8cqh; } #scr-play.has-art .packs.lay .kaartje i { height: 5cqh; width: 1.9cqh; }
  #scr-play.has-art .packs.lay .prijs small { font-size: 1.7cqh; }
}

/* the purse and the till have a name; getting to know the money: everything open on the table */
.beurs { position: relative; }
.beurs small { flex-basis: 100%; text-align: center; font-weight: 800; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: #6a4020; margin-bottom: -2px; }
.beurs.kassa { background: linear-gradient(#d9dde3, #b9c0ca); border: 2px solid #5b6472; }
.beurs.kassa small { color: #2c3440; }
.beurs.portefeuille { background: linear-gradient(#b9793f, #96592a); border: 2px solid #5a3414; }
.beurs.portefeuille small { color: #fff3dd; }
.beurs.open { background: none; box-shadow: none; gap: 10px 14px; }
.packs.board.money.ken { --u: clamp(.5px, .16vw, .72px); }
.packs.board.money.ken.blind .geld b, .packs.board.money.ken.blind .geld::before, .packs.board.money.ken.blind .geld.munt::after { visibility: hidden; }
.packs.board.money.ken [data-right] { box-shadow: 0 0 0 4px #5fd068, 0 0 14px 3px rgba(95, 208, 104, .8); }
#pad.lay.tap button[data-k] { opacity: .22; pointer-events: none; }
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art .packs.board.money.ken { --u: .118cqh; --c: 2.3; max-width: 50cqw; width: 50cqw; }
  #scr-play.has-art .beurs small { font-size: 1.8cqh; }
  #scr-play.has-art .beurs.open { gap: 2cqh 2.4cqh; }
}

/* the cent coins: 1, 2 and 5 cent are copper, 10, 20 and 50 cent are gold; real sizes in proportion (x --c, as the euro coins) */
:is(.packs.board.money, .pad-money) .geld.cent { border-color: #7a4a1c; }
:is(.packs.board.money, .pad-money) .geld.c1 { width: calc(16.25 * var(--c) * var(--u)); } :is(.packs.board.money, .pad-money) .geld.c2 { width: calc(18.75 * var(--c) * var(--u)); }
:is(.packs.board.money, .pad-money) .geld.c5 { width: calc(21.25 * var(--c) * var(--u)); } :is(.packs.board.money, .pad-money) .geld.c10 { width: calc(19.75 * var(--c) * var(--u)); }
:is(.packs.board.money, .pad-money) .geld.c20 { width: calc(22.25 * var(--c) * var(--u)); } :is(.packs.board.money, .pad-money) .geld.c50 { width: calc(24.25 * var(--c) * var(--u)); }
:is(.packs.board.money, .pad-money) .geld.c1, :is(.packs.board.money, .pad-money) .geld.c2, :is(.packs.board.money, .pad-money) .geld.c5 { background: radial-gradient(circle at 35% 30%, #e9a877, #c2713a 70%); }
:is(.packs.board.money, .pad-money) .geld.c10, :is(.packs.board.money, .pad-money) .geld.c20, :is(.packs.board.money, .pad-money) .geld.c50 { background: radial-gradient(circle at 35% 30%, #f5dc8a, #dcae3c 70%); border-color: #8c6a12; }
:is(.packs.board.money, .pad-money) .geld.cent b { font-size: calc(17 * var(--u)); }
:is(.packs.board.money, .pad-money) .geld.cent::after { content: "c"; right: 16%; bottom: 14%; }
.bon .plus { align-self: center; margin: 0 2px; font-size: 22px; }
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art .geld.cent b { font-size: calc(17 * var(--u)); }
  #scr-play.has-art .packs.board.money:not(.lay):not(.ken) { --c: 2.2; }
  #scr-play.has-art .bon .plus { font-size: 4.5cqh; margin: 0 .6cqh; }
}

/* "do I have enough?": your money and the price, with a yes and a no button under them (also when the help is off) */
.scene.no-help .packs.board.money.genoeg { visibility: visible; }
.packs.board.money.genoeg { flex-direction: column; gap: 8px; }
.packs.board.money.genoeg .rij { display: flex; align-items: flex-end; justify-content: center; gap: 18px; }
.janee { display: flex; gap: 12px; justify-content: center; }
.janee button { font: inherit; font-weight: 800; font-size: 17px; padding: 8px 16px; border-radius: 14px; border: 3px solid #2f6b3a; background: #d9f2c9; color: #1f4a27; cursor: pointer; box-shadow: 0 3px 0 rgba(0, 0, 0, .25); }
.janee button.nee { border-color: #9c3b2a; background: #fbd9cf; color: #6e2416; }
.janee button:active { transform: translateY(2px); box-shadow: none; }
#sum .box.yn { min-width: 3.2em; width: auto; padding: 0 .3em; margin-right: .5em; }
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art .packs.board.money.genoeg { gap: 1.6cqh; }
  #scr-play.has-art .packs.board.money.genoeg .rij { gap: 4cqh; }
  #scr-play.has-art .janee { gap: 2.4cqh; }
  #scr-play.has-art .janee button { font-size: 3.4cqh; padding: 1.4cqh 3cqh; border-radius: 2.4cqh; }
}

/* cent sums: no notes on the table, so the coins are drawn 1.7 times larger (still in proportion to each other) */
:is(.packs.board.money, .pad-money) .geld.c1 { width: calc(16.25 * 1.7 * var(--c) * var(--u)); } :is(.packs.board.money, .pad-money) .geld.c2 { width: calc(18.75 * 1.7 * var(--c) * var(--u)); } :is(.packs.board.money, .pad-money) .geld.c5 { width: calc(21.25 * 1.7 * var(--c) * var(--u)); } :is(.packs.board.money, .pad-money) .geld.c10 { width: calc(19.75 * 1.7 * var(--c) * var(--u)); } :is(.packs.board.money, .pad-money) .geld.c20 { width: calc(22.25 * 1.7 * var(--c) * var(--u)); } :is(.packs.board.money, .pad-money) .geld.c50 { width: calc(24.25 * 1.7 * var(--c) * var(--u)); } 
:is(.packs.board.money, .pad-money)[data-unit="c"] .geld.g1 { width: calc(23.25 * 1.7 * var(--c) * var(--u)); }
:is(.packs.board.money, .pad-money) .geld.cent b, :is(.packs.board.money, .pad-money)[data-unit="c"] .geld.g1 b { font-size: calc(32 * var(--u)); }
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art .geld.cent b, #scr-play.has-art :is(.packs.board.money, .pad-money)[data-unit="c"] .geld.g1 b { font-size: calc(32 * var(--u)); }
}

/* ---------- the start screen: a board with the players, one tap selects, "Spelen" starts ---------- */
.home-board { position: relative; }
.profile-list { max-height: min(46vh, 330px); overflow-y: auto; padding: 4px; margin: -4px; }
.profile-btn { width: 100%; font: inherit; color: inherit; }
.profile-btn.sel { background: #ffe9a3; box-shadow: 0 0 0 3px var(--sun), 0 4px 0 var(--soft-2); }
.profile-btn .av, .av-btn .av { display: grid; place-items: center; border-radius: 50%; background: var(--avc, #6cbf5a); overflow: hidden; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(0, 0, 0, .25); }
.profile-btn .av .doodle, .av-btn .av .doodle { width: 100%; height: 100%; object-fit: contain; transform: scale(1.18) translateY(6%); }
.profile-btn .pill.edit { background: var(--paper); }
.home-actions { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.home-actions[hidden], .new-profile[hidden], .profile-list[hidden] { display: none; }
.home-actions .btn.ghost { font-size: 1rem; padding: 9px 12px; }
.home-actions .btn.go { background: linear-gradient(180deg, #7ed957, #3fae2a); color: #fff; box-shadow: 0 5px 0 #1f6b17; text-shadow: 0 2px 0 rgba(0, 60, 0, .45); font-size: 1.6rem; padding: 12px 34px; border-radius: 999px; }
.home-actions .btn.go:active { box-shadow: 0 1px 0 #1f6b17; }
.home-board[data-mode="manage"] .home-actions { grid-template-columns: 1fr; justify-items: center; }
.avatar-pick { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.av-btn { border: 0; background: none; padding: 3px; border-radius: 50%; cursor: pointer; aspect-ratio: 1; }
.av-btn .av { width: 100%; height: 100%; }
.av-btn.sel { box-shadow: 0 0 0 4px var(--sun), 0 0 12px 3px rgba(255, 190, 40, .8); }
.new-profile input { width: 100%; }
@media (max-width: 560px) {
  .home-actions { grid-template-columns: 1fr 1fr; }
  .home-actions .btn.go { grid-column: 1 / -1; grid-row: 1; justify-self: center; }
  .avatar-pick { grid-template-columns: repeat(4, 1fr); max-width: 300px; margin-inline: auto; }
}

/* the logo as a wooden sign, the friends peeking over it, the slogan on a paper ribbon */
#scr-profiles .hero { gap: 0; }
#scr-profiles .hero-art { height: 104px; margin-bottom: -10px; position: relative; z-index: 0; }
#scr-profiles .hero-art .c { width: 104px; height: 104px; } #scr-profiles .hero-art .c.small { width: 84px; height: 84px; }
#scr-profiles .hero h1 { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-shadow: none; }
#scr-profiles .hero h1 .logo { display: inline-block; padding: .04em .5em .12em; border-radius: 26px; transform: rotate(-1.2deg);
  background: var(--grain), linear-gradient(180deg, #a9682c, #7c4416); border: 4px solid var(--line);
  box-shadow: inset 0 3px 0 rgba(255, 215, 150, .35), inset 0 -4px 0 rgba(50, 22, 0, .3), 0 6px 0 var(--line), 0 16px 22px -8px rgba(40, 20, 0, .55);
  color: #ffcf45; -webkit-text-stroke: 3px #5a3210; paint-order: stroke fill; text-shadow: 0 4px 0 #5a3210; }
#scr-profiles .hero h1 small { margin-top: -4px; padding: 3px 18px 4px; border-radius: 12px; transform: rotate(.7deg); background: var(--parchment); border: 3px solid var(--line);
  color: var(--ink); font-weight: 700; text-shadow: none; box-shadow: 0 3px 0 var(--line); position: relative; z-index: 2; }
#scr-profiles .lang-flags { margin-top: 10px; }
#scr-profiles .family-bar { position: absolute; top: 14px; right: 16px; z-index: 5; }
#scr-profiles .family-bar .btn { border: 3px solid var(--line); border-radius: 999px; padding: 8px 18px; font-size: 1.15rem; }

/* the board */
#scr-profiles .home-board { margin-top: 30px; padding: 40px 26px 18px; gap: 14px; border-radius: 30px; border: 5px solid var(--line);
  background: var(--grain), linear-gradient(180deg, #f2a24c, #e08630);
  box-shadow: inset 0 0 0 3px rgba(255, 226, 160, .5), inset 0 -8px 0 rgba(120, 60, 10, .25), 0 8px 0 var(--line), 0 22px 30px -10px rgba(40, 20, 0, .55); }
#scr-profiles .home-board::before { content: ""; position: absolute; top: 12px; left: 14px; right: 14px; height: 16px; pointer-events: none;
  background: radial-gradient(circle at 8px 8px, #e9edf1 0 2px, #a9b0b8 3px 5px, #5f6670 6px 7px, transparent 8px) left / 16px 16px no-repeat,
    radial-gradient(circle at 8px 8px, #e9edf1 0 2px, #a9b0b8 3px 5px, #5f6670 6px 7px, transparent 8px) right / 16px 16px no-repeat; }
#scr-profiles #profilesTitle { position: absolute; top: -30px; left: 50%; transform: translateX(-50%); margin: 0; width: max-content; max-width: 92%; text-align: center;
  padding: 6px 34px 8px; border-radius: 20px; background: var(--parchment); border: 4px solid var(--line); box-shadow: 0 4px 0 var(--line); font-size: 1.7rem; line-height: 1.15; }
#scr-profiles .home-board[data-mode="manage"] #profilesTitle { font-size: 1.15rem; }
#scr-profiles .profile-btn { border-radius: 22px; padding: 7px 16px 7px 12px; gap: 16px; }
#scr-profiles .profile-btn .av { width: 58px; height: 58px; }
#scr-profiles .profile-btn .nm { font-size: 1.7rem; }
#scr-profiles .profile-btn .pill { font-size: 1.2rem; padding: 4px 16px; background: var(--parchment); }
#scr-profiles .profile-btn.sel { background: linear-gradient(180deg, #fff6c2, #ffdf6b); border-color: #c98a00;
  box-shadow: 0 0 0 4px #ffe36e, 0 0 20px 6px rgba(255, 226, 90, .85), 0 4px 0 #c98a00; }
#scr-profiles .home-actions .btn.ghost { border: 3px solid var(--line); border-radius: 999px; font-size: 1.05rem; white-space: nowrap; }
#scr-profiles .home-actions .btn.go { border: 4px solid #1f6b17; box-shadow: inset 0 3px 0 rgba(255, 255, 255, .45), 0 6px 0 #1f6b17, 0 12px 16px -6px rgba(0, 0, 0, .5); font-size: 1.9rem; padding: 10px 46px 12px; }
#scr-profiles .new-profile { background: var(--parchment); border: 3px solid var(--line); border-radius: 20px; padding: 14px 16px; gap: 10px; }
#scr-profiles .store-note { color: #5a2f08; text-align: center; font-weight: 600; }
@media (min-width: 900px) {
  #scr-profiles { width: min(820px, 92vw); margin-inline: calc(50% - min(410px, 46vw)); }
}
@media (max-height: 760px) and (min-width: 900px) {
  #scr-profiles { gap: 8px; }
  #scr-profiles .hero-art { height: 86px; } #scr-profiles .hero-art .c { width: 86px; height: 86px; } #scr-profiles .hero-art .c.small { width: 70px; height: 70px; }
  #scr-profiles .hero h1 { font-size: 3.2rem; }
  #scr-profiles .profile-list { max-height: max(150px, calc(100dvh - 462px)); }
  #scr-profiles .profile-btn .av { width: 50px; height: 50px; }
}
@media (max-width: 560px) {
  #scr-profiles .home-board { padding: 36px 14px 14px; }
  #scr-profiles #profilesTitle { font-size: 1.25rem; padding-inline: 18px; }
  #scr-profiles .family-bar { position: static; }
}

@media (max-width: 560px) {
  #scr-profiles .home-actions .btn.ghost { font-size: .9rem; padding: 8px 8px; white-space: normal; }
}
@media (orientation: landscape) and (max-height: 480px) {
  #scr-profiles .hero-art { height: 58px; margin-bottom: -8px; } #scr-profiles .hero-art .c { width: 58px; height: 58px; } #scr-profiles .hero-art .c.small { width: 48px; height: 48px; }
  #scr-profiles .hero h1 { font-size: 2.1rem; }
  #scr-profiles .hero h1 small { font-size: .36em; white-space: nowrap; }
  #scr-profiles .lang-flags { margin-top: 6px; }
  #scr-profiles .home-board { margin-top: 26px; padding-top: 32px; }
  #scr-profiles #profilesTitle { font-size: 1.3rem; top: -24px; }
}
/* a phone on its side: the logo left, the board right, so "Spelen" is on screen without scrolling */
@media (orientation: landscape) and (max-height: 480px) and (min-width: 620px) {
  #scr-profiles { display: grid; grid-template-columns: minmax(0, 36%) minmax(0, 1fr); align-items: center; gap: 14px; width: 96vw; margin-inline: calc(50% - 48vw); }
  #scr-profiles .hero h1 { font-size: 1.8rem; } #scr-profiles .hero h1 small { white-space: normal; font-size: .38em; }
  #scr-profiles .home-board { margin-top: 22px; padding: 28px 14px 10px; gap: 8px; }
  #scr-profiles .profile-list { max-height: max(96px, calc(100dvh - 190px)); }
  #scr-profiles .profile-btn { padding: 4px 12px 4px 8px; } #scr-profiles .profile-btn .av { width: 40px; height: 40px; } #scr-profiles .profile-btn .nm { font-size: 1.3rem; }
  #scr-profiles .home-actions .btn.go { font-size: 1.4rem; padding: 6px 26px 8px; } #scr-profiles .home-actions .btn.ghost { font-size: .85rem; padding: 6px 8px; white-space: normal; }
  #scr-profiles .store-note { display: none; }
  #scr-profiles .avatar-pick { gap: 4px; } #scr-profiles .new-profile { padding: 8px 10px; gap: 6px; }
}

/* the start screen, second pass: the three buttons stay inside the board, and the chosen player gets a rounded glow
   (the list scrolls, so it needs room around the rows or the glow is cut into a rectangle) */
#scr-profiles .profile-list { padding: 16px 18px 20px; margin: -16px -18px -14px; }
#scr-profiles .home-actions { display: flex; align-items: center; justify-content: center; gap: 12px; }
#scr-profiles .home-actions .btn { flex: 0 1 auto; min-width: 0; margin: 0; }
#scr-profiles .home-actions .btn.ghost { flex: 1 1 0; white-space: normal; line-height: 1.1; padding: 9px 10px; }
#scr-profiles .home-actions .btn.go { flex: 0 0 auto; padding: 10px 40px 12px; }
#scr-profiles .home-board[data-mode="manage"] .home-actions .btn.ghost { flex: 0 0 auto; padding-inline: 26px; }
/* chosen: a white inner edge, a yellow rim and a dark orange outline that both sit a few pixels lower, then the glow */
#scr-profiles .profile-btn.sel { background: linear-gradient(180deg, #fff7c9, #ffe27a); border: 3px solid #fffdf0;
  box-shadow: 0 0 0 3px #ffd84a, 0 3px 0 3px #f7bd0c, 0 4px 0 6px #cf7c0a, 0 4px 14px 11px rgba(255, 224, 90, .85); }
@media (max-width: 560px) {
  #scr-profiles .home-actions { flex-wrap: wrap; }
  #scr-profiles .home-actions .btn.go { order: -1; flex: 0 0 auto; margin-inline: 20%; }
  #scr-profiles .profile-list { padding-inline: 12px; margin-inline: -12px; }
}
#scr-profiles .home-actions .btn.go { display: inline-flex; align-items: center; justify-content: center; gap: 14px; }
#scr-profiles .home-actions .btn.ghost { flex: 0 1 auto; padding: 9px 16px; }
#scr-profiles .home-actions { justify-content: space-between; }
@media (orientation: landscape) and (max-height: 480px) and (min-width: 620px) {
  #scr-profiles .profile-list { padding-bottom: 12px; margin-bottom: -4px; }
}

/* ---------- the start screen, colours taken from the approved design ---------- */
.profile-btn .pill .ster { display: none; }
#scr-profiles .profile-btn .pill .ster { display: inline-block; width: 1.5em; height: 1.5em; vertical-align: -.36em; margin-right: .2em; fill: #ffc313; stroke: #e97908; stroke-width: 1.5; stroke-linejoin: round; filter: drop-shadow(0 1.5px 0 #ffdf67); }
#scr-profiles .profile-btn .pill .emo { display: none; }
#scr-profiles .home-board { border-color: #7a3f14; background: var(--grain), linear-gradient(180deg, #f6ab52, #e8902f 60%, #dd7f25);
  box-shadow: inset 0 0 0 3px #ffd58f, inset 0 -8px 0 rgba(120, 60, 10, .22), 0 8px 0 #5f300e, 0 22px 30px -10px rgba(40, 20, 0, .55); }
#scr-profiles #profilesTitle { border: 3px solid #b97b35; border-radius: 40px; background: linear-gradient(#fff5d8, #f8d397); color: #552b12; text-shadow: 0 2px 0 #fff8e7;
  box-shadow: inset 0 4px 3px #fffdfa, 0 5px 0 #8b461c, 0 9px 9px rgba(81, 42, 29, .4); }
#scr-profiles .profile-btn { border: 4px solid #8d552b; border-radius: 28px; color: #47210c; text-shadow: 0 1px 0 #fff4db;
  background: linear-gradient(180deg, #fff9e8 0%, #fff2d5 48%, #f4d39c 100%); box-shadow: inset 0 3px 0 #fffdf1, 0 5px 0 #7d411e; position: relative; }
#scr-profiles .profile-btn:active { box-shadow: inset 0 3px 0 #fffdf1, 0 2px 0 #7d411e; }
#scr-profiles .profile-btn .av { border-color: #fff5dc; box-shadow: 0 0 0 2px #bb6525, 0 3px 5px rgba(121, 66, 28, .35); }
#scr-profiles .profile-btn .pill { background: linear-gradient(#fff9e9, #ffe6b6); border: 3px solid #e4ae76; box-shadow: inset 0 2px 0 #fff; color: #4a210c; border-radius: 999px; font-weight: 800; }
/* chosen: white inner edge, yellow rim and dark orange outline a few pixels lower, then the glow; three little rays beside it */
#scr-profiles .profile-btn.sel { border: 4px solid #fffdf0; background: linear-gradient(180deg, #fffbbe, #fff1a4 65%, #fddc65);
  box-shadow: inset 0 2px 0 #fffdea, 0 0 0 3px #ffdc00, 0 3px 0 3px #ffbd05, 0 5px 0 6px #ab5816, 0 4px 14px 11px rgba(255, 222, 70, .8); }
#scr-profiles .profile-btn.sel .av { box-shadow: 0 0 0 3px #83b62c, 0 3px 5px rgba(121, 66, 28, .35); }
#scr-profiles .home-actions .btn.ghost { color: #4c270f; border: 4px solid #925019; background: linear-gradient(180deg, #fff9e8 0%, #fff3d4 48%, #f6d3a4 100%);
  box-shadow: inset 0 3px 0 #fffdfa, 0 6px 0 #734017, 0 7px 10px rgba(83, 48, 14, .27); text-shadow: 0 1px 0 #fff7e5; }
#scr-profiles .home-actions .btn.ghost:active { box-shadow: inset 0 3px 0 #fffdfa, 0 2px 0 #734017; }
#scr-profiles .home-actions .btn.go { position: relative; background: linear-gradient(#b0ff3c 0%, #75e50c 38%, #1fc400 73%, #159b00); border: 5px solid #8b3d0d;
  box-shadow: inset 0 3px 0 #fff8cf, inset 0 -6px 0 #188600, 0 6px 0 #6e340d, 0 8px 7px rgba(76, 44, 18, .33);
  -webkit-text-stroke: 4px #236a0a; paint-order: stroke fill; text-shadow: 0 4px 0 #1b530b; }
#scr-profiles .home-actions .btn.go:active { box-shadow: inset 0 3px 0 #fff8cf, inset 0 -3px 0 #188600, 0 2px 0 #6e340d; }
#scr-profiles .family-bar .btn { color: #4c270f; border: 4px solid #925019; background: linear-gradient(180deg, #fff9e8 0%, #fff3d4 48%, #f6d3a4 100%); box-shadow: inset 0 3px 0 #fffdfa, 0 6px 0 #734017; }
#scr-profiles .flag-btn { border: 3px solid #a85c2d; border-radius: 24px; background: linear-gradient(#fff8e5, #f8dcab); box-shadow: 0 5px 0 #824317, 0 6px 7px rgba(89, 51, 13, .3); color: #4d270e; }
#scr-profiles .flag-btn[aria-pressed="true"] { background: linear-gradient(#fff773, #ffd817); border-color: #fff; box-shadow: 0 0 0 3px #ffc300, 0 5px 0 3px #96500b; }
@media (min-width: 700px) and (min-height: 500px) {
  #scr-profiles .profile-list { padding-left: 50px; margin-left: -30px; padding-right: 20px; margin-right: 0; }
  #scr-profiles .home-board { padding-inline: 30px; }
  #scr-profiles .profile-btn.sel::before, #scr-profiles .home-actions .btn.go::after { content: ""; position: absolute; width: 30px; height: 46px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 72'%3E%3Cg fill='none' stroke-linecap='round'%3E%3Cg stroke='%23fff' stroke-width='13'%3E%3Cpath d='M30 6l10 14M8 36h20M30 66l10-14'/%3E%3C/g%3E%3Cg stroke='%23ffde00' stroke-width='8'%3E%3Cpath d='M30 6l10 14M8 36h20M30 66l10-14'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; pointer-events: none; }
  #scr-profiles .profile-btn.sel::before { left: -46px; top: 50%; transform: translateY(-50%) scaleX(-1); }
  #scr-profiles .home-actions .btn.go::after { right: -30px; top: -26px; transform: rotate(-40deg) scale(.8); }
}
@media (max-width: 560px) {
  #scr-profiles .home-actions .btn.ghost { flex: 1 1 40%; border-width: 3px; }
}
@media (orientation: landscape) and (max-height: 480px) and (min-width: 620px) {
  #scr-profiles .lang-flags { flex-wrap: nowrap; gap: 6px; } #scr-profiles .flag-btn { padding: 4px 8px; font-size: .85rem; border-width: 2px; }
  #scr-profiles .home-actions .btn.ghost { border-width: 3px; padding: 5px 8px; font-size: .8rem; }
  #scr-profiles .home-actions .btn.go { border-width: 4px; padding: 4px 22px 6px; }
  #scr-profiles .profile-btn { border-width: 3px; }
  #scr-profiles .profile-list { max-height: max(96px, calc(100dvh - 150px)); }
}

/* the painted logo (the words stay in the page for screen readers, but are not drawn) */
#scr-profiles .hero h1 .logo { width: min(520px, 86vw); aspect-ratio: 1100 / 207; padding: 0; border: 0; border-radius: 0; transform: none; box-shadow: none;
  background: url("ui/logo.webp") center / contain no-repeat; color: transparent; -webkit-text-stroke: 0; text-shadow: none; font-size: 0;
  filter: drop-shadow(0 8px 8px rgba(40, 20, 0, .4)); }
#scr-profiles .hero-art { margin-bottom: -16px; }
#scr-profiles .hero h1 small { margin-top: -2px; font-size: 1.25rem; }
@media (max-height: 760px) and (min-width: 900px) { #scr-profiles .hero h1 .logo { width: 440px; } }
@media (orientation: landscape) and (max-height: 480px) { #scr-profiles .hero h1 .logo { width: min(250px, 100%); } #scr-profiles .hero h1 small { font-size: .72rem; } #scr-profiles .hero-art { margin-bottom: -8px; } }
/* the rays fan out, away from what they belong to */
@media (min-width: 700px) and (min-height: 500px) {
  #scr-profiles .profile-btn.sel::before { width: 34px; height: 52px; left: -50px; transform: translateY(-50%); }
  #scr-profiles .home-actions .btn.go::after { right: -26px; top: -30px; transform: rotate(52deg) scaleX(-1) scale(.8); }
}
/* the logo follows the language (same board, cut the same way, so it does not jump); English has no own board yet */
html[lang="fr"] #scr-profiles .hero h1 .logo { background-image: url("ui/logo-fr.webp"); }

/* the rays, third pass: blunt wedges with a thick white edge, close to what they belong to, fanning away from it */
@media (min-width: 700px) and (min-height: 500px) {
  #scr-profiles .profile-btn.sel::before, #scr-profiles .home-actions .btn.go::after { width: 42px; height: 54px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 62 80'%3E%3Cg stroke-linejoin='round'%3E%3Cg fill='%23fff' stroke='%23fff' stroke-width='9'%3E%3Cpath transform='rotate%2838 62 40%29' d='M34 36.5 L34 43.5 L7 47.5 L7 32.5 Z'/%3E%3Cpath transform='rotate%280 62 40%29' d='M34 36.5 L34 43.5 L7 47.5 L7 32.5 Z'/%3E%3Cpath transform='rotate%28-38 62 40%29' d='M34 36.5 L34 43.5 L7 47.5 L7 32.5 Z'/%3E%3C/g%3E%3Cg fill='%23ffde00' stroke='%23ffde00' stroke-width='3'%3E%3Cpath transform='rotate%2838 62 40%29' d='M34 36.5 L34 43.5 L7 47.5 L7 32.5 Z'/%3E%3Cpath transform='rotate%280 62 40%29' d='M34 36.5 L34 43.5 L7 47.5 L7 32.5 Z'/%3E%3Cpath transform='rotate%28-38 62 40%29' d='M34 36.5 L34 43.5 L7 47.5 L7 32.5 Z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; filter: drop-shadow(0 0 2px rgba(244, 163, 0, .7)); }
  #scr-profiles .profile-btn.sel::before { left: -43px; top: 50%; transform: translateY(-50%); }
  #scr-profiles .home-actions .btn.go::after { right: 8px; top: -24px; transform-origin: 100% 50%; transform: rotate(125deg) scale(.82); }
}

/* the rays, fourth pass: room around the drawing so nothing is cut off, and a bit taller; more air above the buttons */
@media (min-width: 700px) and (min-height: 500px) {
  #scr-profiles .profile-btn.sel::before, #scr-profiles .home-actions .btn.go::after { width: 53px; height: 78px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-8 -16 76 112'%3E%3Cg stroke-linejoin='round'%3E%3Cg fill='%23fff' stroke='%23fff' stroke-width='9'%3E%3Cpath transform='rotate%2840 62 40%29' d='M34 36 L34 44 L5 49 L5 31 Z'/%3E%3Cpath transform='rotate%280 62 40%29' d='M34 36 L34 44 L5 49 L5 31 Z'/%3E%3Cpath transform='rotate%28-40 62 40%29' d='M34 36 L34 44 L5 49 L5 31 Z'/%3E%3C/g%3E%3Cg fill='%23ffde00' stroke='%23ffde00' stroke-width='3'%3E%3Cpath transform='rotate%2840 62 40%29' d='M34 36 L34 44 L5 49 L5 31 Z'/%3E%3Cpath transform='rotate%280 62 40%29' d='M34 36 L34 44 L5 49 L5 31 Z'/%3E%3Cpath transform='rotate%28-40 62 40%29' d='M34 36 L34 44 L5 49 L5 31 Z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); }
  #scr-profiles .profile-btn.sel::before { left: -52px; }
  #scr-profiles .home-actions .btn.go::after { right: 4px; top: -36px; transform-origin: 92% 50%; transform: rotate(125deg) scale(.72); }
  #scr-profiles .home-actions { margin-top: 12px; }
}
@media (max-height: 760px) and (min-width: 900px) { #scr-profiles .profile-list { max-height: max(150px, calc(100dvh - 474px)); } }
@media (min-width: 700px) and (min-height: 500px) { #scr-profiles .home-actions { margin-top: 26px; } }
@media (max-height: 760px) and (min-width: 900px) { #scr-profiles .profile-list { max-height: max(150px, calc(100dvh - 488px)); } #scr-profiles .home-board { padding-bottom: 12px; } }
@media (max-height: 760px) and (min-width: 900px) {
  #scr-profiles .profile-list { max-height: max(150px, calc(100dvh - 452px)); }
  #scr-profiles .hero-art { height: 66px; } #scr-profiles .hero-art .c { width: 72px; height: 72px; } #scr-profiles .hero-art .c.small { width: 60px; height: 60px; }
  #scr-profiles .hero h1 .logo { width: 400px; } #scr-profiles .lang-flags { margin-top: 6px; } #scr-profiles .home-board { margin-top: 26px; }
  #scr-profiles .home-actions { margin-top: 20px; }
}
@media (min-height: 761px) and (max-height: 840px) and (min-width: 900px) {
  #scr-profiles { gap: 8px; }
  #scr-profiles .hero-art { height: 76px; } #scr-profiles .hero-art .c { width: 82px; height: 82px; } #scr-profiles .hero-art .c.small { width: 68px; height: 68px; }
  #scr-profiles .hero h1 .logo { width: 420px; } #scr-profiles .lang-flags { margin-top: 6px; } #scr-profiles .home-board { margin-top: 26px; padding-bottom: 12px; }
  #scr-profiles .profile-list { max-height: max(150px, calc(100dvh - 470px)); }
}

/* the slogan on a ribbon that bows along under the logo (on a narrow screen the straight ribbon stays) */
.hero .ribbon { display: none; }
@media (min-width: 561px) {
  #scr-profiles .hero h1 small { display: none; }
  #scr-profiles .hero .ribbon { display: block; width: min(600px, 92vw); height: auto; margin-top: -30px; position: relative; z-index: 2; overflow: visible; }
  #scr-profiles .ribbon path { fill: none; stroke-linecap: round; }
  #scr-profiles .ribbon .rib-shadow { stroke: #9b5923; stroke-width: 46; }
  #scr-profiles .ribbon .rib-edge { stroke: #c9813a; stroke-width: 46; }
  #scr-profiles .ribbon .rib-face { stroke: #fbe1a8; stroke-width: 40; }
  #scr-profiles .ribbon text { font-family: var(--font-display); font-weight: 700; font-size: 25px; fill: #4f280e; letter-spacing: .2px; -webkit-text-stroke: 0; text-shadow: none; }
  html[lang="fr"] #scr-profiles .ribbon text { font-size: 23px; }
  #scr-profiles .lang-flags { margin-top: -2px; }
}
@media (max-height: 760px) and (min-width: 900px) { #scr-profiles .hero .ribbon { width: 520px; margin-top: -26px; } }
@media (orientation: landscape) and (max-height: 480px) and (min-width: 561px) { #scr-profiles .hero .ribbon { width: 100%; margin-top: -12px; } }
@media (min-width: 561px) {
  #scr-profiles .hero .ribbon { width: min(660px, 94vw); margin-top: -34px; }
  #scr-profiles .ribbon text { font-size: 26.5px; } html[lang="fr"] #scr-profiles .ribbon text { font-size: 24px; }
}
@media (max-height: 760px) and (min-width: 900px) { #scr-profiles .hero .ribbon { width: 590px; margin-top: -30px; } }
@media (orientation: landscape) and (max-height: 480px) and (min-width: 561px) {
  #scr-profiles .hero .ribbon { display: none; } #scr-profiles .hero h1 small { display: block; } #scr-profiles .lang-flags { margin-top: 6px; }
}

/* the painted board behind the players: corners (with the screws) and edges keep their size, the middle stretches */
#scr-profiles .home-board { background: none; box-shadow: none; border: 6px solid transparent; border-radius: 0;
  border-image: url("ui/startbord.webp") 84 fill / 58px stretch; filter: drop-shadow(0 10px 12px rgba(40, 20, 0, .45)); }
#scr-profiles .home-board::before { display: none; }
@media (max-width: 560px), (orientation: landscape) and (max-height: 480px) {
  #scr-profiles .home-board { border-image-width: 40px; }
}

/* the family button: a cream pill with a thick brown edge and a deep shadow, like the other buttons of this screen */
.fam-ic { width: 1.5em; height: 1.1em; vertical-align: -.18em; fill: currentColor; }
#scr-profiles .family-bar { top: 16px; right: 20px; }
#scr-profiles .family-bar .btn { display: inline-flex; align-items: center; gap: 10px; padding: 9px 26px 11px 20px; font-size: 1.45rem; font-weight: 700; color: #4c270f;
  border: 4px solid #925019; border-radius: 999px; background: linear-gradient(180deg, #fff9e8 0%, #fff3d4 48%, #f6d3a4 100%);
  box-shadow: inset 0 3px 0 #fffdfa, 0 7px 0 #734017, 0 12px 14px rgba(60, 32, 8, .45); text-shadow: 0 1px 0 #fff7e5; }
#scr-profiles .family-bar .btn:active { transform: translateY(4px); box-shadow: inset 0 3px 0 #fffdfa, 0 3px 0 #734017; }
#scr-profiles .family-bar .fam-ic { width: 1.55em; height: 1.16em; fill: #4c270f; }
/* the same depth under the other cream buttons, the language buttons and the logo */
#scr-profiles .home-actions .btn.ghost { box-shadow: inset 0 3px 0 #fffdfa, 0 6px 0 #734017, 0 11px 12px rgba(60, 32, 8, .4); }
#scr-profiles .flag-btn { box-shadow: 0 5px 0 #824317, 0 9px 10px rgba(60, 32, 8, .4); }
#scr-profiles .hero h1 .logo { filter: drop-shadow(0 5px 0 rgba(70, 35, 8, .55)) drop-shadow(0 12px 10px rgba(40, 20, 0, .45)); }
@media (max-width: 560px), (orientation: landscape) and (max-height: 480px) {
  #scr-profiles .family-bar .btn { font-size: 1rem; padding: 5px 14px 6px 10px; border-width: 3px; box-shadow: inset 0 2px 0 #fffdfa, 0 4px 0 #734017, 0 7px 8px rgba(60, 32, 8, .4); }
}
@media (orientation: landscape) and (max-height: 480px) { #scr-profiles .family-bar { top: 6px; right: auto; left: 8px; } }

/* the cream buttons, from the inside out: a white line along the top (light), a darker line along the bottom,
   one dark brown outline all round (a little heavier below), then a soft drop shadow. No light edge under the button. */
#scr-profiles .family-bar .btn, #scr-profiles .home-actions .btn.ghost {
  border: 4px solid #7a3f14; background: linear-gradient(180deg, #fff9e8 0%, #fff3d4 50%, #f6d3a4 100%) padding-box;
  box-shadow: inset 0 3px 0 #fffdf6, inset 0 -4px 0 #dfae76, 0 3px 0 #7a3f14, 0 9px 10px rgba(50, 26, 6, .45); }
#scr-profiles .family-bar .btn:active, #scr-profiles .home-actions .btn.ghost:active {
  transform: translateY(3px); box-shadow: inset 0 3px 0 #fffdf6, inset 0 -4px 0 #dfae76, 0 0 0 #7a3f14, 0 3px 4px rgba(50, 26, 6, .4); }
@media (max-width: 560px), (orientation: landscape) and (max-height: 480px) {
  #scr-profiles .family-bar .btn, #scr-profiles .home-actions .btn.ghost { border-width: 3px; box-shadow: inset 0 2px 0 #fffdf6, inset 0 -3px 0 #dfae76, 0 2px 0 #7a3f14, 0 6px 7px rgba(50, 26, 6, .4); }
}
html[lang="en"] #scr-profiles .hero h1 .logo { background-image: url("ui/logo-en.webp"); }

/* the heavier bottom of the outline is part of the border itself (a separate shadow in the same colour left a hairline
   between the two on sharp screens) */
#scr-profiles .family-bar .btn, #scr-profiles .home-actions .btn.ghost {
  border-width: 4px 4px 7px; box-shadow: inset 0 3px 0 #fffdf6, inset 0 -4px 0 #dfae76, 0 7px 9px rgba(50, 26, 6, .45); }
#scr-profiles .family-bar .btn:active, #scr-profiles .home-actions .btn.ghost:active {
  transform: translateY(3px); border-bottom-width: 4px; margin-bottom: 3px; box-shadow: inset 0 3px 0 #fffdf6, inset 0 -4px 0 #dfae76, 0 3px 4px rgba(50, 26, 6, .4); }
@media (max-width: 560px), (orientation: landscape) and (max-height: 480px) {
  #scr-profiles .family-bar .btn, #scr-profiles .home-actions .btn.ghost { border-width: 3px 3px 5px; box-shadow: inset 0 2px 0 #fffdf6, inset 0 -3px 0 #dfae76, 0 5px 7px rgba(50, 26, 6, .4); }
}

/* ---------- the family page: the same buttons as the start screen ----------
   from the inside out: light line on top, darker line below, one dark brown outline (heavier below, part of the border,
   so no hairline), soft drop shadow */
#scr-family .btn, #scr-family a.btn {
  color: #4c270f; border: solid #7a3f14; border-width: 4px 4px 7px; border-radius: 999px; padding: 9px 24px 10px; text-shadow: 0 1px 0 #fff7e5; text-decoration: none;
  background: linear-gradient(180deg, #fff9e8 0%, #fff3d4 50%, #f6d3a4 100%) padding-box;
  box-shadow: inset 0 3px 0 #fffdf6, inset 0 -4px 0 #dfae76, 0 7px 9px rgba(50, 26, 6, .4); }
#scr-family .btn:active { transform: translateY(3px); border-bottom-width: 4px; margin-bottom: 3px; box-shadow: inset 0 3px 0 #fffdf6, inset 0 -4px 0 #dfae76, 0 3px 4px rgba(50, 26, 6, .35); }
/* the main action of a block: the same button in yellow; "delete everything" in red */
#scr-family .btn:not(.ghost):not(.danger) { background: linear-gradient(180deg, #ffe680 0%, #ffd23f 50%, #ffb822 100%) padding-box; box-shadow: inset 0 3px 0 #fff6c4, inset 0 -4px 0 #e89a0c, 0 7px 9px rgba(50, 26, 6, .4); }
#scr-family .btn.danger { color: #fff; text-shadow: 0 2px 0 #8e2019; border-color: #7a2414; background: linear-gradient(180deg, #ff8f7c 0%, #ee5a4c 50%, #d63a31 100%) padding-box; box-shadow: inset 0 3px 0 #ffc4b6, inset 0 -4px 0 #b3261f, 0 7px 9px rgba(50, 26, 6, .4); }
#scr-family .btn.small { border-width: 3px 3px 5px; padding: 5px 16px 6px; box-shadow: inset 0 2px 0 #fffdf6, inset 0 -3px 0 #dfae76, 0 5px 6px rgba(50, 26, 6, .35); }
/* the back button: a round cream button with a dark arrow, instead of the drawn wood */
#scr-family .topbar .icon-btn { color: #4c270f; border: solid #7a3f14; border-width: 4px 4px 7px; border-radius: 50%; --ico-edge: transparent;
  background: linear-gradient(180deg, #fff9e8 0%, #fff3d4 50%, #f6d3a4 100%) padding-box;
  box-shadow: inset 0 3px 0 #fffdf6, inset 0 -4px 0 #dfae76, 0 7px 9px rgba(50, 26, 6, .4); }
#scr-family .topbar .icon-btn:active { transform: translateY(3px); border-bottom-width: 4px; margin-bottom: 3px; box-shadow: inset 0 3px 0 #fffdf6, inset 0 -4px 0 #dfae76, 0 3px 4px rgba(50, 26, 6, .35); }
#scr-family .topbar .icon-btn .ico { stroke-width: 4.4; }
/* page titles: the thick outline of the letters needs room, or the box that shortens long names cuts it off */
#scr-family .topbar .who strong { overflow: visible; padding: .12em .3em .3em; margin: -.12em -.3em -.3em; }
#scr-family .topbar .who { font-size: 1.9rem; }

/* ---------- no hairlines under the wooden buttons and signs ----------
   The dark rim under a button was a separate shadow next to its border; on a sharp screen a thin line showed between the
   two. The rim is now drawn underneath the whole button (a drop shadow), so there is nothing to show through. */
#scr-map.full-map .topbar > .icon-btn, .map-cast .cast-more,
#scr-chapter .topbar .icon-btn, #scr-play.has-art > .topbar .icon-btn, #scr-badges .topbar .icon-btn, #scr-book .topbar .icon-btn, #scr-book .book-nav .icon-btn {
  box-shadow: inset 0 3px 0 rgba(255, 222, 165, .5), inset 0 -4px 0 rgba(50, 25, 5, .35);
  filter: drop-shadow(0 4px 0 #3d220b) drop-shadow(0 5px 5px rgba(0, 0, 0, .4)); }
#scr-badges .album-nav .icon-btn { box-shadow: inset 0 3px 0 rgba(255, 222, 165, .5); filter: drop-shadow(0 4px 0 #3d220b) drop-shadow(0 5px 5px rgba(0, 0, 0, .4)); }
#scr-map.full-map .topbar > .icon-btn:active, .map-cast .cast-more:active,
#scr-chapter .topbar .icon-btn:active, #scr-play.has-art > .topbar .icon-btn:active, #scr-badges .topbar .icon-btn:active, #scr-book .topbar .icon-btn:active, #scr-book .book-nav .icon-btn:active, #scr-badges .album-nav .icon-btn:active {
  box-shadow: inset 0 3px 0 rgba(255, 222, 165, .5); filter: drop-shadow(0 1px 0 #3d220b); }
/* the signs: their rim takes the colour of the painted edge above it, so the two read as one */
#scr-map.full-map .world-tab::before, #scr-chapter .topbar .who::before, #scr-play.has-art > .topbar .who::before, #scr-badges .topbar .who::before, #scr-book .topbar .who::before {
  filter: brightness(.7) saturate(1.2) drop-shadow(0 4px 0 #3a1705) drop-shadow(0 8px 8px rgba(0, 0, 0, .35)); }
#scr-map.full-map .world-tab:not([aria-selected="true"]):not(.locked)::before { filter: brightness(.95) drop-shadow(0 4px 0 #46200a) drop-shadow(0 8px 8px rgba(0, 0, 0, .35)); }

/* the family page uses the back button of the rest of the game */
#scr-family .topbar .icon-btn { --ico-edge: #3d220b; width: 56px; height: 56px; border-radius: 28%; color: #fff1d0; border: 3px solid #3d220b; margin: 0;
  background: linear-gradient(180deg, rgba(255, 230, 190, .16), rgba(60, 30, 5, .14)), url("ui/onderlegger.webp") 50% 50% / auto 320%;
  box-shadow: inset 0 3px 0 rgba(255, 222, 165, .5), inset 0 -4px 0 rgba(50, 25, 5, .35); filter: drop-shadow(0 4px 0 #3d220b) drop-shadow(0 5px 5px rgba(0, 0, 0, .4)); }
#scr-family .topbar .icon-btn:active { transform: translateY(3px); border-bottom-width: 3px; margin: 0; box-shadow: inset 0 3px 0 rgba(255, 222, 165, .5); filter: drop-shadow(0 1px 0 #3d220b); }
#scr-family .topbar .icon-btn .ico { stroke-width: 3.6; }
/* the cream signs with nails are painted boards with an uneven edge: a hard rim under them copied that edge (and
   everything on the sign) a few pixels lower. Only a soft shadow now; the board has its own painted edge. */
.map-sign { filter: drop-shadow(0 3px 2px rgba(40, 20, 0, .45)) drop-shadow(0 10px 12px rgba(0, 0, 0, .35)); }
#scr-map.full-map .top-actions, #scr-map.full-map .lang-menu { filter: drop-shadow(0 3px 2px rgba(40, 20, 0, .45)) drop-shadow(0 12px 14px rgba(0, 0, 0, .4)); }
/* painted signs and boards (uneven edges, notches): no rim under them at all, only a wide soft shadow. Their own painted
   edge is the rim; any tight shadow shows as a straight band that does not follow the waves. */
.map-sign, #scr-map.full-map .top-actions, #scr-map.full-map .lang-menu { filter: drop-shadow(0 8px 9px rgba(0, 0, 0, .38)); }
#scr-map.full-map .world-tab::before, #scr-chapter .topbar .who::before, #scr-play.has-art > .topbar .who::before, #scr-badges .topbar .who::before, #scr-book .topbar .who::before {
  filter: brightness(.7) saturate(1.2) drop-shadow(0 7px 7px rgba(0, 0, 0, .4)); }
#scr-map.full-map .world-tab:not([aria-selected="true"]):not(.locked)::before { filter: brightness(.95) drop-shadow(0 7px 7px rgba(0, 0, 0, .4)); }

/* ---------- shadows under painted signs and boards, final ----------
   These boards have wavy edges and notches, and they may not use CSS filters (see above: smears on big screens). Their rim
   was a straight box under a wavy board. Now: no rim at all (the painted edge is the rim), only a soft shadow, pulled in a
   little so its straight shape stays hidden under the board. */
.map-sign { box-shadow: 0 9px 10px -5px rgba(0, 0, 0, .5) !important; }
#scr-map.full-map .top-actions, #scr-map.full-map .lang-menu { box-shadow: 0 12px 14px -6px rgba(0, 0, 0, .5) !important; }
#scr-chapter .bridge-btn { box-shadow: 0 11px 12px -6px rgba(0, 0, 0, .5) !important; }
#scr-chapter .bridge-btn.next { box-shadow: 0 0 0 3px rgba(255, 214, 90, .8), 0 0 24px 6px rgba(255, 214, 90, .75), 0 11px 12px -6px rgba(0, 0, 0, .5) !important; }
#scr-chapter .topbar .who::before, #scr-map.full-map .world-tab::before, #scr-play.has-art > .topbar .who::before, #scr-badges .topbar .who::before, #scr-book .topbar .who::before,
#scr-map.full-map .world-tab[aria-selected="true"]::before, #scr-map.full-map .world-tab:not([aria-selected="true"]):not(.locked)::before, #scr-map.full-map .world-tab.locked::before {
  box-shadow: 0 8px 8px -4px rgba(0, 0, 0, .5) !important; }
/* the wooden buttons: no filter either. The rim is a shadow again, with a hair of the same colour all round that closes
   the seam between border and rim (that seam was the thin line). */
#scr-map.full-map .topbar > .icon-btn, .map-cast .cast-more, #scr-family .topbar .icon-btn,
#scr-chapter .topbar .icon-btn, #scr-play.has-art > .topbar .icon-btn, #scr-badges .topbar .icon-btn, #scr-book .topbar .icon-btn, #scr-book .book-nav .icon-btn {
  filter: none; box-shadow: inset 0 3px 0 rgba(255, 222, 165, .5), inset 0 -4px 0 rgba(50, 25, 5, .35), 0 0 0 1px #3d220b, 0 4px 0 1px #3d220b, 0 9px 10px -4px rgba(0, 0, 0, .5); }
#scr-badges .album-nav .icon-btn { filter: none; box-shadow: inset 0 3px 0 rgba(255, 222, 165, .5), 0 0 0 1px #3d220b, 0 4px 0 1px #3d220b, 0 9px 10px -4px rgba(0, 0, 0, .5); }
#scr-map.full-map .topbar > .icon-btn:active, .map-cast .cast-more:active, #scr-family .topbar .icon-btn:active,
#scr-chapter .topbar .icon-btn:active, #scr-play.has-art > .topbar .icon-btn:active, #scr-badges .topbar .icon-btn:active, #scr-book .topbar .icon-btn:active, #scr-book .book-nav .icon-btn:active, #scr-badges .album-nav .icon-btn:active {
  filter: none; box-shadow: inset 0 3px 0 rgba(255, 222, 165, .5), 0 0 0 1px #3d220b, 0 1px 0 1px #3d220b; }
/* the next bridge to play: a soft yellow glow only (a hard yellow ring is a straight box around a wavy board) */
#scr-chapter .bridge-btn.next { box-shadow: 0 0 16px 5px rgba(255, 214, 90, .9), 0 0 34px 10px rgba(255, 214, 90, .55), 0 11px 12px -6px rgba(0, 0, 0, .5) !important; }

/* ---------- painted euro money (coins of 1 and 2, notes of 5 to 100): the picture carries the number ---------- */
:is(.packs.board.money, .pad-money) .geld.g1, .geld.g1 { background: url("ui/geld-1.webp") center / 100% 100% no-repeat; }
:is(.packs.board.money, .pad-money) .geld.g2, .geld.g2 { background: url("ui/geld-2.webp") center / 100% 100% no-repeat; }
:is(.packs.board.money, .pad-money) .geld.g5, .geld.g5 { background: url("ui/geld-5.webp") center / 100% 100% no-repeat; }
:is(.packs.board.money, .pad-money) .geld.g10, .geld.g10 { background: url("ui/geld-10.webp") center / 100% 100% no-repeat; }
:is(.packs.board.money, .pad-money) .geld.g20, .geld.g20 { background: url("ui/geld-20.webp") center / 100% 100% no-repeat; }
:is(.packs.board.money, .pad-money) .geld.g50, .geld.g50 { background: url("ui/geld-50.webp") center / 100% 100% no-repeat; }
:is(.packs.board.money, .pad-money) .geld.g100, .geld.g100 { background: url("ui/geld-100.webp") center / 100% 100% no-repeat; }
:is(.packs.board.money, .pad-money) .geld.munt.g1 { aspect-ratio: 265 / 276; }
:is(.packs.board.money, .pad-money) .geld.munt.g2 { aspect-ratio: 324 / 330; }
:is(.packs.board.money, .pad-money) .geld.g5 { --mmh: 59.0; }
:is(.packs.board.money, .pad-money) .geld.g10 { --mmh: 57.4; }
:is(.packs.board.money, .pad-money) .geld.g20 { --mmh: 61.6; }
:is(.packs.board.money, .pad-money) .geld.g50 { --mmh: 61.2; }
:is(.packs.board.money, .pad-money) .geld.g100 { --mmh: 65.4; }
.geld.g1, .geld.g2, .geld.g5, .geld.g10, .geld.g20, .geld.g50, .geld.g100 { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; filter: drop-shadow(0 2px 2px rgba(40, 20, 0, .4)); }
.geld.g1 b, .geld.g2 b, .geld.g5 b, .geld.g10 b, .geld.g20 b, .geld.g50 b, .geld.g100 b { visibility: hidden; }
.geld.g1::before, .geld.g2::before, .geld.g5::before, .geld.g10::before, .geld.g20::before, .geld.g50::before, .geld.g100::before,
.geld.g1::after, .geld.g2::after, .geld.g5::after, .geld.g10::after, .geld.g20::after, .geld.g50::after, .geld.g100::after { display: none !important; }
.packs.board.money.ken [data-right] { box-shadow: none !important; filter: drop-shadow(0 0 5px #3fd04c) drop-shadow(0 0 5px #3fd04c); }

/* ---------- painted cent coins ---------- */
:is(.packs.board.money, .pad-money) .geld.cent.c1 { background: url("ui/cent-1.webp") center / 100% 100% no-repeat; aspect-ratio: 256 / 263; }
:is(.packs.board.money, .pad-money) .geld.cent.c2 { background: url("ui/cent-2.webp") center / 100% 100% no-repeat; aspect-ratio: 289 / 299; }
:is(.packs.board.money, .pad-money) .geld.cent.c5 { background: url("ui/cent-5.webp") center / 100% 100% no-repeat; aspect-ratio: 290 / 300; }
:is(.packs.board.money, .pad-money) .geld.cent.c10 { background: url("ui/cent-10.webp") center / 100% 100% no-repeat; aspect-ratio: 292 / 300; }
:is(.packs.board.money, .pad-money) .geld.cent.c20 { background: url("ui/cent-20.webp") center / 100% 100% no-repeat; aspect-ratio: 291 / 300; }
:is(.packs.board.money, .pad-money) .geld.cent.c50 { background: url("ui/cent-50.webp") center / 100% 100% no-repeat; aspect-ratio: 293 / 300; }
.geld.cent { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; filter: drop-shadow(0 2px 2px rgba(40, 20, 0, .4)); }
.geld.cent b { visibility: hidden; } .geld.cent::before, .geld.cent::after { display: none !important; }

/* the notes at the true proportions of euro notes (the painted ones are a little too long: they are pressed together sideways) */
:is(.packs.board.money, .pad-money) .geld.g5 { --mmh: 62; }
:is(.packs.board.money, .pad-money) .geld.g10 { --mmh: 67; }
:is(.packs.board.money, .pad-money) .geld.g20 { --mmh: 72; }
:is(.packs.board.money, .pad-money) .geld.g50 { --mmh: 77; }
:is(.packs.board.money, .pad-money) .geld.g100 { --mmh: 77; }

/* ---------- the painted clock: the picture is the dial, the game only draws the hands on it ----------
   (the dial without numbers is the same clock, used when the help is off) */
.packs.board.clock .dial { background: url("ui/klok.webp") center / 100% 100% no-repeat; filter: drop-shadow(0 5px 5px rgba(0, 0, 0, .3)); overflow: visible; }
.scene.no-help .packs.board.clock .dial { background-image: url("ui/klok-leeg.webp"); }
.packs.board.clock .dial .rim, .packs.board.clock .dial .face, .packs.board.clock .dial .tk, .packs.board.clock .dial .num { display: none; }
.packs.board.clock .dial .hands { transform-box: view-box; transform-origin: 100px 100px; transform: scale(.8); }
.dial .hand.hour { stroke: #c0392b; stroke-width: 10; } .dial .hand.min { stroke: #2b6cb0; stroke-width: 6.5; } .dial .pin { fill: #4a2a10; }
/* the hands stop just before the numbers, so they never cover the number they point at */
.packs.board.clock .dial .hands { transform: scale(.62); }
.dial .hand.hour { stroke-width: 14; } .dial .hand.min { stroke-width: 9; } .dial .pin { r: 8px; }
.packs.board.clock .dial .hands { transform: scale(.55); }
.dial .hand.hour { stroke-width: 16; } .dial .hand.min { stroke-width: 10; } .dial .pin { r: 9px; }

/* ---------- Fred's painted tub: the whole tub behind him, its front wall again in front of him ---------- */
#scr-play.has-art .scene.dry .fred::before, #scr-play.has-art .scene.dry .fred::after { left: -30%; right: -30%; top: 20%; bottom: -43%; }
#scr-play.has-art .scene.dry .fred::before { background-image: url("ui/tobbe.webp"); }
#scr-play.has-art .scene.dry .fred::after { background-image: url("ui/tobbe-voor.webp"); }
#scr-play.has-art .scene.dry .fred::before, #scr-play.has-art .scene.dry .fred::after { top: 30%; bottom: -53%; }

/* ---------- a wall scene (.scene.wall): the clock hangs on the back wall, everyone stands on the floor in front ---------- */
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art .scene.wall .packs { top: 46.5cqh; }
  #scr-play.has-art .scene.wall .dial { width: 34cqh; filter: drop-shadow(0 6px 5px rgba(40, 20, 0, .45)); }
  #scr-play.has-art .scene.wall .actor { top: calc(76cqh - var(--actor)); }
  #scr-play.has-art .scene.wall .fred { bottom: 27.5cqh; right: 24cqw; }
  #scr-play.has-art .scene.wall .fred-say { right: calc(24cqw + 11cqh); bottom: 29cqh; }
}
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) { #scr-play.has-art .scene.wall .fred { bottom: 29.5cqh; } #scr-play.has-art .scene.wall .fred-say { bottom: 31cqh; } }
/* the clock hangs as high as the question sign allows, well clear of the floor */
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art .scene.wall .packs { top: 44.5cqh; }
  #scr-play.has-art .scene.wall .dial { width: 29.5cqh; }
}
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art .scene.wall .packs.board { top: 45.5cqh; }
  #scr-play.has-art .scene.wall .dial { width: 31cqh; }
}
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) { #scr-play.has-art .scene.wall .packs.board { top: 47cqh; } }

/* a wall scene, second pass: the clock hangs high on the wall, as a clock does, and the sign with the question sits
   under it, just above the keypad (it grows upwards when a tip is shown) */
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art .scene.wall .packs.board { top: 24cqh; }
  #scr-play.has-art .scene.wall .dial { width: 39cqh; }
  #scr-play.has-art.wall-art .q-card { align-self: end; margin-top: 0; margin-bottom: calc(1.6% + 2 * clamp(50px, 7.4vh, 70px) + 58px); width: min(46%, 560px); }
  #scr-play.has-art .scene.wall .fred { right: 20.5cqw; }
  #scr-play.has-art .scene.wall .fred-say { right: calc(15cqw - 6cqh); bottom: 42cqh; }
}
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art.wall-art .q-card { top: auto; bottom: calc(var(--edge) + 2 * clamp(50px, 7.4vh, 70px) + 50px); margin: 0; width: min(44cqw, 560px); }
}
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) { #scr-play.has-art .scene.wall .fred-say { right: 19cqw; bottom: 37.5cqh; } }
/* the wall clock a size smaller: on a wide screen the sign under it is taller, and taller still with a tip */
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art .scene.wall .packs.board { top: 21.5cqh; }
  #scr-play.has-art .scene.wall .dial { width: 32cqh; }
}

/* ---------- a very wide screen (ultrawide, a browser window that is low and wide) ----------
   The painting is 16:9. It used to fill the full width, so on such a screen its top and bottom were cut away (the clock,
   the feet of the figures). Now it is cut by 7 % at most; beyond that the stage stays as it is and the same picture, soft,
   fills the sides. The back button and the progress stay on the stage. */
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art {
    --sw: min(max(100cqw, min(100cqh * 16 / 9, 100cqw * 1.12)), 100cqh * 16 / 9 * 1.07);
    --side: max(0px, calc((100cqw - var(--sw)) / 2));
  }
  #scr-play.has-art > .topbar { left: calc(var(--side) + max(16px, env(safe-area-inset-left, 0px))); right: calc(var(--side) + max(16px, env(safe-area-inset-right, 0px))); }
  #scr-play.has-art .scene { box-shadow: 0 0 40px 10px rgba(0, 0, 0, .35); }
  #scr-play.has-art::before { filter: blur(22px) saturate(1.05) brightness(.7); }
}
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  /* the sign under the wall clock: sized from the stage (not from the whole screen), wide enough that a tip stays short */
  #scr-play.has-art.wall-art .q-card { width: min(calc(var(--sw) * .47), 620px); }
}
}

/* ---------- a very wide screen: the map keeps its shape too ----------
   The map is cut by 7 % at most (top and bottom); beyond that it stays as it is, in the middle, and the same picture,
   soft, fills the sides. The buttons and signs stay on the map. */
#scr-map.full-map { --band: max(0px, calc((100cqw - 100cqh * 1.6 * 1.07) / 2));
  --side-l: calc(var(--band) + max(var(--pad), env(safe-area-inset-left, 0px))); --side-r: calc(var(--band) + max(var(--pad), env(safe-area-inset-right, 0px)));
  --pad: clamp(10px, min(1.8cqw, 2.9cqh), 24px); background: #2c2415; }
#scr-map.full-map::before { content: ""; position: absolute; inset: -30px; background: var(--map-img) center / cover no-repeat; filter: blur(22px) saturate(1.05) brightness(.7); }
#scr-map.full-map .map-art { left: var(--band); right: var(--band); box-shadow: 0 0 40px 10px rgba(0, 0, 0, .35);
  --side-l: max(var(--pad), env(safe-area-inset-left, 0px)); --side-r: max(var(--pad), env(safe-area-inset-right, 0px)); }
#scr-map.full-map .gate { width: min(600px, calc(100% - 2 * var(--pad) - 2 * var(--band))); }

/* a low window (or a screen set to 125 % or 150 %): the sign under the wall clock is drawn smaller as a whole, from its
   bottom edge, so it keeps clear of the clock */
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) and (max-height: 720px) { #scr-play.has-art.wall-art .q-card { transform: translateX(-50%) scale(.86); transform-origin: 50% 100%; } }
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) and (max-height: 660px) { #scr-play.has-art.wall-art .q-card { transform: translateX(-50%) scale(.76); } }
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) and (max-height: 600px) { #scr-play.has-art.wall-art .q-card { transform: translateX(-50%) scale(.68); } }

/* ---------- a very wide screen: the bridge-choice screen, the sticker book and the story book ----------
   Their buttons stay with the middle part (as on the map), and on the bridge-choice screen the sides of the painting
   go soft and dark, like the bands next to the map and the play stage. */
#scr-chapter, #scr-badges, #scr-book { --band: max(0px, calc((100cqw - 100cqh * 16 / 9 * 1.07) / 2)); }
#scr-chapter > .topbar, #scr-badges > .topbar, #scr-book > .topbar {
  left: calc(var(--band) + max(clamp(10px, min(1.8cqw, 2.9cqh), 24px), env(safe-area-inset-left, 0px))); right: calc(var(--band) + max(clamp(10px, min(1.8cqw, 2.9cqh), 24px), env(safe-area-inset-right, 0px))); }
#scr-chapter::before, #scr-chapter::after { content: ""; position: absolute; top: 0; bottom: 0; width: var(--band); z-index: 1; pointer-events: none;
  -webkit-backdrop-filter: blur(22px) saturate(1.05) brightness(.7); backdrop-filter: blur(22px) saturate(1.05) brightness(.7); }
#scr-chapter::before { left: 0; box-shadow: 14px 0 30px -6px rgba(0, 0, 0, .4); }
#scr-chapter::after { right: 0; box-shadow: -14px 0 30px -6px rgba(0, 0, 0, .4); }
#scr-chapter::before, #scr-chapter::after { box-shadow: none; }
/* (the soft sides hang on the top bar: measured inside the screen, where the screen's own size is known) */
#scr-chapter::before, #scr-chapter::after { display: none; }
#scr-chapter > .topbar { --L: calc(var(--band) + max(clamp(10px, min(1.8cqw, 2.9cqh), 24px), env(safe-area-inset-left, 0px))); --R: calc(var(--band) + max(clamp(10px, min(1.8cqw, 2.9cqh), 24px), env(safe-area-inset-right, 0px))); }
#scr-chapter > .topbar::before, #scr-chapter > .topbar::after { content: ""; position: absolute; top: calc(-1 * var(--top)); height: 100cqh; width: var(--band); pointer-events: none;
  -webkit-backdrop-filter: blur(22px) saturate(1.05) brightness(.7); backdrop-filter: blur(22px) saturate(1.05) brightness(.7); }
#scr-chapter > .topbar::before { left: calc(-1 * var(--L)); }
#scr-chapter > .topbar::after { right: calc(-1 * var(--R)); }
/* (container units measure the screen without its padding, so that is added back) */
#scr-chapter > .topbar { --H: calc(100cqh + var(--top) + var(--btn) + 28px); --band: max(0px, calc((100cqw + 32px - var(--H) * 16 / 9 * 1.07) / 2)); }
#scr-chapter > .topbar::before, #scr-chapter > .topbar::after { height: var(--H); }
#scr-badges > .topbar { --band: max(0px, calc((100cqw + 32px - (100cqh + var(--top) + var(--btn) + 36px) * 16 / 9 * 1.07) / 2)); }
#scr-book > .topbar { --band: max(0px, calc((100cqw + 32px - (100cqh + var(--top) + var(--btn) + 26px) * 16 / 9 * 1.07) / 2)); }
#scr-chapter > .topbar::before, #scr-chapter > .topbar::after { height: calc(var(--H) + 16px); }
/* the map gets its side bands at the same screen shape as every other screen (16:9 plus 7 %), not earlier */
#scr-map.full-map { --band: max(0px, calc((100cqw - 100cqh * 16 / 9 * 1.07) / 2)); }
/* the soft sides only exist on a screen wide enough to have them; on any other screen they are not there at all (they
   reached a few pixels below the screen, which gave the bridge-choice screen a scroll bar) */
#scr-chapter > .topbar::before, #scr-chapter > .topbar::after { display: none; }
@media (min-aspect-ratio: 19/10) and (min-height: 480px) {
  #scr-chapter > .topbar::before, #scr-chapter > .topbar::after { display: block; }
  #scr-chapter { overflow: hidden; }
}
/* the sign's inner margin follows the stage, not the whole screen (percentages count from the full screen width, so on
   a maximised ultrawide window the sign grew much taller than in a window of the same stage size) */
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art .q-card { padding: max(10px, calc(var(--sw) * .022)) max(24px, calc(var(--sw) * .05)) max(12px, calc(var(--sw) * .024)) !important; }
}

/* ---------- paying and giving change: the till (or the wallet) lies where the number keys were ---------- */
.pad-money { display: none; }
#pad.lay:not(.tap) .pad-money { display: flex; grid-column: 1 / -1; grid-row: 1 / span 3; align-items: stretch; --u: .5px; --c: 2.2; }
#pad.lay button[data-k]:not(.del):not(.go) { display: none; }
.pad-money .beurs { flex: 1; align-content: center; }
.pad-money .geld { cursor: pointer; }

#pad.lay button[data-k]:not(.del):not(.go), #pad.lay.tap button[data-k] { opacity: 1; }
/* one tap is the answer (which coin is it, yes or no): no keys at all */
.pad-card:has(#pad.lay.tap) { visibility: hidden; }
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art #pad.lay:not(.tap) .pad-money { grid-area: 1 / 1 / 3 / 6; --u: .112cqh; --c: 2.5; }
  #scr-play.has-art .pad-money .beurs { border-radius: 1.6cqh; gap: .6cqh 1.3cqh; padding: .3cqh 1cqh .8cqh; box-shadow: inset 0 3px 6px rgba(0, 0, 0, .3); }
  #scr-play.has-art .pad-money .beurs small { font-size: 1.7cqh; margin-bottom: -.4cqh; }
  /* the counter: what has been put down, now alone on the table */
  #scr-play.has-art .packs.board.money.lay { --u: .135cqh; --c: 2.4; top: 51cqh; }

  /* the shop: the customer stands behind the counter, next to the sign; Fred's tub moves to the other side */
  #scr-play.has-art.shop-art .q-card { left: calc(50% - var(--sw) * .5 + var(--sw) * .235); transform: none; width: calc(var(--sw) * .37); }
  #scr-play.has-art.shop-art .scene.dry .actor.friend { --actor: clamp(110px, 37cqh, 290px); left: calc(50cqw + var(--sw) * .195); top: calc(47.5cqh - var(--actor)); clip-path: inset(0 0 6.5cqh 0); z-index: 1; }
  #scr-play.has-art.shop-art .scene.dry .fred { right: auto; left: calc(50cqw - var(--sw) * .285); }
  #scr-play.has-art.shop-art .scene.dry .fred-say { right: auto; left: calc(50cqw - var(--sw) * .46); bottom: 62cqh; max-width: 18cqw; }
}
/* in the shop the child is the shopkeeper: only the customer is on the screen */
#scr-play.shop-art #actorBram { display: none; }
.pad-money .geld { flex: none; }

/* paying and giving change: no "wis" and no check button either. A tap on a piece on the counter takes it back, and the
   game looks as soon as the amount is there. */
#pad.lay button[data-k] { display: none; }
.kassa-scherm { display: none; }

@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  /* the keypad board is gone here: a till with a little screen and an open drawer, or an open wallet, lies in its place
     (drawn with code until the painted ones are there) */
  #scr-play.has-art .pad-card:has(#pad.lay:not(.tap)) { background: none !important; padding: 0 !important; width: calc(var(--sw) * .5); filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .4)); }
  #scr-play.has-art #pad.lay:not(.tap) { display: block; }
  #scr-play.has-art #pad.lay:not(.tap) .pad-money { display: flex; flex-direction: column; align-items: center; --u: .125cqh; --c: 2.5; }
  #scr-play.has-art .kassa-scherm { display: block; min-width: 13cqh; margin-bottom: -.4cqh; padding: .3cqh 2cqh .7cqh; border-radius: 1.4cqh 1.4cqh 0 0; border: .5cqh solid #3c4350; border-bottom: 0;
    background: #1d2a22; color: #8dffa0; font-family: var(--font-display); font-weight: 700; font-size: 2.8cqh; text-align: center; letter-spacing: .08em; text-shadow: 0 0 6px rgba(120, 255, 150, .7); }
  #scr-play.has-art .pad-money .beurs { flex: none; width: 100%; box-sizing: border-box; min-height: 15.5cqh; padding: .6cqh 1.6cqh 1.4cqh; gap: .8cqh 1.6cqh; }
  #scr-play.has-art .pad-money .beurs.kassa { border: .5cqh solid #3c4350; border-radius: 1.8cqh; background: linear-gradient(#aab2bd, #c9cfd8 12%, #dfe3e9); box-shadow: inset 0 .8cqh 1cqh rgba(0, 0, 0, .35), 0 .8cqh 0 #3c4350; }
  #scr-play.has-art .pad-money .beurs.portefeuille { border: .5cqh solid #4a2a10; border-radius: 2.4cqh; background: linear-gradient(#8a5226, #a86a36 14%, #b97a44); box-shadow: inset 0 .8cqh 1cqh rgba(0, 0, 0, .35), inset 0 0 0 .35cqh rgba(255, 220, 160, .25), 0 .8cqh 0 #4a2a10; }
}

/* the check button is part of the till (and of the wallet); "wis" is not needed: tap a piece on the counter to take it back */
.geld-ok { flex: none; width: 54px; height: 44px; margin-left: 8px; border: 0; border-radius: 12px; background: var(--leaf, #4caf50); box-shadow: 0 4px 0 var(--leaf-dark, #2e7d32); cursor: pointer; }
.geld-ok:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--leaf-dark, #2e7d32); }
.geld-ok svg { width: 60%; height: 60%; fill: none; stroke: #fff; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }

@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art .pad-card:has(#pad.lay:not(.tap)) { width: calc(var(--sw) * .56); }
  #scr-play.has-art .pad-money .beurs { flex-wrap: nowrap; }
  #scr-play.has-art .pad-money .beurs small { position: absolute; top: .5cqh; left: 0; right: 0; flex-basis: auto; }
  #scr-play.has-art .pad-money .beurs { padding-top: 3cqh; }
  #scr-play.has-art .geld-ok { width: 12cqh; height: 9cqh; margin-left: 2cqh; border-radius: 2cqh; border: .5cqh solid #1f5d14;
    background: linear-gradient(#8fe86a, #3fae2a); box-shadow: inset 0 .5cqh 0 rgba(255, 255, 255, .45), 0 .7cqh 0 #1f5d14; }
  #scr-play.has-art .geld-ok:active { transform: translateY(.5cqh); box-shadow: inset 0 .5cqh 0 rgba(255, 255, 255, .45), 0 .2cqh 0 #1f5d14; }
}
#pad.lay button.geld-ok[data-k] { display: block; opacity: 1; pointer-events: auto; }

/* ---------- the shop: a painted till instead of the wooden keypad ----------
   Left its open tray (the money you can take lies there), right its own keys with the check mark. The keys are painted;
   the game's buttons lie over them, invisible. When the child pays, a wallet lies there instead (see below). */
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art.shop-art .pad-card, #scr-play.has-art.shop-art .pad-card:has(#pad.lay:not(.tap)) { background: url("ui/kassa.webp") center / 100% 100% no-repeat !important; padding: 0 !important;
    width: calc(var(--sw) * .74); aspect-ratio: 1600 / 521; bottom: calc(var(--sh) * .012); filter: drop-shadow(0 8px 8px rgba(0, 0, 0, .45)); visibility: visible; }
  #scr-play.has-art.shop-art .pad, #scr-play.has-art.shop-art #pad.lay:not(.tap) { display: block; position: absolute; inset: 0; }
  #scr-play.has-art.shop-art .pad button[data-k]:not(.geld-ok) { display: block; position: absolute; margin: 0; padding: 0; background: none !important; box-shadow: none !important; border: 0 !important; border-radius: 22%;
    color: transparent; font-size: 0; opacity: 1; height: auto; text-shadow: none; }
  #scr-play.has-art.shop-art .pad button[data-k]:not(.geld-ok) svg { display: none; }
  #scr-play.has-art.shop-art .pad button[data-k]:not(.geld-ok):active { background: rgba(255, 255, 255, .35) !important; transform: none; filter: none; }
  #scr-play.has-art.shop-art .pad button[data-k="7"] { left: 75.09%; top: 25.6%; width: 6.9%; height: 10.9%; }
  #scr-play.has-art.shop-art .pad button[data-k="8"] { left: 81.74%; top: 25.6%; width: 6.9%; height: 10.9%; }
  #scr-play.has-art.shop-art .pad button[data-k="9"] { left: 88.48%; top: 25.6%; width: 6.9%; height: 10.9%; }
  #scr-play.has-art.shop-art .pad button[data-k="4"] { left: 75.47%; top: 36.5%; width: 6.9%; height: 10.8%; }
  #scr-play.has-art.shop-art .pad button[data-k="5"] { left: 82.12%; top: 36.5%; width: 6.9%; height: 10.8%; }
  #scr-play.has-art.shop-art .pad button[data-k="6"] { left: 88.86%; top: 36.5%; width: 6.9%; height: 10.8%; }
  #scr-play.has-art.shop-art .pad button[data-k="1"] { left: 75.81%; top: 47.3%; width: 6.9%; height: 12.0%; }
  #scr-play.has-art.shop-art .pad button[data-k="2"] { left: 82.50%; top: 47.3%; width: 6.9%; height: 12.0%; }
  #scr-play.has-art.shop-art .pad button[data-k="3"] { left: 89.29%; top: 47.3%; width: 6.9%; height: 12.0%; }
  #scr-play.has-art.shop-art .pad button[data-k="del"] { left: 76.00%; top: 59.3%; width: 6.9%; height: 14.2%; }
  #scr-play.has-art.shop-art .pad button[data-k="0"] { left: 82.93%; top: 59.3%; width: 6.9%; height: 14.2%; }
  #scr-play.has-art.shop-art .pad button[data-k="ok"] { left: 89.62%; top: 59.3%; width: 6.9%; height: 14.2%; }
  /* nothing to type while money is tapped: the number keys are painted but do nothing; "back" takes the last piece back */
  #scr-play.has-art.shop-art #pad.lay button[data-k]:not(.del):not(.go):not(.geld-ok) { pointer-events: none; }
  #scr-play.has-art.shop-art #pad.lay.tap button[data-k] { pointer-events: none; }
  /* the tray */
  #scr-play.has-art.shop-art #pad.lay:not(.tap) .pad-money { position: absolute; left: 5.6%; top: 28.5%; width: 64.2%; height: 46%; display: flex; flex-direction: row; align-items: center; justify-content: center; --u: calc(var(--sw) * .00078); --c: 2.4; }
  #scr-play.has-art.shop-art .pad-money .beurs.kassa { flex: 1; min-height: 0; height: 100%; background: none; border: 0; box-shadow: none; padding: 0; gap: 0 calc(var(--sw) * .012); flex-wrap: nowrap; }
  #scr-play.has-art.shop-art .pad-money .beurs.kassa small, #scr-play.has-art.shop-art .kassa-scherm, #scr-play.has-art.shop-art .beurs.kassa .geld-ok { display: none !important; }
  /* the wallet (until the painted one is there): drawn with code, in the place of the till, with its own check button */
  #scr-play.has-art.shop-art .pad-card:has(#pad.lay[data-from="portefeuille"]:not(.tap)) { background: none !important; aspect-ratio: auto; width: calc(var(--sw) * .6); bottom: var(--edge); }
  #scr-play.has-art.shop-art #pad.lay[data-from="portefeuille"]:not(.tap) { position: static; }
  #scr-play.has-art.shop-art #pad.lay[data-from="portefeuille"] button[data-k]:not(.geld-ok) { display: none; }
  #scr-play.has-art.shop-art #pad.lay[data-from="portefeuille"]:not(.tap) .pad-money { position: static; width: auto; height: auto; --u: .125cqh; --c: 2.5; }
  /* what lies on the counter sits a little higher, clear of the till */
  #scr-play.has-art.shop-art .packs.board.money.lay { top: 46cqh; }
}
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  /* six pieces fit in the tray */
  #scr-play.has-art.shop-art #pad.lay:not(.tap) .pad-money { --u: calc(var(--sw) * .0006); }
  #scr-play.has-art.shop-art .pad-money .beurs.kassa { gap: 0 calc(var(--sw) * .009); }
  /* everything on the counter sits above the till, and one tap games (which coin, yes or no) can be tapped through it */
  #scr-play.has-art.shop-art .packs.board.money { top: 46cqh; }
  #scr-play.has-art.shop-art .packs.board.money.lay { --u: .112cqh; --c: 2.4; width: 56cqw; max-width: 56cqw; }
  #scr-play.has-art.shop-art .pad-card:has(#pad.lay.tap), #scr-play.has-art.shop-art .pad-card:has(#pad.lay.tap) * { pointer-events: none !important; }
  #scr-play.has-art.shop-art .pad-card:has(#pad.lay.tap) { opacity: .0; }
  #scr-play.has-art.shop-art #pad.lay[data-from="portefeuille"] .geld-ok { display: block; }
}
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  /* no till on screen in the one tap games, so their money lies in the middle of the counter, clear of the customer */
  #scr-play.has-art.shop-art .packs.board.money.ken, #scr-play.has-art.shop-art .packs.board.money.genoeg { top: 55cqh; }
  #scr-play.has-art.shop-art #pad.lay[data-from="portefeuille"] .geld-ok { width: 11cqh; height: 8cqh; }
}

/* ---------- the till, second painting: its own measurements ---------- */
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art.shop-art .pad-card, #scr-play.has-art.shop-art .pad-card:has(#pad.lay:not(.tap)) { width: calc(var(--sw) * .7); height: calc(var(--sw) * .7 * 532 / 1700); aspect-ratio: auto; box-sizing: border-box; border: 0 !important; min-height: 0; }
  #scr-play.has-art.shop-art .pad button[data-k="7"]:not(.geld-ok) { left: 75.65%; top: 26.00%; width: 6.04%; height: 10.70%; }
  #scr-play.has-art.shop-art .pad button[data-k="8"]:not(.geld-ok) { left: 82.11%; top: 26.00%; width: 6.09%; height: 10.70%; }
  #scr-play.has-art.shop-art .pad button[data-k="9"]:not(.geld-ok) { left: 88.62%; top: 26.00%; width: 6.13%; height: 10.70%; }
  #scr-play.has-art.shop-art .pad button[data-k="4"]:not(.geld-ok) { left: 75.84%; top: 37.00%; width: 6.13%; height: 11.00%; }
  #scr-play.has-art.shop-art .pad button[data-k="5"]:not(.geld-ok) { left: 82.39%; top: 37.00%; width: 6.23%; height: 11.00%; }
  #scr-play.has-art.shop-art .pad button[data-k="6"]:not(.geld-ok) { left: 88.99%; top: 37.00%; width: 6.32%; height: 11.00%; }
  #scr-play.has-art.shop-art .pad button[data-k="1"]:not(.geld-ok) { left: 76.02%; top: 48.44%; width: 6.27%; height: 11.59%; }
  #scr-play.has-art.shop-art .pad button[data-k="2"]:not(.geld-ok) { left: 82.71%; top: 48.44%; width: 6.32%; height: 11.59%; }
  #scr-play.has-art.shop-art .pad button[data-k="3"]:not(.geld-ok) { left: 89.45%; top: 48.44%; width: 6.41%; height: 11.59%; }
  #scr-play.has-art.shop-art .pad button[data-k="del"]:not(.geld-ok) { left: 76.12%; top: 60.92%; width: 6.60%; height: 12.93%; }
  #scr-play.has-art.shop-art .pad button[data-k="0"]:not(.geld-ok) { left: 82.99%; top: 60.92%; width: 6.46%; height: 12.48%; }
  #scr-play.has-art.shop-art .pad button[data-k="ok"]:not(.geld-ok) { left: 89.87%; top: 61.52%; width: 6.69%; height: 12.33%; }
  #scr-play.has-art.shop-art #pad.lay:not(.tap) .pad-money { left: 5.99%; top: 29.14%; width: 63.82%; height: 44.85%; --u: calc(var(--sw) * .00058); }
  /* coins stay round and notes keep their shape, whatever the tray does */
  #scr-play.has-art.shop-art .pad-money .geld { flex: 0 0 auto !important; align-self: center; min-width: 0; padding: 0; }
  #scr-play.has-art.shop-art .pad-card:has(#pad.lay[data-from="portefeuille"]:not(.tap)) { height: auto; }
}
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art.shop-art .pad-money .geld { height: auto !important; }
  #scr-play.has-art.shop-art .pad-money .geld.brief { height: calc(var(--mmh) * var(--u)) !important; }
}
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  /* the till a size smaller, as in the design: about a third of the screen high */
  #scr-play.has-art.shop-art .pad-card, #scr-play.has-art.shop-art .pad-card:has(#pad.lay:not(.tap)) { width: calc(var(--sw) * .64); height: calc(var(--sw) * .64 * 532 / 1700); }
  #scr-play.has-art.shop-art #pad.lay:not(.tap) .pad-money { --u: calc(var(--sw) * .00053); }
  #scr-play.has-art.shop-art .pad-card:has(#pad.lay[data-from="portefeuille"]:not(.tap)) { height: auto; width: calc(var(--sw) * .6); }
  #scr-play.has-art.shop-art .packs.board.money { top: 47.5cqh; }
  #scr-play.has-art.shop-art .packs.board.money.ken, #scr-play.has-art.shop-art .packs.board.money.genoeg { top: 55cqh; }
}

/* ---------- the painted wallet: when the child pays, it lies where the till stands otherwise ---------- */
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art.shop-art .pad-card:has(#pad.lay[data-from="portefeuille"]:not(.tap)) { background: url("ui/portefeuille.webp") center / 100% 100% no-repeat !important;
    width: calc(var(--sw) * .64); height: calc(var(--sw) * .64 * 469 / 1700); bottom: calc(var(--sh) * .02); }
  #scr-play.has-art.shop-art #pad.lay[data-from="portefeuille"]:not(.tap) { position: absolute; inset: 0; display: block; }
  #scr-play.has-art.shop-art #pad.lay[data-from="portefeuille"] button[data-k]:not(.geld-ok) { display: none; }
  #scr-play.has-art.shop-art #pad.lay[data-from="portefeuille"] button[data-k="ok"]:not(.geld-ok) { display: block; left: 74.30%; top: 58.26%; width: 17.84%; height: 24.04%; border-radius: 30%; }
  #scr-play.has-art.shop-art #pad.lay[data-from="portefeuille"] .geld-ok { display: none; }
  #scr-play.has-art.shop-art #pad.lay[data-from="portefeuille"]:not(.tap) .pad-money { position: absolute; left: 4.85%; top: 15.13%; width: 63.95%; height: 67.55%; --u: calc(var(--sw) * .00053); --c: 2.4; }
  #scr-play.has-art.shop-art .pad-money .beurs.portefeuille { flex: 1; min-height: 0; height: 100%; background: none; border: 0; box-shadow: none; padding: 0; gap: 0 calc(var(--sw) * .009); flex-wrap: nowrap; }
  #scr-play.has-art.shop-art .pad-money .beurs.portefeuille small { display: none; }
}

/* ---------- the shop, placed on the painting itself ----------
   Everything that has to sit on something in the picture (the customer behind the counter, the money on it, Fred's tub
   on the floor) is measured from the painting, not from the screen. On a screen that is wider or squarer than 16:9 the
   painting is cut differently, and what was measured from the screen drifted off the table. */
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art.shop-art .q-card { left: calc(50% - var(--sw) * .31); width: calc(var(--sw) * .34); }
  #scr-play.has-art.shop-art .scene.dry .actor.friend { --actor: calc(var(--sh) * .37); left: 62%; top: calc(47.5% - var(--actor)); clip-path: inset(0 0 calc(var(--sh) * .065) 0); }
  #scr-play.has-art.shop-art .scene.dry .fred { right: auto; left: 15%; bottom: 40.5%; }
  #scr-play.has-art.shop-art .scene.dry .fred-say { right: auto; left: 3.5%; bottom: 50%; max-width: 15%; }
  #scr-play.has-art.shop-art .packs.board.money { top: 48%; --u: calc(var(--sh) * .00135); }
  #scr-play.has-art.shop-art .packs.board.money.lay { --u: calc(var(--sh) * .00112); width: calc(var(--sw) * .5); max-width: calc(var(--sw) * .5); }
  #scr-play.has-art.shop-art .packs.board.money.ken { top: 52%; --u: calc(var(--sh) * .00118); width: calc(var(--sw) * .44); max-width: calc(var(--sw) * .44); }
  #scr-play.has-art.shop-art .packs.board.money.genoeg { top: 52%; }
}
/* a wide or low window cuts the top off the painting, so the sign reaches further down: draw it a size smaller there */
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) and (min-aspect-ratio: 185/100) { #scr-play.has-art.shop-art .q-card { transform: scale(.84); transform-origin: 0 0; } }
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) and (max-height: 700px) { #scr-play.has-art.shop-art .q-card { transform: scale(.8); transform-origin: 0 0; } }
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  /* getting to know the money: a little higher and a touch smaller, so the two rows lie in the middle of the table top
     with the same margin behind and in front */
  #scr-play.has-art.shop-art .packs.board.money.ken { top: 50.6%; --u: calc(var(--sh) * .0011); gap: calc(var(--sh) * .012) calc(var(--sh) * .02); }
  #scr-play.has-art.shop-art .packs.board.money.ken .beurs { gap: calc(var(--sh) * .014) calc(var(--sh) * .022); padding: 0; }
  #scr-play.has-art.shop-art .packs.board.money.genoeg { top: 50.6%; }
}
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art.shop-art .packs.board.money.ken, #scr-play.has-art.shop-art .packs.board.money.genoeg { top: 51.4%; }
}

/* ---------- the counter in the shop: two rows that both fit on the table top ----------
   Above: what the customer gives (price and note, or the piece to exchange), in one line. Under it: the box for what
   you put down. The table is narrower at the back, so the whole thing is no wider than its back edge. */
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art.shop-art .packs.board.money.lay { top: 51.2%; --u: calc(var(--sh) * .00098); --c: 2.4; width: calc(var(--sw) * .42); max-width: calc(var(--sw) * .42); }
  #scr-play.has-art.shop-art .toonbank { flex-direction: column; align-items: stretch; gap: calc(var(--sh) * .008); }
  #scr-play.has-art.shop-art .bon { justify-content: center; align-items: center; gap: calc(var(--sh) * .03); }
  #scr-play.has-art.shop-art .bon .plus { display: none; }
  #scr-play.has-art.shop-art .bon .prijs { flex-direction: row; gap: calc(var(--sh) * .012); }
  #scr-play.has-art.shop-art .bon .prijs small { font-size: calc(var(--sh) * .021); white-space: nowrap; }
  #scr-play.has-art.shop-art .bon .prijs small::after { content: ":"; }
  #scr-play.has-art.shop-art .packs.lay .kaartje { padding: calc(var(--sh) * .006) calc(var(--sh) * .016) calc(var(--sh) * .006) calc(var(--sh) * .012); }
  #scr-play.has-art.shop-art .packs.lay .kaartje b { font-size: calc(var(--sh) * .034); }
  #scr-play.has-art.shop-art .packs.lay .kaartje i { height: calc(var(--sh) * .044); width: calc(var(--sh) * .017); }
  #scr-play.has-art.shop-art .gelegd { flex: none; min-width: 0; min-height: calc(var(--sh) * .1); padding: calc(var(--sh) * .004) calc(var(--sh) * .012) calc(var(--sh) * .008); gap: 0; }
  #scr-play.has-art.shop-art .gelegd small { font-size: calc(var(--sh) * .019); }
  #scr-play.has-art.shop-art .gelegd em { font-size: calc(var(--sh) * .024); }
  #scr-play.has-art.shop-art .gelegd .stapel { flex-wrap: nowrap; gap: 0 calc(var(--sh) * .008); }
}
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  /* the money is the same size in the tray (or the wallet) and on the counter: as large as six pieces in the tray allow */
  #scr-play.has-art.shop-art #pad.lay:not(.tap) .pad-money, #scr-play.has-art.shop-art #pad.lay[data-from="portefeuille"]:not(.tap) .pad-money { --u: calc(var(--sw) * .00057); --c: 2.4; }
  #scr-play.has-art.shop-art .pad-money .beurs.kassa, #scr-play.has-art.shop-art .pad-money .beurs.portefeuille { gap: 0 calc(var(--sw) * .005); }
  #scr-play.has-art.shop-art .packs.board.money.lay { --u: calc(var(--sw) * .00057); --c: 2.4; width: calc(var(--sw) * .43); max-width: calc(var(--sw) * .43); }
}

@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  /* money in the tray or the wallet: as large as the number of pieces allows (--fit comes from the game) */
  #scr-play.has-art.shop-art #pad.lay:not(.tap) .pad-money, #scr-play.has-art.shop-art #pad.lay[data-from="portefeuille"]:not(.tap) .pad-money { --u: calc(var(--sw) * var(--fit, .00057)); --c: 2.4; }
  #scr-play.has-art.shop-art .pad-money .beurs.kassa, #scr-play.has-art.shop-art .pad-money .beurs.portefeuille { gap: 0 calc(var(--sw) * .009); }
}
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  /* "do I have enough?": lower on the table, so the labels above the money and the price tag stay clear of the customer */
  #scr-play.has-art.shop-art .packs.board.money.genoeg { top: 54.2%; --u: calc(var(--sh) * .00122); gap: calc(var(--sh) * .012); }
  #scr-play.has-art.shop-art .packs.genoeg .prijs { gap: calc(var(--sh) * .008); }
  #scr-play.has-art.shop-art .packs.genoeg .prijs small { font-size: calc(var(--sh) * .022); position: relative; z-index: 2; }
  #scr-play.has-art.shop-art .packs.genoeg .kaartje b { font-size: calc(var(--sh) * .046); }
  #scr-play.has-art.shop-art .packs.genoeg .janee button { font-size: calc(var(--sh) * .03); padding: calc(var(--sh) * .01) calc(var(--sh) * .026); }
}
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  /* "do I have enough?": the two answer buttons sit under the counter, where the till stands otherwise; only the money
     and the price tag lie on the table */
  #scr-play.has-art.shop-art .packs.board.money.genoeg { top: 52.6%; }
  #scr-play.has-art.shop-art .packs.genoeg .janee { position: absolute; left: 50%; top: calc(50% + var(--sh) * .245); transform: translateX(-50%); gap: calc(var(--sh) * .04); width: max-content; }
  #scr-play.has-art.shop-art .packs.genoeg .janee button { font-size: calc(var(--sh) * .046); padding: calc(var(--sh) * .022) calc(var(--sh) * .05); border-radius: calc(var(--sh) * .03); border-width: calc(var(--sh) * .006);
    box-shadow: 0 calc(var(--sh) * .008) 0 rgba(0, 0, 0, .35), 0 calc(var(--sh) * .018) calc(var(--sh) * .02) rgba(0, 0, 0, .35); }
}
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  /* a wall scene: Fred's speech bubble goes up and to the right of him, clear of the sign with the question */
  #scr-play.has-art .scene.wall .fred-say { left: auto; right: 7cqw; bottom: 56cqh; max-width: 21cqw; z-index: 7; }
}
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) { #scr-play.has-art .scene.wall .fred-say { right: 12cqw; bottom: 58cqh; max-width: 22cqw; } }
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) and (max-aspect-ratio: 3/2) { #scr-play.has-art .scene.wall .fred-say { bottom: 64cqh; } }

/* the customer behind the counter: only the bottom is cut off (by the table); head and sides may stick out of the box */
#scr-play.has-art.shop-art .scene.dry .actor.friend { clip-path: inset(-60% -60% calc(var(--sh) * .065) -60%); }

/* ---------- market day: its own placing ----------
   The stall is another painting than the shop: posts left and right of the table, an awning above it, and the table top a
   little higher. The sign hangs between the posts, the customer stands between sign and right post, Fred's tub on the cobbles. */
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art.shop-art:has(.scene[data-art="marktdag"]) .q-card { left: calc(50% - var(--sw) * .285); }
  #scr-play.has-art.shop-art .scene.dry[data-art="marktdag"] .actor.friend { --actor: calc(var(--sh) * .35); left: 64%; top: calc(46% - var(--actor)); }
  #scr-play.has-art.shop-art .scene.dry[data-art="marktdag"] .fred { left: 4.5%; bottom: 36%; }
  #scr-play.has-art.shop-art .scene.dry[data-art="marktdag"] .fred-say { left: 1.5%; bottom: 46%; max-width: 14%; }
  #scr-play.has-art.shop-art:has(.scene[data-art="marktdag"]) .packs.board.money { margin-top: calc(var(--sh) * -.009); }
}

/* "in your head" on a have-I-enough sum: the note sits at the back of the table, the two cards in front of it */
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art.shop-art:has(.packs.genoeg) .scene.no-help .mist-note { top: 39.8%; font-size: calc(var(--sh) * .021); padding: calc(var(--sh) * .006) calc(var(--sh) * .018); }
  #scr-play.has-art.shop-art:has(.scene.no-help) .packs.board.money.genoeg { top: 55.5%; }
}

/* ---------- the sea worlds (9, 10, 11): a drawing on the table, made in forms.js ---------- */
.bridge-btn.signs-zee .mini-bridge { display: none; }
#scr-chapter .bridge-btn.orders.signs-zee .bb-planks i { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Ccircle cx='20' cy='20' r='17' fill='%23d9482f' stroke='%234a2a10' stroke-width='3'/%3E%3Ccircle cx='20' cy='20' r='9' fill='%23fff8e6' stroke='%234a2a10' stroke-width='2'/%3E%3Cpath d='M20 3v8M20 29v8M3 20h8M29 20h8' stroke='%23fff8e6' stroke-width='5'/%3E%3C/svg%3E") !important; aspect-ratio: 1; width: 17% !important; }
.packs.board.fig svg.fig { background: #fff8e6; border: 3px solid #6a4020; box-shadow: 0 5px 0 rgba(74, 42, 16, .35), 0 10px 16px rgba(0, 0, 0, .25); }
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art .scene.dry .packs.board.fig { max-width: 60cqw; gap: 1.6cqh; }
  #scr-play.has-art .scene.dry .packs.board.fig svg.fig { width: min(38cqw, 68cqh); border-radius: 2.4cqh; }
  #scr-play.has-art .scene.dry .packs.board.fig.kiezen svg.fig { width: min(32cqw, 56cqh); }
  #scr-play.has-art .keuze { gap: 2.4cqh; }
  #scr-play.has-art .keuze button { font-size: 3.6cqh; padding: 1.2cqh 3.4cqh; border-radius: 2.4cqh; border-width: .5cqh; }
}
/* the album pages of the sea (until the sea has its own paintings: the market quay, Mona's harbour and the crab beach) */
#scr-badges .album-page[data-sec="w9"] { --page: url("scenes/marktdag.webp"); --sec: #2e86c1; --sec2: #d6ecfa; }
#scr-badges .album-page[data-sec="w10"] { --page: url("scenes/monashaven.webp"); --sec: #1b4f72; --sec2: #d4e6f1; }
#scr-badges .album-page[data-sec="w11"] { --page: url("scenes/krabbenstrand.webp"); --sec: #239b56; --sec2: #d5f5e3; }
/* the shipyard: sawing on a wide ruler, and the pieces to lay under the drawing */
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art .scene.dry .packs.board.fig.fig-zaag svg.fig { width: min(44cqw, 106cqh); translate: 0 var(--zaagy, 0cqh); }
  #scr-play.has-art .scene.dry[data-art="meetlat"] { --zaagy: -1.5cqh; }
  /* Fred's tub stands clear of the bench, so the parked saw does not touch it */
  #scr-play.has-art .scene.dry:has(.fig-zaag) .fred { right: 16.5cqw; }
  #scr-play.has-art .scene.dry .packs.board.fig.fig-leg svg.fig { width: min(31cqw, 55cqh); }
  #scr-play.has-art .rek { gap: 1.6cqh; }
  #scr-play.has-art .rek button { font-size: 3.2cqh; padding: 1.1cqh 2cqh; min-width: 8.5cqh; border-width: .5cqh; border-radius: 1.6cqh; }
  #scr-play.has-art .rek-mast .st100 { min-width: 22cqh; } #scr-play.has-art .rek-mast .st50 { min-width: 13cqh; }
}
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) { #scr-play.has-art .rek-ruim button { min-width: 11cqh; } }

/* the bay: Gust is a whale, he lies in the water right of the stone, not on the rocks */
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art .scene.dry:is([data-art="baai"], [data-art="gerrit"], [data-art="eersteplank"]) .actor.friend { --actor: calc(var(--sh) * .3); left: 84%; top: calc(62% - var(--actor)); }
  /* Fred's tub floats in the bay, behind Gust */
  #scr-play.has-art .scene.dry:is([data-art="baai"], [data-art="gerrit"], [data-art="eersteplank"]) .fred { left: 92.5%; bottom: 29%; }
  #scr-play.has-art .scene.dry:is([data-art="baai"], [data-art="gerrit"], [data-art="eersteplank"]) .fred-say { left: 84.3%; right: auto; bottom: 10%; width: 15.2%; max-width: 15.2%; }
}
/* in the bay Gust and Fred's tub lie IN the water: the bottom is under the surface, with a ripple where they go under */
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art .scene.dry:is([data-art="baai"], [data-art="gerrit"], [data-art="eersteplank"]) .actor.friend { top: calc(66% - var(--actor)); clip-path: polygon(-60% -60%, 160% -60%, 160% 84%, 104% 85.9%, 102% 85.3%, 100% 84.5%, 98% 83.7%, 96% 83.1%, 94% 82.9%, 92% 83.1%, 90% 83.6%, 88% 84.3%, 86% 85.1%, 84% 85.7%, 82% 86.1%, 80% 86.0%, 78% 85.6%, 76% 84.9%, 74% 84.1%, 72% 83.4%, 70% 83.0%, 68% 82.9%, 66% 83.3%, 64% 83.9%, 62% 84.7%, 60% 85.4%, 58% 85.9%, 56% 86.1%, 54% 85.9%, 52% 85.3%, 50% 84.5%, 48% 83.7%, 46% 83.1%, 44% 82.9%, 42% 83.1%, 40% 83.6%, 38% 84.3%, 36% 85.1%, 34% 85.7%, 32% 86.1%, 30% 86.0%, 28% 85.6%, 26% 84.9%, 24% 84.1%, 22% 83.4%, 20% 83.0%, 18% 82.9%, 16% 83.3%, 14% 83.9%, 12% 84.7%, 10% 85.4%, 8% 85.9%, 6% 86.1%, 4% 85.9%, 2% 85.3%, 0% 84.5%, -2% 83.7%, -4% 83.1%, -60% 84%); }
  #scr-play.has-art .scene.dry:is([data-art="baai"], [data-art="gerrit"], [data-art="eersteplank"]) .fred { clip-path: inset(-60% -60% -16% -60%); }
  #scr-play.has-art .scene.dry:is([data-art="baai"], [data-art="gerrit"], [data-art="eersteplank"]) .actor.friend::after { content: ""; position: absolute; left: 8%; right: 2%; bottom: 9.5%; height: 12%; border-radius: 50%; pointer-events: none;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, .95) 0, rgba(215, 243, 255, .8) 40%, rgba(120, 205, 245, .45) 60%, rgba(120, 205, 245, 0) 74%); }
  #scr-play.has-art .scene.dry:is([data-art="baai"], [data-art="gerrit"], [data-art="eersteplank"]) .fred { filter: drop-shadow(0 calc(var(--sh) * .004) 0 rgba(255, 255, 255, .7)); }
}
/* the rocks: Fred's tub stands on the flat rock in front, not on the edge of the slab */
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art .scene.dry[data-art="rotsen"] .fred { left: 90%; bottom: 26%; }
  #scr-play.has-art .scene.dry[data-art="rotsen"] .fred-say { left: 84.3%; right: auto; bottom: 10%; width: 15.2%; max-width: 15.2%; }
}
/* the tide: Bibi stands on the raft that lies in the water right of the slab; Fred's tub floats in the bay */
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art .scene.dry[data-art="tij"] .actor.friend { --actor: calc(var(--sh) * .27); left: 88.5%; top: calc(66% - var(--actor)); }
  #scr-play.has-art .scene.dry[data-art="tij"] .fred { left: 90.5%; bottom: 21%; clip-path: inset(-60% -60% -16% -60%); }
  #scr-play.has-art .scene.dry[data-art="tij"] .fred-say { left: 84.3%; right: auto; bottom: 10%; width: 15.2%; max-width: 15.2%; }
}

/* the bay scenes: the slab is a little wider than the tables elsewhere, so Bram stands a step further left, off the slab */
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art .scene.dry:is([data-art="baai"], [data-art="rotsen"], [data-art="gerrit"], [data-art="tij"], [data-art="eersteplank"]) #actorBram { left: 9%; }
}

/* the hiccup wave on the painted pictures: a long swell over the sea behind the sign, so it shows left and right of it */
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art .scene.dry .hikgolf { top: 19%; height: 20%; background-size: 62% 100%; }
}
/* sawing and laying pieces: a small board with only "wis" and the green key */
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art #pad.rekpad { grid-template-columns: 1fr 1fr; grid-template-areas: "del ok"; width: auto; }
  #scr-play.has-art .pad-card:has(#pad.rekpad) { width: min(36cqw, 440px); }
}
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art #pad.rekpad.zaagpad { grid-template-columns: 1fr; grid-template-areas: "ok"; }
  #scr-play.has-art .pad-card:has(#pad.zaagpad) { width: min(21cqw, 260px); }
}
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art #pad.zaagpad button[data-k="ok"] { font-size: 3.4cqh; }
  #scr-play.has-art .pad-card:has(#pad.zaagpad) { width: min(27cqw, 330px); }
}

/* the saw button: a painted key showing the saw going through a plank, and the same key with a tick once the plank is cut */
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art .pad-card:has(#pad.zaagpad) { background: none !important; padding: 0 !important; width: min(27cqw, 58cqh); bottom: var(--edge); }
  #scr-play.has-art .pad-card:has(#pad.zaagpad)::before, #scr-play.has-art .pad-card:has(#pad.zaagpad)::after { display: none; }
  #scr-play.has-art #pad.zaagpad { width: 100%; }
  #scr-play.has-art #pad.zaagpad button[data-k="ok"] { background: url("ui/zaagknop.webp") center / 100% 100% no-repeat !important; aspect-ratio: 1000 / 320; width: 100%; height: auto; min-height: 0;
    border: 0; box-shadow: none; border-radius: 999px; padding: 0; font-size: 0; color: transparent; text-shadow: none; filter: drop-shadow(0 .6cqh .5cqh rgba(60, 30, 5, .45)); }
  #scr-play.has-art #pad.zaagpad.zaagklaar button[data-k="ok"] { background-image: url("ui/zaagknop-klaar.webp") !important; }
  #scr-play.has-art #pad.zaagpad button[data-k="ok"]:active { translate: 0 .4cqh; filter: brightness(.94); }
}
/* the Boat that grows: a painted picture in the top right corner, under the progress blocks */
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art .bouw { width: clamp(120px, min(13vw, 23vh), 230px); top: calc(24px + max(12px, env(safe-area-inset-top, 0px))); padding: .6cqh; border-radius: 1.6cqh; background: rgba(255, 250, 235, .9); border: .35cqh solid rgba(74, 42, 16, .6); box-shadow: 0 .5cqh .6cqh rgba(60, 30, 5, .3); }
}

/* painted figures lie on the table itself, without a card; the pieces to lay are little planks too */
.packs.board.fig svg.fig.geschilderd { background: none; border: 0; box-shadow: none; }
@media (orientation: landscape) and (min-width: 860px) and (min-height: 560px) {
  #scr-play.has-art .scene.dry .packs.board.fig.fig-leg svg.fig.geschilderd { width: min(44cqw, 100cqh); }
  #scr-play.has-art .rek-mast button { background: url("props/zaagplank.webp") center / 100% 100% no-repeat; border: 0; box-shadow: none; border-radius: 0; color: #3a1f0a; padding: 1.6cqh 2cqh 2.2cqh;
    text-shadow: 0 0 .5cqh #fff8e6, 0 0 .5cqh #fff8e6, 0 0 .3cqh #fff8e6; filter: drop-shadow(0 .5cqh .3cqh rgba(60, 30, 5, .4)); }
  #scr-play.has-art .rek-mast button:active { transform: translateY(.3cqh); filter: none; }
}
