/* ─── Reset & Base ─────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #141414;
  --bg-secondary: #1a1a2e;
  --bg-card: #1e1e30;
  --bg-input: #2a2a3e;
  --text-primary: #e5e5e5;
  --text-secondary: #999;
  --accent: #e50914;
  --accent-hover: #f40612;
  --success: #46d369;
  --warning: #e8b100;
  --danger: #e50914;
  --border: #333;
  --radius: 6px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

.hidden { display: none !important; }

/* ─── Auth Screen ──────────────────────────────────── */
#auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #0a0a1a 0%, #1a1a2e 50%, #0a0a1a 100%);
}

.auth-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.logo h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.subtitle {
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 14px;
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  background: var(--bg-input);
  border-radius: var(--radius);
  padding: 4px;
}

.tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}

.tab.active {
  background: var(--accent);
  color: white;
}

.auth-form {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.auth-form.active {
  display: flex;
}

.input-group input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.input-group input:focus {
  border-color: var(--accent);
}

.input-group input::placeholder {
  color: #666;
}

.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  padding: 8px 16px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  color: white;
  border-color: #666;
}

.demo-hint {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 4px;
}

.error-msg {
  color: var(--danger);
  font-size: 13px;
  margin-top: 12px;
  min-height: 20px;
}

/* ─── Header ───────────────────────────────────────── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(20, 20, 20, 0.95);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

#user-info {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ─── Video Catalog ────────────────────────────────── */
#catalog-section {
  padding: 32px;
}

#catalog-section h2 {
  font-size: 22px;
  margin-bottom: 24px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.video-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.video-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.card-thumbnail {
  width: 100%;
  height: 170px;
  background: linear-gradient(135deg, #1a1a3e, #2a2a5e);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.card-thumbnail .play-icon {
  width: 56px;
  height: 56px;
  background: rgba(229, 9, 20, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: transform 0.2s;
}

.video-card:hover .play-icon {
  transform: scale(1.1);
}

.card-drm-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: var(--success);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-body {
  padding: 16px;
}

.card-body h3 {
  font-size: 16px;
  margin-bottom: 6px;
}

.card-body p {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 12px;
}

.card-meta {
  display: flex;
  gap: 8px;
}

.badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--bg-input);
  color: var(--text-secondary);
  font-weight: 600;
}

/* ─── Video Player ─────────────────────────────────── */
#player-section {
  padding: 24px 32px;
}

.btn-back {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 16px;
  padding: 4px 0;
}

.btn-back:hover {
  color: white;
}

.player-wrapper {
  display: grid;
  grid-template-columns: 1fr 360px;
  grid-template-rows: auto auto;
  gap: 24px;
}

.drm-shield {
  position: relative;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  /* Key anti-capture CSS */
  -webkit-user-select: none;
  user-select: none;
}

#drm-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
}

/* Custom subtitle overlay — moves up when controls are visible */
.subtitle-overlay {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 16px;
  max-width: 80%;
  text-align: center;
  color: white;
  font-size: 1.2em;
  line-height: 1.5;
  pointer-events: none;
  z-index: 4;
  transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.subtitle-overlay:empty {
  display: none;
}

.subtitle-overlay span {
  background: var(--sub-bg-color, rgba(0, 0, 0, 0.8));
  color: var(--sub-font-color, #ffffff);
  padding: 4px 12px;
  border-radius: 4px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* Slide subtitles up when controls are showing */
.drm-shield.controls-visible .subtitle-overlay,
.drm-shield.paused .subtitle-overlay {
  bottom: 72px;
}

/* ─── Subtitle Settings Modal ──────────────────────── */
.sub-settings-modal {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s;
}

.sub-settings-modal.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.sub-settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  width: 380px;
  max-width: 90%;
  max-height: 85%;
  overflow-y: auto;
}

.sub-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.sub-settings-header h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.sub-settings-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.sub-settings-close:hover {
  color: white;
}

/* Preview */
.sub-preview {
  background: #222;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  margin-bottom: 20px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#sub-preview-text {
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 1.2em;
  line-height: 1.5;
  transition: all 0.2s;
}

/* Setting groups */
.sub-setting-group {
  margin-bottom: 16px;
}

.sub-setting-group label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

/* Presets */
.sub-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sub-preset {
  padding: 6px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.sub-preset:hover {
  border-color: #666;
  color: white;
}

.sub-preset.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(229, 9, 20, 0.1);
}

/* Font size buttons */
.sub-size-options {
  display: flex;
  gap: 6px;
}

.sub-size {
  width: 40px;
  height: 36px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.sub-size:hover {
  border-color: #666;
  color: white;
}

.sub-size.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(229, 9, 20, 0.1);
}

/* Color swatches */
.sub-colors {
  display: flex;
  gap: 8px;
}

.sub-color {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.sub-color:hover {
  transform: scale(1.15);
}

.sub-color.active {
  border-color: var(--accent);
  transform: scale(1.1);
}

/* Background buttons */
.sub-bg-options {
  display: flex;
  gap: 6px;
}

.sub-bg {
  padding: 6px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.sub-bg:hover {
  border-color: #666;
  color: white;
}

.sub-bg.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(229, 9, 20, 0.1);
}

/* Embed code fields */
.embed-code-wrap {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.embed-code {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: "SF Mono", "Consolas", monospace;
  font-size: 12px;
  padding: 10px;
  resize: none;
  outline: none;
  width: 100%;
}

.embed-code:focus {
  border-color: var(--accent);
}

.copy-btn {
  padding: 8px 14px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.copy-btn:hover {
  background: var(--accent-hover);
}

.copy-btn.copied {
  background: var(--success);
}

/* Decrypt progress overlay */
.decrypt-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 10;
  transition: opacity 0.4s;
}

.decrypt-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.decrypt-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#decrypt-status {
  color: var(--text-secondary);
  font-size: 14px;
  text-align: center;
}

.decrypt-progress-bar {
  width: 240px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.decrypt-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s;
}

/* ─── Player Controls ──────────────────────────────── */
.player-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
  padding: 32px 16px 12px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 5;
  pointer-events: none;
}

/* Show controls */
.drm-shield.paused .player-controls,
.drm-shield.controls-visible .player-controls {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Cursor behavior */
.drm-shield {
  cursor: default;
  transition: cursor 0.3s;
}

.drm-shield.hide-cursor {
  cursor: none;
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  cursor: pointer;
  margin-bottom: 10px;
  transition: height 0.1s;
  position: relative;
}

.progress-bar:hover {
  height: 6px;
}

/* Seek tooltip */
.seek-tooltip {
  position: absolute;
  bottom: 16px;
  left: 0;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: white;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-family: "SF Mono", "Consolas", monospace;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 10;
}

.progress-bar:hover .seek-tooltip {
  opacity: 1;
}

/* Decryption buffer — dark gray, sits behind playback */
.buffer-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  width: 0%;
  transition: width 0.5s linear;
  z-index: 1;
}

/* Hover preview — light red, shows where you'd seek to */
.hover-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(229, 9, 20, 0.35);
  border-radius: 2px;
  width: 0%;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}

.progress-bar:hover .hover-fill {
  opacity: 1;
}

/* Playback progress — red, sits on top */
.progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s linear;
  z-index: 2;
}

.controls-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ctrl-btn {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 6px;
  transition: transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ctrl-btn:hover {
  transform: scale(1.15);
}

.ctrl-btn svg {
  display: block;
}

/* Volume slider */
.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 70px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  transition: width 0.2s;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
  cursor: pointer;
}

.volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
  border: none;
  cursor: pointer;
}

/* Speed select */
.speed-select {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 12px;
  cursor: pointer;
  outline: none;
}

.speed-select:hover {
  border-color: rgba(255, 255, 255, 0.4);
}

.speed-select option {
  background: #1a1a2e;
  color: white;
}

#time-display {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.controls-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.drm-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--success);
  font-size: 11px;
  font-weight: 600;
  background: rgba(70, 211, 105, 0.1);
  padding: 4px 10px;
  border-radius: 4px;
}

.license-info {
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
}

/* ─── Video Info ───────────────────────────────────── */
.video-info-panel {
  grid-column: 1;
}

.video-info-panel h2 {
  font-size: 20px;
  margin-bottom: 8px;
}

.video-info-panel p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 12px;
}

.video-meta {
  display: flex;
  gap: 8px;
}

/* Generate Transcript button (inline) */
.generate-inline {
  margin-top: 16px;
}

.generate-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.generate-btn:hover {
  background: var(--accent-hover);
}

.generate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.generate-hint {
  display: block;
  color: var(--text-secondary);
  font-size: 11px;
  margin-top: 6px;
}

.transcribe-status {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--bg-input);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.transcribe-status .mini-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

/* ─── DRM Panel ────────────────────────────────────── */
.drm-panel {
  grid-column: 2;
  grid-row: 1 / 3;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

.drm-panel h3 {
  font-size: 14px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.drm-status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 28px;
}

.drm-status-item {
  background: var(--bg-input);
  border-radius: var(--radius);
  padding: 12px;
}

.drm-status-item .label {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.drm-status-item .value {
  font-size: 13px;
  font-weight: 600;
}

.drm-status-item .value.active {
  color: var(--success);
}

.drm-status-item .value.blocked {
  color: var(--danger);
}

.drm-status-item .value.warning {
  color: var(--warning);
}

/* ─── DRM Log ──────────────────────────────────────── */
.drm-log {
  background: #0d0d1a;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  font-size: 11px;
  line-height: 1.6;
  max-height: 300px;
  overflow-y: auto;
}

.drm-log .log-entry {
  padding: 2px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.drm-log .log-time {
  color: #555;
  margin-right: 8px;
}

.drm-log .log-msg {
  color: var(--text-secondary);
}

.drm-log .log-msg.success {
  color: var(--success);
}

.drm-log .log-msg.error {
  color: var(--danger);
}

.drm-log .log-msg.warning {
  color: var(--warning);
}

.drm-log .log-msg.info {
  color: #5b9bd5;
}

/* ─── Scrollbar ────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* ─── CC Button ────────────────────────────────────── */
/* Active state for toggle buttons (CC, Transcript, Settings) */
.ctrl-btn.active {
  color: var(--accent);
  background: rgba(229, 9, 20, 0.15);
  border-radius: 4px;
}

/* ─── Transcript Panel ─────────────────────────────── */
.transcript-panel {
  grid-column: 1 / -1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 400px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 1;
}

.transcript-panel.hidden {
  display: none;
}

.transcript-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.transcript-header h3 {
  font-size: 14px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.transcript-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
}

.transcript-close:hover {
  color: white;
}

.transcript-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px 80px;
  scroll-behavior: smooth;
}

.transcript-empty {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
  padding: 20px 0;
}

.transcript-empty code {
  background: var(--bg-input);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
}

.transcript-cue {
  display: flex;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  margin-bottom: 2px;
}

.transcript-cue:hover {
  background: rgba(255, 255, 255, 0.05);
}

.transcript-cue.active {
  background: rgba(229, 9, 20, 0.25);
  border-left: 3px solid var(--accent);
  padding-left: 7px;
}

.transcript-cue .cue-time {
  color: var(--accent);
  font-size: 12px;
  font-family: "SF Mono", "Consolas", monospace;
  font-variant-numeric: tabular-nums;
  min-width: 50px;
  padding-top: 2px;
  flex-shrink: 0;
}

.transcript-cue .cue-text {
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
}

.transcript-cue.active .cue-text {
  color: white;
  font-weight: 600;
}

.transcript-cue.active .cue-time {
  color: white;
  font-weight: 700;
}

/* ─── Theater Mode ─────────────────────────────────── */
.player-wrapper.theater {
  grid-template-columns: 1fr;
}

.player-wrapper.theater .drm-shield {
  aspect-ratio: 21 / 9;
  max-height: 80vh;
}

.player-wrapper.theater .drm-panel {
  grid-column: 1;
  grid-row: auto;
}

#player-section.theater {
  padding-left: 0;
  padding-right: 0;
}

#player-section.theater .btn-back {
  padding-left: 32px;
}

/* ─── Mini Player ──────────────────────────────────── */
.drm-shield.mini-player {
  position: fixed !important;
  bottom: 24px;
  right: 24px;
  width: 400px;
  height: auto;
  aspect-ratio: 16 / 9;
  z-index: 9999;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.7);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mini-close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.mini-close-btn:hover {
  background: var(--accent);
}

.mini-close-btn.hidden {
  display: none;
}

/* ─── Catalog Search ───────────────────────────────── */
.catalog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.catalog-header h2 {
  font-size: 22px;
  margin: 0;
}

.search-input {
  padding: 10px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  width: 280px;
  transition: border-color 0.2s, width 0.3s;
}

.search-input:focus {
  border-color: var(--accent);
  width: 340px;
}

.search-input::placeholder {
  color: #666;
}

/* ─── Keyboard Shortcuts Overlay ───────────────────── */
.shortcuts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sc {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-input);
  border-radius: 6px;
  font-size: 13px;
}

.sc kbd {
  background: #333;
  color: var(--text-primary);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: "SF Mono", "Consolas", monospace;
  font-size: 12px;
  border: 1px solid #555;
}

.sc span {
  color: var(--text-secondary);
  font-size: 12px;
}

/* ─── Responsive ───────────────────────────────────── */
@media (max-width: 900px) {
  .player-wrapper {
    grid-template-columns: 1fr;
  }

  .drm-panel {
    grid-column: 1;
    grid-row: auto;
  }

  header {
    padding: 12px 16px;
  }

  #catalog-section,
  #player-section {
    padding: 16px;
  }
}
