/* File: assets/css/main.css */
:root {
  --bbv-bg: #0a0a0a;
  --bbv-surface: #151515;
  --bbv-line: #262626;
  --bbv-line-strong: #3a3a3a;
  --bbv-text: #f2f2f2;
  --bbv-sub: #9a9a9a;
  --bbv-en: "Jost", "Helvetica Neue", Arial, sans-serif;
  --bbv-ja: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  --bbv-pad: 20px;
  --bbv-max: 1200px;
  --bbv-safe-t: env(safe-area-inset-top, 0px);
  --bbv-safe-b: env(safe-area-inset-bottom, 0px);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body.bbv {
  margin: 0;
  background: var(--bbv-bg);
  color: var(--bbv-text);
  font-family: var(--bbv-ja);
  font-size: 15px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body.is-modal-open {
  overflow: hidden;
}

img,
video,
svg {
  display: block;
  max-width: 100%;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.bbv-r {
  font-size: 0.5em;
  vertical-align: top;
  margin-left: 0.08em;
  letter-spacing: 0;
}

:focus-visible {
  outline: 2px solid var(--bbv-text);
  outline-offset: 2px;
}

/* ---------- Header ---------- */
.bbv-header {
  display: flex;
  align-items: center;
  min-height: 64px;
  max-width: var(--bbv-max);
  margin: 0 auto;
  padding: 10px var(--bbv-pad);
}

.bbv-logo {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  font-family: var(--bbv-en);
  font-size: 13px;
  letter-spacing: 0.18em;
}

.bbv-logo__main {
  font-weight: 400;
}

.bbv-logo__sub {
  font-weight: 300;
  color: var(--bbv-sub);
}

/* ---------- Intro ---------- */
.bbv-intro {
  max-width: 640px;
  margin: 0 auto;
  padding: 44px var(--bbv-pad) 40px;
  text-align: center;
}

.bbv-intro__title {
  margin: 0 0 28px;
  font-family: var(--bbv-en);
  font-weight: 300;
  font-size: clamp(26px, 7.5vw, 46px);
  line-height: 1.3;
  letter-spacing: 0.12em;
}

.bbv-intro p {
  margin: 0 0 1em;
  font-size: 14px;
  line-height: 2;
  color: #cfcfcf;
  word-break: auto-phrase;
}

.bbv-intro p:last-child {
  margin-bottom: 0;
}

/* ---------- Tabs ---------- */
.bbv-tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(10, 10, 10, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bbv-line);
}

.bbv-tabs__inner {
  display: flex;
  gap: 8px;
  max-width: var(--bbv-max);
  margin: 0 auto;
  padding: 10px var(--bbv-pad);
  overflow-x: auto;
  scrollbar-width: none;
}

.bbv-tabs__inner::-webkit-scrollbar {
  display: none;
}

.bbv-tab {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--bbv-line-strong);
  border-radius: 999px;
  color: var(--bbv-sub);
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.bbv-tab__en {
  font-family: var(--bbv-en);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.16em;
}

.bbv-tab__ja {
  font-size: 11px;
}

.bbv-tab.is-active {
  background: var(--bbv-text);
  border-color: var(--bbv-text);
  color: var(--bbv-bg);
}

@media (min-width: 640px) {
  .bbv-tab {
    flex: 0 0 auto;
    min-width: 180px;
  }

  .bbv-tabs__inner {
    justify-content: center;
  }
}

/* ---------- Legend ---------- */
.bbv-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  padding: 2px 0 18px;
  font-size: 11px;
  color: var(--bbv-sub);
}

.bbv-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---------- Badge ---------- */
.bbv-badge {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.3);
}

.bbv-badge svg {
  width: 16px;
  height: 16px;
}

.bbv-badge--legend {
  width: 22px;
  height: 22px;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--bbv-line-strong);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.bbv-badge--legend svg {
  width: 14px;
  height: 14px;
}

/* ---------- Video grid ---------- */
.bbv-videos {
  max-width: var(--bbv-max);
  margin: 0 auto;
  padding: 18px var(--bbv-pad) 64px;
}

.bbv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .bbv-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px 16px;
  }
}

@media (min-width: 1024px) {
  .bbv-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 40px 20px;
  }
}

.bbv-card__btn {
  display: block;
  width: 100%;
  text-align: left;
}

.bbv-card__btn:focus-visible {
  outline: none;
}

.bbv-card__btn:focus-visible .bbv-card__media {
  outline: 2px solid var(--bbv-text);
  outline-offset: 3px;
}

.bbv-card__media {
  position: relative;
  display: block;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 6px;
  background: var(--bbv-surface);
}

.bbv-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

@media (hover: hover) {
  .bbv-card__btn:hover .bbv-card__media img {
    transform: scale(1.03);
  }
}

.bbv-card__noimg {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--bbv-en);
  font-weight: 300;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: #555;
}

.bbv-card__media .bbv-badge {
  position: absolute;
  top: 8px;
  right: 8px;
}

.bbv-new {
  position: absolute;
  top: 11px;
  left: 8px;
  padding: 1px 7px;
  border-radius: 2px;
  background: var(--bbv-text);
  color: var(--bbv-bg);
  font-family: var(--bbv-en);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0.14em;
}

.bbv-card__duration {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 0 6px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.55);
  font-family: var(--bbv-en);
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 0.04em;
}

.bbv-card__title {
  display: block;
  margin-top: 8px;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.5;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bbv-empty {
  padding: 64px 0;
  text-align: center;
  font-size: 13px;
  color: var(--bbv-sub);
}

.bbv-more {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  min-height: 50px;
  margin: 44px auto 0;
  padding: 0 28px;
  border: 1px solid var(--bbv-line-strong);
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: 0.08em;
  transition: border-color 0.2s, opacity 0.2s;
}

.bbv-more:hover {
  border-color: var(--bbv-text);
}

.bbv-more.is-loading {
  opacity: 0.5;
  pointer-events: none;
}

/* ---------- Buttons ---------- */
.bbv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 32px;
  border-radius: 999px;
  background: var(--bbv-text);
  color: var(--bbv-bg);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.bbv-btn svg {
  width: 20px;
  height: 20px;
}

/* ---------- Notice ---------- */
.bbv-notice {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 var(--bbv-pad) 56px;
  font-size: 12px;
  line-height: 1.9;
  color: var(--bbv-sub);
}

.bbv-notice__title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--bbv-text);
}

.bbv-notice p {
  margin: 0 0 0.6em;
}

/* ---------- Footer ---------- */
.bbv-footer {
  padding: 28px var(--bbv-pad) calc(28px + var(--bbv-safe-b));
  border-top: 1px solid var(--bbv-line);
  text-align: center;
}

.bbv-footer small {
  font-family: var(--bbv-en);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--bbv-sub);
}

/* ---------- In-app browser bar ---------- */
.bbv-inapp {
  padding: 12px var(--bbv-pad);
  background: var(--bbv-text);
  color: var(--bbv-bg);
  font-size: 12px;
  line-height: 1.6;
}

.bbv-inapp__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  max-width: var(--bbv-max);
  margin: 0 auto;
}

.bbv-inapp p {
  margin: 0;
}

.bbv-inapp__actions {
  display: flex;
  gap: 8px;
}

.bbv-inapp__actions button,
.bbv-inapp__actions a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--bbv-bg);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

/* ---------- Modal ---------- */
.bbv-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: #000;
  overscroll-behavior: contain;
}

.bbv-modal__stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
}

.bbv-modal__stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  cursor: pointer;
}

.bbv-round {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
}

.bbv-round svg {
  width: 22px;
  height: 22px;
}

.bbv-modal__close {
  position: absolute;
  top: calc(12px + var(--bbv-safe-t));
  right: 12px;
}

.bbv-modal__sound {
  position: absolute;
  top: calc(12px + var(--bbv-safe-t));
  left: 12px;
}

.bbv-modal__sound .bbv-icon--sound-on,
.bbv-modal__sound.is-on .bbv-icon--sound-off {
  display: none;
}

.bbv-modal__sound.is-on .bbv-icon--sound-on {
  display: block;
}

.bbv-modal__playicon {
  position: absolute;
  inset: 0;
  width: 72px;
  height: 72px;
  margin: auto;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
  transition: opacity 0.2s;
}

.bbv-modal__playicon svg {
  width: 100%;
  height: 100%;
}

.bbv-modal.is-paused .bbv-modal__playicon {
  opacity: 1;
}

.bbv-modal__nav {
  position: absolute;
  top: 50%;
  display: none;
  transform: translateY(-50%);
}

.bbv-modal__nav--prev {
  left: 20px;
}

.bbv-modal__nav--next {
  right: 20px;
}

.bbv-modal__nav:disabled {
  opacity: 0.2;
  cursor: default;
}

@media (hover: hover) and (min-width: 768px) {
  .bbv-modal__nav {
    display: grid;
  }
}

.bbv-modal__bar {
  flex: none;
  padding: 14px var(--bbv-pad) calc(14px + var(--bbv-safe-b));
  background: var(--bbv-bg);
  border-top: 1px solid var(--bbv-line);
}

.bbv-modal__bar-inner {
  max-width: 480px;
  margin: 0 auto;
}

.bbv-modal__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin-bottom: 12px;
}

.bbv-modal__vp {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 6px;
  font-size: 11px;
  color: var(--bbv-sub);
}

.bbv-modal__vp .bbv-badge {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--bbv-line-strong);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.bbv-modal__title {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.5;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bbv-btn--download {
  display: flex;
  width: 100%;
  min-height: 56px;
  font-size: 16px;
}

.bbv-modal__inapp {
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--bbv-sub);
  text-align: center;
}

.bbv-modal__help {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--bbv-sub);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* iPhoneのみ表示 */
.bbv-ios-only {
  display: none;
}

.is-ios .bbv-ios-only {
  display: block;
}

/* ---------- iPhone保存方法シート ---------- */
.bbv-sheet {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
}

.bbv-sheet__panel {
  width: 100%;
  max-width: 480px;
  padding: 28px var(--bbv-pad) calc(24px + var(--bbv-safe-b));
  border: 1px solid var(--bbv-line);
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
  background: var(--bbv-surface);
  animation: bbv-sheet-up 0.25s ease;
}

@media (min-width: 640px) {
  .bbv-sheet {
    align-items: center;
  }

  .bbv-sheet__panel {
    border-bottom: 1px solid var(--bbv-line);
    border-radius: 16px;
  }
}

@keyframes bbv-sheet-up {
  from {
    transform: translateY(24px);
    opacity: 0;
  }

  to {
    transform: none;
    opacity: 1;
  }
}

.bbv-sheet__title {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 500;
  text-align: center;
}

.bbv-sheet ol {
  margin: 0 0 16px;
  padding-left: 1.4em;
  font-size: 14px;
  line-height: 1.9;
}

.bbv-sheet ol li + li {
  margin-top: 6px;
}

.bbv-sheet__note {
  margin: 0 0 20px;
  font-size: 12px;
  line-height: 1.8;
  color: var(--bbv-sub);
}

.bbv-sheet .bbv-btn {
  display: flex;
  width: 100%;
}

/* ---------- Toast ---------- */
.bbv-toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--bbv-safe-b));
  z-index: 300;
  width: max-content;
  max-width: calc(100% - 40px);
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--bbv-text);
  color: var(--bbv-bg);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
  transform: translateX(-50%);
}

.is-modal-open .bbv-toast {
  top: calc(68px + var(--bbv-safe-t));
  bottom: auto;
}

/* ---------- 動きを減らす設定の端末 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}