/* ═══ Tool pages follow the Sparkuna look (2026-11-09) ═══
   Loaded by /words, /tools, /measure, /tubes and /shapes together with partials/tool-look.js, which sets
   html[data-look] (+ html.look-dark for Arcade, Ocean and Batik) from localStorage 'sh-theme'.
   These pages do not load base.css / lobby.css (they are no-sign-in tools, mostly shown inside Sim Lab's frame),
   so this file gives them the look's colours and type faces through CSS variables only:
     --ink --muted --line            text and rules of the room (page, panel, chips)
     --room                          the page background
     --card --card-edge --card-shadow --r-card   the side panel / sheets
     --chip --chip-edge --on --on-ink            chips and plain buttons (pressed = --on)
     --pri --pri-ink --pri-edge      the main button of the page
     --eb                            the small eyebrow over a title
     --field --field-off --soft      inputs, disabled inputs, soft info boxes
     --green --red                   right / not yet lines on the room
     --look-text --look-display --look-ui --look-dw   faces (kit face first, the old Google face second)
   Each page writes var(--x, <its old value>), so without this file (or before it loads) a page looks as before.
   html[data-look=…] (0,1,1) outranks the pages' own :root (0,1,0), so the order of the <style> blocks does not matter.

   The work surface stays light. The drawings (beads, blocks, scales, 3D solids, word pictures) are drawn for a light
   ground, as practice-run's question card is. In the dark looks the stage becomes a light board in the room
   (.look-board: own surface + margin) and word cards keep light faces (.look-ink: tokens only). Inside both,
   the variables are reset to the light values, so every rule that reads them draws as it did.
   No moving background layers here (Ocean / Batik animate theirs on lobby pages): the tools keep the CPU for the
   simulation, on iPads and Chromebooks. */

html[data-look] body { background: var(--room); background-attachment: fixed; font-feature-settings: "lnum" 1; }

/* ── Paper (the default look): warm paper, one ink-blue accent, flat ─────────────────────────── */
html[data-look="paper"] {
  --ink: #1d1b18; --muted: #5f594f; --line: #e3ded3;
  --room: #f6f4ef;
  --card: #fffefb; --card-edge: #e3ded3; --card-shadow: none; --r-card: 12px;
  --chip: #fffefb; --chip-edge: transparent; --on: #1f4b8e; --on-ink: #fff;
  --pri: #1f4b8e; --pri-ink: #fff; --pri-edge: #183a6f;
  --eb: #1f4b8e; --field: #fff; --field-off: #f1eee7; --soft: #f1eee7;
  --look-text: 'freight-sans-pro', 'DM Sans', system-ui, sans-serif;
  --look-display: 'freight-text-pro', 'Lora', Georgia, serif;
  --look-ui: 'proxima-nova', 'DM Sans', system-ui, sans-serif;
  --look-dw: 600;
  color-scheme: light;
}
/* ── Pro: calm, clean, indigo ───────────────────────────────────────────────────────────────── */
html[data-look="pro"] {
  --ink: #0f172a; --muted: #475569; --line: #e2e8f0;
  --room: #f4f6fb;
  --card: #fff; --card-edge: #e2e8f0; --card-shadow: 0 1px 2px rgba(15,23,42,.08), 0 8px 24px -16px rgba(15,23,42,.18); --r-card: 14px;
  --chip: #fff; --chip-edge: #e2e8f0; --on: #4338ca; --on-ink: #fff;
  --pri: #4338ca; --pri-ink: #fff; --pri-edge: #3730a3;
  --eb: #4338ca; --field: #fff; --field-off: #f1f5f9; --soft: #f1f5f9;
  --look-text: 'proxima-nova', 'DM Sans', system-ui, sans-serif;
  --look-display: 'proxima-nova', 'DM Sans', system-ui, sans-serif;
  --look-ui: 'proxima-nova', 'DM Sans', system-ui, sans-serif;
  --look-dw: 700;
  color-scheme: light;
}
/* ── Bloom: cream, lilac and blush, violet buttons ──────────────────────────────────────────── */
html[data-look="bloom"] {
  --ink: #211143; --muted: #574c7a; --line: #eadff8;
  --room: radial-gradient(700px 420px at 8% -6%, #e9defd 0%, transparent 62%), radial-gradient(640px 420px at 96% 4%, #ffd9e8 0%, transparent 62%),
          radial-gradient(620px 460px at 4% 98%, #d4f5e4 0%, transparent 60%), radial-gradient(640px 460px at 100% 100%, #ffe3cf 0%, transparent 60%), #fff8fb;
  --card: #fff; --card-edge: #eadff8; --card-shadow: 0 14px 34px -18px rgba(119,87,250,.4); --r-card: 22px;
  --chip: #fff; --chip-edge: #d9c9f3; --on: #7757fa; --on-ink: #fff;
  --pri: linear-gradient(180deg, #8d70ff, #7757fa); --pri-ink: #fff; --pri-edge: #5232c9;
  --eb: #d63c86; --field: #fff; --field-off: #f6f0ff; --soft: #f9f1ff;
  --look-text: 'sofia-pro-soft', 'DM Sans', system-ui, sans-serif;
  --look-display: 'sofia-pro-soft', 'Comfortaa', 'DM Sans', sans-serif;
  --look-ui: 'sofia-pro-soft', 'Comfortaa', 'DM Sans', sans-serif;
  --look-dw: 700;
  color-scheme: light;
}
/* ── Kopi (2026-11-17): a coffee-garden morning, latte cream, roasted-coffee buttons, cherry red ─── */
html[data-look="kopi"] {
  --ink: #2b1a12; --muted: #6b4f41; --line: #ecdcc8;
  --room: radial-gradient(560px 300px at 84% 0%, rgba(255,214,150,.42), transparent 70%), radial-gradient(640px 420px at 4% 100%, rgba(169,193,147,.28), transparent 62%),
          linear-gradient(180deg, #fae6cf 0%, #f8eee2 45%, #f1eadc 100%);
  --card: #fffaf3; --card-edge: #ecdcc8; --card-shadow: 0 14px 32px -20px rgba(90,52,32,.38); --r-card: 20px;
  --chip: #fffaf3; --chip-edge: #dcc3a6; --on: #7a4a2a; --on-ink: #fff;
  --pri: linear-gradient(180deg, #8d5a36, #6f4127); --pri-ink: #fff; --pri-edge: #4a2a17;
  --eb: #a8401e; --field: #fffdf9; --field-off: #f7ede1; --soft: #fbf1e4;
  --look-text: 'museo-sans-rounded', 'Nunito', 'DM Sans', system-ui, sans-serif;
  --look-display: 'decoy', 'Young Serif', Georgia, serif;
  --look-ui: 'museo-sans-rounded', 'Nunito', 'DM Sans', sans-serif;
  --look-dw: 500;
  color-scheme: light;
}
/* ── Arcade: the dark game look, violet + cyan, gold main button ────────────────────────────── */
html[data-look="arcade"] {
  --ink: #f1ecff; --muted: #b9b2dd; --line: rgba(255,255,255,.13);
  --room: radial-gradient(900px 500px at 12% -8%, rgba(108,92,231,.38), transparent 60%), radial-gradient(800px 480px at 95% 8%, rgba(8,145,178,.30), transparent 60%),
          radial-gradient(700px 500px at 50% 110%, rgba(245,179,1,.10), transparent 60%), #0f0b24;
  --card: linear-gradient(160deg, rgba(255,255,255,.09), rgba(255,255,255,.03)); --card-edge: rgba(255,255,255,.12);
  --card-shadow: 0 18px 40px -26px rgba(0,0,0,.8), inset 0 1px 0 rgba(255,255,255,.08); --r-card: 20px;
  --chip: rgba(255,255,255,.07); --chip-edge: rgba(0,0,0,.35); --on: #8b7cff; --on-ink: #fff;
  --pri: linear-gradient(180deg, #ffd54a, #f5a30b); --pri-ink: #3b2600; --pri-edge: #b45309;
  --eb: #22d3ee; --field: rgba(255,255,255,.08); --field-off: rgba(255,255,255,.03); --soft: rgba(255,255,255,.06);
  --green: #34d399; --red: #fb7185;
  --b-bg: linear-gradient(170deg, #ffffff 0%, #f4f1ff 100%); --b-ring: 0 0 0 5px rgba(139,124,255,.2), 0 28px 60px -24px rgba(0,0,0,.9);
  --look-text: 'futura-pt', 'DM Sans', system-ui, sans-serif;
  --look-display: 'futura-pt-bold', 'Outfit', 'DM Sans', sans-serif;
  --look-ui: 'futura-pt', 'Outfit', 'DM Sans', sans-serif;
  --look-dw: 700;
  color-scheme: dark;
}
/* ── Ocean: deep sea, aqua sea-glass buttons, coral + gold accents ──────────────────────────── */
html[data-look="ocean"] {
  --ink: #e8fbff; --muted: #a9d2de; --line: rgba(140,235,255,.18);
  --room: radial-gradient(900px 420px at 30% -10%, rgba(94,240,226,.22), transparent 62%), radial-gradient(700px 460px at 100% 100%, rgba(255,126,182,.12), transparent 60%),
          linear-gradient(180deg, #0a3a5c 0%, #062a46 48%, #03182c 100%);
  --card: linear-gradient(160deg, rgba(18,82,122,.84), rgba(7,38,66,.86)); --card-edge: rgba(140,235,255,.2);
  --card-shadow: 0 18px 40px -24px rgba(0,0,0,.8), inset 0 1px 0 rgba(140,235,255,.12); --r-card: 20px;
  --chip: rgba(140,235,255,.08); --chip-edge: rgba(0,0,0,.35); --on: #3ee6d8; --on-ink: #03263a;
  --pri: linear-gradient(180deg, #5ef0e2, #14b8b0); --pri-ink: #032a33; --pri-edge: #0b7f8a;
  --eb: #5ef0e2; --field: rgba(140,235,255,.08); --field-off: rgba(140,235,255,.03); --soft: rgba(140,235,255,.07);
  --green: #5eead4; --red: #ff9ab8;
  --b-bg: linear-gradient(170deg, #ffffff 0%, #eefaff 100%); --b-ring: 0 0 0 5px rgba(62,230,216,.2), 0 28px 60px -24px rgba(0,0,0,.9);
  --look-text: 'filson-pro', 'DM Sans', system-ui, sans-serif;
  --look-display: 'filson-soft', 'Fredoka', 'Outfit', 'DM Sans', sans-serif;
  --look-ui: 'filson-pro', 'Fredoka', 'DM Sans', sans-serif;
  --look-dw: 700;
  color-scheme: dark;
}
/* ── Batik: warm Indonesian dusk, gold buttons, rose accents ────────────────────────────────── */
html[data-look="batik"] {
  --ink: #fff3e6; --muted: #e5bfa8; --line: rgba(255,190,130,.2);
  --room: radial-gradient(640px 320px at 82% -4%, rgba(255,150,70,.32), transparent 66%), radial-gradient(700px 460px at 0% 100%, rgba(255,111,145,.14), transparent 62%),
          linear-gradient(180deg, #4a1a35 0%, #2e0f27 52%, #1f0a1c 100%);
  --card: linear-gradient(160deg, rgba(92,28,50,.86), rgba(46,12,36,.9)); --card-edge: rgba(255,190,130,.22);
  --card-shadow: 0 18px 40px -24px rgba(0,0,0,.8), inset 0 1px 0 rgba(255,200,150,.12); --r-card: 20px;
  --chip: rgba(255,200,150,.08); --chip-edge: rgba(0,0,0,.35); --on: #ffb347; --on-ink: #3a1400;
  --pri: linear-gradient(180deg, #ffc46b, #f08a24); --pri-ink: #3a1400; --pri-edge: #a2550f;
  --eb: #ffc46b; --field: rgba(255,200,150,.08); --field-off: rgba(255,200,150,.03); --soft: rgba(255,200,150,.07);
  --green: #6ee7b7; --red: #ff9aa8;
  --b-bg: linear-gradient(170deg, #fffdf8 0%, #fff4e2 100%); --b-ring: 0 0 0 5px rgba(255,179,71,.22), 0 28px 60px -24px rgba(0,0,0,.9);
  --look-text: 'effra', 'DM Sans', system-ui, sans-serif;
  --look-display: 'gelica', 'Baloo 2', 'Outfit', 'DM Sans', sans-serif;
  --look-ui: 'effra', 'Baloo 2', 'DM Sans', sans-serif;
  --look-dw: 600;
  color-scheme: dark;
}

/* ── the light work surface in the dark looks ──────────────────────────────────────────────── */
html.look-dark :is(.look-board, .look-ink) {
  --ink: #13284d; --muted: #52607a; --line: #dfe5f1;
  --chip: #fff; --chip-edge: #d5dcec; --on: #13284d; --on-ink: #fff;
  --field: #fff; --field-off: #f1f5f9; --soft: #f6f9ff;
  --green: #059669; --red: #be123c;
  color: var(--ink); color-scheme: light;
}
html.look-dark .look-board { background: var(--b-bg); border-radius: 20px; box-shadow: var(--b-ring); margin: 10px; }
/* the eyebrow on the board keeps the look's hue, darkened enough for a light ground */
html[data-look="arcade"] .look-board { --eb: #6c5ce7; }
html[data-look="ocean"] .look-board { --eb: #0b7f8a; }
html[data-look="batik"] .look-board { --eb: #c2410c; }
@media (max-width: 720px), (max-height: 380px) and (max-width: 900px) {
  html.look-dark .look-board { margin: 8px 8px 10px; border-radius: 16px; }
}

/* ── the Sparkuna strip (tool-look.js adds it when the page has its own tab, never inside a frame) ────────
   html.look-bar is set before the first paint: flowing pages (/words, /tubes) take body padding, the full-screen
   apps (.look-app = .mt-app / .ms-app / .ss-app, position: fixed; inset: 0) start under it. */
html.look-bar { --tl-bar: 46px; }
@media (max-height: 520px) { html.look-bar { --tl-bar: 38px; } }
html.look-bar body { padding-top: var(--tl-bar); }
html.look-bar .look-app { top: var(--tl-bar); }
.look-strip { position: fixed; left: 0; right: 0; top: 0; z-index: 60; height: var(--tl-bar, 46px); display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  background: var(--bar-bg, #fff); border-bottom: 1px solid var(--bar-edge, #dfe5f1); font-family: var(--look-ui, 'DM Sans'), system-ui, sans-serif; }
.look-strip a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink, #13284d); font-weight: 700; border-radius: 999px; }
.look-strip a:focus-visible { outline: 3px solid var(--on, #0ea5e9); outline-offset: 2px; }
.look-strip .ls-home { font-family: var(--look-display, 'Outfit'), sans-serif; font-weight: var(--look-dw, 800); font-size: 1.05rem; padding: 4px 6px 4px 2px; }
.look-strip .ls-home img { width: 26px; height: 26px; display: block; }
.look-strip .ls-back { font-size: .86rem; padding: 0 14px; min-height: 34px; background: var(--chip, #fff); border: 1px solid var(--line, #dfe5f1); }
.look-strip .ls-back:hover { border-color: var(--on, #13284d); }
@media (max-height: 520px) { .look-strip .ls-home img { width: 22px; height: 22px; } .look-strip .ls-home { font-size: .95rem; } .look-strip .ls-back { min-height: 30px; } }
@media print { .look-strip { display: none; } html.look-bar body { padding-top: 0; } }
html[data-look="paper"]  { --bar-bg: #fffefb; --bar-edge: #e3ded3; }
html[data-look="pro"]    { --bar-bg: #ffffff; --bar-edge: #e2e8f0; }
html[data-look="bloom"]  { --bar-bg: rgba(255,248,251,.96); --bar-edge: #eadff8; }
html[data-look="kopi"]   { --bar-bg: #fff9f0; --bar-edge: #ecdcc8; }
html[data-look="arcade"] { --bar-bg: #15102f; --bar-edge: rgba(255,255,255,.11); }
html[data-look="ocean"]  { --bar-bg: #072a45; --bar-edge: rgba(140,235,255,.16); }
html[data-look="batik"]  { --bar-bg: #3a1430; --bar-edge: rgba(255,190,130,.18); }

/* framed by /tool: see-through, so the tool stands on the lobby page's look (and its Ocean / Batik scenery) */
html.look-in-tool[data-look], html.look-in-tool[data-look] body { background: transparent; }

/* focus rings and text selection follow the look */
html[data-look] ::selection { background: color-mix(in srgb, var(--on) 30%, transparent); }
