:root {
  color-scheme: dark;
  --bg: #08080a;
  --panel: #111116;
  --panel2: #18181f;
  --text: #f7f7f9;
  --muted: #a7a7b0;
  --line: rgba(255,255,255,.1);
  --accent: #ff315d;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input { font: inherit; }
button { color: inherit; }
body { overflow: hidden; }
.topbar {
  position: fixed; z-index: 40; top: 0; left: 0; right: 0; height: calc(54px + var(--safe-top));
  padding: calc(8px + var(--safe-top)) 14px 8px; display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(to bottom, rgba(0,0,0,.58), transparent); pointer-events: none;
}
.brand-heading { margin: 0; padding: 0; line-height: 1; font-size: inherit; font-weight: inherit; pointer-events: none; }
.brand { pointer-events: auto; background: none; border: 0; font-weight: 900; letter-spacing: .08em; font-size: 16px; text-shadow: 0 1px 12px #000; }
.top-actions { display: flex; gap: 8px; pointer-events: auto; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: rgba(0,0,0,.38); backdrop-filter: blur(10px); }
#app, .view { height: 100dvh; }
.view { display: none; }
.view.active { display: block; }
.feed { height: 100dvh; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior-y: contain; scrollbar-width: none; }
.feed::-webkit-scrollbar { display: none; }
.video-card { height: 100dvh; position: relative; scroll-snap-align: start; scroll-snap-stop: always; background: #0d0d11; overflow: hidden; }
.media-wrap { position: absolute; inset: 0; display: grid; place-items: center; background: #0d0d11; }
.media-wrap video, .media-wrap img { width: 100%; height: 100%; object-fit: cover; }
.media-wrap .poster-only { filter: brightness(.78); }
.media-shade { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,.08) 42%, rgba(0,0,0,.8) 88%, #08080a 100%); pointer-events: none; }
.card-body { position: absolute; z-index: 4; left: 0; right: 0; bottom: calc(72px + var(--safe-bottom)); padding: 22px 76px 18px 16px; text-shadow: 0 2px 12px rgba(0,0,0,.85); }
.genre-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
.genre-chip { border: 1px solid rgba(255,255,255,.22); background: rgba(0,0,0,.35); color: #fff; border-radius: 999px; padding: 5px 9px; font-size: 12px; }
.work-title { font-size: 17px; line-height: 1.45; margin: 0 0 7px; font-weight: 800; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { font-size: 12px; color: #ddd; margin-bottom: 12px; }
.cta { display: inline-flex; align-items: center; justify-content: center; min-height: 43px; padding: 0 18px; border-radius: 12px; border: 0; background: #fff; color: #111; font-weight: 850; text-decoration: none; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.cta.disabled { opacity: .5; pointer-events: none; }
.side-actions { position: absolute; z-index: 5; right: 12px; bottom: calc(96px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 18px; align-items: center; }
.side-button { width: 48px; min-height: 48px; border: 0; border-radius: 50%; background: rgba(0,0,0,.36); backdrop-filter: blur(7px); font-size: 22px; }
.side-button.liked { background: var(--accent); }
.side-label { font-size: 10px; margin-top: -14px; text-shadow: 0 1px 8px #000; }
.bottom-nav { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; min-height: calc(62px + var(--safe-bottom)); padding-bottom: var(--safe-bottom); display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); background: rgba(8,8,10,.88); backdrop-filter: blur(16px); }
.nav-button { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #8f8f98; }
.nav-button span { font-size: 18px; }
.nav-button small { font-size: 10px; }
.nav-button.active { color: #fff; }
.content-view { overflow-y: auto; padding: calc(72px + var(--safe-top)) 14px calc(90px + var(--safe-bottom)); }
.section-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 20px; }
.eyebrow { margin: 0 0 4px; font-size: 11px; letter-spacing: .16em; color: var(--accent); font-weight: 900; }
.section-head h1 { margin: 0; font-size: 25px; }
.count-pill { padding: 5px 10px; border-radius: 999px; background: var(--panel2); font-size: 12px; color: var(--muted); }
.genre-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.genre-card { min-height: 112px; padding: 14px; text-align: left; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(145deg, var(--panel2), #101015); display: flex; flex-direction: column; justify-content: space-between; }
.genre-card strong { font-size: 17px; }
.genre-card span { color: var(--muted); font-size: 11px; }
.ranking-list { display: grid; gap: 10px; }
.rank-card { display: grid; grid-template-columns: 34px 78px minmax(0,1fr); gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); background: var(--panel); border-radius: 14px; }
.rank-number { font-size: 19px; font-weight: 900; text-align: center; color: var(--accent); }
.rank-card img { width: 78px; height: 104px; object-fit: cover; border-radius: 9px; background: var(--panel2); }
.rank-info { min-width: 0; }
.rank-info strong { font-size: 13px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow:hidden; }
.rank-info p { margin: 6px 0 9px; font-size: 11px; color: var(--muted); }
.rank-link { display: inline-block; text-decoration: none; color: #111; background: #fff; font-weight: 800; font-size: 11px; padding: 8px 10px; border-radius: 8px; }
.empty-state { height: 100dvh; display: grid; place-content: center; gap: 8px; text-align: center; padding: 30px; color: var(--muted); }
.empty-state strong { color: #fff; }
.age-gate { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.92); }
.age-card { width: min(420px, 100%); padding: 28px 22px; border: 1px solid var(--line); border-radius: 22px; background: var(--panel); text-align: center; }
.age-logo { color: var(--accent); font-weight: 900; letter-spacing: .1em; }
.age-card h1, .age-card h2 { font-size: 24px; margin: 16px 0 8px; }
.age-card p { color: var(--muted); line-height: 1.65; font-size: 14px; }
.primary-button, .ghost-button { width: 100%; min-height: 48px; border-radius: 12px; font-weight: 850; margin-top: 10px; }
.primary-button { border: 0; color: #fff; background: var(--accent); }
.ghost-button { border: 1px solid var(--line); background: transparent; }
.info-dialog { width: min(430px, calc(100% - 28px)); border: 1px solid var(--line); border-radius: 18px; padding: 24px; color: var(--text); background: #111116; }
.info-dialog::backdrop { background: rgba(0,0,0,.68); backdrop-filter: blur(4px); }
.dialog-close { float: right; border: 0; border-radius: 50%; width: 34px; height: 34px; background: var(--panel2); }
.info-dialog h2 { margin-top: 0; }
.info-dialog p { line-height: 1.7; }
.muted { color: var(--muted); font-size: 12px; }
@media (min-width: 720px) {
  .feed { max-width: 480px; margin: 0 auto; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  .bottom-nav { width: 480px; left: 50%; right: auto; transform: translateX(-50%); }
  .content-view { max-width: 760px; margin: auto; }
  .genre-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}