:root { color-scheme: dark; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: #050505; }
header { position: fixed; z-index: 10; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; background: linear-gradient(#000d, transparent); pointer-events: none; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand strong { font-size: 20px; letter-spacing: -.03em; }
.brand strong span { color: #ff2f68; }
.brand em { padding: 2px 6px; border: 1px solid #ffffff55; border-radius: 4px; font-size: 9px; font-style: normal; color: #ddd; }
.header-actions { display: flex; align-items: center; gap: 8px; pointer-events: auto; }
header select { color: #fff; background: #222e; border: 1px solid #777; border-radius: 8px; padding: 8px; }
.site-menu { position: relative; }
.site-menu summary { list-style: none; cursor: pointer; padding: 8px 10px; border: 1px solid #555; border-radius: 8px; background: #171717e8; font-size: 13px; }
.site-menu summary::-webkit-details-marker { display: none; }
.site-menu nav { position: absolute; top: calc(100% + 8px); right: 0; display: grid; width: 210px; padding: 8px; border: 1px solid #333; border-radius: 12px; background: #111f; box-shadow: 0 12px 30px #000a; }
.site-menu nav a { padding: 10px 12px; border-radius: 7px; color: #eee; text-decoration: none; font-size: 13px; }
.site-menu nav a:hover { background: #ffffff10; }
#feed { width: 100%; height: 100%; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior-y: contain; }
.card { position: relative; width: 100%; height: 100%; min-height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always; background: #000; overflow: hidden; }
.player-shell { position: absolute; top: 50%; left: 50%; width: min(720px, 100vw); height: min(480px, 66.67vw); transform: translate(-50%, -58%); overflow: hidden; background: #080808; }
.card iframe, .poster { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.poster { object-fit: contain; opacity: .72; }
.card iframe { z-index: 2; visibility: hidden; }
.card iframe.ready { visibility: visible; }
.loading, .player-failed { position: absolute; z-index: 3; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 24px; background: #0008; color: #fff; text-align: center; }
.loading span { width: 22px; height: 22px; border: 3px solid #ffffff55; border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.loading.hidden, .player-failed { display: none; }
.player-failed.visible { display: flex; align-items: flex-end; background: linear-gradient(transparent, #000c); }
@keyframes spin { to { transform: rotate(1turn); } }
.shade { position: absolute; z-index: 4; inset: 55% 0 0; background: linear-gradient(transparent, #000e); pointer-events: none; }
.meta { position: absolute; z-index: 5; left: 18px; right: min(170px, 30vw); bottom: calc(28px + env(safe-area-inset-bottom)); max-width: 760px; pointer-events: none; }
.meta h2 { margin: 0 0 10px; font-size: clamp(18px, 3.2vw, 28px); line-height: 1.3; text-shadow: 0 2px 8px #000; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.facts { display: flex; gap: 14px; align-items: center; font-size: 14px; }
.facts span:empty { display: none; }
.product, .gate button { display: inline-block; border: 0; border-radius: 999px; padding: 12px 20px; color: #fff; background: #e80046; font-weight: 700; text-decoration: none; cursor: pointer; }
.product { position: absolute; z-index: 7; right: 18px; bottom: calc(28px + env(safe-area-inset-bottom)); box-shadow: 0 4px 20px #0008; }
.swipe-rail { position: absolute; z-index: 6; right: max(18px, calc((100vw - 850px) / 2)); width: 52px; height: 52px; border: 1px solid #ffffff30; border-radius: 50%; color: #fffc; background: #090909aa; backdrop-filter: blur(8px); font-size: 28px; line-height: 1; cursor: pointer; touch-action: none; }
.swipe-rail:hover, .swipe-rail:focus-visible { color: #fff; border-color: #ffffff80; background: #222d; }
.swipe-prev { top: calc(50% - 60px); }
.swipe-next { top: calc(50% + 8px); }
.credit { position: fixed; z-index: 10; right: 14px; bottom: calc(4px + env(safe-area-inset-bottom)); font-size: 10px; color: #aaa; }
.credit span { color: #ddd; }
.credit a { color: #bbb; }
.status { position: fixed; z-index: 6; left: 50%; bottom: 20px; translate: -50% 0; padding: 9px 14px; border-radius: 99px; background: #111d; font-size: 13px; }
.gate { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 24px; background: #050505; }
.gate.hidden { display: none; }
.gate-card { width: min(440px, 100%); padding: 32px; text-align: center; border: 1px solid #333; border-radius: 20px; background: #111; }
.gate-label { color: #ff336d; letter-spacing: .15em; font-weight: 800; }
.gate button { display: block; width: 100%; margin: 24px 0 16px; }
.gate a { color: #bbb; }
@media (max-width: 600px) {
  header { min-height: 62px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; gap: 8px; background: linear-gradient(#000 0%, #000e 72%, transparent); }
  .brand { min-width: 0; gap: 6px; }
  .brand strong { font-size: 16px; white-space: nowrap; }
  .brand em { padding: 1px 5px; font-size: 8px; }
  .header-actions { flex: 0 0 auto; gap: 6px; }
  header select { width: 84px; height: 36px; padding: 0 22px 0 8px; font-size: 12px; }
  .site-menu summary { position: relative; display: block; width: 52px; height: 36px; padding: 0; overflow: hidden; color: transparent; font-size: 0; line-height: 0; }
  .site-menu summary::after { content: "情報"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; text-align: center; font-size: 12px; line-height: 1; }
  .site-menu nav { width: min(250px, calc(100vw - 24px)); }
  .credit { position: fixed; z-index: 10; top: auto; right: 10px; bottom: calc(3px + env(safe-area-inset-bottom)); left: 10px; overflow: hidden; color: #888; text-align: right; white-space: nowrap; text-overflow: ellipsis; font-size: 9px; pointer-events: none; }
  .credit .disclosure, .credit .provider { position: static; color: inherit; white-space: inherit; }
  .credit a { pointer-events: auto; }
  .player-shell { top: 45%; transform: translate(-50%, -50%); }
  .meta { left: 14px; right: 14px; bottom: calc(84px + env(safe-area-inset-bottom)); }
  .product { left: 14px; right: 14px; bottom: calc(32px + env(safe-area-inset-bottom)); text-align: center; padding: 10px 16px; }
  .swipe-rail { display: none; }
}
