:root { color-scheme: dark; }

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: system-ui, Segoe UI, Roboto, Arial, sans-serif;
  background:#000;
  color:#eaeaf2;
  overflow: hidden;
}

/* Top bar */

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.65), rgba(0,0,0,0));
  pointer-events: none;
}

.left {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.title { font-weight: 700; font-size: 14px; }
.sub { opacity: 0.7; font-size: 11px; }

.controls {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

button {
  background: rgba(20,20,28,0.85);
  color:#eaeaf2;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 13px;
  backdrop-filter: blur(6px);
}

/* Status pill */

.status {
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(20,20,28,0.75);
  border: 1px solid rgba(255,255,255,0.14);
  font-size: 12px;
  opacity: 0.9;
  backdrop-filter: blur(6px);
}

.spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: rgba(255,255,255,0.85);
  animation: spin 0.85s linear infinite;
  display: none;
}

.status.loading .spinner { display: inline-block; }

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

/* Styled Volume Slider */

.vol-wrap {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;

  height: 34px;
  padding: 0 10px;
  border-radius: 999px;

  background: rgba(20,20,28,0.75);
  border: 1px solid rgba(255,255,255,0.14);
  backdrop-filter: blur(6px);

  font-size: 12px;
  opacity: 0.95;
}

.vol-label {
  opacity: 0.7;
  letter-spacing: 0.06em;
  font-weight: 700;
  font-size: 11px;
  user-select: none;
}

.vol-val {
  opacity: 0.75;
  min-width: 28px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  user-select: none;
}

.vol {
  width: 130px;
  height: 18px;
  background: transparent;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
}

/* WebKit */
.vol::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.22);
}

.vol::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-top: -5px;
  background: rgba(234,234,242,0.95);
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
}

/* Firefox */
.vol::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.22);
}

.vol::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(234,234,242,0.95);
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
}

/* Error */

.error {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 30;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(60,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.12);
  color: #ffb4b4;
  font-size: 13px;
  display: none;
  white-space: pre-wrap;
  backdrop-filter: blur(6px);
}

/* Feed */

.feed {
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  background: #000;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.card {
  height: 100vh;
  height: 100dvh;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  background: #000;
  position: relative;
}

.player {
  flex: 1 1 auto;
  display:flex;
  align-items:stretch;
  justify-content:stretch;
  background:#000;
  min-height: 0;
}

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

.placeholder {
  width:100%; height:100%;
  display:flex; align-items:center; justify-content:center;
  background:#111;
  background-position:center;
  background-size:cover;
}

.overlay {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 14px;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.overlay .box {
  max-width: 720px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 10px 12px;
  backdrop-filter: blur(6px);
}

.ov-title {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  margin-bottom: 4px;
}

.ov-sub {
  opacity: 0.8;
  font-size: 12px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.dot { opacity: 0.6; }
