/* The player owns the viewport; film sheets keep their compact layout. */
.sheet.player-sheet {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: #050506;
  box-shadow: none;
}
.player-sheet::backdrop { background: #050506; backdrop-filter: none; }
.player-shell { position: relative; width: 100%; height: 100%; isolation: isolate; color: #faf9f6; }
.player-screen { position: absolute; inset: 0; z-index: -1; background: #050506; }
.player-screen img { width: 100%; height: 100%; object-fit: contain; }
.player-topbar {
  position: absolute;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 35px max(18px, env(safe-area-inset-left));
  background: linear-gradient(#000b, #0004 65%, transparent);
}
.player-back { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; gap: 7px; min-height: 46px; padding: 10px 14px 10px 10px; border-radius: 16px; font-size: 12px; }
.player-back svg { width: 17px; height: 17px; transform: rotate(180deg); }
[dir=rtl] .player-back svg { transform: none; }
.player-preview-badge { display: inline-flex; align-items: center; gap: 7px; color: #dddde3; font-size: 10px; line-height: 1.5; text-align: end; }
.player-preview-badge > span { width: 5px; height: 5px; border-radius: 50%; background: #ed3d42; flex-shrink: 0; }
.player-hud {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 56px max(18px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background: linear-gradient(transparent, #050506ba 22%, #050506f2 74%);
}
.player-heading h2 { margin: 0; font-size: clamp(20px, 2.8vw, 38px); font-weight: 550; line-height: 1.2; letter-spacing: -.035em; }
.player-heading p { margin-top: 7px; color: #bfc0ca; font-size: 10px; line-height: 1.5; }
.player-progress { margin-top: 5px; }
.player-sheet .seek { display: block; appearance: none; -webkit-appearance: none; height: 44px; min-height: 44px; margin: 0; background: transparent; cursor: pointer; border: 0; border-radius: 0; }
.player-sheet .seek::-webkit-slider-runnable-track { height: 3px; border-radius: 4px; background: linear-gradient(to right, var(--red) var(--played), #ffffff4a var(--played)); }
.player-sheet .seek::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 14px; height: 14px; border: 0; border-radius: 50%; margin-top: -5.5px; background: #f5f5f7; box-shadow: 0 1px 8px #0006; }
.player-sheet .seek::-moz-range-track { height: 3px; border-radius: 4px; background: #ffffff4a; }
.player-sheet .seek::-moz-range-progress { height: 3px; border-radius: 4px; background: var(--red); }
.player-sheet .seek::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #f5f5f7; }
.player-controlbar { display: grid; gap: 18px; }
.player-transport { display: flex; align-items: center; gap: 10px; min-width: 0; }
.player-sheet .player-transport .icon-button { width: 44px; height: 44px; background: #ffffff08; }
.player-sheet .player-transport .icon-button:hover { background: #ffffff18; }
.player-sheet #player-toggle { flex-shrink: 0; min-height: 56px; width: 56px; height: 56px; padding: 0; border-radius: 50%; }
.player-time { display: flex; gap: 7px; align-items: center; margin-inline-start: auto; font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; color: #aeb1bd; }
.player-time #elapsed { color: #f2f2f5; }
.player-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.player-options label { display: flex; flex-direction: column; gap: 6px; min-width: 0; color: #aeb1bd; font-size: 10px; }
.player-options select { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid #ffffff20; border-radius: 12px; color: #e8e8ee; font: inherit; font-size: 12px; background: #202126d9; }
.player-options select option { background: #202126; color: white; }
[dir=rtl] .player-heading h2 { letter-spacing: 0; }
@media (orientation:portrait) and (max-width:699px) {
  .player-screen { inset-block: 82px 260px; }
}
@media (min-width:700px) {
  .player-topbar { padding: max(28px, env(safe-area-inset-top)) 36px 60px; }
  .player-back { min-height: 48px; padding-inline: 15px; font-size: 14px; }
  .player-preview-badge { font-size: 12px; }
  .player-hud { padding: 85px 36px max(32px, env(safe-area-inset-bottom)); }
  .player-heading p { font-size: 12px; }
  .player-controlbar { grid-template-columns: minmax(250px, 1fr) auto; gap: 24px; align-items: center; }
  .player-transport { gap: 16px; }
  .player-time { margin-inline-start: 6px; font-size: 12px; }
  .player-options { width: 260px; }
  .player-options label { font-size: 11px; }
  .player-options select { font-size: 13px; }
}
@media (min-width:1000px) {
  .tv-mode .player-sheet { width: 100%; max-height: none; border-radius: 0; }
  .tv-mode .player-topbar { padding: max(42px, env(safe-area-inset-top)) 64px 80px; }
  .tv-mode .player-back { min-height: 60px; font-size: 18px; padding-inline: 20px; gap: 12px; }
  .tv-mode .player-back svg { width: 24px; height: 24px; }
  .tv-mode .player-preview-badge { font-size: 17px; gap: 12px; }
  .tv-mode .player-hud { padding: 120px 64px max(44px, env(safe-area-inset-bottom)); }
  .tv-mode .player-heading p { font-size: 16px; }
  .tv-mode .player-sheet #player-toggle { width: 76px; height: 76px; }
  .tv-mode .player-sheet #player-toggle svg { width: 30px; height: 30px; }
  .tv-mode .player-sheet .player-transport .icon-button { width: 60px; height: 60px; }
  .tv-mode .player-transport { gap: 22px; }
  .tv-mode .player-time { font-size: 18px; margin-inline-start: 15px; gap: 12px; }
  .tv-mode .player-options { width: 360px; gap: 18px; }
  .tv-mode .player-options label { font-size: 15px; }
  .tv-mode .player-options select { min-height: 52px; font-size: 18px; padding-inline: 16px; }
  .tv-mode .player-sheet .seek { height: 52px; }
}
@media (max-height:500px) and (orientation:landscape) {
  .player-topbar { padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 30px max(16px, env(safe-area-inset-left)); }
  .player-back { min-height: 44px; font-size: 11px; }
  .player-preview-badge { font-size: 10px; }
  .player-hud { padding: 35px max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  .player-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
  .player-heading h2 { font-size: 18px; }
  .player-heading p { font-size: 9px; margin-top: 0; text-align: end; }
  .player-controlbar { grid-template-columns: minmax(215px, 1fr) 220px; gap: 16px; align-items: center; }
  .player-transport { gap: 6px; }
  .player-time { font-size: 10px; margin-inline-start: 4px; }
  .player-sheet #player-toggle { min-height: 44px; width: 44px; height: 44px; }
  .player-sheet .seek { height: 44px; min-height: 44px; }
  .player-options { width: auto; gap: 10px; }
  .player-options label { font-size: 9px; gap: 3px; }
  .player-options select { font-size: 11px; padding: 7px 9px; }
}
