/* Shared building blocks for the newer tools (Countdown, Task Cards, Focus, Decision Wheel, Dice, Story Dice).
   Each page sets --section to its section colour. Loaded before the page's own <style>. */
:root {
  --bg: #0D0F14; --surface: #161A22; --raise: #1A1F29; --line: #262C38; --line-2: #3A4252;
  --ink: #F2F4F8; --muted: #A3ACBD; --soft-ink: #C9D0DC;
  --amber: #FFB547; --blue: #6CA8FF; --teal: #4FD1B5; --purple: #C79BFF; --coral: #FF8A7A; --green: #4ADE80;
  --section: var(--amber); --section-ink: #0D0F14;
  --f-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body: "Inter", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.55 var(--f-body); }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--section); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); }

.intro { padding-block: 30px 22px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; }
.intro .kicker { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--section); }
.intro .kicker::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--section); }
.intro h1 { margin: 0; font: 800 clamp(2.1rem, 1.5rem + 2.4vw, 3.3rem)/1.02 var(--f-display); letter-spacing: -0.03em; }
.intro p.lede { margin: 8px 0 0; max-width: 40em; color: var(--muted); font-size: 1.05rem; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: clamp(18px, 2.4vw, 28px); }
.panel h2 { margin: 0 0 14px; font: 600 1.3rem/1.2 var(--f-display); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 11px 18px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--raise); color: var(--ink); font: 600 .98rem/1.1 var(--f-body); cursor: pointer; text-decoration: none; transition: transform .15s ease, background-color .2s ease, border-color .2s ease, color .2s ease; }
.btn:hover { border-color: #4A5366; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-main { background: var(--section); border-color: var(--section); color: var(--section-ink); }
.btn-main:hover { border-color: var(--section); filter: brightness(1.06); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--soft-ink); }
.btn-quiet:hover { background: var(--raise); }
.btn-big { min-height: 56px; padding: 14px 26px; font-size: 1.08rem; border-radius: 16px; }
.icon-btn { width: 40px; height: 40px; min-height: 0; padding: 0; border-radius: 12px; }

.field { display: flex; flex-direction: column; gap: 7px; font-size: .86rem; font-weight: 600; color: var(--soft-ink); }
.field input, .field select, .field textarea, .input {
  font: 400 1rem/1.3 var(--f-body); color: var(--ink); background: var(--bg);
  border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 13px; min-height: 46px; width: 100%;
}
.field textarea { resize: vertical; min-height: 84px; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--section); box-shadow: 0 0 0 3px color-mix(in srgb, var(--section) 25%, transparent); }
.hint { margin: 0; color: var(--muted); font-size: .86rem; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.seg button { min-height: 38px; padding: 8px 14px; border: 0; border-radius: 10px; background: transparent; color: var(--soft-ink); font: 600 .9rem/1 var(--f-body); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--section); color: var(--section-ink); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 42px; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 600 .92rem/1 var(--f-body); cursor: pointer; transition: transform .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease; }
.chip:hover { transform: translateY(-2px); }
.chip[aria-pressed="true"] { background: var(--section); border-color: var(--section); color: var(--section-ink); }

.check { display: flex; align-items: center; gap: 10px; font-size: .95rem; color: var(--soft-ink); cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--section); }

.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 12px 18px; border-radius: 14px; background: var(--ink); color: var(--bg); font-weight: 600; transition: opacity .25s ease, transform .25s ease; z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
