:root {
  --bg: #0d0d10;
  --fg: #f2f2f5;
  --sub: #a9a9b5;
  --accent: #ff4d94;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif; }

.feed {
  height: 100dvh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: contain;
  display: none;
}
.feed.on { display: block; }

.slide {
  position: relative;
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  /* 動画(.stage)を画面の縦の真ん中に置き、作品情報(.info)はその下に続ける */
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  justify-items: center;
  overflow: hidden;
}
.slide .bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: blur(28px) brightness(.45);
  transform: scale(1.15);
}
.stage {
  position: relative;
  grid-row: 2;
  width: 100%;
  max-width: 560px;
  aspect-ratio: 16 / 9;
  background: #000;
}
.stage iframe, .stage video {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
  object-fit: contain; background: #000;
}
.stage.vertical { aspect-ratio: 9 / 16; height: auto; width: auto; max-height: 62dvh; }
.stage.vertical video { object-fit: cover; }

.info {
  position: relative; z-index: 1; width: 100%; max-width: 560px;
  grid-row: 3; align-self: start;
  padding: 14px 16px calc(40px + env(safe-area-inset-bottom));
}
.badge {
  display: inline-block; margin-bottom: 6px; padding: 2px 8px;
  font-size: 12px; border-radius: 999px; background: var(--accent); color: #fff;
}
.title {
  margin: 0 0 10px; font-size: 15px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cta {
  display: block; text-align: center; padding: 12px;
  font-weight: 700; color: #fff; background: var(--accent);
  border-radius: 10px; text-decoration: none;
}
.hint { position: absolute; top: 12px; right: 12px; font-size: 12px; color: var(--sub); }
.empty { padding: 48px 16px; text-align: center; color: var(--sub); }

.credit {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; justify-content: space-between; gap: 8px;
  padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
  font-size: 10px; color: var(--sub); background: rgba(0,0,0,.6);
}
.credit a { color: var(--sub); }

.gate { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.96); padding: 24px; }
.gate.off { display: none; }
.gate-box { max-width: 360px; text-align: center; }
.gate-box h1 { font-size: 20px; margin: 0 0 12px; }
.gate-box p { color: var(--sub); line-height: 1.7; margin: 0 0 20px; font-size: 14px; }
.gate-box button { width: 100%; padding: 14px; font-size: 16px; font-weight: 700; border: 0;
  border-radius: 10px; background: var(--accent); color: #fff; }
.gate-no { display: block; margin-top: 14px; color: var(--sub); font-size: 13px; }

/* Xの本人投稿(公式ウィジェット) */
.stage.x { aspect-ratio: auto; min-height: 40dvh; max-height: 62dvh; overflow-y: auto; display: flex; align-items: center; justify-content: center; }
.stage.x > * { margin: 0 auto !important; }

.tap-hint {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  padding: 6px 14px; border-radius: 999px; background: rgba(0,0,0,.65); color: #fff;
  font-size: 13px; font-weight: 700; pointer-events: none; white-space: nowrap;
  animation: tap-hint-fade 0.4s ease 5s forwards;
}
@keyframes tap-hint-fade { to { opacity: 0; } }

/* 公式プレイヤー(720x480=3:2)は枠を3:2にして、切れ・スクロールバーが出ないようにする */
.stage:has(> iframe) { aspect-ratio: 3 / 2; }
.stage iframe { overflow: hidden; }

.back {
  position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 10px; z-index: 20;
  padding: 6px 12px; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff;
  font-size: 12px; font-weight: 700; text-decoration: none;
}

.sound-hint {
  position: absolute; left: 10px; top: 10px;
  padding: 5px 12px; border-radius: 999px; background: rgba(0,0,0,.65); color: #fff;
  font-size: 12px; font-weight: 700; pointer-events: none; white-space: nowrap;
}
