/* Themes a child can relate to (Oli, 6 Dec 2026: "we can add themes that align with the bot types, on the details of the
   boxes we can add a branch or some grass etc make the themes something that a child could relate to in their
   curriculum: space"; then "match the bots and a mix of other fun childrens subjects").
   Five bot worlds (Jungle, Safari, Forest, Mountains, Volcano) and five subjects (Space, Under the sea, Dinosaurs, Snow
   and ice, Candy). Each sets every colour token (text 4.5:1 or more on its boxes and buttons, checked 6 Dec 2026), a page
   background, and one small drawing on every box: a vine, grass, a branch, peaks, lava, a planet, waves, a fern, snow,
   icing. The drawings sit behind the box's content (z-index -1 inside an isolated box), so they never cover a word or a
   button; pop-ups attach to the page, not to a box, so they are not affected. Drawn in code, so they stay sharp at any
   size. Picked under Preferences, Theme. */

:root[data-theme="jungle"] { --bg: #0e2a1b; --surface: #164029; --ink: #f1fbef; --muted: #b8d9bc; --line: #2c6b46; --accent: #ffcc33; --accent-ink: #1f2a0e; --accent-soft: #2c5233; --accent-edge: #b88a00; --sun: #ffcc33; --berry: #ff7a6b; --sel: rgba(255, 204, 51, .55); --edge: #071a10; color-scheme: dark; }
:root[data-theme="safari"] { --bg: #f6e5bf; --surface: #fff8e6; --ink: #3b2a12; --muted: #6e5734; --line: #e0c48a; --accent: #a04c15; --accent-ink: #ffffff; --accent-soft: #f8dcb5; --accent-edge: #6e330c; --sun: #e8a33a; --berry: #b03a2e; --sel: rgba(160, 76, 21, .5); --edge: #d9b877; color-scheme: light; }
:root[data-theme="forest"] { --accent-edge: #2f8a5a; --sun: #f2c14e; --berry: #ff7a6b; --edge: #0a140f; }
:root[data-theme="mountains"] { --bg: #1b2a3f; --surface: #24385a; --ink: #eef4ff; --muted: #b4c4dc; --line: #3e5a85; --accent: #5bb8ff; --accent-ink: #062036; --accent-soft: #26476e; --accent-edge: #2a7cc0; --sun: #ffd166; --berry: #ff8a7a; --sel: rgba(91, 184, 255, .5); --edge: #101b2b; color-scheme: dark; }
:root[data-theme="volcano"] { --bg: #1f0f0c; --surface: #301712; --ink: #fff2ea; --muted: #e3bba9; --line: #5e2c1f; --accent: #ff6a2b; --accent-ink: #2a0a00; --accent-soft: #4d2316; --accent-edge: #b23d0f; --sun: #ffb02e; --berry: #ff8a7a; --sel: rgba(255, 106, 43, .5); --edge: #120806; color-scheme: dark; }
:root[data-theme="space"] { --bg: #0b0d26; --surface: #171b45; --ink: #f3f4ff; --muted: #b6baea; --line: #2f3678; --accent: #2fd3c6; --accent-ink: #04201d; --accent-soft: #173f4a; --accent-edge: #18958a; --sun: #ffd166; --berry: #ff8a7a; --sel: rgba(47, 211, 198, .5); --edge: #05061a; color-scheme: dark; }
:root[data-theme="ocean"] { --accent-edge: #1f6f9e; --sun: #ffd166; --berry: #ff8a7a; --edge: #08121c; }
:root[data-theme="dinosaurs"] { --bg: #1d2414; --surface: #2a3420; --ink: #f4f6e8; --muted: #c6cdaa; --line: #4b5b33; --accent: #f28b30; --accent-ink: #241405; --accent-soft: #4a3a1e; --accent-edge: #b45f14; --sun: #ffd166; --berry: #ff8a7a; --sel: rgba(242, 139, 48, .5); --edge: #10150a; color-scheme: dark; }
:root[data-theme="arctic"] { --bg: #e6f2fb; --surface: #eef6fd; --ink: #12324a; --muted: #4f6a82; --line: #c3dcee; --accent: #1b6fac; --accent-ink: #ffffff; --accent-soft: #d4e9f7; --accent-edge: #134f7c; --sun: #f2b84b; --berry: #b03a2e; --sel: rgba(27, 111, 172, .45); --edge: #bcd6ea; color-scheme: light; }
:root[data-theme="candy"] { --accent-edge: #7a3479; --sun: #f2b84b; --berry: #b03a2e; --edge: #e8c6e6; }

/* Page backgrounds: the page is at least the screen's height, so a gradient never stops partway down */
:root[data-theme] { min-height: 100%; }
:root[data-theme="jungle"] body { background: radial-gradient(130% 800px at 50% 0%, #1f5534 0%, #0e2a1b 60%, #08180f 100%) no-repeat, #08180f; }
:root[data-theme="safari"] body { background: radial-gradient(circle at 88% 90px, #ffd27a 0 64px, #ffd27a00 66px) no-repeat, linear-gradient(#fbe9c2, #f2d79f) no-repeat, #f2d79f; }
:root[data-theme="forest"] body { background: radial-gradient(130% 800px at 50% 0%, #22392d 0%, #13201a 60%, #0b140f 100%) no-repeat, #0b140f; }
:root[data-theme="mountains"] body { background: linear-gradient(#2c4369, #1b2a3f 520px) no-repeat, #1b2a3f; }
:root[data-theme="volcano"] body { background: radial-gradient(120% 600px at 50% 100%, #6a210c 0%, #1f0f0c 70%) fixed, #1f0f0c; }
:root[data-theme="space"] body { background:
  radial-gradient(1.6px 1.6px at 22px 34px, #fff 50%, #fff0 52%), radial-gradient(1.2px 1.2px at 84px 128px, #cfd4ff 50%, #fff0 52%),
  radial-gradient(1.8px 1.8px at 152px 62px, #fff 50%, #fff0 52%), radial-gradient(1.1px 1.1px at 206px 176px, #fff 50%, #fff0 52%),
  radial-gradient(1.3px 1.3px at 118px 206px, #ffe7a8 50%, #fff0 52%), #0b0d26;
  background-size: 240px 230px; }
:root[data-theme="space"] body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 380px at 85% 10%, #3b2a8a66, #0000), radial-gradient(50% 320px at 10% 80%, #12507a55, #0000); }
:root[data-theme="ocean"] body { background: linear-gradient(#174067, #0f1e2e 560px) no-repeat, #0f1e2e; }
:root[data-theme="dinosaurs"] body { background: radial-gradient(130% 800px at 50% 0%, #34421f 0%, #1d2414 60%, #12170c 100%) no-repeat, #12170c; }
:root[data-theme="arctic"] body { background: linear-gradient(#f4f9fe, #dcecf8 600px) no-repeat, #dcecf8; }
:root[data-theme="candy"] body { background: radial-gradient(#f2c4ec 2px, #0000 2.6px) 0 0 / 28px 28px, #fbf0fa; }

/* Boxes: chunky, like the bots' worlds; the drawing goes behind the content */
:root:is([data-theme="jungle"], [data-theme="safari"], [data-theme="forest"], [data-theme="mountains"], [data-theme="volcano"], [data-theme="space"], [data-theme="ocean"], [data-theme="dinosaurs"], [data-theme="arctic"], [data-theme="candy"]) :is(.card, .tile, .bot-tile) {
  position: relative; isolation: isolate; border-width: 3px; box-shadow: 0 5px 0 var(--edge); }
:root:is([data-theme="jungle"], [data-theme="safari"], [data-theme="forest"], [data-theme="mountains"], [data-theme="volcano"], [data-theme="space"], [data-theme="ocean"], [data-theme="dinosaurs"], [data-theme="arctic"], [data-theme="candy"]) :is(.card, .tile, .bot-tile)::before,
:root:is([data-theme="jungle"], [data-theme="safari"], [data-theme="forest"], [data-theme="mountains"], [data-theme="volcano"], [data-theme="space"], [data-theme="ocean"], [data-theme="dinosaurs"], [data-theme="arctic"], [data-theme="candy"]) :is(.card, .tile, .bot-tile)::after {
  position: absolute; z-index: -1; pointer-events: none; background-repeat: no-repeat; }

/* Jungle: a vine hanging over the top left */
:root[data-theme="jungle"] :is(.card, .tile, .bot-tile)::before { content: ''; top: -8px; left: 12px; width: 64px; height: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 30'%3E%3Cpath d='M2 4 C14 10 22 0 34 6 S54 4 62 8' fill='none' stroke='%23386b2a' stroke-width='3' stroke-linecap='round'/%3E%3Cpath d='M14 7 q-4 10 2 16 q4-8 -2-16z' fill='%2350a83c'/%3E%3Cpath d='M32 6 q6 9 0 18 q-6-9 0-18z' fill='%2366c24a'/%3E%3Cpath d='M50 6 q5 7 1 14 q-6-6 -1-14z' fill='%2350a83c'/%3E%3C/svg%3E"); }
/* Safari: long grass along the bottom */
:root[data-theme="safari"] :is(.card, .tile, .bot-tile)::after { content: ''; left: 10px; right: 10px; bottom: 0; height: 10px; opacity: .75; background-repeat: repeat-x; background-size: 30px 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 14'%3E%3Cg fill='none' stroke-linecap='round' stroke-width='2'%3E%3Cpath d='M4 14 q1-7 -2-12' stroke='%23a3a23a'/%3E%3Cpath d='M7 14 q0-8 3-13' stroke='%23c9b44c'/%3E%3Cpath d='M10 14 q1-5 5-8' stroke='%238f9a32'/%3E%3Cpath d='M24 14 q-1-6 -4-10' stroke='%23c9b44c'/%3E%3Cpath d='M27 14 q1-8 0-13' stroke='%23a3a23a'/%3E%3Cpath d='M30 14 q2-5 6-7' stroke='%23c9b44c'/%3E%3C/g%3E%3C/svg%3E"); }
/* Forest: a branch lying across the top right */
:root[data-theme="forest"] :is(.card, .tile, .bot-tile)::before { content: ''; top: -10px; right: 10px; width: 84px; height: 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 84 26'%3E%3Cpath d='M2 10 C24 6 46 12 82 6' fill='none' stroke='%236b4a2b' stroke-width='4' stroke-linecap='round'/%3E%3Cpath d='M42 10 l9 -7' stroke='%236b4a2b' stroke-width='2.5' stroke-linecap='round'/%3E%3Cellipse cx='20' cy='15' rx='6' ry='3.5' transform='rotate(25 20 15)' fill='%235cc28c'/%3E%3Cellipse cx='54' cy='3.5' rx='6' ry='3' transform='rotate(-20 54 3.5)' fill='%237bd6a2'/%3E%3Cellipse cx='66' cy='13' rx='6' ry='3.5' transform='rotate(30 66 13)' fill='%2348a874'/%3E%3Cellipse cx='34' cy='15' rx='5' ry='3' transform='rotate(-25 34 15)' fill='%237bd6a2'/%3E%3C/svg%3E"); }
/* Mountains: snowy peaks along the bottom */
:root[data-theme="mountains"] :is(.card, .tile, .bot-tile)::after { content: ''; left: 0; right: 0; bottom: 0; height: 11px; border-radius: 0 0 14px 14px; background-repeat: repeat-x; background-size: 49px 11px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 18'%3E%3Cpath d='M0 18 L14 6 L22 12 L36 1 L50 13 L60 7 L80 18Z' fill='%232f4a72'/%3E%3Cpath d='M36 1 L31 5 L34 6.2 L37 4.5 L39 6 L40.7 5Z M14 6 L11 8.6 L13 8 L15 9 L16.7 8Z M60 7 L56.7 9 L59 8.6 L61 9.6 L63.6 9Z' fill='%23eef4ff'/%3E%3C/svg%3E"); }
/* Volcano: lava dripping from the top edge */
:root[data-theme="volcano"] :is(.card, .tile, .bot-tile)::before { content: ''; top: 0; left: 14px; right: 14px; height: 14px; background-repeat: repeat-x; background-size: 36px 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 14'%3E%3Cpath d='M0 0 H36 V3 Q31 3 30 6 Q29 12 26 12 Q23 12 23 6 Q22 3 17 3 Q13 3 12 5 Q11 8 9 8 Q7 8 6 5 Q5 3 0 3Z' fill='%23ff6a2b'/%3E%3Ccircle cx='26' cy='12' r='1.6' fill='%23ffb02e'/%3E%3C/svg%3E"); }
/* Space: a ringed planet over the top right */
:root[data-theme="space"] :is(.card, .tile, .bot-tile)::before { content: ''; top: -12px; right: 12px; width: 40px; height: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 28'%3E%3Ccircle cx='20' cy='14' r='9' fill='%23ffb547'/%3E%3Cpath d='M13 10 q7 -2 14 3' stroke='%23e08a1e' stroke-width='2' fill='none'/%3E%3Cellipse cx='20' cy='15' rx='18' ry='4.5' fill='none' stroke='%23c9d0ff' stroke-width='2' transform='rotate(-14 20 15)'/%3E%3Ccircle cx='4' cy='4' r='1.2' fill='%23fff'/%3E%3Ccircle cx='36' cy='25' r='1' fill='%23fff'/%3E%3C/svg%3E"); }
/* Under the sea: waves along the bottom, bubbles rising from the top right */
:root[data-theme="ocean"] :is(.card, .tile, .bot-tile)::after { content: ''; left: 0; right: 0; bottom: 0; height: 10px; border-radius: 0 0 14px 14px; background-repeat: repeat-x; background-size: 32px 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 10'%3E%3Cpath d='M0 6 Q4 2 8 6 T16 6 T24 6 T32 6 V10 H0Z' fill='%233aa0d8' fill-opacity='.45'/%3E%3C/svg%3E"); }
:root[data-theme="ocean"] :is(.card, .tile, .bot-tile)::before { content: ''; top: -16px; right: 14px; width: 20px; height: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 30'%3E%3Cg fill='none' stroke='%239fd6f5' stroke-width='1.5'%3E%3Ccircle cx='6' cy='24' r='4'/%3E%3Ccircle cx='13' cy='13' r='3'/%3E%3Ccircle cx='8' cy='4' r='2'/%3E%3C/g%3E%3C/svg%3E"); }
/* Dinosaurs: a fern over the top left, a footprint in the corner */
:root[data-theme="dinosaurs"] :is(.card, .tile, .bot-tile)::before { content: ''; top: -12px; left: 10px; width: 46px; height: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 46 24'%3E%3Cpath d='M2 22 Q20 18 44 4' fill='none' stroke='%235f8a2e' stroke-width='2.5' stroke-linecap='round'/%3E%3Cg fill='%237fb540'%3E%3Cellipse cx='11' cy='14' rx='5' ry='2' transform='rotate(-70 11 14)'/%3E%3Cellipse cx='15' cy='22' rx='5' ry='2' transform='rotate(20 15 22)'/%3E%3Cellipse cx='20' cy='10' rx='5' ry='2' transform='rotate(-75 20 10)'/%3E%3Cellipse cx='25' cy='18' rx='5' ry='2' transform='rotate(10 25 18)'/%3E%3Cellipse cx='29' cy='6' rx='4.5' ry='2' transform='rotate(-80 29 6)'/%3E%3Cellipse cx='34' cy='13' rx='4.5' ry='2' transform='rotate(0 34 13)'/%3E%3C/g%3E%3C/svg%3E"); }
:root[data-theme="dinosaurs"] :is(.card, .tile, .bot-tile)::after { content: ''; bottom: 6px; right: 8px; width: 22px; height: 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cg fill='%23f28b30' fill-opacity='.45'%3E%3Cellipse cx='11' cy='15' rx='5' ry='5.5'/%3E%3Cellipse cx='4' cy='7' rx='2' ry='4' transform='rotate(-25 4 7)'/%3E%3Cellipse cx='11' cy='4' rx='2' ry='4'/%3E%3Cellipse cx='18' cy='7' rx='2' ry='4' transform='rotate(25 18 7)'/%3E%3C/g%3E%3C/svg%3E"); }
/* Snow and ice: snow lying on the top edge, with icicles */
:root[data-theme="arctic"] :is(.card, .tile, .bot-tile)::before { content: ''; top: -8px; left: 8px; right: 8px; height: 14px; background-repeat: repeat-x; background-size: 48px 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 14'%3E%3Cpath d='M0 7 Q6 0 12 5 Q18 1 24 6 Q30 0 36 5 Q42 1 48 7 V9 Q44 9 43 13 Q41 9 36 9 Q30 9 29 12 Q27 9 20 9 Q12 9 11 13 Q9 9 0 9Z' fill='%23ffffff'/%3E%3Cpath d='M0 7 Q6 0 12 5 Q18 1 24 6 Q30 0 36 5 Q42 1 48 7' fill='none' stroke='%238fb8da' stroke-width='1.4'/%3E%3Cpath d='M43 9 Q41 9 43 13 M11 9 Q9 9 11 13 M29 9 Q27 9 29 12' fill='none' stroke='%238fb8da' stroke-width='1'/%3E%3C/svg%3E"); }
/* Candy: pink icing with sprinkles along the top */
:root[data-theme="candy"] :is(.card, .tile, .bot-tile)::before { content: ''; top: 0; left: 14px; right: 14px; height: 12px; background-repeat: repeat-x; background-size: 40px 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 12'%3E%3Cpath d='M0 0 H40 V3 Q35 3 34 6 Q33 11 30 11 Q27 11 27 6 Q26 3 20 3 Q15 3 14 5 Q13 8 11 8 Q9 8 8 5 Q7 3 0 3Z' fill='%23f48cc8'/%3E%3Crect x='4' y='.8' width='3' height='1.2' rx='.6' fill='%23ffd400'/%3E%3Crect x='18' y='.8' width='3' height='1.2' rx='.6' fill='%233aa0d8' transform='rotate(30 19.5 1.4)'/%3E%3Crect x='31' y='.8' width='3' height='1.2' rx='.6' fill='%235cc28c'/%3E%3C/svg%3E"); }

/* Preferences: the group names above the theme buttons */
.opts .thgroup { flex-basis: 100%; margin: .5rem 0 0; font-weight: 700; color: var(--muted); }
.opts .thgroup:first-child { margin-top: 0; }
