:root {
  --bg: #0b0a0c;
  --bg-elev: #161318;
  --bg-soft: #1e181c;
  --line: #3a2832;
  --ink: #f7eef2;
  --muted: #a8909c;
  --pink: #ff4d94;
  --pink-soft: #ff7bad;
  --pink-deep: #e0367c;
  --glow: rgba(255, 77, 148, 0.35);
  --radius: 14px;
  --font: "M PLUS Rounded 1c", "Hiragino Sans", "Noto Sans JP", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(255, 77, 148, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(224, 54, 124, 0.12), transparent 50%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.55;
}

a { color: var(--pink-soft); text-decoration: none; }
a:hover { color: #fff; }

.yt-top {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(11, 10, 12, 0.82);
  border-bottom: 1px solid var(--line);
}
.yt-top__inner {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
}
.yt-top__brand {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
  flex-shrink: 0;
}
.yt-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.yt-logo__mark {
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--pink-soft), var(--pink-deep));
  box-shadow: 0 0 16px var(--glow);
  font-size: 1rem;
}
.yt-logo__text {
  white-space: nowrap;
}
.yt-search {
  display: flex;
  flex: 1 1 auto;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-elev);
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.22s ease, transform 0.22s ease;
}
.yt-search:focus-within {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(255, 77, 148, 0.2);
}
.yt-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0.55rem 0.9rem;
  font: inherit;
  outline: none;
}
.yt-search button[type="submit"] {
  border: 0;
  background: linear-gradient(120deg, var(--pink-soft), var(--pink-deep));
  color: #fff;
  padding: 0 1.05rem;
  cursor: pointer;
  font-size: 1.05rem;
}
.yt-search__close {
  display: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 0.85rem;
  cursor: pointer;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
}
.yt-search__close:hover {
  color: #fff;
}
.yt-search-toggle {
  display: none;
}
.yt-search-scrim {
  display: none;
}
.yt-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--bg-soft);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.yt-chip:hover {
  border-color: var(--pink);
  background: rgba(255, 77, 148, 0.12);
  color: #fff;
}
.yt-chip--ghost {
  cursor: pointer;
  font: inherit;
  background: transparent;
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.18);
}
.yt-chip--ghost:hover {
  color: #fff;
  border-color: rgba(255, 180, 120, 0.55);
  background: rgba(255, 160, 80, 0.12);
}
.yt-top__actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
  margin-left: auto;
}

.yt-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.4rem 1.25rem 3rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1.4rem;
  align-items: start;
}
.yt-empty {
  grid-column: 1 / -1;
  padding: 2rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}

.yt-stage { min-width: 0; }
.yt-player {
  position: relative;
  background: #000;
  border-radius: 18px;
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255, 77, 148, 0.08),
    0 18px 48px rgba(0, 0, 0, 0.55),
    0 0 40px rgba(255, 77, 148, 0.12);
}
.yt-player__stills-wrap {
  position: relative;
  background: #1a1016;
  border-bottom: 1px solid rgba(255, 77, 148, 0.25);
}
.yt-player__stills-wrap[hidden] { display: none; }
.yt-player__stills {
  display: flex;
  flex-wrap: nowrap;
  gap: 2px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 77, 148, 0.55) transparent;
}
.yt-player__stills:empty { display: none; }
.yt-player__stills::-webkit-scrollbar {
  height: 4px;
}
.yt-player__stills::-webkit-scrollbar-thumb {
  background: rgba(255, 77, 148, 0.55);
  border-radius: 999px;
}
.yt-player__stills img {
  display: block;
  flex: 0 0 25%;
  width: 25%;
  max-width: 25%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #120a0e;
  scroll-snap-align: start;
  user-select: none;
  -webkit-user-drag: none;
}
.yt-stills__arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(12, 8, 12, 0.72);
  color: #fff;
  font: inherit;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.yt-player__stills-wrap:hover .yt-stills__arrow:not([hidden]),
.yt-player__stills-wrap:focus-within .yt-stills__arrow:not([hidden]),
.yt-stills__arrow:focus-visible {
  opacity: 1;
  pointer-events: auto;
}
.yt-stills__arrow:hover,
.yt-stills__arrow:focus-visible {
  background: rgba(255, 77, 148, 0.55);
  border-color: rgba(255, 180, 210, 0.7);
  outline: none;
}
.yt-stills__arrow[hidden] {
  display: none !important;
}
.yt-stills__arrow--prev { left: 0.4rem; }
.yt-stills__arrow--next { right: 0.4rem; }
@media (hover: none) {
  .yt-stills__arrow:not([hidden]) {
    opacity: 0.92;
    pointer-events: auto;
  }
}
.yt-player__frame {
  display: block;
  width: 100%;
  background: #000;
}
.yt-player__stage {
  position: relative;
  width: 100%;
  height: 306px; /* JSで横幅に合わせて上書き */
  overflow: hidden;
  background: #000;
}
.yt-player__iframe-host {
  position: absolute;
  top: 0;
  left: 0;
  width: 720px;
  height: 480px;
  transform-origin: top left;
}
.yt-player__iframe-host iframe {
  width: 720px;
  height: 480px;
  border: 0;
  display: block;
}
.yt-btn.is-on {
  border-color: var(--pink);
  background: rgba(255, 77, 148, 0.18);
  color: #fff;
}
.yt-player__shine {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 77, 148, 0.08), transparent 35%, transparent 70%, rgba(255, 255, 255, 0.04));
}
.yt-meta { margin-top: 1rem; }
.yt-title {
  margin: 0 0 0.7rem;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: 0.01em;
}
.yt-meta__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.yt-stats {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.yt-meta__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.yt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease, background 0.12s ease;
}
.yt-btn--primary {
  background: linear-gradient(120deg, var(--pink-soft), var(--pink) 55%, var(--pink-deep));
  color: #fff;
  box-shadow: 0 6px 18px var(--glow);
}
.yt-btn--primary:hover { filter: brightness(1.08); transform: translateY(-1px); color: #fff; }
.yt-btn--ghost {
  background: var(--bg-soft);
  border-color: var(--line);
  color: var(--ink);
}
.yt-btn--ghost:hover {
  border-color: var(--pink);
  background: rgba(255, 77, 148, 0.12);
}
.yt-desc {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--bg-elev), var(--bg-soft));
  border: 1px solid var(--line);
}
.yt-desc__label {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--pink-soft);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.yt-slot {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 77, 148, 0.45);
  background: rgba(255, 77, 148, 0.14);
  color: #ffe3ef;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: none;
}
.yt-desc__body {
  margin: 0;
  color: #e8d6de;
  font-size: 0.95rem;
}

.yt-rail {
  position: sticky;
  top: 4.5rem;
  max-height: calc(100vh - 5.5rem);
  overflow: auto;
  padding-right: 0.25rem;
}
.yt-rail__head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.7rem;
  padding: 0.1rem 0 0.55rem;
  background: var(--bg);
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
}
#yt-count {
  color: var(--pink-soft);
  font-weight: 700;
}
.yt-rail__refresh {
  margin-left: auto;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  color: #ffd0e2;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
}
.yt-rail__refresh:hover,
.yt-rail__refresh:focus-visible {
  border-color: var(--pink-soft);
  background: rgba(255, 77, 148, 0.2);
  color: #fff;
  outline: none;
}
.yt-rail__refresh:disabled,
.yt-rail__refresh.is-busy {
  opacity: 0.55;
  cursor: wait;
}
.yt-rail__item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 0.25rem;
  width: 100%;
  margin: 0 0 0.45rem;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0.2rem 0.2rem 0.2rem 0.2rem;
  background: transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.yt-rail__item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
}
.yt-rail__item.is-active {
  background: rgba(255, 77, 148, 0.12);
  border-color: rgba(255, 77, 148, 0.45);
  box-shadow: inset 0 0 0 1px rgba(255, 77, 148, 0.2);
}
.yt-rail__main {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 0.7rem;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 10px;
  padding: 0.35rem;
  margin: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.yt-rail__thumb-wrap {
  position: relative;
  display: block;
  width: 112px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  background: #2a1a22;
}
.yt-rail__thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #2a1a22;
}
.yt-rail__thumb.is-scrubbable {
  cursor: ew-resize;
}
.yt-rail__body { min-width: 0; }
.yt-rail__title {
  margin: 0 0 0.25rem;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.yt-rail__meta {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
}
.yt-rail__why {
  position: relative;
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  margin: 0.35rem 0.2rem 0 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffd0e2;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  cursor: help;
}
.yt-rail__why:hover,
.yt-rail__why:focus-visible,
.yt-rail__why.is-open {
  border-color: var(--pink-soft);
  background: rgba(255, 77, 148, 0.2);
  color: #fff;
  outline: none;
}
.yt-rail__tip {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  z-index: 20;
  width: min(240px, 70vw);
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 77, 148, 0.35);
  background: #1a1016;
  color: #ffe8f1;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.55;
  text-align: left;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s ease;
}
.yt-rail__why:hover .yt-rail__tip,
.yt-rail__why:focus-visible .yt-rail__tip,
.yt-rail__why.is-open .yt-rail__tip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.yt-foot {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem 2.5rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.age-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.72);
}
.age-gate[hidden] { display: none; }
.age-gate__panel {
  width: min(420px, 100%);
  padding: 1.5rem;
  border-radius: 18px;
  background: linear-gradient(160deg, #241820, #140f12);
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
.age-gate__kicker {
  margin: 0 0 0.35rem;
  color: var(--pink-soft);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.age-gate__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

@media (max-width: 980px) {
  .yt-main { grid-template-columns: 1fr; }
  .yt-rail { position: static; max-height: none; }
  .yt-top__inner {
    padding: 0.65rem 0.9rem;
    gap: 0.55rem;
  }
  .yt-logo__text {
    font-size: 0.88rem;
  }
  .yt-search-toggle {
    display: inline-flex;
  }
  .yt-top__actions {
    margin-left: auto;
  }
  .yt-search {
    position: fixed;
    left: max(0.75rem, env(safe-area-inset-left));
    right: max(0.75rem, env(safe-area-inset-right));
    top: calc(3.15rem + env(safe-area-inset-top));
    z-index: 22;
    width: auto;
    max-width: none;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  }
  .yt-top.is-search-open .yt-search {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }
  .yt-search__close {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
  }
  .yt-search button[type="submit"] {
    flex-shrink: 0;
  }
  .yt-search-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 19;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
  }
  .yt-top.is-search-open .yt-search-scrim {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .yt-top.is-search-open .yt-search-scrim[hidden] {
    display: block;
  }
}
