/* songcode — the ode player (public/embed/ode-player.js).
 *
 * A card with a bar over a block of ode. It takes the page's own tokens where
 * the page has them (the blog, the docs, the landing page) and falls back to
 * songcode's values where it does not. The accent is the play button and the
 * rows that are sounding, as in the app.
 */
.ode-player {
  --odp-surface: var(--surface-0, #0e0f12);
  --odp-line: var(--line, rgba(255, 255, 255, 0.08));
  --odp-line-strong: var(--line-strong, rgba(255, 255, 255, 0.16));
  --odp-text: var(--text-2, #a4a7b1);
  --odp-dim: var(--text-3, #6f727c);
  --odp-accent: var(--accent, #b8ff2e);
  --odp-accent-ink: var(--accent-ink, #0b0d08);
  --odp-mono: var(--font-mono, ui-monospace, 'SF Mono', Menlo, Consolas, monospace);
  --odp-pad: 20px;
  position: relative;
  margin: 1.6em 0;
  min-width: 0;
  border-radius: var(--r-lg, 14px);
  background: var(--odp-surface);
  box-shadow: inset 0 0 0 1px var(--odp-line);
  overflow: hidden;
  transition: box-shadow 0.24s ease;
}
.ode-player[data-state='playing'] { box-shadow: inset 0 0 0 1px var(--odp-line-strong); }

.odp-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px var(--odp-pad) 10px 12px;
  box-shadow: inset 0 -1px 0 var(--odp-line);
}
.odp-play {
  flex: none;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: var(--odp-accent);
  color: var(--odp-accent-ink);
  transition: transform 0.12s ease, box-shadow 0.24s ease, opacity 0.24s ease;
}
.odp-play:hover { transform: scale(1.05); }
.odp-play:active { transform: scale(0.96); }
.odp-play:focus-visible { outline: 0; box-shadow: var(--focus, 0 0 0 2px #0e0f12, 0 0 0 4px #b8ff2e); }
.odp-play:disabled { cursor: default; transform: none; animation: odp-wait 1.1s ease-in-out infinite; }
.odp-play svg { width: 14px; height: 14px; fill: currentColor; }
.odp-play .i-stop, .ode-player[data-state='playing'] .odp-play .i-play { display: none; }
.ode-player[data-state='playing'] .odp-play .i-stop { display: inline; }
.ode-player[data-state='playing'] .odp-play { box-shadow: 0 0 18px rgba(184, 255, 46, 0.28); }
.ode-player[data-state='playing'] .odp-play:focus-visible { box-shadow: var(--focus, 0 0 0 2px #0e0f12, 0 0 0 4px #b8ff2e); }
@keyframes odp-wait { 50% { opacity: 0.45; } }

.odp-meta, .odp-status {
  font-family: var(--odp-mono);
  font-size: 12px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.odp-meta { flex: none; color: var(--odp-text); }
.odp-status { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: right; color: var(--odp-dim); }
.ode-player[data-state='playing'] .odp-status { color: var(--odp-accent); }

/* the shown ode: the page's code block, without a card of its own */
.ode-player pre.code,
.prose .ode-player pre.code {
  margin: 0;
  padding: 18px var(--odp-pad);
  border-radius: 0;
  background: none;
  box-shadow: none;
  overflow-x: auto;
  color: #d5d7de;
  font-family: var(--odp-mono);
  font-size: 13px;
  line-height: 1.7;
  tab-size: 2;
}
/* the editor that takes its place: same type, same padding, so nothing moves */
.odp-editor { position: relative; min-width: 0; }
.odp-editor > songcode-editor {
  --sc-pad: 18px 0;
  --sc-gutter: 0px;
  --sc-gutter-pad: 0;
  --sc-text-pad: 0 var(--odp-pad);
  display: block;
  height: auto;
  line-height: 1.7;
}
.odp-editor .sc-scroller { height: auto; overflow-x: auto; overflow-y: visible; font-family: var(--odp-mono); }

@media (max-width: 720px) {
  .prose .ode-player { margin-inline: calc(var(--gutter, 0px) * -1); border-radius: 0; --odp-pad: var(--gutter, 16px); }
  .ode-player pre.code, .prose .ode-player pre.code { font-size: 12.5px; }
  .odp-bar { padding-left: var(--odp-pad); }
}
@media (prefers-reduced-motion: reduce) {
  .odp-play, .ode-player { transition: none; }
  .odp-play:disabled { animation: none; opacity: 0.6; }
}

/* thin, quiet scrollbars, as in the app (public/styles.css): no arrows, no
   track, a rounded thumb */
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.16) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border: 3px solid transparent;
  border-radius: 99px;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, 0.28); }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-button { display: none; }
