/* Cocoon focus scene (study with me). Converted from design/scene-a.html; all rules live under #focus. */
#focus { --wall: #e9edf7; --wall2: #dfe4f3; --text: #3b4470; --muted: #7a82a8; --faint: #aab0cc;
  --primary: #5f6fae; --gold: #d8b46a; --peach: #e7a98f; --lav: #b9b0e6;
  --sky1: #b7cbea; --sky2: #f4ecf0;
  --mount: #bcc2e2; --hA1: #c3d6b6; --hA2: #aac4a0; --hB1: #a9c69c; --hB2: #8fb187; --hC1: #93b789; --hC2: #779d72;
  --tree: #6f9572; --tree2: #9cbf92; --house: #f8f3e8; --cloud-top: #ffffff; --cloud-bot: #d6daf0;
  --curtain: #f7efe2; --curtain-fold: rgba(170, 150, 120, .25); --patch: rgba(255, 236, 200, .42);
  --frame: #f2e8d5; --sill: #e9dcc2; --glow: rgba(255, 214, 150, .0);
  --card: rgba(255, 255, 255, .55); --ring-bg: rgba(95, 111, 174, .14); }
#focus.rainy { --sky1: #c2cbe2; --sky2: #e8e9f3; --cloud-top: #eff1f8; --cloud-bot: #bcc3dd; }
#focus[data-time="night"] { --wall: #353a68; --wall2: #2c3060; --text: #eef0fb; --muted: #b9bde0; --faint: #7c82b5;
  --primary: #f5b8a6; --sky1: #151a44; --sky2: #3a3f74;
  --mount: #2e3467; --hA1: #2b3a62; --hA2: #25335a; --hB1: #233256; --hB2: #1e2b4c; --hC1: #1c2947; --hC2: #17223d;
  --tree: #16223f; --tree2: #24365c; --house: #3d4573; --cloud-top: #4b5189; --cloud-bot: #2b2f5e;
  --curtain: #565b94; --curtain-fold: rgba(20, 22, 60, .35); --patch: rgba(200, 210, 255, .10);
  --frame: #4a4f82; --sill: #565c92; --glow: rgba(255, 200, 140, .22);
  --card: rgba(255, 255, 255, .08); --ring-bg: rgba(255, 255, 255, .12); }
#focus { position: fixed; inset: 0; overflow: hidden; color: var(--text);
  background: radial-gradient(60vw 60vh at 8% 0%, var(--glow), transparent 70%), linear-gradient(var(--wall), var(--wall2));
  transition: background 1.2s, color 1.2s; }
#focus * { transition: background-color 1.2s, border-color 1.2s, fill 1.2s, stroke 1.2s, color 1.2s; }
#focus .window svg.land { position: absolute; inset: 0; width: 100%; height: 100%; }
#focus .window canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; transition: opacity 1.5s; }
#focus:not(.rainy) .window canvas { opacity: 0; }
#focus .night-only { opacity: 0; transition: opacity 1.5s; }
#focus[data-time="night"] .night-only { opacity: 1; }
#focus .day-only { transition: opacity 1.5s, visibility 1.5s; }
#focus[data-time="night"] .day-only, #focus.rainy .sunny { opacity: 0; visibility: hidden; }
#focus .sunny { transition: opacity 1.5s, visibility 1.5s; }
#focus .clouds { animation: drift 140s linear infinite alternate; }
@keyframes drift { to { transform: translateX(-70px); } }
#focus.rainy .clouds { filter: brightness(.94); }
#focus .tree { transform-box: fill-box; transform-origin: 50% 100%; animation: wind 7s ease-in-out infinite; }
#focus .grass { transform-box: fill-box; transform-origin: 50% 100%; animation: wind 5s ease-in-out infinite; }
#focus .grass:nth-child(2n) { animation-duration: 6.3s; animation-delay: -1.5s; }
@keyframes wind { 50% { transform: skewX(-4deg); } }
#focus .beams { mix-blend-mode: screen; animation: beam 9s ease-in-out infinite; }
@keyframes beam { 50% { opacity: .55; } }
#focus .houselight { fill: var(--house); }
#focus[data-time="night"] .houselight { fill: #ffd98a; }
#focus .ff { fill: #ffe7a0; animation: ff 4s ease-in-out infinite; }
@keyframes ff { 0%, 100% { opacity: .1; transform: translate(0, 0); } 50% { opacity: 1; transform: translate(6px, -8px); } }
#focus .motes i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: rgba(255, 246, 225, .9); box-shadow: 0 0 6px rgba(255, 240, 200, .9);
  animation: mote 14s ease-in-out infinite; }
@keyframes mote { 0%, 100% { transform: translate(0, 0); opacity: 0; } 20%, 80% { opacity: .9; } 50% { transform: translate(24px, -40px); } }
#focus .grain { position: absolute; inset: 0; pointer-events: none; z-index: 9; opacity: .22; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .45  0 0 0 0 .4  0 0 0 0 .35  0 0 0 .45 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
#focus[data-time="night"] .grain { mix-blend-mode: overlay; opacity: .3; }
#focus::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 9; background: radial-gradient(ellipse at 55% 45%, transparent 55%, rgba(50, 45, 90, .14)); }
#focus .cocoon-g { transform-origin: 150px 62px; animation: sway 6s ease-in-out infinite; }
#focus .cocoon-body { fill: #f3ead6; stroke: #d9c9a6; stroke-width: 1.5; }
#focus .silk { fill: none; stroke: #e2d3b2; stroke-width: 1.6; stroke-linecap: round; }
#focus .caterpillar .seg { fill: #a9c98f; }
#focus .caterpillar .head { fill: #94b97c; }
#focus .caterpillar { transition: opacity 1.5s; }
#focus .caterpillar .seg { transform-box: fill-box; transform-origin: center bottom; animation: inch 1.6s ease-in-out infinite; }
#focus .caterpillar .seg:nth-child(2) { animation-delay: -.2s; }
#focus .caterpillar .seg:nth-child(3) { animation-delay: -.4s; }
#focus .caterpillar .seg:nth-child(4) { animation-delay: -.6s; }
@keyframes inch { 50% { transform: translateY(-2.5px) scaleY(1.15); } }
#focus .shell { opacity: 0; transition: opacity 1s; }
#focus.opened .shell { opacity: 1; }
#focus.opened .cocoon-full { opacity: 0; }
#focus .cocoon-full { transition: opacity 1s; transform-origin: 150px 80px; animation: breathe 4.5s ease-in-out infinite; }
#focus .cocoon-body { transition: filter 1.5s; }
#focus.ripe .cocoon-body { filter: drop-shadow(0 0 7px rgba(216, 180, 106, .85)); }
@keyframes sway { 50% { transform: rotate(3deg); } }
@keyframes breathe { 50% { transform: scale(1.025, 1.015); } }
#focus .steam { fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; opacity: 0; animation: steam 4s ease-in-out infinite; }
@keyframes steam { 0% { opacity: 0; transform: translateY(6px); } 40% { opacity: .6; } 100% { opacity: 0; transform: translateY(-10px); } }
#focus .fly { position: absolute; width: 54px; height: 54px; z-index: 6; pointer-events: none; }
#focus .fly .wl, #focus .fly .wr { transform-box: view-box; transform-origin: 32px 36px; animation: flap .28s ease-in-out infinite alternate; }
#focus .fly.rest .wl, #focus .fly.rest .wr { animation-duration: 1.8s; }
@keyframes flap { to { transform: scaleX(.25); } }
#focus .w-up { fill: var(--lav); }
#focus .w-lo { fill: var(--peach); opacity: .85; }
#focus .w-line { stroke: var(--gold); fill: none; stroke-width: 2; stroke-linecap: round; }
#focus .w-body { fill: var(--text); }
#focus .w-ant { stroke: var(--text); fill: none; stroke-width: 1.6; stroke-linecap: round; }
#focus .panel { position: absolute; left: 6vw; top: 12vh; width: clamp(260px, 30vw, 420px); max-width: 420px; display: flex; flex-direction: column; gap: 3.2vh; z-index: 5; }
#focus .f-brand { display: flex; align-items: center; gap: 10px; color: var(--primary); letter-spacing: .16em; font-weight: 600; font-size: 13px; }
#focus .f-brand svg { width: 26px; height: 26px; }
#focus .goal .label { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
#focus .goal .text { font-size: clamp(22px, 2.6vw, 34px); font-weight: 600; line-height: 1.2; margin-top: 6px; }
#focus .ringwrap { position: relative; width: clamp(180px, 19vw, 260px); aspect-ratio: 1; }
#focus .ringwrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
#focus .ringwrap .bg { stroke: var(--ring-bg); }
#focus .ringwrap .fg { stroke: var(--primary); transition: stroke-dashoffset .3s linear, stroke 1.2s; }
#focus[data-phase="break"] .ringwrap .fg { stroke: var(--gold); }
#focus .ringtext { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
#focus .ringtext .time { font-size: clamp(36px, 4vw, 56px); font-weight: 300; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
#focus .ringtext .phase { font-size: 13px; color: var(--muted); }
#focus .mix { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
#focus .mix b { color: var(--text); font-weight: 500; }
#focus .f-bars { display: inline-flex; gap: 2px; align-items: end; height: 12px; }
#focus .f-bars i { width: 3px; background: var(--primary); border-radius: 2px; animation: bar 1.1s ease-in-out infinite alternate; }
#focus .f-bars i:nth-child(2) { animation-delay: -.4s; }
#focus .f-bars i:nth-child(3) { animation-delay: -.8s; }
@keyframes bar { from { height: 3px; } to { height: 12px; } }
#focus .msg { font-size: 15px; color: var(--muted); min-height: 1.5em; }
#focus .ctrl { display: flex; gap: 8px; margin-top: -1.4vh; }
#focus .ctrl button { font: inherit; font-size: 13px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--faint); background: transparent; color: var(--text); cursor: pointer; }
#focus .ctrl button:hover { border-color: var(--primary); }
#focus .ctrl .f-snd { padding: 0; width: 31px; display: grid; place-items: center; }
#focus .ctrl .f-snd svg { width: 17px; height: 17px; }
#focus .ctrl .f-snd.off { color: var(--muted); border-style: dashed; }
#focus .ringwrap { transition: opacity .6s; }
#focus.paused .ringwrap { opacity: .5; }
#focus.paused .f-bars i { animation-play-state: paused; }
#focus .f-slot path { fill: none; stroke: var(--muted); stroke-width: 2; stroke-dasharray: 3 4; }
#focus .f-slot:not(.done) path { opacity: .6; }
@keyframes bob { 50% { transform: translateY(-7px) rotate(-4deg); } }
#focus .f-donecard b { color: var(--text); font-weight: 600; }
#focus .f-slot.done path { stroke: none; }
#focus .f-slot.done .w-up { fill: var(--lav); }
#focus .f-slot.done .w-lo { fill: var(--peach); }
#focus .f-slot.done .w-body { fill: var(--text); }
#focus .f-slot.done .w-ant { stroke: var(--text); stroke-dasharray: none; }
#focus .f-slot.done .w-line { stroke: var(--gold); stroke-dasharray: none; }
#focus .f-slot:not(.done) .w-up, #focus .f-slot:not(.done) .w-lo { fill: none; }
#focus .ritual { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center;
  background: color-mix(in srgb, var(--wall) 70%, transparent); backdrop-filter: blur(10px); transition: opacity .8s; }
#focus .ritual.hide { opacity: 0; pointer-events: none; }
#focus .card { width: min(460px, 90vw); background: var(--card); border: 1px solid rgba(255, 255, 255, .5); border-radius: 22px; padding: 28px;
  box-shadow: 0 30px 60px -30px rgba(40, 50, 100, .35); display: flex; flex-direction: column; gap: 16px; }
#focus .card h2 { margin: 0; font-weight: 600; font-size: 22px; }
#focus .card p { margin: 0; color: var(--muted); }
#focus .card input { font: inherit; font-size: 17px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--faint); background: rgba(255, 255, 255, .7); color: #3b4470; }
#focus .f-chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
#focus .f-chips span { font-size: 12px; color: var(--muted); width: 70px; }
#focus .f-chip { font: inherit; font-size: 14px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--faint); background: transparent; color: var(--text); cursor: pointer; }
#focus .f-chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
#focus .go { font: inherit; font-weight: 600; padding: 12px; border-radius: 12px; border: 0; background: var(--primary); color: #fff; cursor: pointer; }
#focus[data-time="night"] .go, #focus[data-time="night"] .f-chip.on { color: #2c3060; }

/* ---------- inside the app ---------- */
#focus { display: none; z-index: 1000; font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; }
#focus.open { display: block; animation: f-in .6s ease; }
@keyframes f-in { from { opacity: 0; } }
#focus *, #focus *::before, #focus *::after { box-sizing: border-box; }
#focus .clouds { will-change: transform; }
#focus .f-top { position: absolute; top: 14px; right: 16px; z-index: 11; display: flex; gap: 6px; }
#focus .f-top button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--faint); background: var(--card); color: var(--text);
  font: 15px/1 inherit; cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
#focus .f-top button:hover, #focus .f-scenetop:hover { border-color: var(--primary); }
#focus .f-scenesel, #focus .f-scenebtn { font: inherit; font-size: 14px; color: var(--text); background: transparent; border: 1px solid var(--faint); border-radius: 999px;
  padding: 6px 30px 6px 12px; cursor: pointer; -webkit-appearance: none; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 15px center, right 10px center; background-size: 5px 5px; background-repeat: no-repeat; }
#focus .f-scenesel option { color: #2f3a6b; background: #fff; }
#focus .f-scenetop { height: 34px; padding-top: 0; padding-bottom: 0; background-color: var(--card); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); max-width: 190px; }
#focus .f-link { font: inherit; font-size: 13px; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
#focus .f-chips { background: none; padding: 0; border-radius: 0; }
#focus .f-chip.on { box-shadow: none; }
#focus .f-breakmix { padding-left: 30px; position: relative; }
#focus .f-breakmix::before { content: ""; position: absolute; left: 10px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; border: 1.5px solid currentColor; }
#focus .f-breakmix.on::before { background: currentColor; box-shadow: inset 0 0 0 2px var(--primary); }
#focus .card input { outline: none; } #focus .card input:focus { border-color: var(--primary); }
#focus .ritual { -webkit-backdrop-filter: blur(10px); }

/* ---------- the room (drawn style: ink outlines and flat shadow shapes) ---------- */
#focus {
  --ink: #3a3656; --desk1: #c99d77; --desk2: #b0855f; --deskfront: #8f6a4f; --grain: rgba(90, 60, 40, .18);
  --cork: #d9bb91; --cork-dot: #c4a173; --boardframe: #a77c58; --paper: #fbf7ee; --paper-line: #c9cde3;
  --postit-y: #f6dc84; --postit-p: #f4beb5; --lampc: #55609c; --lampc2: #434d84; --book3: #8fa8c8; --mug: #f4efe6;
  --dark-on: .16; --dark-off: .10; --glowa: .30;
}
#focus.rainy { --dark-on: .26; --dark-off: .24; }
#focus[data-time="night"] {
  --ink: #12132b; --desk1: #5a4954; --desk2: #4a3c48; --deskfront: #2f2738; --grain: rgba(0, 0, 0, .18);
  --cork: #6e5c5a; --cork-dot: #5b4b4c; --boardframe: #43364a; --paper: #cfcade; --paper-line: #9a9ec0;
  --postit-y: #b9a86c; --postit-p: #ad8b97; --lampc: #3c4576; --lampc2: #2e365f; --book3: #56688e; --mug: #8e8fb8;
  --dark-on: .62; --dark-off: .55; --glowa: .55;
}
#focus .window { position: absolute; z-index: 1; overflow: hidden; background: linear-gradient(var(--sky1), var(--sky2)); }
/* the room starts where the text column ends (it never slides under the timer, also in narrow windows) */
#focus .f-room { position: absolute; left: max(34vw, calc(6vw + 320px)); right: 0; top: 0; bottom: 0; width: calc(100vw - max(34vw, calc(6vw + 320px))); height: 100%; overflow: visible; z-index: 2; }
#focus .f-room .ink, #focus .f-room .ink * { stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
#focus .f-frame { fill: var(--frame); }
#focus .f-sillr { fill: var(--frame); filter: brightness(.94); }
#focus .f-rodl { stroke: var(--ink); stroke-width: 6; stroke-linecap: round; }
#focus .f-curtain { transform-box: view-box; transform-origin: 540px 52px; animation: curtain 9s ease-in-out infinite; }
#focus .f-curtain2 { transform-origin: 970px 52px; animation-delay: -4s; }
@keyframes curtain { 50% { transform: skewX(1.6deg); } }
#focus .f-curtain .cloth { fill: var(--curtain); }
#focus .f-curtain .fold { fill: none; stroke: var(--curtain-fold); stroke-width: 4; stroke-linecap: round; }
#focus .f-desktop { fill: url(#f-deskg); }
#focus .f-deskfront { fill: var(--deskfront); }
#focus .f-grain { fill: none; stroke: var(--grain); stroke-width: 2; stroke-linecap: round; }
#focus .f-shadow { fill: rgba(20, 15, 40, .16); stroke: none; }
#focus .f-boardframe { fill: var(--boardframe); }
#focus .f-paper { fill: var(--paper); }
#focus .f-postit.y { fill: var(--postit-y); } #focus .f-postit.p { fill: var(--postit-p); }
#focus .f-pin { fill: var(--peach); stroke: var(--ink); stroke-width: 1.5; }
#focus .f-hand { font-family: "Noteworthy", "Chalkboard SE", "Bradley Hand", "Comic Sans MS", cursive; fill: #3a3656; font-size: 21px; }
#focus .f-hand.small { font-size: 17px; }
#focus .f-doodle { fill: none; stroke: #6c7a5e; stroke-width: 2.5; stroke-linecap: round; }
#focus .f-lines { fill: none; stroke: var(--paper-line); stroke-width: 2; stroke-linecap: round; }
#focus .f-check { fill: none; stroke: #5a9a6a; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 80; stroke-dashoffset: 80; transition: stroke-dashoffset 1.2s .4s; }
#focus.finished .f-check { stroke-dashoffset: 0; }
#focus .f-slotcard { fill: var(--paper); stroke: var(--ink); stroke-width: 2; }
#focus .f-board.celebrate .f-slot.done { animation: bob 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
#focus .f-board.celebrate .f-slot:nth-child(2n) { animation-delay: -.8s; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-3deg); } }
#focus .f-book.b1 { fill: var(--lav); } #focus .f-book.b2 { fill: var(--book3); } #focus .f-book.b3 { fill: var(--gold); }
#focus .f-bookedge { fill: var(--paper); }
#focus .f-cup { fill: var(--peach); } #focus .f-pencil { stroke-width: 5 !important; stroke-linecap: round; }
#focus .f-pencil.a { stroke: #e8c46a !important; } #focus .f-pencil.b { stroke: #8fb187 !important; } #focus .f-pencil.c { stroke: #b9b0e6 !important; }
#focus .f-mug { fill: var(--mug); } #focus .f-mugh { fill: none; }
#focus .f-pageL, #focus .f-pageR, #focus .f-page { fill: var(--paper); }
#focus .f-page { transform-box: view-box; transform-origin: 529px 668px; animation: pageflip 34s ease-in-out infinite; opacity: 0; }
@keyframes pageflip { 0%, 93% { opacity: 0; transform: scaleX(1); } 93.5% { opacity: 1; transform: scaleX(1); } 96.5% { transform: scaleX(0); } 99.5% { opacity: 1; transform: scaleX(-1); } 100% { opacity: 0; transform: scaleX(-1); } }
#focus .f-loose { fill: var(--paper); }
#focus .f-lamparm { stroke: var(--lampc); stroke-width: 9; fill: none; stroke-linecap: round; stroke-linejoin: round; }
#focus .f-lamparm-ink { stroke: var(--ink); stroke-width: 15; fill: none; stroke-linecap: round; stroke-linejoin: round; }
#focus .f-lamp { fill: var(--lampc); } #focus .f-lamp2 { fill: var(--lampc2); }
#focus .f-bulb { fill: #9a9cb8; transition: fill .3s; }
#focus.lamp .f-bulb { fill: #fff3c4; }
#focus .f-lampglow { opacity: 0; transition: opacity 1.2s; pointer-events: none; }
#focus.lamp .f-lampglow { opacity: var(--glowa); }
#focus .f-twig .pot { fill: var(--peach); stroke: var(--ink); stroke-width: 2.5; }
#focus .f-twig .stem { stroke: #7d6a58; fill: none; stroke-width: 3; stroke-linecap: round; }
#focus .f-twig .leaf { fill: #9fbf9a; stroke: var(--ink); stroke-width: 1.2; }
#focus .f-twig .cocoon-body { stroke: var(--ink); stroke-width: 1.4; }
#focus .pine { fill: var(--pine); }
#focus { --pine: #7e9c92; --pine2: #6b8a82; }
#focus.rainy { --pine: #74898f; --pine2: #627781; }
#focus[data-time="night"] { --pine: #1b2646; --pine2: #151e3a; }

/* lamp light: the room darkens around a warm pool of light; with the lamp off the whole room turns blue */
#focus .f-shade, #focus .f-shade-off { position: absolute; inset: 0; z-index: 3; pointer-events: none; transition: opacity 1.4s; }
#focus .f-shade { opacity: 0;
  background: radial-gradient(circle at var(--lx, 60%) var(--ly, 60%), rgba(14, 16, 46, 0) 0, rgba(14, 16, 46, 0) var(--r0, 120px), rgba(14, 16, 46, var(--dark-on)) var(--r1, 700px)); }
#focus .f-shade-off { background: rgba(14, 16, 46, var(--dark-off)); }
#focus.lamp .f-shade { opacity: 1; } #focus.lamp .f-shade-off { opacity: 0; }
#focus.flick .f-lampglow, #focus.flick .f-shade { animation: flick 1.3s steps(1) 1; }
@keyframes flick { 0% { opacity: 0; } 10% { opacity: .9; } 18% { opacity: .15; } 30% { opacity: 1; } 38% { opacity: .5; } 48% { opacity: 1; } }
#focus .motes { position: absolute; z-index: 4; pointer-events: none; transition: opacity 1.4s; opacity: 0; }
#focus.lamp .motes { opacity: 1; }

/* the summary card shows today's butterflies */
#focus .f-donerow { display: flex; gap: 10px; flex-wrap: wrap; }
#focus .f-donerow svg { width: 38px; height: 38px; animation: bob 2.4s ease-in-out infinite; }
#focus .f-donerow svg:nth-child(2n) { animation-delay: -.8s; }

@media (prefers-reduced-motion: reduce) {
  #focus .clouds, #focus .tree, #focus .grass, #focus .beams, #focus .ff, #focus .f-curtain, #focus .motes i, #focus .cocoon-g, #focus .cocoon-full,
  #focus .caterpillar .seg, #focus .steam, #focus .f-bars i, #focus .fly .wl, #focus .fly .wr, #focus .f-page, #focus .f-donerow svg,
  #focus .f-board.celebrate .f-slot.done, #focus.flick .f-lampglow, #focus.flick .f-shade { animation: none; }
  #focus .steam { opacity: .4; }
}
/* Phone / narrow window: one centred column on top, the room along the bottom edge. */
@media (max-width: 760px), (max-aspect-ratio: 5/6) {   /* phones, and tall narrow windows */
  #focus .panel { left: 20px; right: 20px; width: auto; max-width: none; top: calc(env(safe-area-inset-top, 0px) + 54px);
    gap: 1.8vh; align-items: center; text-align: center; }
  #focus .f-brand { display: none; }   /* the top bar already carries the buttons; the room is the branding */
  #focus .goal .text { font-size: 24px; }
  #focus .ringwrap { width: min(62vw, 30vh, 280px); }
  #focus .ringtext .time { font-size: calc(min(62vw, 30vh, 280px) * .26); }   /* scales with the ring, so the digits always fit */
  #focus .ringtext .phase { font-size: 15px; }
  #focus .ctrl { margin-top: 0; gap: 12px; }
  #focus .ctrl button { font-size: 17px; padding: 10px 26px; min-height: 44px; }
  #focus .ctrl .f-snd { width: 44px; padding: 0; }
  #focus .ctrl .f-snd svg { width: 21px; height: 21px; }
  #focus .mix { font-size: 15px; justify-content: center; flex-wrap: wrap; }
  #focus .msg { font-size: 16px; }
  #focus .f-room { left: 0; width: 100vw; top: var(--roomtop, 62vh); bottom: 0; height: calc(100% - var(--roomtop, 62vh)); }
}
@media (max-width: 760px) and (max-height: 900px) { #focus .msg { display: none; } }
#focus .f-drawer { fill: var(--deskfront); filter: brightness(1.12); stroke-width: 2.5 !important; }
#focus .f-knob { fill: var(--gold); stroke-width: 2 !important; }

/* ---------- second scene: the office ---------- */
#focus { --bld0: #c9d0e3; --bld1: #b4bfd8; --bld2: #a3b0cd; --bld3: #95a3c3; --winlit: rgba(255, 255, 255, .5); --winoff: rgba(255, 255, 255, .2); }
#focus.rainy { --bld0: #c3c8d6; --bld1: #b0b8cb; --bld2: #a1aabf; --bld3: #949eb5; }
#focus[data-time="night"] { --bld0: #252b4b; --bld1: #1f2546; --bld2: #1b2141; --bld3: #171c3a; --winlit: #ffd98a; --winoff: rgba(255, 255, 255, .05); }
#focus .f-bld .lit { fill: var(--winlit); } #focus .f-bld .unlit { fill: var(--winoff); }
#focus:not([data-scene="study"]):not([data-scene="xmas"]):not([data-scene="library"]) .f-nature { display: none; }
#focus:not([data-scene="office"]) .f-city { display: none; }
#focus:not([data-scene="loft"]) .f-high { display: none; }
#focus:not([data-scene="train"]) .f-rail { display: none; }
#focus:not([data-scene="xmas"]) .f-snowfall { display: none; }
#focus[data-scene="office"] {
  --wall: #eceef3; --wall2: #e0e3eb; --desk1: #e4c9a5; --desk2: #d3b38c; --deskfront: #c09e77; --frame: #2f3340; --lampc: #2f3340; --lampc2: #252935;
  --mug: #f6f3ee; --scr1: #eef2fa; --scr2: #cfd8ec; --floor: #d6d2cb; --wb: #fbfbfd; --wbf: #c3c7d2; --blind: #f1ede4; --kb: #ececf1;
}
#focus[data-scene="office"][data-time="night"] {
  --wall: #2b3050; --wall2: #232845; --desk1: #6e5e57; --desk2: #5d4f4a; --deskfront: #4b403e; --frame: #181b29; --lampc: #1e2131; --lampc2: #161926;
  --mug: #9a9cc0; --scr1: #c3d0f5; --scr2: #8fa3df; --floor: #1e2237; --wb: #c6c9de; --wbf: #5c6183; --blind: #66698f; --kb: #8f92b2;
}
#focus .f-oframe { fill: var(--frame); } #focus .f-osill { fill: var(--frame); }
#focus .f-blind { fill: var(--blind); } #focus .f-cord { stroke: var(--ink); stroke-width: 1.5; }
#focus .f-floor { fill: var(--floor); }
#focus .f-clockface { fill: var(--wb); }
#focus .f-ticks { stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; fill: none; }
#focus .f-hh { stroke: var(--ink); stroke-width: 4; stroke-linecap: round; } #focus .f-mh { stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; }
#focus .f-hub { fill: var(--peach); }
#focus .f-wbframe { fill: var(--wbf); } #focus .f-wb { fill: var(--wb); } #focus .f-wbshine { fill: rgba(255, 255, 255, .45); }
#focus .f-hand.f-marker { fill: #2e4f9c; font-size: 23px; }
#focus .f-marker-ul, #focus .f-marker-line { fill: none; stroke: #2e4f9c; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
#focus .f-marker-line.green { stroke: #3f8a5a; }
#focus .f-tray { fill: var(--wbf); } #focus .f-pen-blue { fill: #2e4f9c; } #focus .f-pen-green { fill: #3f8a5a; }
#focus .f-deskedge { fill: var(--deskfront); } #focus .f-leg { fill: var(--frame); }
#focus .f-mon { fill: #2a2d38; }
#focus[data-scene="office"][data-time="night"] .f-scr { filter: drop-shadow(0 0 14px rgba(150, 175, 255, .55)); }
#focus .f-uiside { fill: rgba(60, 80, 140, .16); } #focus .f-uilines { stroke: rgba(60, 80, 140, .32); stroke-width: 5; stroke-linecap: round; fill: none; }
#focus .f-kb { fill: var(--kb); } #focus .f-keys { stroke: rgba(0, 0, 0, .18); stroke-width: 3; fill: none; stroke-dasharray: 6 4; }
#focus .f-nb { fill: #3f5a8a; } #focus .f-nbband { stroke: #1f2b44; stroke-width: 3; } #focus .f-penl { stroke: #2a2d38; stroke-width: 4; stroke-linecap: round; }
#focus .f-hp { fill: none; stroke: #2a2d38; stroke-width: 7; stroke-linecap: round; } #focus .f-hpcup { fill: #3a3e4c; }
#focus .f-saucer { fill: var(--mug); }
/* the mini-window button only exists in the Mac app, during a session */
#focus .f-minibtn { display: none; }
html.mac #focus.f-started .f-minibtn { display: inline-block; }

/* iPhone app: room for the status bar / Dynamic Island and the home bar */
html.ios #focus .f-top { top: calc(env(safe-area-inset-top) + 6px); right: max(16px, env(safe-area-inset-right)); }

/* Mac app: the top 28 px of the window is the drag strip, keep the scene buttons below it */
html.mac #focus .f-top { top: 36px; }

/* ---------- third scene: a high-rise apartment over the city ---------- */
#focus { --ground: #b9c2d8; --river: #a6bddb; --roof: #d9deeb; --road: #a9b2c8; }
#focus[data-time="night"] { --ground: #1b2040; --river: #2a3a68; --roof: #2b3258; --road: #151a33; }
#focus[data-scene="loft"] {
  --wall: #e8e6e2; --wall2: #dcd9d3; --floor: #b89b7c; --desk1: #8a5a3c; --desk2: #744a30; --deskfront: #5e3c27; --frame: #22252e;
  --boardframe: #2a2d38; --cork: #e6dfd2; --cork-dot: #d6cdbd; --lampc: #2a2d38; --lampc2: #1f2129; --rug: #cfc6bb; --mug: #f6f3ee;
  --scr1: #eef2fa; --scr2: #cfd8ec; --book3: #8fa8c8;
}
#focus[data-scene="loft"][data-time="night"] {
  --wall: #2a2c44; --wall2: #22243b; --floor: #3a3040; --desk1: #5a4038; --desk2: #4a342e; --deskfront: #3a2a26; --frame: #101219;
  --boardframe: #14161f; --cork: #8f8ca3; --cork-dot: #7e7b93; --lampc: #1b1d27; --lampc2: #14161e; --rug: #4a4560; --mug: #9a9cc0;
  --scr1: #c3d0f5; --scr2: #8fa3df;
}
#focus[data-scene="loft"][data-time="night"] .f-scr { filter: drop-shadow(0 0 14px rgba(150, 175, 255, .55)); }
#focus .f-high .lit { fill: var(--winlit); } #focus .f-high .unlit { fill: var(--winoff); }
#focus .f-bridge { stroke: var(--bld3); stroke-width: 2; fill: none; }
#focus .f-blamp { fill: #ffd98a; }
#focus .f-avi { fill: #ff5a4e; animation: avi 2.2s steps(1) infinite; } @keyframes avi { 50% { opacity: .1; } }
#focus .f-car { animation: car 14s linear infinite; } #focus .f-car.head { fill: #fff1c2; } #focus .f-car.tail { fill: #ff6a5a; }
#focus:not([data-time="night"]) .f-car { fill: rgba(40, 46, 70, .45); }
@keyframes car { to { transform: translateX(680px); } }
#focus .f-car.tail { animation-name: car-back; } @keyframes car-back { from { transform: translateX(-680px); } to { transform: translateX(0); } }
#focus .f-glare { fill: rgba(255, 255, 255, .22); }
#focus .f-cordp { stroke: var(--ink); stroke-width: 2.5; }
#focus .f-rug { fill: var(--rug); stroke-width: 2 !important; }
#focus .f-hairpin { stroke: var(--frame); stroke-width: 5; fill: none; stroke-linejoin: round; }
#focus .f-lap { fill: #c9ccd6; }
#focus[data-time="night"] .f-lap { fill: #6a6e86; }

/* ---------- fourth scene: Christmas ---------- */
#focus[data-scene="xmas"] {
  --wall: #f1e6d6; --wall2: #e8d9c4; --wains: #5d7b66; --chair: #4b6655; --frame: #f6efe4; --curtain: #b8433f; --curtain-fold: rgba(80, 10, 10, .28);
  --desk1: #b7885f; --desk2: #9c7049; --deskfront: #7a5537; --stone: #cdbca9; --brick: rgba(120, 90, 70, .25); --mantel: #6b4a34;
  --fir: #3f6b4f; --fir2: rgba(255, 255, 255, .12); --boardframe: #6b4a34; --shadec: #ecd7b4; --lampc: #8a6a4a; --lampc2: #7a5a3c; --mug: #f4efe6;
  --mount: #c9d2e6; --hA1: #eef2f8; --hA2: #dfe6f0; --hB1: #e6ecf5; --hB2: #d3dcea; --hC1: #f4f7fb; --hC2: #e2e9f2; --tree: #5d7a6a; --tree2: #e9eef6; --pine: #5a776b; --pine2: #4b685e;
}
#focus[data-scene="xmas"][data-time="night"] {
  --wall: #3d2f3f; --wall2: #34283a; --wains: #22332d; --chair: #1b2a25; --frame: #5a5170; --curtain: #7a2f3a; --curtain-fold: rgba(20, 0, 10, .35);
  --desk1: #5e4440; --desk2: #4e3836; --deskfront: #33252a; --stone: #5c4e56; --brick: rgba(0, 0, 0, .22); --mantel: #3a2a28;
  --fir: #1f3a2e; --fir2: rgba(255, 255, 255, .06); --boardframe: #3a2a28; --shadec: #9a8670; --lampc: #4a3a30; --lampc2: #3e3028; --mug: #8e8fb8;
  --mount: #3a4170; --hA1: #4a5384; --hA2: #3f4776; --hB1: #464f80; --hB2: #3b4372; --hC1: #4f5889; --hC2: #434c7c; --tree: #1e2d44; --tree2: #5a6390; --pine: #1d2a47; --pine2: #18233e;
}
#focus[data-scene="xmas"] .f-meadow, #focus[data-scene="xmas"] .f-flies { display: none; }
#focus .flake { fill: #fff; opacity: .85; animation: snow 10s linear infinite; }
@keyframes snow { to { transform: translate(var(--dx, 0), 440px); } }
#focus .f-wains { fill: var(--wains); } #focus .f-chair { fill: var(--chair); stroke-width: 2 !important; }
#focus .f-snowsill { fill: #fbfcff; } #focus[data-time="night"] .f-snowsill { fill: #c9cde6; }
#focus .f-tie { fill: none; stroke: var(--gold); stroke-width: 4; stroke-linecap: round; }
#focus .f-stone { fill: var(--stone); } #focus .f-bricks { stroke: var(--brick); stroke-width: 2; fill: none; }
#focus .f-firebox { fill: #2a1d22; } #focus .f-mantel { fill: var(--mantel); }
#focus .f-logs rect { fill: #6b4a34; stroke: #2a1d22; stroke-width: 2; }
#focus .f-flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flame 1.4s ease-in-out infinite alternate; }
#focus .f-flame.f1 { fill: #f08a3e; animation-delay: -.4s; } #focus .f-flame.f2 { fill: #f6a646; animation-duration: 1.1s; }
#focus .f-flame.f3 { fill: #f08a3e; animation-delay: -.9s; animation-duration: 1.7s; } #focus .f-flame.f4 { fill: #fde08a; animation-duration: .9s; }
@keyframes flame { 0% { transform: scale(1, 1) skewX(0); } 50% { transform: scale(.9, 1.12) skewX(3deg); } 100% { transform: scale(1.06, .88) skewX(-3deg); } }
#focus .f-fireglow { animation: fireglow 2.1s ease-in-out infinite alternate; pointer-events: none; }
@keyframes fireglow { from { opacity: .55; } to { opacity: .85; } }
#focus .f-garland { fill: none; stroke: #3f6b4f; stroke-width: 9; stroke-linecap: round; }
#focus .f-stock .s1 { fill: #b8433f; } #focus .f-stock .s2 { fill: #3f6b4f; } #focus .f-stock .cuff { fill: #fbf7ee; stroke-width: 2 !important; }
#focus .f-trunk { fill: #7a5537; } #focus .f-fir { fill: var(--fir); } #focus .f-fir2 { fill: var(--fir2); }
#focus .f-tinsel { fill: none; stroke: var(--gold); stroke-width: 3; stroke-dasharray: 2 6; stroke-linecap: round; }
#focus .f-baubles circle { stroke: var(--ink); stroke-width: 2; } #focus .f-baubles .r { fill: #c9483f; } #focus .f-baubles .g { fill: #e0b24e; } #focus .f-baubles .b { fill: #6f8fc9; }
#focus .f-xl { animation: twinkle 2.8s ease-in-out infinite; } #focus .f-xl.c0 { fill: #ffd36b; } #focus .f-xl.c1 { fill: #ff8a70; } #focus .f-xl.c2 { fill: #9fd4ff; } #focus .f-xl.c3 { fill: #c4f08f; }
@keyframes twinkle { 50% { opacity: .3; } }
#focus[data-time="night"] .f-tlights, #focus[data-time="night"] .f-glights { filter: drop-shadow(0 0 3px rgba(255, 220, 150, .9)); }
#focus .f-xstar { fill: #f2c94c; animation: starglow 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes starglow { 50% { transform: scale(1.08); filter: drop-shadow(0 0 6px rgba(255, 220, 120, .9)); } }
#focus .f-gift .p1 { fill: #c9483f; } #focus .f-gift .p2 { fill: #6f8fc9; } #focus .f-gift .rb { fill: var(--gold); } #focus .f-gift .bow { fill: none; stroke: var(--gold); stroke-width: 4; }
#focus .f-lshade { fill: var(--shadec); }
#focus .f-cocoa { fill: #b8433f; } #focus .f-mallow { fill: #fbf7ee; stroke: var(--ink); stroke-width: 1.5; }
#focus .f-plate { fill: #f4efe6; stroke-width: 2 !important; } #focus .f-cookie { fill: #c99a5e; stroke-width: 2 !important; }

/* ---------- fifth scene: an old-style train compartment ---------- */
#focus { --snow: #f6f8fc; } #focus[data-time="night"] { --snow: #9ea4cc; }
#focus[data-scene="train"] {
  --wall: #efe4d2; --wall2: #e6d8c2; --panel: #b48459; --panel-line: rgba(60, 30, 10, .32); --tframe: #6b4026; --brass: #c9a15a; --velvet: #8f3b45; --velvet2: #6f2a33;
  --desk1: #7a4a2c; --desk2: #683d23; --deskfront: #4f2e1a; --blind: #6e4a33; --boardframe: #5e3a22; --scr1: #eef2fa; --scr2: #cfd8ec; --tshade: #3f6b4f;
  --case: #8a5a3a; --mug: #f4efe6; --curtain: #8f3b45; --curtain-fold: rgba(40, 0, 10, .3); --pole: #5a4a3e; --wire: rgba(60, 50, 45, .55);
}
#focus[data-scene="train"][data-time="night"] {
  --wall: #3a3046; --wall2: #322a3e; --panel: #553b38; --panel-line: rgba(0, 0, 0, .3); --tframe: #2f1f1c; --brass: #8a7448; --velvet: #4f2530; --velvet2: #3b1a22;
  --desk1: #4a3028; --desk2: #3e2822; --deskfront: #2b1b17; --blind: #3e2b24; --boardframe: #2e1e1a; --scr1: #c3d0f5; --scr2: #8fa3df; --tshade: #2a4a38;
  --case: #4a3428; --mug: #8e8fb8; --curtain: #4f2530; --curtain-fold: rgba(0, 0, 0, .35); --pole: #14162a; --wire: rgba(10, 10, 30, .6);
}
#focus[data-scene="train"][data-time="night"] .f-scr { filter: drop-shadow(0 0 12px rgba(150, 175, 255, .5)); }
#focus .f-panels rect { fill: var(--panel); stroke: var(--panel-line); stroke-width: 3; }
#focus .f-tframe { fill: var(--tframe); } #focus .f-tblind { fill: var(--blind); } #focus .f-brass { fill: var(--brass); }
#focus .f-tpane { stroke: var(--brass); stroke-width: 4; }
#focus .f-brassl, #focus .f-rack { stroke: var(--brass); stroke-width: 5; fill: none; stroke-linecap: round; }
#focus .f-case { fill: var(--case); } #focus .f-case2 { fill: #5f6f8f; } #focus .f-strap { stroke: #3a2a20; stroke-width: 6; }
#focus .f-benchtop { fill: var(--velvet2); }
#focus .f-tleg { stroke: var(--brass); stroke-width: 7; fill: none; stroke-linecap: round; }
#focus .f-tshade { fill: var(--tshade); }
#focus .f-pole { stroke: var(--pole); stroke-width: 5; fill: none; } #focus .f-wire { stroke: var(--wire); stroke-width: 1.2; fill: none; }
#focus .rl { animation: rail 60s linear infinite; } @keyframes rail { to { transform: translateX(-600px); } }
@media (prefers-reduced-motion: no-preference) {
  #focus[data-scene="train"] .window, #focus[data-scene="train"] .f-room { animation: rock 2.6s ease-in-out infinite; }
}
@keyframes rock { 0%, 100% { transform: translateY(0); } 45% { transform: translateY(1.2px); } 55% { transform: translateY(.4px); } }
@media (prefers-reduced-motion: reduce) { #focus .rl, #focus .flake, #focus .f-car, #focus .f-flame, #focus .f-xl { animation: none; } }

/* ---------- sixth scene: a coffee shop on a rainy street ---------- */
#focus:not([data-scene="cafe"]) .f-street { display: none; }
#focus { --hz1: #d9c7b8; --hz2: #c9b6a8; --hz3: #b9a7a3; --road: #9da3b4; --curb: #b8bccb; --cornice: #f3ece2; --skin: #e9c3a6;
  --coat1: #5d6f9a; --coat2: #9a5d5d; --coat3: #6a8a72; }
#focus.rainy { --road: #8e95a8; }
#focus[data-time="night"] { --hz1: #3a3552; --hz2: #332f4b; --hz3: #2d2a45; --road: #1c1f36; --curb: #2a2d48; --cornice: #4a4566; --skin: #9a8090;
  --coat1: #2c3454; --coat2: #4a2c36; --coat3: #2c4036; }
#focus[data-scene="cafe"] {
  --wall: #f0e4d4; --wall2: #e6d6c2; --desk1: #9a6a45; --desk2: #845838; --deskfront: #6a4428; --frame: #2f3a33; --cframe: #3d4a40;
  --boardframe: #6a4428; --lampc: #3d4a40; --lampc2: #2f3a33; --mug: #f6f1ea; --scr1: #eef2fa; --scr2: #cfd8ec;
  --awn1: #3f6b55; --awn2: #f3ece2; --tile1: #e9e2d6; --tile2: #c9bfae; --ctop: #e6ddcf; --cfront: #3f6b55; --plank: rgba(0, 0, 0, .16);
  --chrome: #c9ced8; --chrome2: #9aa1b0;
}
#focus[data-scene="cafe"][data-time="night"] {
  --wall: #3a2f3c; --wall2: #322836; --desk1: #5a4038; --desk2: #4a342e; --deskfront: #33241f; --frame: #161a22; --cframe: #1e2420;
  --boardframe: #33241f; --lampc: #1e2420; --lampc2: #161a22; --mug: #9a9cc0; --scr1: #c3d0f5; --scr2: #8fa3df;
  --awn1: #24402f; --awn2: #6f6a7e; --tile1: #3e3644; --tile2: #2e2834; --ctop: #6a6276; --cfront: #22382b; --plank: rgba(0, 0, 0, .25);
  --chrome: #7b8096; --chrome2: #5a5f74;
}
#focus[data-scene="cafe"][data-time="night"] .f-scr { filter: drop-shadow(0 0 12px rgba(150, 175, 255, .5)); }
#focus .f-cframe { fill: var(--cframe); }
#focus .f-awning { stroke-width: 2 !important; }
#focus .f-gild { font: italic 700 42px Georgia, "Times New Roman", serif; fill: #e2b955; stroke: #5a3d16; stroke-width: 2.5px; paint-order: stroke; letter-spacing: 1px; }
#focus .f-gildline { stroke: #e2b955; stroke-width: 3; }
#focus .f-ctop { fill: var(--ctop); } #focus .f-cfront { fill: var(--cfront); }
#focus .f-planks { stroke: var(--plank); stroke-width: 3; fill: none; }
#focus .f-esp { fill: var(--chrome); } #focus .f-esp2 { fill: var(--chrome2); } #focus .f-cup2 { fill: var(--mug); stroke-width: 2 !important; }
#focus .f-gauge { fill: #fbf7ee; stroke-width: 2 !important; } #focus .f-needle { stroke: #b8433f; stroke-width: 2; stroke-linecap: round; }
#focus .f-cake { fill: #d79a7a; stroke-width: 2 !important; } #focus .f-cream { stroke: #fbf7ee; stroke-width: 5; } #focus .f-berry { fill: #b8433f; }
#focus .f-dome { fill: rgba(255, 255, 255, .22); stroke-width: 2 !important; }
#focus .f-cleg { stroke: var(--frame); stroke-width: 6; fill: none; stroke-linecap: round; }
#focus .f-stoolt { fill: var(--desk1); }
#focus .f-latte { fill: #c99a6e; } #focus .f-art { fill: none; stroke: #fbf2e4; stroke-width: 2; stroke-linecap: round; }
#focus .f-croiss { fill: #d9a05a; stroke-width: 2 !important; } #focus .f-crlines { stroke: #a8743a; stroke-width: 2; fill: none; stroke-linecap: round; }
#focus .f-st .lit { fill: var(--winlit); } #focus .f-st .unlit { fill: var(--winoff); }
#focus .f-st .shop { fill: rgba(255, 255, 255, .35); } #focus[data-time="night"] .f-st .shop { fill: #ffcf86; opacity: .8; }
#focus .f-refl { fill: #ffd98a; opacity: .22; filter: blur(3px); } #focus[data-time="night"] .f-refl { opacity: .28; }
#focus:not(.rainy) .f-refl { display: none; }
#focus .f-lpost { stroke: #2a2d38; stroke-width: 3; fill: none; } #focus .f-lhead { fill: #2a2d38; }
#focus[data-time="night"] .f-lhead { fill: #ffe2a0; } #focus .f-lglow { fill: #ffd98a; opacity: 0; filter: blur(8px); }
#focus[data-time="night"] .f-lglow { opacity: .4; }
#focus .f-walker { animation: walk 46s linear infinite; } @keyframes walk { from { transform: translateX(-40px); } to { transform: translateX(660px); } }
#focus .f-legs { stroke: #2a2d38; stroke-width: 3; stroke-linecap: round; }
#focus .f-umb { fill: #2a2d38; stroke: #2a2d38; stroke-width: 1.5; opacity: 0; transition: opacity 1s; } #focus.rainy .f-umb { opacity: 1; }

/* ---------- seventh scene: an old library during a storm ---------- */
#focus[data-scene="library"] {
  --wall: #e9dfcc; --wall2: #ddd0b8; --desk1: #8a5a38; --desk2: #744a2c; --deskfront: #5a361e; --shelfc: #6e4529; --shelfb: #4f2f1a;
  --stone: #cbbfac; --lead: rgba(60, 55, 50, .5); --boardframe: #5a361e; --bshade: #2f6b4a; --brass: #c9a15a; --mug: #f4efe6;
  --k0: #8f3b45; --k1: #3f5a8a; --k2: #3f6b4f; --k3: #b8873a; --k4: #6b4a6e; --k5: #a86a3a; --globe: #e8dcb8; --globe2: #9cb38a; --quill: #f6f1e6;
}
#focus[data-scene="library"][data-time="night"] {
  --wall: #33293a; --wall2: #2b2232; --desk1: #523a30; --desk2: #44302a; --deskfront: #2b1d19; --shelfc: #3a2620; --shelfb: #24160f;
  --stone: #5c5466; --lead: rgba(10, 10, 25, .55); --boardframe: #2b1d19; --bshade: #1f4a33; --brass: #8a7448; --mug: #8e8fb8;
  --k0: #5a2830; --k1: #2a3a5a; --k2: #27422f; --k3: #6e5428; --k4: #43304a; --k5: #634028; --globe: #8a8270; --globe2: #566650; --quill: #b9b6c8;
}
#focus .f-shelf { fill: var(--shelfc); } #focus .f-shelfb { stroke: var(--shelfb); stroke-width: 12; fill: none; }
#focus .f-lbook { stroke: rgba(20, 10, 10, .45); stroke-width: 1.2; }
#focus .f-lbook.k0 { fill: var(--k0); } #focus .f-lbook.k1 { fill: var(--k1); } #focus .f-lbook.k2 { fill: var(--k2); }
#focus .f-lbook.k3 { fill: var(--k3); } #focus .f-lbook.k4 { fill: var(--k4); } #focus .f-lbook.k5 { fill: var(--k5); }
#focus .f-room .f-lbook.ink { stroke: var(--ink); stroke-width: 3; }
#focus .f-lband { stroke: #d8b46a; stroke-width: 1.6; opacity: .75; fill: none; }
#focus .f-ladder { stroke: #8a5a38; stroke-width: 7; fill: none; stroke-linecap: round; }
#focus[data-time="night"] .f-ladder { stroke: #4a3228; }
#focus .f-lrail { stroke: var(--brass); stroke-width: 5; stroke-linecap: round; }
#focus .f-joints { stroke: rgba(60, 50, 40, .3); stroke-width: 2; fill: none; }
#focus .f-leadg { opacity: .7; }
#focus .f-bshade { fill: var(--bshade); } #focus .f-pull { stroke: var(--brass); stroke-width: 2; }
#focus .f-inkpot { fill: #23283f; } #focus .f-quill { fill: var(--quill); } #focus .f-quillrib { stroke: rgba(0, 0, 0, .25); stroke-width: 1.5; fill: none; }
#focus .f-globe { fill: var(--globe); } #focus .f-land { fill: var(--globe2); } #focus .f-meridian { stroke: var(--brass); stroke-width: 5; fill: none; }
/* lightning: only in the library, only while the thunder channel plays */
#focus .f-flash { position: absolute; inset: 0; z-index: 3; background: #eef2ff; opacity: 0; pointer-events: none; }
#focus.stormy[data-scene="library"] .f-flash { animation: flash 13s infinite; }
#focus.stormy[data-scene="library"][data-time="night"] .f-flash { animation-duration: 9s; }
@keyframes flash { 0%, 61% { opacity: 0; } 61.6% { opacity: .75; } 62.4% { opacity: .08; } 63% { opacity: .5; } 64.5%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #focus .f-walker, #focus .f-flash { animation: none !important; } }

/* ---------- eighth scene: a wizard's tower ---------- */
#focus:not([data-scene="tower"]) .f-wiz { display: none; }
#focus { --wzfar: #b9c3dc; --wznear: #9fb0c9; --wzcrag: #8d97ad; --wzcastle: #7b839a; }
#focus[data-time="night"] { --wzfar: #2a3160; --wznear: #222852; --wzcrag: #1b2045; --wzcastle: #161a3a; }
#focus[data-scene="tower"] {
  --wall: #d9d2c6; --wall2: #cfc6b8; --stone: #d2cabd; --mortar: rgba(90, 80, 70, .16); --arch: #b4aa9a;
  --desk1: #7a4a2e; --desk2: #683d24; --deskfront: #4c2b18; --boardframe: #5a3520; --brass: #c9a15a; --mug: #f4efe6;
  --k0: #6b4a8e; --k1: #3f5a8a; --k3: #b8873a; --k4: #8f3b45; --owl: #a8835e; --candle: #f3ead6;
}
#focus[data-scene="tower"][data-time="night"] {
  --wall: #2c2840; --wall2: #252238; --stone: #332f49; --mortar: rgba(0, 0, 0, .22); --arch: #4a4462;
  --desk1: #4a3028; --desk2: #3e2822; --deskfront: #2a1a16; --boardframe: #2a1a16; --brass: #8a7448; --mug: #8e8fb8;
  --k0: #43305a; --k1: #2a3a5a; --k3: #6e5428; --k4: #5a2830; --owl: #6a5444; --candle: #b9b2a6;
}
#focus .f-arch { fill: var(--arch); }
#focus .f-owlb { fill: var(--owl); } #focus .f-owle { fill: #f6e7b0; } #focus .f-owlp { fill: #2a1d14; }
#focus .f-beak { fill: #e0a040; } #focus .f-owlf { stroke: rgba(0, 0, 0, .25); stroke-width: 2; fill: none; }
#focus .f-lids { transform-box: fill-box; transform-origin: 50% 0; transform: scaleY(.15); animation: owlblink 7s infinite; }
@keyframes owlblink { 0%, 88%, 100% { transform: scaleY(.15); } 92% { transform: scaleY(1); } 94% { transform: scaleY(.15); } }
#focus[data-time="night"] .f-lids { animation: none; transform: scaleY(.15); }
#focus .f-lant { fill: rgba(255, 230, 160, .35); } #focus .f-lantl { stroke: var(--ink); stroke-width: 2; fill: none; }
#focus[data-time="night"] .f-lant { fill: rgba(255, 220, 140, .75); filter: drop-shadow(0 0 8px rgba(255, 210, 130, .8)); }
#focus .f-float { animation: float 7s ease-in-out infinite; } #focus .f-float.b { animation-duration: 9s; animation-delay: -3s; } #focus .f-float.c { animation-duration: 8s; animation-delay: -5s; }
@keyframes float { 50% { transform: translateY(-12px) rotate(2deg); } }
#focus .f-tripod { stroke: #4c2b18; stroke-width: 6; fill: none; stroke-linecap: round; }
#focus .f-tube { fill: #5a3520; }
#focus .f-orb { fill: rgba(170, 190, 255, .45); } #focus .f-orbshine { fill: rgba(255, 255, 255, .6); }
#focus[data-time="night"] .f-orb { fill: rgba(150, 170, 255, .55); filter: drop-shadow(0 0 10px rgba(150, 170, 255, .7)); }
#focus .f-candle { fill: var(--candle); stroke-width: 2 !important; } #focus .f-wick { stroke: #2a1d14; stroke-width: 2; }
#focus .f-cflame { transform-box: fill-box; transform-origin: 50% 100%; }
#focus.lamp .f-cflame { fill: #ffd66b; animation: candle 1.6s ease-in-out infinite alternate; filter: drop-shadow(0 0 6px rgba(255, 200, 100, .9)); }
#focus.lamp .f-cflame.b { animation-duration: 1.2s; } #focus.lamp .f-cflame.c { animation-duration: 1.9s; animation-delay: -.6s; }
@keyframes candle { 50% { transform: scale(.85, 1.12) skewX(4deg); } 100% { transform: scale(1.05, .92) skewX(-3deg); } }
#focus .f-rune { fill: none; stroke: #8a6ac8; stroke-width: 2; }
#focus .f-bottle { fill: rgba(220, 235, 245, .4); stroke-width: 2 !important; } #focus .f-cork { fill: #a8835e; stroke-width: 2 !important; }
#focus .f-potion.p1 { fill: #8a6ac8; } #focus .f-potion.p2 { fill: #5ab8a0; } #focus .f-potion.p3 { fill: #e07a8a; }
#focus[data-time="night"] .f-potion { filter: drop-shadow(0 0 6px currentColor); opacity: .95; }
#focus[data-time="night"] .f-potion.p1 { color: #b89aff; } #focus[data-time="night"] .f-potion.p2 { color: #7af0d0; } #focus[data-time="night"] .f-potion.p3 { color: #ff9aac; }
#focus .f-cwin { fill: #ffd98a; } #focus .f-mist { fill: rgba(255, 255, 255, .28); filter: blur(6px); }
#focus[data-time="night"] .f-mist { fill: rgba(140, 150, 210, .18); }
#focus .f-lantern { fill: #ffcf7a; filter: drop-shadow(0 0 3px #ffb860); animation: lantern 40s linear infinite; }
@keyframes lantern { from { transform: translateY(0); opacity: 0; } 10% { opacity: 1; } 85% { opacity: .9; } to { transform: translateY(-360px) translateX(20px); opacity: 0; } }
#focus .f-shoot { stroke: #fff; stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 70 600; stroke-dashoffset: 70; animation: shoot 14s linear infinite; }
@keyframes shoot { 0%, 90% { stroke-dashoffset: 70; transform: translate(0, 0); } 96% { stroke-dashoffset: -70; transform: translate(-160px, 60px); } 100% { stroke-dashoffset: -70; transform: translate(-160px, 60px); } }

/* ---------- ninth scene: a spaceship cabin ---------- */
#focus:not([data-scene="space"]) .f-space { display: none; }
#focus[data-scene="space"] .window > svg.land:first-child > :not(defs), #focus[data-scene="space"] .clouds, #focus[data-scene="space"] .f-rain { display: none; }
#focus[data-scene="space"] {
  --wall: #e6e9f0; --wall2: #d9dee8; --hull: #c9cfdb; --hullc: #b9c0cf; --spanel: #dde2ec; --duct: #aab2c2;
  --desk1: #d7dce6; --desk2: #c3cad8; --deskfront: #8f98ab; --cfront: #4a5268; --boardframe: #8f98ab; --cork: #eef1f6; --cork-dot: #dde2ec;
  --scr1: #dff3ff; --scr2: #a9d4f0; --mug: #f6f3ee; --lampc: #8f98ab;
  --void1: #101532; --void2: #2a2458; --planet: #5b8fd0; --pband: #8fc1e6; --pband2: #e9f4ff; --neb1: #c86ad0; --neb2: #5ac8d8;
}
#focus[data-scene="space"][data-time="night"] {
  --wall: #232842; --wall2: #1d2138; --hull: #3a4060; --hullc: #2f3552; --spanel: #2b3050; --duct: #3a4060;
  --desk1: #3a4060; --desk2: #30364f; --deskfront: #20243a; --cfront: #181b2e; --boardframe: #20243a; --cork: #4a5070; --cork-dot: #40465f;
  --scr1: #a9d4f0; --scr2: #5a8ac8; --mug: #8e8fb8; --lampc: #2f3552;
  --void1: #04050f; --void2: #121433; --planet: #1c2f5e; --pband: #2c4a80; --pband2: #3a5a90; --neb1: #7a3a8a; --neb2: #2a7a8a;
}
#focus[data-scene="space"][data-time="night"] .f-scr { filter: drop-shadow(0 0 12px rgba(120, 200, 255, .55)); }
#focus .f-void { fill: var(--void1); }
#focus .f-nebula.a { fill: var(--neb1); opacity: .35; filter: blur(14px); } #focus .f-nebula.b { fill: var(--neb2); opacity: .3; filter: blur(14px); }
#focus .f-nebula { fill-opacity: 1; }
#focus .f-starfield { fill: #fff; animation: stars 240s linear infinite alternate; } @keyframes stars { to { transform: translateX(-160px); } }
#focus .f-starfield .tw { animation: twinkle 3.2s ease-in-out infinite; }
#focus .f-spsun { fill: #fff6dc; filter: blur(16px); opacity: .85; }
#focus .f-atmo { fill: none; stroke: #8fd0ff; stroke-width: 6; opacity: .5; filter: blur(4px); }
#focus[data-time="night"] .f-atmo { opacity: .3; }
#focus .f-planet { fill: var(--planet); }
#focus .f-band { fill: none; stroke: var(--pband); opacity: .6; stroke-linecap: round; } #focus .f-band:nth-child(3n) { stroke: var(--pband2); opacity: .45; }
#focus .f-bands { animation: bands 220s linear infinite; } @keyframes bands { to { transform: translateX(-600px); } }
#focus .f-citylight { fill: #ffd98a; }
#focus .f-moonlet { fill: #d8d4cc; } #focus[data-time="night"] .f-moonlet { fill: #8a88a0; }
#focus .f-sat { animation: sat 45s linear infinite; } @keyframes sat { 0% { transform: translate(-40px, 0); } 60%, 100% { transform: translate(680px, -40px); } }
#focus .f-satp { fill: #5a7ac8; } #focus .f-satb { fill: #d8dce6; } #focus .f-satl { fill: #ff5a4e; animation: avi 1.6s steps(1) infinite; }
#focus .f-hull { fill: var(--hull); } #focus .f-hullc { fill: var(--hullc); }
#focus .f-pring { fill: none; stroke: var(--hullc); stroke-width: 10; } #focus .f-bolt { fill: var(--hullc); stroke: var(--ink); stroke-width: 1.5; }
#focus .f-spanel rect { fill: var(--spanel); stroke: rgba(0, 0, 0, .12); stroke-width: 3; }
#focus .f-duct { stroke: var(--duct); stroke-width: 20; stroke-linecap: round; } #focus .f-ductl { stroke: rgba(0, 0, 0, .18); stroke-width: 3; }
#focus .f-cfront2 { fill: var(--cfront); }
#focus .f-strip { stroke: #7ad8ff; stroke-width: 3; opacity: .7; animation: strip 4s ease-in-out infinite; } @keyframes strip { 50% { opacity: .3; } }
#focus .f-leds .led { fill: #6ad0a0; } #focus .f-leds .led.b { fill: #ffcf6a; animation: avi 2.6s steps(1) infinite; } #focus .f-leds .led.c { fill: #7ad8ff; animation: avi 3.4s steps(1) infinite; animation-delay: -1s; }
#focus .f-mlid { fill: var(--hullc); stroke-width: 2 !important; }
#focus .f-neck { stroke: var(--hullc); stroke-width: 7; fill: none; stroke-linecap: round; }
#focus[data-scene="space"].lamp .f-bulb { fill: #eaf2ff; }
#focus .f-pen { fill: #e07a5a; } #focus .f-star { fill: #f2c94c; stroke: var(--ink); stroke-width: 2; }
@media (prefers-reduced-motion: reduce) {
  #focus .f-lids, #focus .f-float, #focus .f-cflame, #focus .f-lantern, #focus .f-shoot, #focus .f-starfield, #focus .f-bands, #focus .f-sat, #focus .f-strip, #focus .f-leds .led { animation: none !important; }
}

/* Wall patterns: kept close to the wall colour so the timer and text stay readable */
#focus .f-crail { stroke: var(--crail, #8a6a4a); stroke-width: 8; fill: none; }
#focus[data-scene="study"] { --wp1: #e9edf7; --wp2: #dce1f0; --wp3: #cdd5ea; }
#focus[data-scene="study"][data-time="night"] { --wp1: #353a68; --wp2: #2f335c; --wp3: #41467a; }
#focus[data-scene="loft"] { --bw1: #e8e0db; --bw2: #e4d5cd; --bw3: #dfcdc4; --bmortar: #f0eae6; }
#focus[data-scene="loft"][data-time="night"] { --bw1: #2e3250; --bw2: #3d3349; --bw3: #382f47; --bmortar: #242842; }
#focus[data-scene="cafe"] { --sub1: #f6f1e9; --grout: #ddd3c4; --crail: #845838; }
#focus[data-scene="cafe"][data-time="night"] { --sub1: #43384a; --grout: #342b3a; --crail: #33241f; }
#focus[data-scene="library"] { --dm1: #d5dbc6; --dm2: #ccd3bb; --wp: #8a5a38; --wpl: #744a2c; --crail: #5a361e; }
#focus[data-scene="library"][data-time="night"] { --dm1: #26302b; --dm2: #2f3c35; --wp: #3e2a24; --wpl: #2f1f1a; --crail: #24160f; }
#focus[data-scene="office"] { --blk1: #eceef3; --blk2: #e8eaf0; --joint: #dcdfe7; }
#focus[data-scene="office"][data-time="night"] { --blk1: #2b3050; --blk2: #2d324f; --joint: #23273f; }
#focus[data-scene="xmas"] { --hp1: #f1e6d6; --hp2: #dcd6bf; --hp3: #e2c2b2; }
#focus[data-scene="xmas"][data-time="night"] { --hp1: #3d2f3f; --hp2: #3f3a40; --hp3: #4d3440; }
#focus[data-scene="train"] { --quilt: #e6d6bf; --quiltl: #d6c2a6; }
#focus[data-scene="train"][data-time="night"] { --quilt: #332a3e; --quiltl: #2a2234; }
#focus .f-inlay { fill: none; stroke: var(--panel-line); stroke-width: 1.5; }
#focus .f-rivet circle { fill: var(--brass); }
#focus .f-brassl { stroke: var(--brass); stroke-width: 4; fill: none; }
#focus[data-scene="space"] { --pl1: #e6e9f0; --seam: #d6dbe5; --haz1: #e9c45a; --haz2: #3a3f4f; }
#focus[data-scene="space"][data-time="night"] { --pl1: #232842; --seam: #1c2036; --haz1: #8a7440; --haz2: #1a1d30; }

/* Dropdowns in the focus screen follow the scene's day/night colours */
#focus .f-scenebtn.dd { background-image: none; padding-right: 12px; }
#focus .ddmenu { font-family: inherit; font-size: 13.5px; color: var(--text); border-color: var(--faint);
  background: color-mix(in srgb, var(--wall) 90%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
#focus .dd-item { color: var(--muted); }
#focus .dd-item.act { background: var(--ring-bg); color: var(--text); }
#focus .dd-item.sel { color: var(--text); font-weight: 700; }
#focus .f-top .f-scenebtn { width: auto; border-radius: 999px; font-size: 14px; line-height: normal; }

/* the coffee ask on the done card (website only) */
#focus .f-coffee { margin: 16px 0 0; display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; }
#focus .f-coffee a { color: var(--text); font-weight: 600; text-decoration: none; }
#focus .f-coffee a:hover { text-decoration: underline; text-underline-offset: 3px; }
#focus .f-coffee span { color: var(--muted); font-size: 12px; }
