/* =====================================================================
   Cine18 web player + watch / player pages
   ===================================================================== */
.c18p { display: block; width: 100%; outline: none; --pa: var(--pink, #f43f8e); --pb: var(--violet, #6d4bff); }
.c18p-i { width: 1.3em; height: 1.3em; flex: none; display: block; }

.c18p-stage {
  position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; isolation: isolate; color: #fff; background: #05040f;
  border-radius: 22px; box-shadow: 0 30px 60px -28px rgba(30, 10, 90, .75); -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
.c18p-stage.is-fs { border-radius: 0; aspect-ratio: auto; height: 100%; }
.c18p-stage.c18p-idle { cursor: none; }
.c18p-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.c18p-embed { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.c18p-poster { position: absolute; inset: 0; background: center / cover no-repeat #120e38; }
.c18p-poster::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 5, 30, .35), rgba(8, 5, 30, .1) 40%, rgba(8, 5, 30, .65)); }
.c18p-poster[hidden], .c18p-embed[hidden], .c18p-err[hidden], .c18p-menu[hidden], .c18p-badge[hidden] { display: none; }
.c18p-stage[data-state="idle"]:not(.is-loading):not(.is-embed) .c18p-poster:not([hidden]) { display: block; }

/* top bar */
.c18p-top { position: absolute; z-index: 4; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 10px; padding: 16px 18px 40px; background: linear-gradient(180deg, rgba(5, 4, 20, .78), transparent); transition: opacity .25s; pointer-events: none; }
.c18p-title { font-weight: 700; font-size: 15px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 8px rgba(0, 0, 0, .6); }
.c18p-badge { flex: none; padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 800; letter-spacing: .06em; background: #f43f5e; box-shadow: 0 6px 14px -6px #f43f5e; }

/* big play */
.c18p-big {
  position: absolute; z-index: 3; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; border: 0; border-radius: 50%; cursor: pointer; color: #fff;
  display: grid; place-items: center; background: linear-gradient(135deg, var(--pa), var(--pb)); box-shadow: 0 18px 40px -10px var(--pa), inset 0 1px 0 rgba(255, 255, 255, .4);
  transition: transform .18s, opacity .2s;
}
.c18p-big .c18p-i { width: 34px; height: 34px; margin-left: 4px; }
.c18p-big:hover { transform: scale(1.07); }
.c18p-stage[data-state="playing"] .c18p-big, .c18p-stage.is-loading .c18p-big, .c18p-stage.is-embed .c18p-big, .c18p-stage.has-err .c18p-big { opacity: 0; pointer-events: none; transform: scale(.8); }
.c18p-stage.is-loading[data-state="idle"] .c18p-big { display: none; }

/* spinner */
.c18p-spin { position: absolute; z-index: 3; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .22); border-top-color: #fff; opacity: 0; pointer-events: none; animation: c18p-spin .8s linear infinite paused; transition: opacity .2s; }
.c18p-stage.is-loading .c18p-spin { opacity: 1; animation-play-state: running; }
.c18p-stage.is-embed .c18p-spin { display: none; }
@keyframes c18p-spin { to { transform: rotate(360deg); } }

/* double-tap ripples + messages */
.c18p-skip { position: absolute; z-index: 3; top: 0; bottom: 0; width: 32%; display: grid; place-items: center; opacity: 0; pointer-events: none; background: radial-gradient(closest-side, rgba(255, 255, 255, .22), transparent); }
.c18p-skip .c18p-i { width: 44px; height: 44px; }
.c18p-skip-l { left: 0; border-radius: 0 50% 50% 0; }
.c18p-skip-r { right: 0; border-radius: 50% 0 0 50%; }
.c18p-skip.on { animation: c18p-skip .6s ease-out; }
@keyframes c18p-skip { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }
.c18p-msg { position: absolute; z-index: 6; top: 18px; left: 50%; transform: translate(-50%, -8px); padding: 7px 14px; border-radius: 99px; font-size: 13px; font-weight: 700; background: rgba(10, 8, 34, .82); backdrop-filter: blur(8px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; white-space: nowrap; }
.c18p-msg.on { opacity: 1; transform: translate(-50%, 0); }

/* bottom controls */
.c18p-bar { position: absolute; z-index: 5; left: 0; right: 0; bottom: 0; padding: 36px 14px 10px; background: linear-gradient(0deg, rgba(5, 4, 20, .9), rgba(5, 4, 20, .55) 55%, transparent); transition: opacity .25s, transform .25s; }
.c18p-stage.c18p-idle .c18p-bar, .c18p-stage.c18p-idle .c18p-top { opacity: 0; pointer-events: none; }
.c18p-stage.c18p-idle .c18p-bar { transform: translateY(6px); }
.c18p-stage.is-embed .c18p-bar, .c18p-stage.is-embed .c18p-top, .c18p-stage.is-embed .c18p-poster, .c18p-stage.has-err .c18p-bar { display: none; }
.c18p-stage[data-state="idle"] .c18p-bar { opacity: .0; pointer-events: none; }
.c18p-row { display: flex; align-items: center; gap: 2px; }
.c18p-sp { flex: 1; }
.c18p-btn { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border: 0; border-radius: 12px; color: #fff; background: transparent; cursor: pointer; transition: background .15s, transform .15s; }
.c18p-btn:hover { background: rgba(255, 255, 255, .16); }
.c18p-btn:active { transform: scale(.94); }
.c18p-btn:focus-visible, .c18p-big:focus-visible, .c18p-pill:focus-visible, .c18p-chip:focus-visible { outline: 3px solid rgba(255, 255, 255, .8); outline-offset: 2px; }
.c18p-time { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; margin-left: 6px; white-space: nowrap; text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }
.c18p-vol { display: inline-flex; align-items: center; }
.c18p-volr { width: 0; opacity: 0; transition: width .2s, opacity .2s; }
.c18p-vol:hover .c18p-volr, .c18p-vol:focus-within .c18p-volr { width: 84px; opacity: 1; margin-right: 8px; }

/* range sliders (reset the panel's global input styling) */
.c18p-range, .c18p-volr {
  -webkit-appearance: none; appearance: none; display: block; min-height: 0; padding: 0; margin: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; cursor: pointer; --p: 0%; --b: 0%;
}
.c18p-range { width: 100%; height: 22px; }
.c18p-volr { height: 22px; }
.c18p-range:focus, .c18p-volr:focus { box-shadow: none; border: 0; }
.c18p-range::-webkit-slider-runnable-track { height: 5px; border-radius: 99px; background: linear-gradient(90deg, var(--pa) 0 var(--p), rgba(255, 255, 255, .55) var(--p) var(--b), rgba(255, 255, 255, .22) var(--b)); transition: height .12s; }
.c18p-range::-moz-range-track { height: 5px; border-radius: 99px; background: linear-gradient(90deg, var(--pa) 0 var(--p), rgba(255, 255, 255, .55) var(--p) var(--b), rgba(255, 255, 255, .22) var(--b)); }
.c18p-range:hover::-webkit-slider-runnable-track { height: 7px; }
.c18p-range::-webkit-slider-thumb { -webkit-appearance: none; width: 15px; height: 15px; margin-top: -5px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 2px 8px rgba(0, 0, 0, .5); transition: transform .12s; }
.c18p-range:hover::-webkit-slider-thumb { transform: scale(1.25); margin-top: -4px; }
.c18p-range::-moz-range-thumb { width: 15px; height: 15px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
.c18p-volr::-webkit-slider-runnable-track { height: 4px; border-radius: 99px; background: linear-gradient(90deg, #fff 0 var(--p), rgba(255, 255, 255, .3) var(--p)); }
.c18p-volr::-moz-range-track { height: 4px; border-radius: 99px; background: linear-gradient(90deg, #fff 0 var(--p), rgba(255, 255, 255, .3) var(--p)); }
.c18p-volr::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4px; border-radius: 50%; background: #fff; border: 0; }
.c18p-volr::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 0; }
.c18p-stage.is-live .c18p-range { pointer-events: none; }
.c18p-stage.is-live .c18p-range::-webkit-slider-thumb { opacity: 0; }
.c18p-stage.is-live .c18p-range::-moz-range-thumb { opacity: 0; }

/* settings menu */
.c18p-menu { position: absolute; z-index: 7; right: 12px; bottom: 74px; min-width: 190px; max-height: calc(100% - 100px); overflow: auto; padding: 8px; border-radius: 16px; background: rgba(14, 11, 44, .94); backdrop-filter: blur(14px); border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 24px 50px -12px rgba(0, 0, 0, .7); }
.c18p-mh { padding: 8px 10px 4px; font-size: 12px; font-weight: 700; color: #a9a5e6; }
.c18p-menu button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 10px; border: 0; border-radius: 10px; color: #fff; background: transparent; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-align: left; }
.c18p-menu button:hover { background: rgba(255, 255, 255, .1); }
.c18p-menu button.on { background: rgba(255, 255, 255, .12); }
.c18p-menu button small { opacity: .7; font-weight: 500; }
.c18p-menu .c18p-i { width: 16px; height: 16px; color: #35e0a1; }

/* error card */
.c18p-err { position: absolute; z-index: 8; inset: 0; display: grid; place-items: center; padding: 16px; overflow: auto; background: radial-gradient(500px 300px at 50% 0%, rgba(244, 63, 142, .28), transparent 70%), rgba(8, 6, 28, .93); }
.c18p-stage:has(.c18p-err:not([hidden])) .c18p-big, .c18p-stage:has(.c18p-err:not([hidden])) .c18p-spin { display: none; }
.c18p-err-card { width: min(460px, 100%); text-align: center; display: grid; gap: 10px; justify-items: center; }
.c18p-err-ico { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 18px; background: linear-gradient(135deg, #f43f5e, #ff7a59); box-shadow: 0 14px 28px -10px #f43f5e; }
.c18p-err-card h3 { margin: 4px 0 0; font-size: 18px; font-weight: 800; }
.c18p-err-card p { margin: 0; color: #c9c6ee; font-size: 13.5px; line-height: 1.55; }
.c18p-err-card details { width: 100%; text-align: left; font-size: 12px; color: #a9a5e6; }
.c18p-err-card summary { cursor: pointer; text-align: center; }
.c18p-err-card code { display: block; margin-top: 6px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, .07); word-break: break-word; font-size: 11.5px; }
.c18p-err-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }
.c18p-pill { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 8px 15px; border: 1px solid rgba(255, 255, 255, .22); border-radius: 12px; color: #fff; background: rgba(255, 255, 255, .08); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; text-decoration: none; }
.c18p-pill:hover { background: rgba(255, 255, 255, .18); }
.c18p-pill .c18p-i { width: 16px; height: 16px; }
.c18p-pill-pri { border-color: transparent; background: linear-gradient(120deg, var(--pa), var(--pb)); }
.c18p-pill-pri:hover { background: linear-gradient(120deg, var(--pa), var(--pb)); filter: brightness(1.1); }

/* source chips under the picture */
.c18p-sources { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.c18p-chip { display: inline-flex; align-items: baseline; gap: 8px; padding: 9px 15px; border-radius: 13px; cursor: pointer; font: inherit; font-size: 13.5px; color: var(--text, #1a1743); background: var(--surface, #fff); border: 1.5px solid var(--line-strong, #d6d3ec); transition: border-color .15s, background .15s, transform .15s; }
.c18p-chip:hover { transform: translateY(-1px); border-color: var(--ac, #6d4bff); }
.c18p-chip b { font-weight: 800; }
.c18p-chip small { color: var(--muted, #6f6c96); font-weight: 700; }
.c18p-chip.on { color: #fff; border-color: transparent; background: linear-gradient(120deg, var(--ac, #f43f8e), var(--ac2, #6d4bff)); box-shadow: 0 10px 20px -10px var(--ac, #f43f8e); }
.c18p-chip.on small { color: rgba(255, 255, 255, .85); }

/* ---------- Watch page ---------- */
.watch-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.watch-info { display: grid; gap: 16px; }
.watch-poster { width: 100%; max-width: 220px; aspect-ratio: 2 / 3; border-radius: 16px; overflow: hidden; background: linear-gradient(145deg, #f43f8e, #6d4bff); box-shadow: var(--shadow); position: relative; }
.watch-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.watch-info h2 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; }
.watch-info .desc { color: var(--text-2); line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.watch-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.src-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.src-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; min-width: 0; }
.src-list b { flex: none; }
.src-list code { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.help-note { display: flex; gap: 12px; padding: 14px 16px; border-radius: 15px; background: var(--surface-2); border: 1px dashed var(--line-strong); color: var(--text-2); font-size: 13px; line-height: 1.6; }
.help-note .i { flex: none; margin-top: 2px; color: var(--ac); }

/* ---------- Web player page ---------- */
.player-tool { display: grid; gap: 14px; margin-bottom: 20px; }
.player-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; }
.player-form .input-icon { flex: 1 1 320px; }
.player-form .btn { min-height: 46px; }
.player-opts { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 13px; font-weight: 600; }
.player-opts label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.recent-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.recent-row .lbl { flex: none; }
.recent-chip { border: 0; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
.recent-chip:hover { filter: brightness(.95); }
.format-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.format-tile { --c: var(--violet); padding: 14px; border-radius: 16px; background: color-mix(in srgb, var(--c) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 24%, var(--line)); }
.format-tile strong { display: block; font-size: 14px; color: color-mix(in srgb, var(--c) 80%, var(--text)); }
.format-tile span { font-size: 12.5px; color: var(--muted); }

/* ---------- Test-play modal in the editor ---------- */
dialog.player-modal { width: min(980px, calc(100vw - 24px)); padding: 0; border: 1px solid var(--line-strong); border-radius: 26px; color: var(--text); background: var(--surface); box-shadow: var(--shadow-lg); overflow: hidden; }
dialog.player-modal::backdrop { background: rgba(8, 5, 30, .72); backdrop-filter: blur(5px); }
.pm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 14px 22px; }
.pm-head strong { font-size: 16px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-body { padding: 0 16px 18px; }
.pm-body .c18p-stage { border-radius: 18px; }

/* Play buttons on list cards */
.btn-play { color: #fff; border-color: transparent; background: linear-gradient(120deg, #16b77a, #13b8d9); box-shadow: 0 10px 20px -10px #16b77a; }
.btn-play:hover { border-color: transparent; filter: brightness(1.07); }
.chip.c-warn { --c: var(--amber); }

@media (max-width: 1100px) {
  .watch-grid { grid-template-columns: minmax(0, 1fr); }
  .watch-poster { max-width: 150px; }
}
@media (max-width: 720px) {
  .c18p-stage { border-radius: 16px; }
  .c18p-hide-s { display: none; }
  .c18p-vol .c18p-volr { display: none; }
  .c18p-btn { width: 44px; height: 44px; }
  .c18p-bar { padding: 30px 10px 6px; }
  .c18p-big { width: 68px; height: 68px; margin: -34px 0 0 -34px; }
  .c18p-big .c18p-i { width: 28px; height: 28px; }
  .c18p-title { font-size: 13px; }
  .c18p-top { padding: 12px 14px 32px; }
  .c18p-menu { right: 8px; bottom: 66px; }
  .pm-head { padding-left: 16px; }
  .player-form .btn { flex: 1; }
  .c18p-err { padding: 10px; align-items: start; }
  .c18p-err-card p { font-size: 12.5px; }
}
@media (pointer: coarse) {
  .c18p-vol .c18p-volr { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .c18p-spin { animation-duration: 1.6s !important; }
}
