/* Ывак-плеер (player.js) + единый вид мини-плеера экзамена.
   Цвета из site.css (--x-*), поэтому на ывак.рф плеер советский сам. */

.yp { position: relative; outline: none; --yp-accent: var(--x-red, #d3142f); --yp-ink: var(--x-ink, #0c0d11); --yp-paper: var(--x-paper, #f3eee5); font-family: var(--x-mono, monospace); color: #fff; }
.yp:focus-visible { box-shadow: 0 0 0 3px var(--x-gold, #f2b935); }
.yp-btn { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }
.yp-btn svg { width: 20px; height: 20px; fill: currentColor; }
.yp-btn:hover { color: var(--x-gold, #f2b935); }

/* ── видео ── */
.yp-video { background: #000; border: 2px solid var(--yp-ink); overflow: hidden; }
.yp-video video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; cursor: pointer; }
.yp-big { position: absolute; left: 50%; top: 50%; width: 92px; height: 92px; margin: -46px 0 0 -46px; background: var(--yp-accent); border: 3px solid #fff; box-shadow: 6px 6px 0 var(--yp-ink); transition: transform .2s, opacity .2s; }
.yp-big svg { width: 38px; height: 38px; margin-left: 5px; }
.yp-big:hover { color: #fff; transform: scale(1.06); }
.yp:not(.is-paused) .yp-big { opacity: 0; pointer-events: none; transform: scale(.8); }
.yp-chapter { position: absolute; left: 14px; top: 14px; max-width: 70%; padding: 5px 10px; background: rgba(0, 0, 0, .72); font-size: 12.5px; letter-spacing: .02em; pointer-events: none; transition: opacity .3s; }
.yp-chapter:empty { display: none; }

.yp-bar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 8px; }
.yp-video .yp-bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 10px 8px; background: linear-gradient(to top, rgba(0, 0, 0, .86), transparent); transition: opacity .3s; }
.yp-video.is-idle .yp-bar, .yp-video.is-idle .yp-chapter { opacity: 0; }
.yp-video.is-idle { cursor: none; }
.yp-left, .yp-right { display: flex; align-items: center; gap: 2px; }
.yp-time { padding: 0 8px; font-size: 12.5px; white-space: nowrap; opacity: .9; }
.yp-title { padding: 0 8px; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }

/* полоса перемотки */
.yp-track { position: relative; height: 22px; cursor: pointer; touch-action: none; }
.yp-track::before, .yp-buffered, .yp-played { content: ""; position: absolute; left: 0; top: 9px; height: 4px; }
.yp-track::before { right: 0; background: rgba(255, 255, 255, .22); }
.yp-buffered { background: rgba(255, 255, 255, .38); width: 0; }
.yp-played { background: var(--yp-accent); width: 0; }
.yp-track:hover::before, .yp-track:hover .yp-buffered, .yp-track:hover .yp-played { top: 8px; height: 6px; }
.yp-knob { position: absolute; top: 5px; width: 12px; height: 12px; margin-left: -6px; background: #fff; border: 2px solid var(--yp-accent); transform: scale(0); transition: transform .15s; }
.yp-track:hover .yp-knob, .yp:focus-visible .yp-knob { transform: scale(1); }
.yp-mark { position: absolute; top: 8px; width: 3px; height: 6px; margin-left: -1px; background: var(--yp-ink); }
.yp-tip { position: absolute; bottom: 24px; padding: 4px 8px; background: var(--yp-paper); color: var(--yp-ink); font-size: 12px; white-space: nowrap; transform: translateX(-50%); opacity: 0; pointer-events: none; transition: opacity .15s; }
.yp-track:hover .yp-tip { opacity: 1; }

/* громкость и скорость */
.yp-vol { -webkit-appearance: none; appearance: none; width: 70px; height: 4px; margin: 0 6px; background: linear-gradient(to right, #fff var(--v, 50%), rgba(255, 255, 255, .25) var(--v, 50%)); cursor: pointer; }
.yp-vol::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; background: #fff; border: 0; }
.yp-vol::-moz-range-thumb { width: 12px; height: 12px; background: #fff; border: 0; border-radius: 0; }
.yp-speed { width: auto; min-width: 42px; padding: 0 6px; font: 700 12.5px var(--x-mono, monospace); }
.yp-cc.is-on { color: var(--x-gold, #f2b935); }

.yp.is-full { border: 0; }
.yp.is-full video { height: 100vh; aspect-ratio: auto; }
.yp video::cue { background: rgba(0, 0, 0, .78); font-family: var(--x-body, sans-serif); }

/* ── аудио ── */
.yp-audio { background: var(--yp-ink); border: 2px solid var(--yp-ink); box-shadow: 5px 5px 0 var(--yp-accent); }
.yp-audio audio { display: none; }
.yp-audio .yp-play { background: var(--yp-accent); }

@media (max-width: 640px) {
  .yp-vol, .yp-speed { display: none; }
  .yp-big { width: 70px; height: 70px; margin: -35px 0 0 -35px; }
  .yp-time { font-size: 11.5px; padding: 0 4px; }
}

/* ── советская тема ── */
html.ussr .yp-video { border: 4px solid var(--x-ink); box-shadow: 10px 10px 0 var(--x-red); }
html.ussr .yp-big { border-radius: 50%; background: var(--x-red); color: var(--x-gold); border: 4px solid var(--x-gold); box-shadow: 5px 5px 0 var(--x-ink); }
html.ussr .yp-played, html.ussr .yp-knob { background: var(--x-gold); border-color: var(--x-red); }
html.ussr .yp-chapter { background: var(--x-red); color: var(--x-paper); font-family: var(--x-cond, sans-serif); text-transform: uppercase; letter-spacing: .08em; }
html.ussr .yp-tip { background: var(--x-gold); font-family: var(--x-cond, sans-serif); }
html.ussr .yp-audio { box-shadow: 5px 5px 0 var(--x-gold); }

/* ── мини-плеер экзамена (exam_run.html): тот же вид, разметка и логика прежние ── */
.yv-player#yv-player { border-radius: 0 !important; background: var(--x-ink, #0c0d11) !important; border: 2px solid var(--x-ink, #0c0d11) !important; box-shadow: 5px 5px 0 var(--x-red, #d3142f) !important; backdrop-filter: none !important; }
.yv-player#yv-player .yv-player-btn { border-radius: 0 !important; background: var(--x-red, #d3142f) !important; border: 0 !important; color: #fff !important; }
.yv-player#yv-player .yv-player-title { font-family: var(--x-mono, monospace) !important; letter-spacing: .02em; }
.yv-player#yv-player .yv-player-seek, .yv-player#yv-player .yv-player-vol { border-radius: 0 !important; height: 4px !important; }
.yv-player#yv-player .yv-player-seek::-webkit-slider-thumb, .yv-player#yv-player .yv-player-vol::-webkit-slider-thumb { border-radius: 0 !important; background: #fff !important; }
.yv-player#yv-player .yv-player-seek::-moz-range-thumb, .yv-player#yv-player .yv-player-vol::-moz-range-thumb { border-radius: 0 !important; background: #fff !important; }

@media (prefers-reduced-motion: reduce) {
  .yp-big, .yp-bar, .yp-knob, .yp-tip { transition: none; }
}
