/* Calm ambient backdrop (only while sounds play), bigger play button, sheet tabs. */
:root { --ring: rgba(79, 122, 52, .22); --b1: hsla(110, 45%, 45%, .13); --b2: hsla(120, 50%, 45%, .10); --b3: transparent; }
[data-theme="dark"] { --ring: rgba(143, 192, 106, .22); --b1: hsla(120, 45%, 40%, .16); --b2: hsla(125, 55%, 45%, .09); --b3: transparent; }
/* Nostalgic CRT glow: a dim warm vignette and one smooth scanline roll, only while playing. */
body::before, body::after { content: ""; position: fixed; z-index: -1; pointer-events: none; opacity: 0; transition: opacity 1.5s ease; }
body::before { inset: 0; background: radial-gradient(ellipse at 50% 45%, var(--b1), transparent 70%); }
body::after { left: 0; right: 0; top: 0; height: 28vh; background: linear-gradient(transparent, var(--b2), transparent); will-change: transform; animation: roll 7s linear infinite; animation-play-state: paused; }
body.playing::before { opacity: 1; }
body.playing::after { opacity: 1; animation-play-state: running; }
@keyframes roll { from { transform: translateY(-30vh); } to { transform: translateY(105vh); } }

.play { box-shadow: 0 0 0 6px var(--ring); transition: transform .2s ease, box-shadow .6s ease; }
.play:active { transform: scale(.94); }
body.playing .play { animation: breathe 6s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 0 11px var(--ring); } }
.dock { gap: 14px; padding: 8px 14px 8px 10px; }

.tabs { display: flex; gap: 4px; padding: 3px; margin: 0 0 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.tabs button { flex: 1; padding: 5px 2px; border-radius: 11px; color: var(--mute); }
.tabs button[aria-selected="true"] { background: var(--acc); color: var(--on); }
.pane[hidden] { display: none; }
.refs { font-size: .85rem; line-height: 1.25; }
.refs li { margin-bottom: 4px; }
.sheet .grab { position: absolute; top: 6px; right: 8px; padding: 0; }
.sheet .body { padding-top: 50px; }

.brand { user-select: none; }
.sleep { padding: 6px 12px; border-radius: 12px; font-size: 1rem; line-height: 1; background: var(--card); border: 1px solid var(--line); color: var(--mute); min-width: 64px; }
.sleep.on { color: var(--on); background: var(--acc); border-color: var(--acc); }
.dock { position: relative; }
.pop { position: absolute; z-index: 22; right: 0; bottom: calc(100% + 12px); width: min(340px, 100%); padding: 12px; background: var(--card); border: 2px solid var(--line); display: flex; flex-direction: column; gap: 12px; animation: rise .18s ease-out; }
.pop[hidden], #toff[hidden] { display: none; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.grid6 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.chip.big { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 62px; padding: 0; font-size: 1.9rem; line-height: 1; }
.chip.big small { font-size: .85rem; color: var(--mute); }
.step { display: flex; align-items: center; gap: 8px; }
.step .gbtn { flex: none; width: 48px; height: 48px; font-size: 1.9rem; }
.step label { flex: 1; text-align: center; font-size: 1.3rem; color: var(--mute); }
.step input { width: 3.2ch; padding: 0; font-size: 2.2rem; text-align: center; color: var(--ink); background: none; border: 0; border-bottom: 2px solid var(--line); -moz-appearance: textfield; }
.step input::-webkit-outer-spin-button, .step input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.chip.go { height: 48px; padding: 0 16px; font-size: 1.4rem; background: var(--acc); color: var(--on); }
#toff { height: 44px; font-size: 1.3rem; }
/* Reference cards and noise-color chart. */
.refs li.ref { display: flex; gap: 10px; margin: 0 0 8px; padding: 8px; list-style: none; background: var(--card); border: 2px solid var(--line); }
.refs { padding: 0; }
.yr { flex: none; align-self: flex-start; min-width: 46px; padding: 2px 4px; text-align: center; background: var(--acc); color: var(--on); font-weight: 400; }
.ref .tt { display: block; color: var(--ink); line-height: 1.2; }
.ref .au { display: block; margin-top: 2px; font-size: .85rem; }
.ref .lk { display: flex; gap: 6px; margin-top: 6px; }
.ref .lk a { padding: 0 8px; font-size: .85rem; color: var(--ink); text-decoration: none; border: 2px solid var(--line); box-shadow: 2px 2px 0 var(--line); }
.ref .lk a:active { transform: translate(2px, 2px); box-shadow: none; }
.sp { display: flex; align-items: flex-end; gap: 4px; height: 38px; margin-bottom: 8px; }
.sp span { width: 52px; align-self: center; }
.sp i { flex: 1; height: calc(var(--n) * 100%); background: var(--acc); border: 2px solid var(--line); }
