.player {
  position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: transparent; color: var(--ink); overflow: hidden;
}
.player::backdrop { background: rgba(6, 6, 8, 0.86); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.player[open] { animation: player-in 0.28s var(--ease); }
@keyframes player-in { from { opacity: 0; transform: scale(0.985); } }

.player-in { height: 100%; display: flex; align-items: center; justify-content: center; gap: clamp(16px, 2vw, 28px); padding: 28px 84px 28px 28px; }
.player-main { display: flex; align-items: center; gap: clamp(14px, 1.6vw, 22px); min-height: 0; }
.player-nav { display: flex; flex-direction: column; gap: 12px; }
.nav-btn {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line-2); background: rgba(29, 31, 35, 0.9); color: var(--ink); transition: background 0.15s, transform 0.15s;
}
.nav-btn svg { width: 20px; height: 20px; }
.nav-btn:hover { background: var(--panel-3); }
.nav-btn:active { transform: scale(0.95); }

.player-stage { position: relative; height: min(calc(100dvh - 56px), 1000px); aspect-ratio: 9 / 16; border-radius: 18px; overflow: hidden; background: #000; box-shadow: 0 30px 90px -30px rgba(0, 0, 0, 0.95), inset 0 0 0 1px var(--line); }
.player-stage video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.stage-hit { position: absolute; inset: 0; border: 0; background: transparent; padding: 0; cursor: pointer; }
.stage-hit::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%;
  background: rgba(12, 12, 14, 0.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5.5v13l11-6.5Z' fill='%23f8f6f1'/%3E%3C/svg%3E") 54% 50% / 26px no-repeat;
  opacity: 0; transition: opacity 0.2s;
}
.player-stage.is-paused .stage-hit::after { opacity: 1; }
.stage-cta {
  position: absolute; left: 50%; bottom: 64px; transform: translateX(-50%); min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid rgba(248, 246, 241, 0.3); background: rgba(12, 12, 14, 0.7); color: var(--ink); font-weight: 600; font-size: 0.9rem;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.sound {
  position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid rgba(248, 246, 241, 0.2); background: rgba(12, 12, 14, 0.55); color: var(--ink);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.sound svg { width: 20px; height: 20px; }
.sound .sound-off { display: none; }
.sound[aria-pressed="true"] .sound-on { display: none; }
.sound[aria-pressed="true"] .sound-off { display: block; }
.progress { position: absolute; left: 12px; right: 12px; bottom: 10px; height: 3px; border-radius: 3px; background: rgba(248, 246, 241, 0.22); overflow: hidden; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--ink); transform-origin: 0 50%; transform: scaleX(0); }

.player-side {
  width: clamp(280px, 24vw, 390px); max-height: calc(100dvh - 56px); overflow-y: auto; overscroll-behavior: contain;
  padding: 22px 22px 18px; border-radius: 18px; background: rgba(23, 24, 27, 0.96); border: 1px solid var(--line-2); scrollbar-width: thin;
}
.side-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 0.8rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.tag { padding: 4px 10px; border-radius: 999px; background: rgba(248, 246, 241, 0.08); border: 1px solid var(--line-2); color: var(--ink); }
.side-count { margin-left: auto; color: var(--dim); }
.side-title { margin: 14px 0 6px; font: 700 clamp(1.9rem, 2.4vw, 2.5rem)/1 var(--font-display); text-transform: uppercase; letter-spacing: 0.005em; }
.side-hook { margin: 0; color: var(--muted); font-size: 0.98rem; line-height: 1.45; }
.side-label { margin: 22px 0 8px; color: var(--dim); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.about { list-style: none; margin: 0; padding: 0; }
.about li { display: grid; grid-template-columns: 7.2em minmax(0, 1fr); gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 0.9rem; line-height: 1.45; color: var(--muted); }
.about li:first-child { border-top: 0; padding-top: 2px; }
.about b { color: var(--ink); font-weight: 600; }
.recipe { margin: 0; padding: 11px 13px; border-radius: 12px; background: rgba(248, 246, 241, 0.05); border: 1px solid var(--line); font-size: 0.9rem; line-height: 1.5; }
.go-wide { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; margin-top: 20px; font-size: 1rem; }
.go-wide svg { width: 16px; height: 16px; }
.side-note { margin: 10px 0 0; color: var(--dim); font-size: 0.8rem; line-height: 1.4; text-align: center; }
.keys { margin: 14px 0 0; color: var(--dim); font-size: 0.75rem; text-align: center; }
@media (hover: none), (pointer: coarse) { .keys { display: none; } }

.close {
  position: absolute; top: 18px; right: 18px; z-index: 3; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line-2); background: rgba(29, 31, 35, 0.9); color: var(--ink);
}
.close svg { width: 18px; height: 18px; }
.close:hover { background: var(--panel-3); }

/* Portrait screens: video on top, panel below, arrows beside the video (over it when there is no room). */
@media (max-aspect-ratio: 1/1) {
  .player { background: #0c0c0e; }
  .player-in { display: block; height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: max(64px, env(safe-area-inset-top)) 12px max(24px, env(safe-area-inset-bottom)); }
  .player-main { position: relative; display: block; width: min(100% - 112px, calc(70dvh * 9 / 16), 520px); margin: 0 auto; }
  .player-stage { width: 100%; height: auto; border-radius: 16px; }
  .player-nav { position: absolute; z-index: 2; left: calc(100% + 10px); top: 50%; transform: translateY(-50%); gap: 10px; }
  .nav-btn { width: 44px; height: 44px; }
  .player-side { width: min(100%, 560px); max-height: none; overflow: visible; margin: 14px auto 0; padding: 18px 16px 16px; }
  .close { position: fixed; top: max(12px, env(safe-area-inset-top)); right: 12px; }
}
@media (max-aspect-ratio: 1/1) and (max-width: 22.4375rem) {
  .player-main { width: min(100%, calc(70dvh * 9 / 16)); }
  .player-nav { left: 12px; top: 12px; transform: none; flex-direction: row; gap: 8px; }
  .nav-btn { width: 40px; height: 40px; border-color: rgba(248, 246, 241, 0.2); background: rgba(12, 12, 14, 0.55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
}
@media (max-width: 26.25rem) {
  .about li { grid-template-columns: 1fr; gap: 2px; }
}
.side-title:focus { outline: none; }
/* Short landscape screens (phones on their side). */
@media (min-aspect-ratio: 1/1) and (max-height: 35rem) {
  .player-in { padding: 12px 68px 12px 12px; gap: 12px; }
  .player-stage { height: calc(100dvh - 24px); border-radius: 12px; }
  .player-side { max-height: calc(100dvh - 24px); padding: 14px; }
  .nav-btn { width: 42px; height: 42px; }
  .close { top: 10px; right: 10px; }
}
