/* Crown shared controls (fleet canon, 2026-11-15 wave 4): the three
 * floating buttons — Settings cogwheel, the canonical theme disc
 * (theme-canonical.js), and the feedback droplet — plus the Settings
 * sheet and Crown's Glass material.
 *
 * Canon carried here:
 *  - All three buttons float and lock into six positions (the float
 *    engine lives in crown-controls.js); positions persist per button.
 *  - The theme disc is the ONLY theme control anywhere on the site.
 *  - Opacity is the ONLY glass control. The frosting is a fixed
 *    property of the glass material (--glass-blur), never a control.
 *  - No button, and no text or icon inside a button, is ever
 *    highlightable (Rob's canon, 2026-11-15).
 *  - Never layer glass: while a sheet is open, covered glass surfaces
 *    drop their backdrop blur; the open sheet keeps its own.
 */

/* No button is highlightable, anywhere, ever. */
button{user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}

/* ---- Glass material tokens ---- */
:root{--glass-o:.63;--glass-fill:255,255,255;--glass-blur:18px}
:root[data-theme-resolved="night"]{--glass-fill:23,28,36}

/* ---- The floating buttons ---- */
.crown-gear{position:fixed;z-index:9998;width:40px;height:40px;border-radius:50%;background:rgba(128,128,128,0.2);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border:1px solid rgba(128,128,128,0.3);font-size:18px;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;line-height:1;touch-action:none;color:inherit}
.crown-fb{position:fixed;z-index:9998;width:54px;height:54px;border-radius:50%;background:rgba(128,128,128,0.2);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border:1px solid rgba(128,128,128,0.3);cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;padding:0;touch-action:none;color:#14314e}
.crown-fb .crown-fb-mark{display:block}
.crown-fb .crown-fb-word{font-size:8px;font-weight:700;letter-spacing:.02em;line-height:1}
/* The readable mark switch: navy on Day, white on Night, white over
 * the workshop scene in Glass (the scene is a dim photo in both
 * resolutions), with a soft shadow so the word stays readable. */
:root[data-theme-resolved="night"] .crown-fb{color:#fff}
:root[data-theme="glass"] .crown-fb{color:#fff}
:root[data-theme-resolved="night"] .crown-fb .crown-fb-word,:root[data-theme="glass"] .crown-fb .crown-fb-word{text-shadow:0 1px 2px rgba(0,0,0,.45)}
:root[data-theme-resolved="night"] .crown-fb .crown-fb-mark,:root[data-theme="glass"] .crown-fb .crown-fb-mark{filter:drop-shadow(0 1px 1px rgba(0,0,0,.45))}
/* The springy settle, applied by the float engine while a button is
 * travelling to its anchor; removed while it is being dragged. */
.crown-seat{transition:left .45s cubic-bezier(.34,1.56,.64,1),top .45s cubic-bezier(.34,1.56,.64,1)}
/* The canonical disc carries its chassis inline; it still needs the
 * drag gesture kept from scrolling the page under it. */
.themeToggle{touch-action:none}

/* ---- Settings sheet ---- */
.settings-sheet{z-index:52}
.crown-glass-ctl{display:none}
:root[data-theme="glass"] .crown-glass-ctl{display:block}
.crown-glass-ctl input[type=range]{width:100%;min-height:44px;accent-color:#2456a6}
.crown-theme-note{margin-top:12px}

/* ---- Glass mode: the workshop scene behind glass surfaces ---- */
:root[data-theme="glass"]{background:linear-gradient(rgba(247,244,236,.34),rgba(247,244,236,.34)),url('carpenter-scene.webp') center/cover no-repeat fixed}
:root[data-theme="glass"][data-theme-resolved="night"]{background:linear-gradient(rgba(10,13,18,.52),rgba(10,13,18,.52)),url('carpenter-scene.webp') center/cover no-repeat fixed}
:root[data-theme="glass"] body{background:transparent}
:root[data-theme="glass"] .card,
:root[data-theme="glass"] .stock-preview,
:root[data-theme="glass"] .helper,
:root[data-theme="glass"] .tcard{
  background:linear-gradient(180deg,rgba(255,255,255,.14),rgba(255,255,255,0) 42%),rgba(var(--glass-fill),var(--glass-o));
  backdrop-filter:blur(var(--glass-blur)) saturate(150%);
  -webkit-backdrop-filter:blur(var(--glass-blur)) saturate(150%);
  border-color:rgba(255,255,255,.38);
}
:root[data-theme="glass"] .feedback-sheet{
  background:linear-gradient(180deg,rgba(255,255,255,.14),rgba(255,255,255,0) 42%),rgba(var(--glass-fill),var(--glass-o));
  backdrop-filter:blur(22px) saturate(150%);
  -webkit-backdrop-filter:blur(22px) saturate(150%);
  border-color:rgba(255,255,255,.38);
}
/* Never layer glass: with a sheet open, the covered surfaces go quiet;
 * the open sheet itself (above) keeps its blur. */
:root.crown-fb-open[data-theme="glass"] .card,
:root.crown-fb-open[data-theme="glass"] .stock-preview,
:root.crown-fb-open[data-theme="glass"] .helper,
:root.crown-fb-open[data-theme="glass"] .tcard,
:root.crown-settings-open[data-theme="glass"] .card,
:root.crown-settings-open[data-theme="glass"] .stock-preview,
:root.crown-settings-open[data-theme="glass"] .helper,
:root.crown-settings-open[data-theme="glass"] .tcard{backdrop-filter:none;-webkit-backdrop-filter:none}
