/* Sleep Call Kit. A night palette in both light and dark mode: it redefines the shared tokens inside this tool only,
   so every shared class (chips, buttons, cards, CTA) follows. The night screen is pure black on purpose. */
.tool.sc {
  --ink: 244 236 255; --accent: 184 110 255; --surface: #22113A; --surface-2: #2C1748; --link: #D3A6FF; --bg: #12061F;
  --shadow: 0 8px 32px rgb(0 0 0 / .35);
  gap: 16px; color: rgb(var(--ink)); color-scheme: dark;
  background: radial-gradient(120% 70% at 50% 0%, #2A1150 0%, #160828 55%, #10051C 100%);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .04);
}
.tool.sc .btn-secondary { background: var(--surface-2); color: rgb(var(--ink)); box-shadow: inset 0 0 0 1px rgb(var(--ink) / .14); }
.tool.sc .tool-chips button[aria-pressed="true"] { background: rgb(var(--ink)); color: #12061F; }
.tool .sc-panel { gap: 16px; }

/* Player: ring with a play button in the middle */
.tool .sc-stage { position: relative; width: 212px; max-width: 100%; margin: 4px auto 0; }
.tool .sc-stage .ck-ring-mid { pointer-events: none; padding-top: 92px; }
.tool .sc-stage .ck-ring-time { font-size: 18px; line-height: 24px; font-weight: 850; max-width: 170px; text-wrap: balance; }
.tool .sc-stage .ck-ring-bg { stroke: rgb(var(--ink) / .1); }
.tool .sc-play {
  position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -68px 0 0 -42px; border-radius: 42px;
  display: grid; place-items: center; color: #fff; background: var(--ramp); box-shadow: 0 10px 32px rgb(167 60 255 / .45);
  transition: transform .2s var(--ease-out), box-shadow .3s ease; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.tool .sc-play:active { transform: scale(.93); }
.tool .sc-play:focus-visible { outline: 3px solid rgb(var(--accent) / .6); outline-offset: 4px; }
.tool .sc-play[aria-pressed="true"] { background: rgb(var(--ink) / .12); color: rgb(var(--ink)); box-shadow: none; }
.tool .sc-play svg { width: 32px; height: 32px; }
.tool .sc-play[aria-pressed="false"] svg { margin-left: 4px; }
.tool.sc.is-playing .ck-ring-fg { filter: drop-shadow(0 0 8px rgb(var(--accent) / .55)); }

/* Sound tiles: pick one or two */
.tool .sc-tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.tool .sc-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 76px; padding: 10px 4px; border-radius: 18px;
  font-size: 13px; line-height: 16px; font-weight: 800; color: rgb(var(--ink) / .78); background: rgb(var(--ink) / .05);
  box-shadow: inset 0 0 0 1px rgb(var(--ink) / .08); transition: background-color .2s ease, color .2s ease, box-shadow .2s ease, transform .2s var(--ease-out);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.tool .sc-tile:active { transform: scale(.95); }
.tool .sc-tile[aria-pressed="true"] { color: rgb(var(--ink)); background: rgb(var(--accent) / .22); box-shadow: inset 0 0 0 1.5px rgb(var(--accent) / .8); }
.tool .sc-tile:focus-visible { outline: 2px solid rgb(var(--accent)); outline-offset: 2px; }

.tool .sc-group { display: flex; flex-direction: column; gap: 8px; }
.tool .sc-label { font-size: 12px; line-height: 16px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; color: rgb(var(--ink) / .5); }
.tool .sc-seg { flex-wrap: nowrap; gap: 6px; }
.tool .sc-seg button { flex: 1 1 0; min-width: 0; padding: 0 4px; white-space: nowrap; background: rgb(var(--ink) / .06); color: rgb(var(--ink) / .7); box-shadow: inset 0 0 0 1px rgb(var(--ink) / .08); }
.tool .sc-volrow { flex-direction: row; align-items: center; gap: 12px; color: rgb(var(--ink) / .55); }
.tool .sc-vol { flex: 1; accent-color: rgb(var(--accent)); height: 32px; }
.tool .sc-sync { padding: 12px 16px; border-radius: 16px; background: rgb(var(--accent) / .14); box-shadow: inset 0 0 0 1px rgb(var(--accent) / .4); font-size: 15px; line-height: 22px; font-weight: 750; color: rgb(var(--ink)); }
.tool .tool-actions .btn svg { width: 22px; height: 22px; }
.tool .sc-help { border-radius: 16px; background: rgb(var(--ink) / .05); }
.tool .sc-help summary { min-height: 44px; padding: 11px 16px; font-size: 14px; font-weight: 800; color: rgb(var(--ink) / .7); cursor: pointer; list-style: none; }
.tool .sc-help summary::-webkit-details-marker { display: none; }
.tool .sc-help ul { display: flex; flex-direction: column; gap: 6px; padding: 0 16px 14px 32px; list-style: disc; }
.tool .sc-help li { font-size: 14px; line-height: 20px; font-weight: 600; color: rgb(var(--ink) / .7); }

/* Wind down */
.tool .sc-intro { margin: 0; color: rgb(var(--ink) / .65); }
.tool .sc-qcard { min-height: 220px; display: flex; flex-direction: column; justify-content: center; gap: 14px; background: rgb(var(--ink) / .06); box-shadow: inset 0 0 0 1px rgb(var(--ink) / .08); }
.tool .sc-qcard.is-cross .sc-q, .tool .sc-qcard.is-cross .sc-qmeta { animation: sc-cross .6s ease both; }
.tool .sc-qmeta { font-size: 12px; line-height: 16px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; color: var(--link); }
.tool .sc-q { font-size: 24px; line-height: 32px; font-weight: 800; color: rgb(var(--ink)); text-wrap: balance; outline: 0; }
.tool .sc-qactions { display: flex; align-items: center; gap: 12px; }
.tool .sc-qactions .btn { flex: 1 1 auto; width: auto; }
.tool .sc-textbtn { flex: none; min-height: 48px; padding: 0 16px; font-size: 15px; font-weight: 800; color: rgb(var(--ink) / .65); background: transparent; border-radius: 24px; }
.tool .sc-textbtn:disabled { opacity: .3; }
@keyframes sc-cross { from { opacity: 0; } }

/* Our rules */
.tool .sc-rules { display: flex; flex-direction: column; gap: 8px; }
.tool .sc-rules li { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 18px; background: rgb(var(--ink) / .05); }
.tool .sc-rules input { flex: none; width: 22px; height: 22px; margin-top: 2px; accent-color: rgb(var(--accent)); }
.tool .sc-rules label { display: flex; flex-direction: column; gap: 2px; cursor: pointer; }
.tool .sc-rules b { font-size: 16px; line-height: 22px; font-weight: 850; color: rgb(var(--ink)); }
.tool .sc-rules span { font-size: 14px; line-height: 20px; font-weight: 600; color: rgb(var(--ink) / .62); }
.tool .sc-answers { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 18px; box-shadow: inset 0 0 0 1px rgb(var(--ink) / .1); }
.tool .sc-answers p { font-size: 14px; line-height: 20px; color: rgb(var(--ink) / .7); }
.tool .sc-answers b { color: rgb(var(--ink)); font-weight: 850; }
.tool.sc .tool-cta { color: rgb(var(--ink) / .65); }

/* Night screen: black, a very dim clock that drifts, controls fade away after a few seconds */
.tool.sc-night {
  position: fixed; inset: 0; z-index: 1000; margin: 0; border-radius: 0; gap: 0; background: rgb(0 0 0); color: rgb(255 255 255 / .3);
  display: flex; flex-direction: column; justify-content: space-between; padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  overscroll-behavior: contain; animation: sc-fade 1.2s ease both; cursor: default;
}
.tool.sc-night[hidden] { display: none !important; }
.tool.sc-night .sc-night-mid { flex: 1; display: grid; place-content: center; text-align: center; gap: 8px; transition: transform 20s ease-in-out, opacity 2s ease; }
.tool.sc-night .sc-night-time { font-size: 72px; line-height: 80px; font-weight: 400; letter-spacing: -.02em; color: rgb(255 255 255 / .24); font-variant-numeric: tabular-nums; }
.tool.sc-night .sc-night-sub { font-size: 15px; line-height: 22px; font-weight: 600; color: rgb(255 255 255 / .2); }
.tool.sc-night .sc-night-ctl { display: flex; gap: 8px; justify-content: center; transition: opacity .6s ease; }
.tool.sc-night .sc-night-btn { min-width: 96px; min-height: 52px; padding: 0 16px; border-radius: 26px; font-size: 15px; font-weight: 750; color: rgb(255 255 255 / .4); background: rgb(255 255 255 / .05); }
.tool.sc-night .sc-night-btn:focus-visible { outline: 2px solid rgb(255 255 255 / .35); outline-offset: 2px; }
.tool.sc-night.is-idle .sc-night-mid { opacity: .4; }
.tool.sc-night.is-idle .sc-night-ctl { opacity: 0; }
@keyframes sc-fade { from { opacity: 0; } }

@media (max-width: 599px) {
  .tool .sc-tiles { grid-template-columns: repeat(3, 1fr); }
  .tool .sc-tile { min-height: 68px; }
  .tool .sc-q { font-size: 22px; line-height: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .tool.sc-night, .tool .sc-qcard.is-cross .sc-q, .tool .sc-qcard.is-cross .sc-qmeta { animation: none; }
  .tool.sc-night .sc-night-mid { transition: opacity 2s ease; }
}

/* Round 2 */
.tool .sc-pre { text-align: center; font-size: 14px; line-height: 20px; font-weight: 700; color: rgb(var(--ink) / .7); margin-top: -4px; }
.tool .sc-mixrow .sc-mixlab { flex: none; min-width: 44px; font-size: 12px; font-weight: 800; color: rgb(var(--ink) / .6); }
.tool .sc-mixrow .sc-mixlab:last-child { text-align: right; }
.tool .sc-qactions .sc-back { flex: none; width: auto; padding: 0 20px; }
.tool .sc-qactions .btn-primary { min-width: 0; }
.tool .sc-windsend { align-self: center; }
.tool.sc .btn-secondary .tool-icon { width: 20px; height: 20px; }

/* Round 3 */
.tool .sc-warn { color: #FFC66B; }
.tool .sc-volrow .sc-volpct { flex: none; width: 40px; text-align: right; font-size: 13px; font-weight: 800; color: rgb(var(--ink) / .7); font-variant-numeric: tabular-nums; }
.tool .sc-low { min-width: 0; min-height: 36px; padding: 0 12px; font-size: 13px; background: rgb(var(--ink) / .06); color: rgb(var(--ink) / .8); box-shadow: inset 0 0 0 1px rgb(var(--ink) / .12); }
.tool .sc-calltip { margin: 0; color: rgb(var(--ink) / .7); }
.tool.sc .sc-seg button[aria-pressed="true"] { background: rgb(var(--accent) / .3); color: rgb(var(--ink)); box-shadow: inset 0 0 0 1.5px rgb(var(--accent) / .85); }
.tool .sc-stage .ck-ring { cursor: pointer; }
.tool .sc-play[aria-pressed="true"] { background: rgb(var(--ink)); color: #12061F; }
.tool .sc-qcard { min-height: 170px; }
.tool .sc-dots { display: flex; gap: 6px; justify-content: center; }
.tool .sc-dots span { width: 6px; height: 6px; border-radius: 3px; background: rgb(var(--ink) / .18); transition: width .3s var(--ease-out), background-color .3s ease; }
.tool .sc-dots span.is-done { background: rgb(var(--accent) / .55); }
.tool .sc-dots span.is-on { width: 18px; background: rgb(var(--accent)); }
.tool .sc-windsend { align-self: stretch; }
.tool.sc-night .sc-night-time { color: rgb(255 255 255 / .16); }
.tool.sc-night .sc-night-sub { color: rgb(255 255 255 / .14); }
.tool.sc-night .sc-night-btn { background: rgb(255 255 255 / .04); color: rgb(255 255 255 / .35); }
.tool.sc-night.is-idle .sc-night-mid { opacity: .5; }
@media (prefers-reduced-motion: reduce) { .tool .sc-dots span { transition: none; } }
.tool .sc-seg.tool-chips { flex-wrap: wrap; } .tool .sc-seg.tool-chips button { flex: 1 1 52px; }
/* Round 4 */
.tool.sc-night.is-idle .sc-night-ctl { pointer-events: none; }
.tool.sc-night.is-idle .sc-night-time { color: rgb(255 255 255 / .12); }
.tool .sc-resume { padding: 12px 16px; border-radius: 16px; font-size: 15px; font-weight: 800; color: #12061F; background: #FFC66B; }
.tool .sc-help .sc-group { padding: 0 16px 14px; }
.tool .sc-answers { margin-top: 0; }
/* After round 5 */
.tool .sc-warn { color: rgb(var(--ink) / .7); text-align: left; font-weight: 650; margin: 0; }
.tool .sc-help .sc-seg.tool-chips { display: grid; grid-template-columns: 1fr 1fr; }
.tool .sc-qactions { min-width: 0; }
.tool .sc-qactions .btn-primary { flex: 1 1 0; padding: 0 16px; white-space: nowrap; }
/* Round 6: two-line pre-play hint, icons in the mix labels, screen setting note */
.tool .sc-pre p { margin: 0; }
.tool .sc-mixrow .sc-mixlab { display: inline-flex; align-items: center; gap: 4px; }
.tool .sc-mixrow .sc-mixlab:last-child { justify-content: flex-end; }
.tool .sc-mixrow .sc-mixlab svg { flex: none; }
.tool .sc-screennote { margin: 0; }
