:root {
  --bg: #0a0a0c;
  --accent: #ff5b2e;
  --accent-2: #ffb020;
  --text: #f5f5f7;
  --text-dim: rgba(245,245,247,0.7);
  --glass: rgba(20,20,24,0.55);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow: hidden;
  height: 100%;
  width: 100%;
  overscroll-behavior: none;
}

/* ---------- Loading ---------- */
#loading-screen {
  position: fixed;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: radial-gradient(circle at 50% 30%, #1a1a1f 0%, #0a0a0c 70%);
  z-index: 100;
}
#loading-screen:not([hidden]) { display: flex; }
.loader-rocket {
  font-size: 48px;
  animation: float 1.4s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}
#loading-screen p {
  color: var(--text-dim);
  font-size: 14px;
  letter-spacing: 0.3px;
}

/* ---------- Feed ---------- */
.feed {
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  position: relative;
}
.feed::-webkit-scrollbar { display: none; }

.short-slide {
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
}

.short-slide .player-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
}

/* placeholder shown before iframe is mounted (virtualization) */
.short-slide .placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 13px;
  background: linear-gradient(160deg, #151518, #08080a);
}

/* gradient overlays so text is legible over any video */
.short-slide .overlay-top,
.short-slide .overlay-bottom {
  position: absolute;
  left: 0; right: 0;
  pointer-events: none;
  z-index: 3;
}
.short-slide .overlay-top {
  top: 0; height: 110px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.55), transparent);
}
.short-slide .overlay-bottom {
  bottom: 0; height: 180px;
  background: linear-gradient(to top, rgba(0,0,0,0.75), transparent);
}

.short-slide .info {
  position: absolute;
  left: 16px;
  right: 76px;
  bottom: 28px;
  z-index: 4;
  pointer-events: none;
}
.short-slide .category-chip {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #12100c;
  margin-bottom: 10px;
}
.short-slide .title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  text-shadow: 0 1px 6px rgba(0,0,0,0.6);
  margin: 0;
}

/* right-side action rail */
.short-slide .rail {
  position: absolute;
  right: 12px;
  bottom: 40px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.rail button {
  background: var(--glass);
  backdrop-filter: blur(6px);
  border: none;
  color: var(--text);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.rail button:active { transform: scale(0.88); }
.rail button.active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #12100c; }
.rail .mute-btn,
.rail .mute-btn.active { background: #75d705; }
.rail .rail-label {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: -14px;
}

/* progress dots (subtle) */
.short-slide .idx-badge {
  position: absolute;
  top: 60px;
  left: 16px;
  z-index: 4;
  font-size: 11px;
  color: var(--text-dim);
  background: var(--glass);
  padding: 3px 9px;
  border-radius: 20px;
  backdrop-filter: blur(6px);
}

/* ---------- Top bar ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  pointer-events: none;
}
.brand {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.2px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.7);
}
.brand-accent { color: var(--accent-2); }
.update-badge {
  font-size: 10px;
  color: var(--text-dim);
  background: var(--glass);
  padding: 4px 10px;
  border-radius: 20px;
  backdrop-filter: blur(6px);
}

/* ---------- Swipe hint ---------- */
.swipe-hint {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--text-dim);
  font-size: 12px;
  animation: pulse-up 1.6s ease-in-out infinite;
  pointer-events: none;
}
.swipe-hint:not([hidden]) { display: flex; }
.swipe-hint .chev { font-size: 20px; }
@keyframes pulse-up {
  0%, 100% { opacity: 0.35; transform: translate(-50%, 0); }
  50% { opacity: 1; transform: translate(-50%, -8px); }
}

/* ---------- Empty state ---------- */
.empty-state {
  position: fixed;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 50;
  background: var(--bg);
}
.empty-state:not([hidden]) { display: flex; }
.empty-state button {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border: none;
  color: #12100c;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: 24px;
  cursor: pointer;
}

/* desktop niceties */
@media (min-width: 768px) {
  .feed { max-width: 480px; margin: 0 auto; }
  body { background: #000; }
  .short-slide { max-width: 480px; margin: 0 auto; }
}
