:root {
  color-scheme: light dark;
  --bg: #f4f1ea;
  --bg2: #e9e4f3;
  --card: #ffffff;
  --ink: #1c1a2e;
  --muted: #5d5a73;
  --line: rgba(28, 26, 46, .14);
  --accent: #c7781a;
  --accent-ink: #ffffff;
  --track: #dcd7e8;
  --chip: #f1eef7;
  --shadow: 0 10px 30px rgba(28, 26, 46, .10);
  --radius: 20px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0e1f;
    --bg2: #1a1736;
    --card: #1b1933;
    --ink: #eeecf8;
    --muted: #a9a5c4;
    --line: rgba(238, 236, 248, .14);
    --accent: #f5b553;
    --accent-ink: #1b1933;
    --track: #33305a;
    --chip: #252246;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg2), var(--bg) 420px) var(--bg);
  min-height: 100vh;
  line-height: 1.5;
}
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip-link:focus { left: 8px; }

.site-header { max-width: 1080px; margin: 0 auto; padding: 18px 16px 6px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand__mark { width: 44px; height: 44px; color: var(--accent); flex: none; }
.brand__title { margin: 0; font-size: 1.6rem; letter-spacing: -.02em; }
.brand__tag { margin: 0; color: var(--muted); font-size: .92rem; }

.layout { display: grid; gap: 16px; max-width: 1080px; margin: 0 auto; padding: 10px 16px 24px; }
@media (min-width: 900px) {
  .layout { grid-template-columns: 1fr 300px; align-items: start; }
  .side { position: sticky; top: 16px; }
}
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 16px; border: 1px solid var(--line); }
.player:focus { outline: none; }

/* Hero / play */
.hero { text-align: center; padding: 4px 0 8px; }
.mix-name {
  font: inherit; font-size: 1.25rem; font-weight: 650; text-align: center;
  color: var(--ink); background: transparent; border: 1px solid transparent; border-radius: 10px;
  padding: 4px 10px; width: min(100%, 360px);
}
.mix-name:hover { border-color: var(--line); }
.mix-name:focus { border-color: var(--accent); outline: none; }
.play {
  display: grid; place-items: center;
  width: 128px; height: 128px; margin: 14px auto 8px; border-radius: 50%;
  border: 0; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--accent) 80%, #fff), var(--accent));
  color: var(--accent-ink);
  box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 45%, transparent);
  transition: transform .15s ease;
}
.play:hover { transform: scale(1.04); }
.play:active { transform: scale(.97); }
.play__icon { width: 56px; height: 56px; fill: currentColor; }
.play__icon--pause, .is-playing .play__icon--play { display: none; }
.is-playing .play__icon--pause { display: block; }
.is-playing .play { animation: breathe 6s ease-in-out infinite; }
@keyframes breathe {
  0%, 100% { box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 35%, transparent); }
  50% { box-shadow: 0 10px 50px color-mix(in srgb, var(--accent) 75%, transparent); }
}
.status { margin: 0; color: var(--muted); font-weight: 550; }
.hint { margin: 6px 0 0; color: var(--muted); font-size: .88rem; }
#silent-hint { color: var(--accent); }

/* Blocks */
.block { margin-top: 18px; }
.block__title { font-size: .8rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 0 0 8px; font-weight: 700; }
.timer-left { text-transform: none; letter-spacing: 0; color: var(--accent); font-variant-numeric: tabular-nums; margin-left: 6px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-size: .92rem; cursor: pointer;
  min-height: 40px; padding: 6px 14px; border-radius: 999px;
  color: var(--ink); background: var(--chip); border: 1px solid var(--line);
}
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 650; }

/* Layers */
.layers { display: grid; gap: 4px 20px; }
@media (min-width: 620px) { .layers { grid-template-columns: 1fr 1fr; } }
.layer {
  display: grid; grid-template-columns: 40px 1fr 38px; grid-template-areas: "tog label val" "tog slider slider";
  align-items: center; column-gap: 10px; padding: 6px 0;
}
.layer:not(:has(.layer__toggle)) { grid-template-columns: 1fr 38px; grid-template-areas: "label val" "slider slider"; }
.layer__toggle {
  grid-area: tog; width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line); background: var(--chip); color: var(--muted);
  display: grid; place-items: center; padding: 0;
}
.layer__toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.layer__toggle[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 22%, var(--chip)); color: var(--accent); border-color: var(--accent); }
.layer__label { grid-area: label; font-weight: 600; font-size: .95rem; }
.layer__hint { color: var(--muted); font-weight: 400; font-size: .8rem; margin-left: 4px; }
.layer__val { grid-area: val; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; font-size: .9rem; }
.slider { grid-area: slider; width: 100%; height: 32px; margin: 0; accent-color: var(--accent); cursor: pointer; background: transparent; }

/* Actions */
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.btn {
  font: inherit; font-weight: 600; cursor: pointer; min-height: 44px; padding: 8px 16px; border-radius: 12px;
  color: var(--ink); background: var(--chip); border: 1px solid var(--line);
}
.btn:hover { border-color: var(--accent); }
.embed-link { display: none; }

/* Ads: reserved sizes so nothing jumps */
.ad-slot {
  position: relative; display: flex; align-items: center; justify-content: center;
  margin: 0 auto; border: 2px dashed var(--line); border-radius: 12px; overflow: hidden;
}
.ad-slot__label { position: absolute; top: 4px; left: 8px; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ad-slot--rect { width: 300px; max-width: 100%; height: 250px; }
.ad-slot--bottom { width: 100%; max-width: 728px; height: 100px; margin: 24px auto; }

/* SEO + footer */
.seo { max-width: 760px; margin: 24px auto 0; padding: 0 16px; }
.seo h2 { font-size: 1.2rem; margin: 28px 0 8px; }
.seo li { margin-bottom: 4px; }
details { border-bottom: 1px solid var(--line); padding: 10px 0; }
summary { cursor: pointer; font-weight: 600; }
.site-footer { max-width: 760px; margin: 24px auto; padding: 0 16px 32px; font-size: .92rem; }
.muted { color: var(--muted); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); z-index: 30;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Dim mode: near-black, one control, no ads */
.dim {
  position: fixed; inset: 0; z-index: 20; background: #000; color: #6d6a80;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
}
.dim[hidden] { display: none; }
.dim__play {
  width: 140px; height: 140px; border-radius: 50%; border: 1px solid #2a2838; background: #0b0a12;
  color: #6d6a80; cursor: pointer; display: grid; place-items: center;
}
.dim .play__icon { width: 56px; height: 56px; fill: currentColor; }
.dim__status { margin: 0; font-size: .95rem; }
.dim__exit { background: none; border: 0; color: #4c4a5c; font: inherit; text-decoration: underline; cursor: pointer; min-height: 44px; }
body.dim-on { overflow: hidden; }
body.dim-on .ad-slot { display: none !important; }

/* Embed mode */
body.embed { background: var(--card); min-height: 0; }
body.embed .chrome, body.embed .ad-slot, body.embed .skip-link { display: none !important; }
body.embed .layout { grid-template-columns: 1fr; padding: 6px; max-width: 640px; }
body.embed .card { box-shadow: none; padding: 12px; }
body.embed .play { width: 96px; height: 96px; margin-top: 8px; }
body.embed .play__icon { width: 44px; height: 44px; }
body.embed .block { margin-top: 12px; }
body.embed .embed-link { display: block; text-align: center; margin-top: 12px; font-size: .85rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
