:root {
  --bg: #0b0b10;
  --panel: rgba(20,20,28,0.92);
  --text: #fff;
  --muted: #a6a8b1;
  --accent: #7c5cff;
  --accent-2: #19c37d;
  --danger: #ff4d4d;
  --seek-bg: #2b2f3a;
  --seek-buffer: #4b5161;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; color: var(--text); font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji"; }
#app { width: 100%; height: 100svh; display: grid; place-items: center; }

.nlp { position: relative; width: 100%; height: 100%; background: #000; overflow: hidden; touch-action: none; }
.nlp video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.nlp-visual-layer { position: absolute; inset: 0; pointer-events: none; filter: brightness(1); transition: filter .15s linear; }

.nlp-topbar {
  position: absolute; top: 0; left: 0; right: 0; height: 56px;
  display: flex; align-items: center; gap: 8px; padding: 0 env(safe-area-inset-right) 0 env(safe-area-inset-left);
  background: linear-gradient(180deg, rgba(0,0,0,.6), rgba(0,0,0,0));
  pointer-events: none;
}
.nlp-topbar .nlp-icon-btn { pointer-events: auto; margin-left: 8px; }
.nlp-title { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .92; }
.nlp-top-actions { display: flex; gap: 6px; margin-right: 8px; }

.nlp-controls {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(0,0,0,.7), rgba(0,0,0,0));
  transform: translateY(0);
  transition: opacity .2s ease, transform .2s ease;
}
.nlp-row { display: flex; align-items: center; gap: 8px; }
.nlp-seek-row { position: relative; padding: 10px 0 2px; }
.nlp-seek-buffer {
  position: absolute; left: 8px; right: 8px; top: 50%; height: 4px; transform: translateY(-50%);
  background: var(--seek-bg); border-radius: 999px; overflow: hidden;
}
.nlp-seek-buffer::after {
  content: ""; display: block; height: 100%; width: 0%;
  background: var(--seek-buffer);
}
.nlp-seek {
  width: 100%;
  appearance: none; height: 4px; background: transparent; outline: none; margin: 0 8px; cursor: pointer;
}
.nlp-seek::-webkit-slider-runnable-track { height: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 999px; }
.nlp-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; margin-top: -6px; box-shadow: 0 0 0 3px rgba(255,255,255,.15); }
.nlp-seek::-moz-range-track { height: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 999px; }
.nlp-seek::-moz-range-thumb { width: 16px; height: 16px; border: none; border-radius: 50%; background: #fff; }

.nlp-volume { width: 110px; }
.nlp-vol-wrap { display: flex; align-items: center; gap: 6px; }

.nlp-time { color: var(--muted); font-size: 13px; }
.nlp-spacer { flex: 1; }

.nlp-icon-btn {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.06); cursor: pointer; transition: transform .08s ease, background .2s ease;
}
.nlp-icon-btn:hover { background: rgba(255,255,255,0.14); }
.nlp-icon-btn:active { transform: scale(0.96); }
.nlp-icon-btn svg { width: 22px; height: 22px; }

.nlp-bigplay {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: 84px; height: 84px; display: grid; place-items: center; border-radius: 999px;
  background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.1); cursor: pointer;
  backdrop-filter: blur(4px);
}

.nlp-gesture-overlay {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity .12s;
}
.nlp-gesture-overlay.show { opacity: 1; }
.nlp-gesture-badge {
  padding: 8px 12px; border-radius: 10px; background: rgba(0,0,0,.7);
  font-weight: 700; font-size: 16px; color: #fff; border: 1px solid rgba(255,255,255,.1);
}

.nlp-pill {
  height: 32px; padding: 0 10px; border-radius: 999px; background: rgba(255,255,255,.08);
  color: #fff; border: 1px solid rgba(255,255,255,.06); cursor: pointer;
}
.nlp-secondary-right { display: flex; gap: 8px; margin-left: auto; }

.nlp-menu {
  position: absolute; right: 10px; bottom: 90px; min-width: 220px; max-width: 80vw;
  max-height: 60vh; overflow: auto; background: var(--panel); border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px; padding: 8px; display: none;
}
.nlp-menu.show { display: block; }
.nlp-menu .item { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.nlp-menu .item:hover { background: rgba(255,255,255,.08); }
.nlp-menu .item .label { color: #fff; }
.nlp-menu .item .meta { color: var(--muted); font-size: 12px; }
.nlp-menu .section { padding: 6px 10px; color: var(--muted); font-size: 12px; }

.hidden-ui .nlp-controls,
.hidden-ui .nlp-topbar { opacity: 0; pointer-events: none; }

@media (orientation: portrait) {
  .nlp-volume { width: 90px; }
}