/* /screensaver (L33): the card fills the viewport; the bar is the only chrome and fades when idle. */
:root{ --edge:#1a1526; --ink:#1a1526; --paper:#fff; }
html, body{ height:100%; margin:0; overflow:hidden; background:var(--edge); font-family:Sora, system-ui, sans-serif; }
[hidden]{ display:none !important; }
#view{ position:fixed; inset:0; width:100%; height:100%; display:block; }
body.is-idle{ cursor:none; }
/* The logo and site address are drawn on the canvas; these clear links sit on top so a tap goes to the main site. */
.home-link{ position:fixed; display:block; border-radius:8px; -webkit-tap-highlight-color:transparent; }
.home-link:focus-visible{ outline:3px solid #ffd84a; outline-offset:2px; }
.bar{
  position:fixed; left:50%; bottom:calc(44px + env(safe-area-inset-bottom)); transform:translateX(-50%);
  display:flex; flex-direction:column; align-items:center; gap:10px; width:max-content; max-width:calc(100vw - 32px);
  transition:opacity .4s ease;
}
.bar.is-hidden{ opacity:0; pointer-events:none; }   /* still focusable: a Tab brings it back */
.bar .row{ display:flex; flex-wrap:wrap; justify-content:center; gap:8px; }
.sr{ position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
.bar button[aria-pressed="true"]{ background:#ffd84a; color:var(--ink); border-color:#ffd84a; }
.bar button[aria-busy="true"]{ cursor:progress; }
.bar button, .bar a{
  font:600 15px/1 Sora, system-ui, sans-serif; color:var(--paper); background:var(--ink); border:2px solid var(--paper);
  border-radius:999px; padding:12px 18px; min-height:44px; box-sizing:border-box; cursor:pointer; text-decoration:none;
  display:inline-flex; align-items:center;
}
.bar button:hover, .bar a:hover{ background:#3a2c5c; }
.bar button:focus-visible, .bar a:focus-visible{ outline:3px solid #ffd84a; outline-offset:2px; }
/* L49: the row is icons; the word (.lbl) shows above its button on hover (a real pointer only) or keyboard focus */
.bar .row{ gap:10px; }
.bar .row > *{ position:relative; width:52px; height:52px; min-height:52px; padding:0; justify-content:center; }
.bar .row .ico{ display:block; width:26px; height:26px; pointer-events:none; }
.bar .row .lbl{ position:absolute; z-index:2; left:50%; bottom:calc(100% + 8px); transform:translateX(-50%); white-space:nowrap; padding:7px 12px; border-radius:999px;
  background:var(--ink); color:var(--paper); border:2px solid var(--paper); font:600 13px/1 Sora, system-ui, sans-serif; opacity:0; pointer-events:none; }
.bar .row > :focus-visible > .lbl{ opacity:1; }
@media (hover: hover){ .bar .row > :hover > .lbl{ opacity:1; } }
.bar.is-hidden .lbl{ opacity:0 !important; }
/* a mood that is on shows its words in the button */
.bar .row #mood.is-on{ width:auto; padding:0 16px 0 12px; gap:6px; }
.bar .row #mood.is-on .lbl{ position:static; transform:none; opacity:1; padding:0; border:0; background:none; color:inherit; font-size:15px; }
/* L44: the Mood button and box */
.bar button.is-on{ background:#ffd84a; color:var(--ink); border-color:#ffd84a; }
.bar button.is-on:hover{ background:#ffe58a; }
.bar button[aria-pressed="true"]:hover{ background:#ffe58a; }   /* L49: a pressed button under the pointer stays readable */
.bar button[aria-disabled="true"]{ opacity:.6; cursor:progress; }
.bar .row #mood.is-on .mood-words{ display:block; max-width:18ch; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mood-box{ width:min(460px, calc(100vw - 32px)); box-sizing:border-box; padding:12px 14px; border-radius:16px; background:var(--ink); color:var(--paper);
  border:2px solid var(--paper); display:flex; flex-direction:column; gap:6px; font:500 14px/1.4 Sora, system-ui, sans-serif; }
/* L48: the Speed & colour box */
.tune-box{ width:min(460px, calc(100vw - 32px)); box-sizing:border-box; padding:12px 14px; border-radius:16px; background:var(--ink); color:var(--paper);
  border:2px solid var(--paper); display:flex; flex-direction:column; gap:12px; font:600 14px/1.4 Sora, system-ui, sans-serif; }
.tune-line{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.tune-name{ flex:0 0 100%; }
.speed-now{ min-width:5ch; text-align:center; font-size:16px; }
.bar button[disabled]{ opacity:.45; cursor:default; }
.swatches{ display:flex; flex-wrap:wrap; gap:8px; }
.bar .swatch{ width:36px; height:36px; min-height:36px; padding:0; border-radius:50%; border:2px solid var(--paper); }
.bar .swatch[aria-pressed="true"]{ border-color:var(--ink); box-shadow:0 0 0 3px #ffd84a; }
.tune-own{ display:inline-flex; align-items:center; gap:8px; min-height:44px; }
.tune-own input{ width:44px; height:36px; padding:0; border:2px solid var(--paper); border-radius:8px; background:none; cursor:pointer; }
.tune-own input:focus-visible{ outline:3px solid #ffd84a; outline-offset:2px; }
@media (forced-colors: active){ .bar .swatch{ forced-color-adjust:none; } }
/* L49: the "no fullscreen here" box, the copy-this-link box, and the line that says what Keep or Share just did */
.fs-box{ font-weight:500; gap:8px; }
.fs-box p{ margin:0; display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.share-box{ gap:6px; }
.share-box input{ min-height:44px; box-sizing:border-box; padding:10px 14px; border-radius:999px; border:2px solid var(--paper); background:#fff; color:var(--ink);
  font:500 16px/1.2 Sora, system-ui, sans-serif; min-width:0; }
.share-box input:focus-visible{ outline:3px solid #ffd84a; outline-offset:2px; }
.bar-note{ margin:0; padding:8px 14px; border-radius:16px; background:var(--ink); color:var(--paper); border:2px solid var(--paper); text-align:center;
  font:500 14px/1.4 Sora, system-ui, sans-serif; max-width:min(460px, calc(100vw - 32px)); box-sizing:border-box; }
.mood-fields{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.mood-fields input{ flex:1 1 200px; min-width:0; min-height:44px; box-sizing:border-box; padding:10px 14px; border-radius:999px; border:2px solid var(--paper);
  background:#fff; color:var(--ink); font:500 16px/1.2 Sora, system-ui, sans-serif; }
.mood-fields input::placeholder{ color:#5a5470; opacity:1; }
.mood-fields input:focus-visible{ outline:3px solid #ffd84a; outline-offset:2px; }
.mood-box p{ margin:0; }
.mood-head{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
.mood-title{ font:700 17px/1.2 Fraunces, Georgia, serif; }
.bar .mood-close{ width:44px; padding:0; justify-content:center; font-size:18px; border-color:transparent; }
.mood-ideas{ display:flex; flex-wrap:wrap; gap:6px; }
.bar .mood-ideas button{ min-height:44px; padding:8px 12px; font-size:13px; font-weight:500; border-width:1px; }
.bar .mood-clear{ min-height:44px; padding:8px 14px; font-size:14px; }
.mood-note{ font-size:12px; opacity:.85; }
.mood-link{ display:block; }
.bar .mood-link a{ display:inline-flex; align-items:center; min-height:44px; padding:0; border:0; border-radius:0; background:none; font:600 13px/1.4 Sora, system-ui, sans-serif; color:#ffd84a; text-decoration:underline; }
.bar .mood-link a:hover{ background:none; }
/* Touch screens: while the Mood box is open the button row hides and the box sits just above the on-screen keyboard
   (--kb is the keyboard's height, from visualViewport in js/screensaver.js), with the field as its last row. */
@media (pointer: coarse){
  .bar.mood-open{ bottom:calc(var(--kb, 0px) + 12px + env(safe-area-inset-bottom)); transition:none; }
  .bar.mood-open > .row, .bar.mood-open > .reduced{ display:none; }
  .mood-ideas{ flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; margin:0 -14px; padding:0 14px; }
  .mood-ideas::-webkit-scrollbar{ display:none; }
  .bar .mood-ideas button{ flex:0 0 auto; white-space:nowrap; }
  .mood-box{ position:relative; gap:8px; padding:10px 12px; }
  .mood-head{ display:contents; }
  .mood-title{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
  .bar .mood-close{ position:absolute; top:10px; right:10px; z-index:1; width:44px; height:44px; background:var(--ink); box-shadow:-14px 0 10px 2px var(--ink); }
  .mood-ideas{ order:-1; margin:0 0 0 -12px; padding:0 56px 0 12px; }
  .mood-note{ font-size:11px; line-height:1.35; }
  .mood-link{ display:inline; }
  .bar .mood-link a{ display:inline-flex; min-height:44px; margin:-15px 0; vertical-align:middle; font-size:11px; }
}
.mood-status{ min-height:1.4em; }
.mood-status:empty{ display:none; }
@media (forced-colors: active){ .bar button.is-on{ forced-color-adjust:none; } }
.reduced{
  margin:0; padding:10px 14px; border-radius:16px; background:var(--ink); color:var(--paper); text-align:center;
  font:500 14px/1.4 Sora, system-ui, sans-serif; border:2px solid var(--paper); display:flex; flex-wrap:wrap; gap:8px; align-items:center; justify-content:center;
}
.reduced[hidden]{ display:none; }
.reduced button{ min-height:36px; padding:8px 14px; }
.note{ position:fixed; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; padding:24px; text-align:center;
  background:#f7f0e2; color:var(--ink); }
.note h1{ font:700 28px/1.2 Fraunces, Georgia, serif; margin:0 0 8px; }
.note p{ font-size:17px; line-height:1.5; margin:4px 0; }
.note a{ color:#1f3fff; font-weight:600; }
.note a:focus-visible{ outline:3px solid var(--ink); outline-offset:2px; }
@media (prefers-reduced-motion: reduce){ .bar{ transition:none; } }
