/* ==========================================================================
   ORBIT player skin: styles the Video.js v10 elements through their
   documented data-* state attributes and --media-slider-* CSS variables.
   ========================================================================== */
video-player { display: contents; }

.orbit {
  --lime: #C6FF5E; --ink: #F4F5F1; --bg: #101211; --panel: rgba(16, 18, 17, .88);
  --glass: rgba(16, 18, 17, .72); --edge: rgba(244, 245, 241, .26);
  --btn: 44px;
  /* biggest radial dial that still fits the player's height (16:9 means height = 56.25% of the width) */
  --dmax: max(160px, calc(56.25cqi - 28px));
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; overflow: hidden;
  background: #000; border-radius: 19px; color: var(--ink); font-family: var(--font, 'Space Grotesk', 'Inter', system-ui, sans-serif);
  container-type: inline-size; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
.orbit:focus-visible { outline: 3px solid var(--lime); outline-offset: -3px; }
.orbit:fullscreen { aspect-ratio: auto; width: 100%; height: 100%; border-radius: 0; --dmax: max(160px, calc(100vh - 170px)); }
.orbit:-webkit-full-screen { aspect-ratio: auto; width: 100%; height: 100%; border-radius: 0; --dmax: max(160px, calc(100vh - 170px)); }
/* The dial must stay visible and clickable inside the fullscreen element */
.orbit:fullscreen .radial, .orbit:-webkit-full-screen .radial, .orbit[data-orbit-fs] .radial { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 20; display: grid; pointer-events: auto; }
.orbit:fullscreen .radial[hidden], .orbit:-webkit-full-screen .radial[hidden] { display: none !important; }
.orbit:fullscreen .keys-panel, .orbit:-webkit-full-screen .keys-panel { z-index: 30; }
.orbit > video, .orbit > mux-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.orbit video::cue { background: rgba(16, 18, 17, .88); color: #F4F5F1; font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif; font-size: 100%; line-height: 1.35; }
.orbit video::-webkit-media-text-track-display { font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif; }

/* ---------- buttons ---------- */
.oc-btn, .rbtn, .rplay, .oc-start { font: inherit; color: var(--ink); border: 0; background: none; cursor: pointer; padding: 0; display: inline-grid; place-items: center; }
.oc-btn { width: var(--btn); height: var(--btn); border-radius: 50%; transition: background .18s, color .18s, transform .18s; }
.oc-btn:hover { background: rgba(244, 245, 241, .14); }
.oc-btn:active { transform: scale(.94); }
.oc-btn svg { width: 24px; height: 24px; }
.oc-btn:focus-visible, .rbtn:focus-visible, .rplay:focus-visible, .oc-start:focus-visible, .oc-timeline:focus-visible, .oc-vol-slider:focus-visible, .ring-slider:focus-visible,
media-menu-item:focus-visible, media-menu-radio-item:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }
.oc-btn[data-active] { color: var(--lime); }
.oc-btn[aria-disabled="true"] { opacity: .45; }

/* play: lime disc */
.oc-play { background: var(--lime); color: #101211; width: 48px; height: 48px; }
.oc-play:hover { background: #d6ff86; }
.oc-play svg { width: 22px; height: 22px; }
media-play-button svg { display: none; }
media-play-button[data-paused] .i-play, media-play-button:not([data-paused]) .i-pause { display: block; }
media-play-button[data-ended] svg { display: none; }
media-play-button[data-ended] .i-replay { display: block; }
media-mute-button svg { display: none; }
media-mute-button[data-volume-level="high"] .v-high, media-mute-button[data-volume-level="medium"] .v-high,
media-mute-button[data-volume-level="low"] .v-low, media-mute-button[data-volume-level="off"] .v-off,
media-mute-button[data-muted] .v-off { display: block; }
media-mute-button[data-muted] .v-high, media-mute-button[data-muted] .v-low { display: none; }
media-fullscreen-button .fs-exit { display: none; }
media-fullscreen-button[data-fullscreen] .fs-enter { display: none; }
media-fullscreen-button[data-fullscreen] .fs-exit { display: block; }

/* ---------- controls layer (auto-hides; stays while focus is inside) ---------- */
.oc { position: absolute; inset: 0; display: block; pointer-events: none; opacity: 0; transition: opacity .3s ease; z-index: 3; }
.oc[data-visible], .oc:has(:focus-visible) { opacity: 1; }
.oc-backdrop { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(16, 18, 17, .94) 0, rgba(16, 18, 17, .55) 22%, transparent 42%), linear-gradient(to bottom, rgba(16, 18, 17, .7), transparent 22%); }
.oc-content { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(10px, 2.2cqi, 22px); }
.oc[data-visible] .oc-content > *, .oc:has(:focus-visible) .oc-content > * { pointer-events: auto; }
.oc-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.oc-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.oc-brand-mark { width: 30px; height: 30px; color: var(--lime); flex: none; }
.oc-brand-text { display: grid; line-height: 1.2; min-width: 0; }
.oc-brand-text strong { letter-spacing: .24em; font-size: 14px; }
.oc-brand-text span { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: rgba(244, 245, 241, .78); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oc-bottom { display: grid; gap: 8px; }

/* ---------- timeline ---------- */
.oc-timeline { position: relative; display: block; height: 46px; margin: 0 4px; cursor: pointer; touch-action: none; }
.oc-wave { position: absolute; left: 0; right: 0; bottom: 12px; width: 100%; height: 28px; pointer-events: none; opacity: 0; transition: opacity .4s; }
.oc-timeline.has-wave .oc-wave { opacity: 1; }
.oc-chapters { position: absolute; left: 0; right: 0; bottom: 0; height: 100%; display: flex; gap: 4px; align-items: flex-end; }
.oc-chapter { height: 100%; display: flex; align-items: flex-end; min-width: 0; }
.oc-track { position: relative; display: block; width: 100%; height: 100%; }
.oc-track::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; border-radius: 4px; background: rgba(244, 245, 241, .22); transition: height .15s; }
.oc-buffer, .oc-fill { position: absolute; left: 0; bottom: 0; height: 4px; border-radius: 4px; transition: height .15s; }
.oc-buffer { width: var(--media-slider-buffer, 0%); background: rgba(244, 245, 241, .38); }
.oc-fill { width: var(--media-slider-fill, 0%); background: var(--lime); box-shadow: 0 0 12px rgba(198, 255, 94, .6); }
.oc-timeline:hover .oc-track::before, .oc-timeline:hover .oc-buffer, .oc-timeline:hover .oc-fill,
.oc-timeline[data-dragging] .oc-track::before, .oc-timeline[data-dragging] .oc-buffer, .oc-timeline[data-dragging] .oc-fill { height: 6px; }
.oc-thumb { position: absolute; left: var(--media-slider-fill, 0%); bottom: 2px; width: 18px; height: 18px; border-radius: 50%; transform: translate(-50%, 50%);
  background: var(--bg); border: 4px solid var(--lime); box-shadow: 0 0 0 5px rgba(198, 255, 94, .18), 0 0 16px rgba(198, 255, 94, .7); transition: transform .15s; z-index: 2; }
.oc-timeline:hover .oc-thumb, .oc-timeline[data-dragging] .oc-thumb { transform: translate(-50%, 50%) scale(1.2); }
.slider-unitless .oc-fill, .slider-unitless .oc-vfill { width: calc(var(--media-slider-fill) * 1%); }
.slider-unitless .oc-buffer { width: calc(var(--media-slider-buffer) * 1%); }
.slider-unitless .oc-thumb, .slider-unitless .oc-vthumb { left: calc(var(--media-slider-fill) * 1%); }

/* seek preview */
.oc-preview { position: absolute; bottom: calc(100% + 8px); left: var(--media-slider-pointer, 0%); transform: translateX(-50%); display: grid; gap: 6px; justify-items: center; pointer-events: none; opacity: 0; transition: opacity .15s; z-index: 4; }
.oc-timeline[data-pointing] .oc-preview, .oc-timeline[data-dragging] .oc-preview, .oc-timeline:focus-visible .oc-preview { opacity: 1; }
.oc-preview-img { display: block; width: 160px; height: 90px; border-radius: 10px; overflow: hidden; background: #000; border: 2px solid var(--lime); box-shadow: 0 10px 30px rgba(0, 0, 0, .6); }
.oc-preview-img[data-hidden], .oc-preview-img[hidden] { display: none; }
.oc-preview-meta { display: flex; gap: 8px; align-items: center; padding: 4px 10px; border-radius: 999px; background: var(--panel); border: 1px solid var(--edge); font-size: 12px; font-weight: 600; letter-spacing: .06em; white-space: nowrap; }
.oc-preview-chapter { text-transform: uppercase; color: var(--lime); letter-spacing: .12em; font-size: 11px; }
.oc-preview-chapter:empty { display: none; }

/* ---------- button row ---------- */
.oc-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.oc-left, .oc-right { display: flex; align-items: center; gap: 6px; min-width: 0; }
.oc-time { display: inline-flex; gap: 6px; align-items: center; margin-left: 8px; font-size: 14.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.oc-time media-time-separator { opacity: .5; }
.oc-time media-time[type="duration"] { opacity: .75; }
.oc-volume { display: flex; align-items: center; }
.oc-vol-slider { position: relative; display: block; width: 0; height: 32px; opacity: 0; transition: width .2s, opacity .2s, margin .2s; cursor: pointer; touch-action: none; }
.oc-volume:hover .oc-vol-slider, .oc-volume:focus-within .oc-vol-slider, .oc-vol-slider:focus-visible { width: 86px; opacity: 1; margin: 0 8px 0 2px; }
.oc-vtrack { position: absolute; left: 0; right: 0; top: 14px; height: 4px; border-radius: 4px; background: rgba(244, 245, 241, .26); }
.oc-vfill { position: absolute; left: 0; top: 0; height: 100%; width: var(--media-slider-fill, 0%); border-radius: 4px; background: var(--lime); }
.oc-vthumb { position: absolute; top: 16px; left: var(--media-slider-fill, 0%); width: 14px; height: 14px; border-radius: 50%; background: var(--lime); transform: translate(-50%, -50%); }

/* ---------- menus ---------- */
.oc-menu { z-index: 7; }
media-menu-content { display: block; min-width: 230px; padding: 6px; border-radius: 16px; background: rgba(22, 26, 24, .97); border: 1px solid var(--edge); box-shadow: 0 20px 60px rgba(0, 0, 0, .6); color: var(--ink); backdrop-filter: blur(14px); }
media-menu-item, media-menu-radio-item { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 10px; cursor: pointer; font-size: 15px; font-weight: 500; min-height: 44px; }
media-menu-item:hover, media-menu-radio-item:hover, media-menu-item[data-highlighted], media-menu-radio-item[data-highlighted] { background: rgba(244, 245, 241, .1); }
media-menu-radio-item[aria-checked="true"], media-menu-radio-item[data-checked] { color: var(--lime); }
media-menu-radio-item [data-part="label"] { flex: 1; }
media-menu-item-indicator { opacity: 0; width: 20px; height: 20px; }
[aria-checked="true"] > media-menu-item-indicator, [data-checked] > media-menu-item-indicator, media-menu-item-indicator[data-checked] { opacity: 1; }
media-menu-item-indicator svg { width: 20px; height: 20px; }
media-menu-separator { display: block; height: 1px; margin: 4px 6px; background: var(--line, rgba(244, 245, 241, .12)); }
.oc-hint { margin-left: auto; color: rgba(244, 245, 241, .7); font-size: 13.5px; }
.oc-chev { width: 18px; height: 18px; }
.oc-back { font-weight: 700; }
.oc-back svg { width: 20px; height: 20px; }

/* ---------- start button, loading, feedback pill ---------- */
.oc-start { position: absolute; left: 50%; top: 50%; width: clamp(64px, 14cqi, 96px); height: clamp(64px, 14cqi, 96px); transform: translate(-50%, -50%); border-radius: 50%; z-index: 2;
  background: var(--glass); border: 2px solid var(--lime); box-shadow: 0 0 40px rgba(198, 255, 94, .35); backdrop-filter: blur(6px); transition: transform .2s, box-shadow .2s; }
.oc-start:hover { transform: translate(-50%, -50%) scale(1.06); box-shadow: 0 0 56px rgba(198, 255, 94, .55); }
.oc-start svg { width: 42%; height: 42%; color: var(--lime); }
.oc-start .i-again { display: none; }
.orbit[data-ended] .oc-start .i-start { display: none; }
.orbit[data-ended] .oc-start .i-again { display: block; }
.oc-start::after { content: ""; position: absolute; inset: -14px; border-radius: 50%; border: 1px solid rgba(198, 255, 94, .3); animation: spin 9s linear infinite; transform-origin: center;
  background: radial-gradient(circle 4px at 50% 0, var(--lime) 98%, transparent 100%); }
.orbit[data-started]:not([data-ended]) .oc-start, .orbit[data-radial] .oc-start { display: none; }
.oc-buffering { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 4; pointer-events: none; display: none; }
.oc-buffering[data-visible] { display: block; }
.oc-spinner { position: relative; width: 56px; height: 56px; border-radius: 50%; border: 3px solid rgba(244, 245, 241, .2); animation: spin 1s linear infinite; }
.oc-spinner::after { content: ""; position: absolute; left: 50%; top: -6px; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 12px var(--lime); }
@keyframes spin { to { transform: rotate(360deg); } }

.oc-osd { position: absolute; left: 50%; bottom: 26%; transform: translate(-50%, 8px); z-index: 6; padding: 8px 18px; border-radius: 999px; border: 1.5px solid var(--lime);
  background: var(--panel); color: var(--ink); font-size: 12.5px; font-weight: 700; letter-spacing: .18em; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; }
.oc-osd.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- radial dial ---------- */
.radial { --d: min(clamp(200px, 44cqi, 420px), var(--dmax)); position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; }
.radial-scrim { position: absolute; inset: 0; background: radial-gradient(circle at center, rgba(16, 18, 17, .55), rgba(16, 18, 17, .86)); backdrop-filter: blur(5px); animation: fade .25s ease both; }
@keyframes fade { from { opacity: 0; } }
.radial-dial { --bs: max(44px, calc(var(--d) * .17)); --r: calc(var(--d) * .30);
  position: relative; width: var(--d); height: var(--d); animation: pop .3s cubic-bezier(.2, .9, .3, 1.2) both; touch-action: none; }
@keyframes pop { from { transform: scale(.88); opacity: 0; } }
.radial-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ring-track { fill: none; stroke: rgba(244, 245, 241, .18); stroke-width: 3; }
.ring-progress { fill: none; stroke: var(--lime); stroke-width: 5; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 150px 150px; filter: drop-shadow(0 0 6px rgba(198, 255, 94, .7)); }
.ring-ticks line { stroke: rgba(244, 245, 241, .3); stroke-width: 1.2; }
.ring-ticks line.major { stroke: rgba(198, 255, 94, .75); stroke-width: 1.8; }
.ring-knob circle { fill: var(--bg); stroke: var(--lime); stroke-width: 4; filter: drop-shadow(0 0 8px rgba(198, 255, 94, .8)); }
.ring-knob { transform-origin: 150px 150px; cursor: grab; }
.ring-slider { position: absolute; inset: 0; border-radius: 50%; pointer-events: none; }
.radial-dial { cursor: default; }
.rbtn { position: absolute; left: 50%; top: 50%; width: var(--bs); height: var(--bs); margin: calc(var(--bs) / -2) 0 0 calc(var(--bs) / -2);
  transform: rotate(var(--a)) translateX(var(--r)) rotate(calc(-1 * var(--a))); border-radius: 50%; background: var(--glass); border: 1.5px solid var(--edge);
  font-weight: 700; font-size: clamp(13px, calc(var(--d) * .04), 17px); transition: border-color .15s, background .15s, color .15s; backdrop-filter: blur(6px); }
.rbtn:hover { border-color: var(--lime); }
.rbtn[data-active] { background: var(--lime); color: #101211; border-color: var(--lime); }
.rbtn svg { width: 46%; height: 46%; }
.rbtn-rate::after { content: attr(data-rate) "\00D7"; }
.rbtn-rate[data-rate="1"] { color: var(--ink); }
.rbtn[data-hidden] { display: none; }
.radial .v-high, .radial .v-low, .radial .v-off, .radial .fs-enter, .radial .fs-exit { display: none; }
.radial media-mute-button[data-volume-level="high"] .v-high, .radial media-mute-button[data-volume-level="medium"] .v-high,
.radial media-mute-button[data-volume-level="low"] .v-low, .radial media-mute-button[data-volume-level="off"] .v-off, .radial media-mute-button[data-muted] .v-off { display: block; }
.radial media-mute-button[data-muted] .v-high, .radial media-mute-button[data-muted] .v-low { display: none; }
.radial media-fullscreen-button .fs-enter { display: block; }
.radial media-fullscreen-button[data-fullscreen] .fs-enter { display: none; }
.radial media-fullscreen-button[data-fullscreen] .fs-exit { display: block; }
.radial-center { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; pointer-events: none; }
.rplay { pointer-events: auto; width: max(56px, calc(var(--d) * .22)); height: max(56px, calc(var(--d) * .22)); border-radius: 50%; background: var(--bg); border: 2px solid var(--lime); box-shadow: 0 0 30px rgba(198, 255, 94, .3); }
.rplay svg { width: 44%; height: 44%; color: var(--lime); }
.radial-time { font-size: clamp(14px, calc(var(--d) * .06), 20px); font-weight: 600; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.radial-hint { position: absolute; left: 0; right: 0; top: calc(50% + var(--d) / 2 + 12px); margin: 0; text-align: center; font-size: 12.5px; letter-spacing: .06em; color: rgba(244, 245, 241, .75); }
.radial-hint kbd { background: #1d221f; font-size: 11px; }
/* current / total time shown beside the dial on small players (the centre readout is used on large ones) */
.radial-side { display: none; position: absolute; top: 50%; transform: translateY(-50%); z-index: 1; padding: 5px 11px; border-radius: 999px; background: var(--panel); border: 1px solid var(--edge);
  font-size: 13px; font-weight: 700; letter-spacing: .04em; font-variant-numeric: tabular-nums; pointer-events: none; }
.radial-side-l { left: 10px; color: var(--lime); border-color: var(--lime); }
.radial-side-r { right: 10px; }

/* ---------- keyboard guide ---------- */
.keys-panel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 8; width: min(440px, 92%); max-height: 92%; overflow: auto;
  padding: 18px 20px 20px; border-radius: 20px; background: rgba(22, 26, 24, .97); border: 1px solid var(--edge); box-shadow: 0 30px 90px #000; backdrop-filter: blur(14px); user-select: text; }
.keys-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.keys-head h2 { margin: 0; font-size: 12.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--lime); }
.keys-list { margin: 0; display: grid; gap: 2px; }
.keys-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid rgba(244, 245, 241, .08); }
.keys-list dt { display: flex; gap: 5px; align-items: center; }
.keys-list dd { margin: 0; font-size: 14.5px; color: rgba(244, 245, 241, .85); }
.orbit kbd { background: #1d221f; border: 1px solid rgba(244, 245, 241, .26); border-bottom-width: 2px; border-radius: 7px; padding: .1em .5em; min-width: 1.8em; text-align: center; font: 600 13px/1.5 inherit; color: var(--ink); }

/* ---------- error state ---------- */
.oc-error { position: absolute; inset: 0; z-index: 9; display: none; place-items: center; }
.oc-error[data-open] { display: grid; }
.oc-error-backdrop { position: absolute; inset: 0; background: rgba(16, 18, 17, .88); }
.oc-error-popup { position: relative; display: grid; gap: 10px; justify-items: center; text-align: center; max-width: min(420px, 88%); padding: 24px; border-radius: 20px; background: #1a1f1c; border: 1px solid rgba(255, 138, 128, .7); }
.oc-error-title { font-weight: 700; font-size: 18px; color: #ffb3aa; }
.oc-error-desc { font-size: 14.5px; color: rgba(244, 245, 241, .85); }
.oc-error-close { display: inline-block; margin-top: 6px; padding: 10px 20px; border-radius: 999px; background: var(--lime); color: #101211; font-weight: 700; cursor: pointer; }

/* ---------- compact (phones / narrow players) ---------- */
@container (max-width: 640px) {
  .oc-time { font-size: 13px; margin-left: 4px; }
  .oc-preview-img { width: 120px; height: 68px; }
  .oc-brand-text span { display: none; }
  .oc-vol-slider { display: none; }
  .oc-left, .oc-right { gap: 2px; }
  .radial-hint { display: none; }
}
@container (max-width: 520px) {
  .oc-content { padding: 8px; }
  .oc-row, .oc-left, .oc-right { gap: 0; }
  .oc-time { gap: 4px; margin-left: 4px; }
  .oc-osd { bottom: 31%; }
  .oc-brand-mark { width: 24px; height: 24px; }
  .oc-wave { height: 20px; bottom: 11px; }
  .oc-play { width: 44px; height: 44px; }
  .oc-start { width: 52px; height: 52px; top: 32%; }   /* sits above the control bar on a short player */
  .oc-start:hover { transform: translate(-50%, -50%) scale(1.06); }
  /* the dial on a short player: buttons sit slightly wider apart and the time moves beside the dial */
  .radial-dial { --r: calc(var(--d) * .32); }
  .rplay { width: 48px; height: 48px; }
  .radial-time { display: none; }
  .radial-side { display: block; }
}
@container (max-width: 520px) {
  media-menu-content, .oc-menu { max-height: calc(56.25cqi - 20px); overflow-y: auto; }
}
@container (max-width: 359px) {
  .oc-time media-time-separator, .oc-time media-time[type="duration"] { display: none; }   /* keep the current time, drop the total */
}
@container (max-width: 335px) {
  .radial-dial { --r: calc(var(--d) * .37); }
  .rbtn:not([seconds]) { display: none; }   /* tiny phones: the dial keeps the ±5 buttons and the ring; the bar has the rest */
}
@container (max-width: 299px) {
  .oc-volume { display: none; }
}
@media (hover: none) { .oc-vol-slider { display: none; } }
@media (hover: none) and (pointer: coarse) { #keys-btn { display: none; } }   /* touch screens have no keyboard to show shortcuts for */
@media (prefers-reduced-motion: reduce) {
  .orbit *, .orbit *::before, .orbit *::after { animation: none !important; transition: none !important; }
  .oc-spinner { animation: none !important; border-top-color: var(--lime); }
}
@media (forced-colors: active) { .oc-btn, .rbtn { border: 1px solid ButtonText; } .oc-fill { background: Highlight; } }
