:root {
  color-scheme: dark;
  --bg: #0d0e11;
  --panel: #1e1f22;
  --text: #f2f3f5;
  --muted: #9aa1ab;
  --accent: #16a34a;
  --accent-bright: #4ade80;
  --timeline-thumb: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "gg sans", "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow: hidden;
}

#player-wrap {
  position: absolute;
  inset: 0;
  background: #000;
}

#player-wrap video {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  object-fit: contain;
  background: #000;
}

.seek-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 24px;
  background: rgba(4, 5, 7, 0.62);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  text-align: left;
  pointer-events: none;
}

/* Ilk stream kaniti veya recovery URL'si hazirlanirken goruntuyu kapatmak
   yerine ustte kucuk bir durum rozeti kullanilir; HTTP 200 sonrasi
   `is-preparing` kaldirilinca tam katman kurallari yeniden devreye girer. */
.seek-loading.is-preparing {
  inset: max(12px, env(safe-area-inset-top)) auto auto 50%;
  width: max-content;
  max-width: calc(100% - 32px);
  min-height: 44px;
  padding: 9px 14px;
  transform: translateX(-50%);
  justify-content: flex-start;
  gap: 9px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: rgba(18, 20, 24, 0.88);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.seek-loading.is-preparing .seek-loading-copy {
  max-width: min(420px, calc(100vw - 82px));
  gap: 1px;
}

.seek-loading.is-preparing .seek-loading-copy strong { font-size: 13px; }
.seek-loading.is-preparing .seek-loading-copy span { font-size: 11px; }

.seek-loading.is-preparing .seek-spinner {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

.seek-loading-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: min(430px, 76vw);
}

.seek-loading-copy strong { font-size: 15px; }
.seek-loading-copy span { color: #c6cbd2; font-size: 12px; line-height: 1.35; }

.seek-spinner {
  width: 27px;
  height: 27px;
  flex: none;
  border: 3px solid rgba(255, 255, 255, 0.22);
  border-top-color: var(--accent-bright);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

.hidden { display: none !important; }

/* Klip oynatilamadigi her durumda (radyo, gomme kapali, bos kuyruk) bu kart
   gorunur. Ses bu karttan bagimsiz calmaya devam eder. */
.card {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  text-align: center;
  background: radial-gradient(circle at 50% 35%, #23262c 0%, var(--bg) 70%);
}

.card img {
  max-width: min(420px, 78%);
  max-height: 46%;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
}

.card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 560px;
}

.card-icon { font-size: 34px; line-height: 1; }

.card-title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
}

.card-note {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.bar {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0));
  font-size: 13px;
  pointer-events: none;
}

.bar > * { pointer-events: auto; }

.bar-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.timeline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
  padding: 7px 12px;
  background: rgba(0, 0, 0, 0.48);
  color: var(--text);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.timeline-toggle:hover { background: rgba(255, 255, 255, 0.12); }
.timeline-toggle:disabled { opacity: 0.4; cursor: default; }
.timeline-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.timeline-toggle[aria-expanded="true"] > span:first-child { transform: rotate(180deg); }
.timeline-toggle > span:first-child { display: inline-block; transition: transform 0.18s ease; }

.timeline-panel {
  position: absolute;
  z-index: 4;
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  bottom: calc(63px + env(safe-area-inset-bottom));
  padding: 13px 15px 11px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 13px;
  background: rgba(15, 16, 19, 0.92);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: timeline-in 0.18s ease-out;
}

@keyframes timeline-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.timeline-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}

.timeline-time { color: #b5bbc4; font-size: 11px; }
.timeline-time:last-child { text-align: right; }

.timeline-stage { position: relative; padding: 7px 0 5px; }

.timeline-range {
  width: 100%;
  height: 44px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
  touch-action: none;
}

.timeline-range::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(to right,
    var(--accent-bright) 0 var(--timeline-progress, 0%),
    rgba(255, 255, 255, 0.24) var(--timeline-progress, 0%) 100%);
}

.timeline-range::-moz-range-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
}

.timeline-range::-moz-range-progress {
  height: 5px;
  border-radius: 999px;
  background: var(--accent-bright);
}

.timeline-range::-webkit-slider-thumb {
  width: var(--timeline-thumb);
  height: var(--timeline-thumb);
  margin-top: -6.5px;
  appearance: none;
  -webkit-appearance: none;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.timeline-range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.timeline-range:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.timeline-range:disabled { cursor: default; opacity: 0.45; }

.timeline-preview {
  position: absolute;
  z-index: 2;
  left: var(--preview-x, 0%);
  bottom: 45px;
  min-width: 48px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 7px;
  padding: 4px 7px;
  background: rgba(8, 9, 11, 0.94);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.65);
  pointer-events: none;
}

.timeline-preview span {
  display: block;
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.timeline-help { color: #8f96a1; font-size: 10px; text-align: center; }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.6);
  animation: pulse 2s infinite;
}

.dot.paused { background: #faa81a; animation: none; }
.dot.off { background: #72767d; animation: none; }

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

.btn {
  background: #4e5058;
  color: var(--text);
  border: 0;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

.btn:hover { background: #6d6f78; }
.btn.small { padding: 5px 9px; font-size: 14px; }

/* Kontroller sag ust kosede dikey bir sutun halinde: videonun ortasini
   kapatmazlar. Fare/dokunus gelince belirginlesiyorlar ki izlerken gozu
   yormasinlar. */
.controls {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 10px 7px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid #3f4147;
  border-radius: 999px;
  opacity: 0.45;
  transition: opacity 0.15s ease;
}

.controls:hover,
.controls:focus-within { opacity: 1; }

.ctl {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1;
  padding: 0;
  border-radius: 6px;
  cursor: pointer;
}

.ctl:hover { background: rgba(255, 255, 255, 0.12); }
.ctl:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.ctl:disabled { opacity: 0.35; cursor: default; background: transparent; }
.ctl-main { font-size: 21px; }

/* Kontroller sag ustte durdugu icin toast alt cubugun ustunde: cakismazlar. */
.toast {
  position: absolute;
  bottom: 44px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.82);
  border: 1px solid #3f4147;
  border-radius: 7px;
  padding: 7px 13px;
  font-size: 12px;
  color: var(--muted);
  max-width: 88%;
  text-align: center;
}

body.timeline-open .toast { bottom: 174px; }

@media (prefers-reduced-motion: reduce) {
  .dot, .seek-spinner, .timeline-panel { animation: none; }
}

@media (max-width: 520px) {
  .timeline-toggle-label { display: none; }
  .timeline-panel { padding-inline: 11px; }
}
