/* Shared structure for dialogs and karaoke. Each version sets --yv-* tokens to make these its own. */
.yv-dialog { border: 0; padding: 0; max-width: min(720px, calc(100vw - 24px)); width: 100%; max-height: calc(100dvh - 24px); background: var(--yv-surface, #fff); color: var(--yv-ink, #111); border-radius: var(--yv-radius, 20px); font-family: var(--yv-body, system-ui); }
.yv-dialog::backdrop { background: rgba(10, 12, 30, .6); }
.yv-dialog form, .yv-brief-in { padding: 32px; display: grid; gap: 16px; }
.yv-dialog h2 { font-family: var(--yv-display, inherit); font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1.05; margin: 0; padding-right: 40px; }
.yv-dialog h3 { font-family: var(--yv-display, inherit); font-size: 1.05rem; margin: 0 0 6px; }
.yv-dialog p { margin: 0; line-height: 1.55; }
.yv-dialog section { display: grid; gap: 6px; }
.yv-dialog ol { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
.yv-dialog figure { margin: 0 0 8px; padding-left: 12px; border-left: 4px solid var(--yv-accent, #f0f); }
.yv-dialog blockquote { margin: 0; }
.yv-dialog figcaption { font-size: .88rem; opacity: .75; }
.yv-close { position: absolute; z-index: 2; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%; border: 2px solid currentColor; background: transparent; color: inherit; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.yv-brief-in { position: relative; }
.yv-brief-kind { font-weight: 700; font-size: .92rem; opacity: .8; }
.yv-brief-status { justify-self: start; font-weight: 700; font-size: .9rem; padding: 5px 12px; border-radius: 999px; background: var(--yv-accent, #f0f); color: var(--yv-accent-ink, #fff); }
.yv-s-yes { background: var(--yv-yes, #1fb46a); color: #fff; }
.yv-mix { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.yv-mix b { font-family: var(--yv-display, inherit); font-size: 1.8rem; display: block; line-height: 1; }
.yv-mix span { font-size: .82rem; opacity: .8; }
.yv-small { font-size: .88rem; opacity: .75; }
.yv-emoji { font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1.3; letter-spacing: .08em; }
.yv-key { font-style: italic; opacity: .85; }
.yv-row { display: flex; flex-wrap: wrap; gap: 10px; }
.yv-btn { font: 700 1rem var(--yv-body, inherit); padding: 11px 20px; border-radius: 999px; border: 2px solid currentColor; background: transparent; color: inherit; cursor: pointer; }
.yv-btn-main { background: var(--yv-accent, #f0f); border-color: var(--yv-accent, #f0f); color: var(--yv-accent-ink, #fff); }
.yv-parent { display: grid; gap: 12px; padding-top: 6px; }
.yv-parent[hidden] { display: none; }
.yv-dialog a { color: inherit; font-weight: 700; }
@media (max-width: 520px) { .yv-dialog form, .yv-brief-in { padding: 22px; } .yv-mix { grid-template-columns: 1fr 1fr; } }

/* Karaoke */
.yv-k-notes { display: flex; flex-wrap: wrap; gap: 8px; min-height: 36px; }
.yv-k-note { font-weight: 700; font-size: .9rem; padding: 6px 12px; border-radius: 999px; background: var(--yv-accent, #f0f); color: var(--yv-accent-ink, #fff); }
@media (prefers-reduced-motion: no-preference) { .yv-k-note { animation: yv-pop .35s cubic-bezier(.2, 1.4, .4, 1) both; } @keyframes yv-pop { from { transform: scale(.6); opacity: 0; } } }
.yv-k-text { font-family: var(--yv-display, inherit); font-size: clamp(1.25rem, 2.6vw, 1.7rem); line-height: 1.4; margin: 14px 0; }
.yv-k-text span { opacity: .35; transition: opacity .15s; }
.yv-k-text span.on { opacity: 1; }
.yv-k-text span.hit.on { background: var(--yv-highlight, yellow); color: var(--yv-highlight-ink, #111); border-radius: 6px; padding: 0 4px; }
.yv-k-audio { width: 100%; }
.yv-k-red { font-size: .88rem; opacity: .8; margin-top: 8px; }

@media print { body:has(dialog.yv-brief[open]) > *:not(dialog) { display: none !important; } .yv-dialog { position: static; max-height: none; box-shadow: none; } .yv-close, .yv-row { display: none; } }

/* Answer player */
.yv-pl { display: grid; gap: 10px; }
.yv-pl-row { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; }
.yv-pl-btn { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--yv-accent, #f0f); color: var(--yv-accent-ink, #fff); display: grid; place-items: center; cursor: pointer; box-shadow: 0 6px 16px -8px rgba(0,0,0,.5); }
.yv-pl-btn svg { width: 22px; height: 22px; }
.yv-pl-btn:active { transform: scale(.96); }
.yv-pl-main { min-width: 0; }
.yv-pl-wave { position: relative; padding-top: 28px; }
.yv-pl-wave canvas { width: 100%; height: 44px; display: block; cursor: pointer; touch-action: none; }
.yv-pl-notes { position: absolute; inset: 0 0 auto 0; height: 26px; pointer-events: none; }
.yv-pl-note { position: absolute; top: 0; transform: translateX(-6px); white-space: nowrap; font-size: .74rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: var(--yv-wave-chip, rgba(0,0,0,.08)); color: inherit; opacity: .55; transition: opacity .2s, background-color .2s; }
.yv-pl-note::after { content: ""; position: absolute; left: 5px; top: 100%; width: 2px; height: 8px; background: currentColor; opacity: .5; }
.yv-pl-note.on { opacity: 1; background: var(--yv-highlight, yellow); color: var(--yv-highlight-ink, #111); }
.yv-pl-time { display: flex; justify-content: space-between; font-size: .8rem; font-weight: 700; opacity: .7; font-variant-numeric: tabular-nums; margin-top: 2px; }
.yv-pl-words { margin: 0; line-height: 1.5; }
.yv-pl-words span { opacity: .45; transition: opacity .12s; }
.yv-pl.playing .yv-pl-words span.on, .yv-pl-words span.on { opacity: 1; }
.yv-pl-words span.hit.on { background: var(--yv-highlight, yellow); color: var(--yv-highlight-ink, #111); border-radius: 5px; padding: 0 3px; }
.yv-pl:not(.playing) .yv-pl-words span:not(.on) { opacity: 1; }
@media (prefers-reduced-motion: no-preference) { .yv-pl-note.on { animation: yv-pop .3s cubic-bezier(.2, 1.4, .4, 1); } }
.yv-btn { text-decoration: none; display: inline-block; }
