:root {
  --bg: #080b0e;
  --panel: #11161c;
  --panel-2: #161d24;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f3f7f1;
  --text-soft: #c4cdd3;
  --muted: #8d98a2;
  --faint: #606b75;
  --lime: #c3ff63;
  --cyan: #61e7ff;
  --red: #ff4d4d;
  --sans: "Helvetica Neue", "Segoe UI", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  --display: "Helvetica Neue", "Arial Black", "Hiragino Sans", "Yu Gothic", sans-serif;
  --mono: "SFMono-Regular", "Cascadia Code", Consolas, monospace;
  --pad: clamp(18px, 4vw, 54px);
  --max: 1280px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

::selection {
  background: var(--lime);
  color: #0a1006;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 0%, rgba(35, 79, 66, 0.34), transparent 32%),
    radial-gradient(circle at 88% 18%, rgba(31, 61, 78, 0.28), transparent 36%),
    linear-gradient(180deg, #080b0e, #0a0f13 55%, #080b0e);
}

.grid {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: linear-gradient(to bottom, #000, transparent 70%);
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.3;
}

.glow-a {
  top: -180px;
  right: -100px;
  width: 480px;
  height: 480px;
  background: #1d6a5a;
}

.glow-b {
  top: 420px;
  left: -160px;
  width: 380px;
  height: 380px;
  background: #153b53;
}

/* ---------- Header ---------- */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(var(--max), calc(100% - var(--pad) * 2));
  margin: 0 auto;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: #050708;
  box-shadow: 0 8px 22px -10px rgba(195, 255, 99, 0.6);
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-copy strong {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.brand-copy small {
  margin-top: 4px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.1em;
}

.header nav {
  display: flex;
  gap: 24px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.header nav a:hover {
  color: var(--lime);
}

/* ---------- Hero / Search ---------- */

main {
  width: min(var(--max), calc(100% - var(--pad) * 2));
  margin: 0 auto;
}

.search-hero {
  padding: clamp(34px, 5vw, 62px) 0 clamp(24px, 3vw, 38px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 18px;
  padding: 6px 11px;
  border: 1px solid rgba(195, 255, 99, 0.22);
  border-radius: 999px;
  background: rgba(195, 255, 99, 0.06);
  color: var(--lime);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
}

.eyebrow span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 8px rgba(195, 255, 99, 0.7);
}

.search-hero h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(34px, 4.6vw, 58px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.search-hero h1 span {
  background: linear-gradient(100deg, var(--lime), #7df0cf 55%, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lead {
  max-width: 40em;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 860px;
  margin-top: 20px;
  padding: 6px 6px 6px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(15, 20, 25, 0.94);
  box-shadow: 0 18px 50px -30px rgba(0, 0, 0, 0.9);
}

.search-form > svg {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--faint);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.search-form input {
  flex: 1;
  min-width: 0;
  height: 38px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}

.search-form input::placeholder {
  color: var(--faint);
}

.search-form button {
  flex: none;
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 7px;
  background: var(--lime);
  color: #0a1006;
  font-size: 10.5px;
  font-weight: 800;
}

.search-form button:hover {
  background: #d5ff8c;
}

.quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.quick-tags button {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 9px;
}

.quick-tags button:hover {
  border-color: rgba(195, 255, 99, 0.35);
  color: var(--lime);
}

/* ---------- Watch layout ---------- */

.watch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 32px;
  align-items: start;
  padding-bottom: 70px;
}

.watch-main {
  min-width: 0;
}

.player-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #050708;
  box-shadow: 0 28px 70px -38px rgba(0, 0, 0, 0.95);
}

.player-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--faint);
  font-size: 11px;
  text-align: center;
}

.placeholder-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(195, 255, 99, 0.25);
  border-radius: 50%;
  color: var(--lime);
  font-size: 20px;
  padding-left: 3px;
}

#player {
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.video-info {
  padding: 18px 2px 0;
}

.video-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.source-badge {
  padding: 3px 7px;
  border: 1px solid rgba(195, 255, 99, 0.3);
  border-radius: 4px;
  color: var(--lime);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.1em;
}

.external-link {
  color: var(--cyan);
  font-size: 9px;
  border-bottom: 1px solid rgba(97, 231, 255, 0.3);
}

.video-info h2 {
  margin: 10px 0 4px;
  font-family: var(--display);
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.video-meta {
  margin: 0;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
}

.description-block {
  margin-top: 18px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(17, 22, 28, 0.8);
}

.description-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.description-head h3 {
  margin: 0;
  font-size: 10px;
  font-weight: 600;
}

.description-head span {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.1em;
}

#video-description {
  max-height: 240px;
  margin: 10px 0 0;
  overflow-y: auto;
  color: var(--text-soft);
  font-size: 11.5px;
  line-height: 1.9;
  white-space: pre-line;
  scrollbar-width: thin;
}

/* ---------- Results ---------- */

.results-panel {
  position: sticky;
  top: 20px;
  min-width: 0;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  padding: 4px 0 0;
}

.results-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 10px;
  border-bottom: 1px solid var(--line);
}

.results-kicker {
  margin: 0 0 2px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.14em;
}

.results-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

#results-count {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 8px;
}

.results-list {
  flex: 1;
  min-height: 80px;
  overflow-y: auto;
  padding: 8px 2px;
  scrollbar-width: thin;
}

.results-loading,
.results-empty {
  padding: 30px 10px;
  color: var(--faint);
  font-size: 10px;
  text-align: center;
}

.result-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  padding: 8px 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}

.result-card:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.result-card.active {
  border-color: rgba(195, 255, 99, 0.3);
  background: rgba(195, 255, 99, 0.06);
}

.result-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  background: #151c22;
}

.result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-duration {
  position: absolute;
  right: 4px;
  bottom: 4px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-family: var(--mono);
  font-size: 7px;
}

.result-copy {
  min-width: 0;
}

.result-copy h3 {
  display: -webkit-box;
  overflow: hidden;
  margin: 1px 0 4px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.result-copy p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--faint);
  font-size: 8px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.result-copy small {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.results-note {
  margin: 4px 2px 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 7.5px;
  line-height: 1.6;
}

/* ---------- Footer ---------- */

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(var(--max), calc(100% - var(--pad) * 2));
  margin: 0 auto;
  padding: 22px 0 34px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 8px;
}

.footer a:hover {
  color: var(--lime);
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .watch-layout {
    grid-template-columns: 1fr;
  }

  .results-panel {
    position: static;
    max-height: none;
  }

  .results-list {
    max-height: 520px;
  }
}

@media (max-width: 600px) {
  .header {
    padding: 14px 0;
  }

  .header nav a:first-child {
    display: none;
  }

  .brand-copy small {
    display: none;
  }

  .search-hero {
    padding-top: 42px;
  }

  .search-hero h1 {
    font-size: clamp(34px, 10.5vw, 50px);
  }

  .search-form {
    padding-left: 12px;
  }

  .search-form button {
    padding: 0 12px;
    font-size: 9px;
  }

  .result-card {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 8px;
  }

  .result-copy h3 {
    font-size: 10px;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
