:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f1ede6;
  background: #0b0c0c;
  font-synthesis: none;
  --background: #0b0c0c;
  --surface: #111313;
  --player: #050606;
  --text: #f1ede6;
  --muted: #aaa6a1;
  --border: #343536;
  --accent: #ad493b;
  --success: #67bd54;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--background); }
body { margin: 0; min-width: 320px; background: var(--background); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled, input:disabled, select:disabled { cursor: default; opacity: .42; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.site-header { height: 76px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); padding: 0 44px; }
.brand { color: var(--text); text-decoration: none; font: 42px/1 Georgia, "Times New Roman", serif; letter-spacing: -1.4px; }
.brand em { color: var(--accent); font-style: normal; }
.quiet-button { min-height: 44px; padding: 8px 0 8px 28px; border: 0; border-left: 1px solid var(--border); background: transparent; font-size: 15px; }
.quiet-button:hover { color: var(--accent); }

.login-screen { min-height: calc(100svh - 76px); display: grid; place-items: center; padding: 48px 24px; }
.login-panel { width: min(100%, 420px); border: 1px solid var(--border); border-radius: 5px; padding: 36px 30px 26px; background: var(--surface); display: flex; flex-direction: column; }
.login-panel h1 { margin: 0 0 32px; font: 34px/1.2 Georgia, "Times New Roman", serif; letter-spacing: -.6px; }
.login-panel label { font-size: 13px; margin-bottom: 8px; color: var(--muted); }
.login-panel input { height: 46px; padding: 10px 12px; margin-bottom: 20px; border: 1px solid var(--border); border-radius: 3px; background: #090a0a; }
.primary-button { min-height: 46px; border: 1px solid var(--accent); border-radius: 3px; background: var(--accent); padding: 10px 16px; }
.primary-button:hover:not(:disabled) { background: #923d32; }
.login-status { min-height: 24px; margin: 16px 0 4px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.login-note { margin: 0; color: #76736f; text-align: center; font-size: 12px; }

.cinema { min-height: calc(100svh - 76px); display: grid; grid-template-columns: 280px minmax(0, 1fr); }
.library { border-right: 1px solid var(--border); padding: 30px 0; min-width: 0; }
.library h2 { display: flex; align-items: center; gap: 13px; padding: 0 28px 20px; margin: 0; font: 28px/1.2 Georgia, "Times New Roman", serif; font-weight: 400; }
.library h2 svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }
.movie-list { list-style: none; margin: 0; padding: 0; }
.movie-button { width: 100%; min-height: 62px; border: 0; border-left: 4px solid transparent; background: transparent; color: var(--muted); display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: center; gap: 14px; padding: 11px 28px 11px 24px; text-align: left; }
.movie-button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }
.movie-button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.movie-button:hover:not(:disabled) { color: var(--text); background: #151616; }
.movie-button[aria-current="true"] { color: var(--text); border-left-color: var(--accent); background: #281716; }

.player-column { min-width: 0; padding: 22px 32px 26px; max-width: 1500px; width: 100%; margin: 0 auto; }
.mobile-movie-picker { display: none; }
.player-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--border); border-radius: 3px 3px 0 0; overflow: hidden; background: var(--player); }
#video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.video-placeholder { position: absolute; inset: 0; background: #0a0b0b; overflow: hidden; }
.video-placeholder::before, .video-placeholder::after { content: ''; position: absolute; inset: 12% -8%; border-top: 18px dotted #181a1a; border-bottom: 18px dotted #181a1a; transform: rotate(-24deg); opacity: .75; }
.video-placeholder::after { inset: 38% -8%; opacity: .4; }
.video-placeholder span { position: absolute; width: 42%; aspect-ratio: 1; border: 1px solid #151717; border-radius: 50%; right: 8%; top: -8%; }
.overlay-play { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: 112px; height: 112px; border-radius: 50%; border: 2px solid var(--text); background: rgba(11, 12, 12, .8); display: grid; place-items: center; }
.overlay-play svg { width: 50px; height: 50px; fill: var(--text); }
.overlay-play:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); }
.timeline-row { grid-column: 1 / -1; grid-row: 1; margin: 0 -14px; border-bottom: 1px solid var(--border); padding: 0 16px; height: 28px; display: flex; align-items: center; background: var(--surface); }
.timeline, #volume { width: 100%; accent-color: var(--accent); }
.transport { min-height: 96px; display: grid; grid-template-columns: 48px 52px 48px minmax(120px, 1fr) 210px 48px; grid-template-rows: 28px 68px; align-items: center; column-gap: 12px; padding: 0 14px; border: 1px solid var(--border); border-top: 0; background: var(--surface); }
.transport > :not(.timeline-row) { grid-row: 2; }
.icon-button { width: 44px; height: 44px; border: 0; background: transparent; display: grid; place-items: center; border-radius: 50%; }
.icon-button:hover:not(:disabled) { color: var(--accent); background: #1b1d1d; }
.icon-button svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.seek-button svg { width: 35px; height: 35px; }
.seek-button text { fill: currentColor; stroke: none; font: 10px sans-serif; text-anchor: middle; }
.play-button svg { fill: currentColor; stroke: none; }
.play-button .pause-icon { display: none; }
.play-button[data-playing="true"] .play-icon { display: none; }
.play-button[data-playing="true"] .pause-icon { display: block; }
.time { margin: 0 0 0 14px; display: flex; gap: 8px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.volume-control { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 10px; }
.volume-control svg, .fullscreen-button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.subtitle-controls { min-height: 94px; display: grid; grid-template-columns: minmax(200px, 320px) minmax(380px, 1fr) auto; align-items: center; gap: 24px; border-bottom: 1px solid var(--border); padding: 18px 4px; }
.select-control { display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: 16px; }
.select-control span, .control-label { font-size: 15px; }
select, .delay-stepper, .secondary-button { height: 46px; border: 1px solid var(--border); border-radius: 3px; background: var(--surface); }
select { width: 100%; padding: 0 42px 0 14px; }
.delay-control { display: grid; grid-template-columns: 112px minmax(190px, 260px) 78px; gap: 12px; align-items: center; }
.delay-stepper { display: grid; grid-template-columns: 44px minmax(72px, 1fr) 28px 44px; align-items: center; overflow: hidden; }
.delay-stepper button { height: 100%; border: 0; border-right: 1px solid var(--border); background: transparent; font-size: 24px; }
.delay-stepper button:last-child { border-right: 0; border-left: 1px solid var(--border); }
.delay-stepper button:hover:not(:disabled) { color: var(--accent); background: #1b1d1d; }
#subtitle-delay { min-width: 0; width: 100%; height: 100%; border: 0; background: transparent; text-align: right; font-variant-numeric: tabular-nums; appearance: textfield; }
#subtitle-delay::-webkit-inner-spin-button { appearance: none; }
.delay-stepper > span { color: var(--muted); font-size: 13px; }
.secondary-button { padding: 0 14px; }
.secondary-button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.keyboard-help { margin: 0; padding-left: 20px; border-left: 1px solid var(--border); color: var(--muted); font-size: 13px; white-space: nowrap; }
kbd { font: inherit; color: var(--text); }
.status { min-height: 56px; margin: 0; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.status > span { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: var(--success); }

@media (max-width: 980px) {
  .site-header { padding: 0 24px; }
  .brand { font-size: 34px; }
  .cinema { display: block; padding: 24px; }
  .library { display: none; }
  .player-column { padding: 0; }
  .mobile-movie-picker { display: grid; gap: 7px; margin-bottom: 18px; color: var(--muted); font-size: 13px; }
  .mobile-movie-picker select { color: var(--text); font-size: 17px; }
  .subtitle-controls { grid-template-columns: 1fr; align-items: stretch; gap: 18px; padding: 22px 0; }
  .select-control { grid-template-columns: 1fr; gap: 8px; }
  .delay-control { grid-template-columns: 1fr minmax(0, 1fr) 86px; }
  .keyboard-help { border-left: 0; padding: 16px 0 0; border-top: 1px solid var(--border); }
}

@media (max-width: 560px) {
  .site-header { height: 66px; padding: 0 18px; }
  .brand { font-size: 29px; letter-spacing: -.8px; }
  .quiet-button { padding-left: 18px; font-size: 14px; }
  .login-screen { min-height: calc(100svh - 66px); padding: 28px 18px; }
  .login-panel { padding: 28px 22px 22px; }
  .login-panel h1 { font-size: 29px; }
  .cinema { padding: 24px 18px 18px; }
  .player-frame { border-radius: 3px; }
  .overlay-play { width: 70px; height: 70px; border: 0; background: var(--accent); }
  .overlay-play svg { width: 34px; height: 34px; }
  .transport { min-height: 160px; grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 68px 28px 42px; grid-template-areas: "back play forward" "timeline timeline timeline" "time volume full"; border: 0; padding: 4px 0 0; background: transparent; gap: 5px 14px; }
  .transport > :not(.timeline-row) { grid-row: auto; }
  #back-ten { grid-area: back; }
  #play { grid-area: play; }
  #forward-ten { grid-area: forward; }
  .timeline-row { grid-area: timeline; margin: 0; border: 0; height: 28px; padding: 0; background: transparent; }
  .time { grid-area: time; margin: 0; justify-self: start; font-size: 12px; }
  .volume-control { grid-area: volume; grid-template-columns: 24px minmax(0, 1fr); }
  #fullscreen { grid-area: full; justify-self: end; }
  .seek-button { width: 58px; height: 58px; justify-self: center; border: 1px solid var(--border); }
  .play-button { width: 66px; height: 66px; justify-self: center; color: var(--text); background: var(--accent); }
  .play-button:hover:not(:disabled) { color: var(--text); background: #923d32; }
  .delay-control { grid-template-columns: 1fr 78px; }
  .delay-control .control-label { grid-column: 1 / -1; }
  .delay-stepper { min-width: 0; }
  .status { line-height: 1.5; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
