:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #09090b;
  color: #fafafa;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { background: #09090b; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.seo-fallback { width: min(100%, 1060px); margin: 0 auto; padding: 32px 16px; }
.seo-fallback h1 { margin: 0 0 10px; font-size: 26px; }
.seo-fallback p { color: #a1a1aa; line-height: 1.7; }

.shell { min-height: 100vh; padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; padding: 0 16px;
  background: rgba(9,9,11,.9); backdrop-filter: blur(18px);
  border-bottom: 1px solid #242428;
}
.brand { color: #fff; text-decoration: none; font-size: 23px; font-weight: 900; letter-spacing: -.8px; }
.brand span { color: #ff3b30; }
.icon-btn { display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; color: #fff; background: #202024; cursor: pointer; }
.icon-btn svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.content { width: min(100%, 1060px); margin: 0 auto; padding: 14px 12px 28px; }
.switcher { position: sticky; top: 68px; z-index: 18; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: rgba(24,24,27,.96); border: 1px solid #29292e; border-radius: 13px; margin-bottom: 16px; box-shadow: 0 8px 22px #0008; backdrop-filter: blur(14px); }
.switcher button { min-height: 44px; border: 0; border-radius: 10px; color: #a1a1aa; background: transparent; font-weight: 800; cursor: pointer; }
.switcher button.active { color: #fff; background: #2d2d32; box-shadow: 0 1px 6px #0005; }
.period-bar { display: flex; gap: 8px; margin: 0 0 14px; overflow-x: auto; scrollbar-width: none; }
.period-bar::-webkit-scrollbar { display: none; }
.period-bar button { flex: 0 0 auto; min-width: 76px; min-height: 38px; padding: 0 15px; border: 1px solid #34343a; border-radius: 999px; color: #a1a1aa; background: #151518; font-weight: 800; cursor: pointer; }
.period-bar button.active { border-color: #ff3b30; color: #fff; background: #ff3b30; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 7px 2px 12px; }
.section-head h1 { margin: 0; font-size: 21px; letter-spacing: -.4px; }
.section-head small { color: #8c8c95; font-size: 12px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 10px; }
.feed-ad { grid-column: 1 / -1; margin: 2px 0; }
.feed-ad .ad { margin: 0; }
.card { min-width: 0; cursor: pointer; }
.thumb { position: relative; aspect-ratio: 16/9; overflow: hidden; border: 1px solid #27272c; border-radius: 9px; background: var(--tone, #050506); }
.thumb-img { display: block; width: 100%; height: 100%; object-fit: contain; background: #050506; }
.thumb::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, #0000 55%, #0008); }
.rank { position: absolute; top: 8px; left: 8px; display: grid; place-items: center; min-width: 31px; height: 31px; padding: 0 8px; border-radius: 9px; background: #08080bd9; font-weight: 900; }
.duration { position: absolute; right: 7px; bottom: 7px; padding: 3px 6px; border-radius: 5px; background: #050507db; font-size: 12px; font-weight: 700; }
.card-save { position: absolute; z-index: 2; top: 8px; right: 8px; display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 9px; color: #fff; background: #08080bd9; font-size: 18px; font-weight: 900; cursor: pointer; }
.card-save.saved { background: #ff3b30; }
.rank + .card-save { top: 8px; }
.card-author { margin: 8px 2px 0; overflow: hidden; color: #b4b4bd; font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.bottom-nav { position: fixed; z-index: 20; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(2,1fr); height: calc(66px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgba(16,16,18,.94); border-top: 1px solid #29292e; backdrop-filter: blur(18px); }
.nav-item { display: grid; place-content: center; gap: 4px; border: 0; background: transparent; color: #777780; font-size: 11px; font-weight: 700; cursor: pointer; }
.nav-item b { font-size: 20px; line-height: 1; }
.nav-item.active { color: #ff5148; }

.watch { width: min(100%, 680px); margin: 0 auto; padding: 12px; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; border: 0; color: #e4e4e7; background: transparent; padding: 0; font-weight: 700; cursor: pointer; }
.ad { display: grid; place-items: center; min-height: 250px; margin: 10px 0 18px; overflow: hidden; border-radius: 12px; background: #121215; }
.ad ins { display: block; width: 300px; height: 250px; max-width: 100%; }
.link-panel { padding: 18px 14px; border: 1px solid #29292e; border-radius: 14px; background: #151518; text-align: center; }
.link-panel p { margin: 0 0 18px; color: #9f9fa8; font-size: 13px; }
.link-panel .video-author, .outbound-panel .video-author { margin-bottom: 12px; color: #d4d4d8; font-weight: 800; }
.video-preview { position: relative; display: block; width: 100%; aspect-ratio: 16/9; margin-bottom: 14px; overflow: hidden; border: 1px solid #36363c; border-radius: 10px; background: #050506; }
.video-preview::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, #0008); }
.play-video { width: 100%; min-height: 52px; border: 0; border-radius: 12px; color: #fff; background: #ff3b30; font-weight: 900; cursor: pointer; }
.save-video { width: 100%; min-height: 50px; margin-top: 10px; border: 1px solid #45454c; border-radius: 12px; color: #fff; background: #25252a; font-weight: 850; cursor: pointer; }
.save-video.saved { border-color: #ff3b30; color: #ff625a; background: #ff3b3012; }
.notice { margin: 14px 2px 0; color: #777780; font-size: 12px; line-height: 1.6; text-align: left; }
.recommendations { margin: 28px 0 8px; }
.recommendations .section-head { margin-bottom: 14px; }
.recommend-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 9px; }
.recommend-grid .thumb { aspect-ratio: 16/9; }
.link-page { width: min(100%, 680px); margin: 0 auto; padding: 12px; }
.outbound-panel { padding: 18px 14px; border: 1px solid #29292e; border-radius: 14px; background: #151518; text-align: center; }
.mini-preview { aspect-ratio: 16/9; margin-bottom: 16px; overflow: hidden; border-radius: 10px; background: #050506; }
.outbound-panel > p { margin: 0 0 18px; color: #9f9fa8; font-size: 13px; }
.outbound-actions { display: grid; gap: 10px; }
.outbound-actions a { display: grid; place-items: center; min-height: 52px; border-radius: 12px; color: #fff; font-weight: 900; text-decoration: none; }
.primary-link { background: #ff3b30; }
.secondary-link { border: 1px solid #45454c; background: #25252a; }
.scroll-sentinel { display: grid; place-items: center; min-height: 80px; }
.scroll-sentinel span { width: 26px; height: 26px; border: 3px solid #33333a; border-top-color: #ff3b30; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { padding: 72px 20px; color: #8c8c95; text-align: center; }
.saved-head { margin-top: 12px; }
.empty-save { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 18px; color: #ff5148; background: #ff3b3015; font-size: 28px; }
.auth-box { width: min(100%, 440px); margin: 24px auto; padding: 26px 20px; border: 1px solid #303036; border-radius: 18px; background: #151518; }
.auth-box .eyebrow { margin: 0 0 7px; color: #ff5148; font-size: 12px; font-weight: 900; letter-spacing: 1.6px; }
.auth-box h1 { margin: 0 0 8px; font-size: 25px; }.auth-box > p:not(.eyebrow) { margin: 0 0 22px; color: #9f9fa8; line-height: 1.6; }
.auth-form { display: grid; gap: 13px; }.auth-form label { display: grid; gap: 7px; color: #d4d4d8; font-size: 14px; font-weight: 750; }
.auth-form input { min-height: 48px; padding: 0 12px; border: 1px solid #414148; border-radius: 10px; color: #fff; background: #09090b; }
.auth-form button { min-height: 50px; border: 0; border-radius: 11px; color: #fff; background: #ff3b30; font-weight: 900; cursor: pointer; }
.auth-form button:disabled { opacity: .55; cursor: wait; }
.form-message { min-height: 20px; margin: 0; color: #ff746d; font-size: 13px; }
.auth-switch { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 6px; }
.auth-switch button, .text-button { min-height: 40px; border: 0; color: #b4b4bd; background: transparent; text-decoration: underline; cursor: pointer; }

.age-gate { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 22px; background: #08080af5; }
.age-card { width: min(100%, 400px); padding: 28px 22px; border: 1px solid #303036; border-radius: 20px; background: #151518; text-align: center; }
.age-mark { display: grid; place-items: center; width: 62px; height: 62px; margin: 0 auto 18px; border-radius: 18px; background: #ff3b30; font-size: 22px; font-weight: 900; }
.age-card h1 { margin: 0 0 10px; font-size: 23px; }
.age-card p { margin: 0 0 22px; color: #a1a1aa; line-height: 1.65; }
.age-actions { display: grid; gap: 10px; }
.age-actions button { min-height: 50px; border: 0; border-radius: 12px; color: #fff; font-weight: 800; cursor: pointer; }
.age-actions .yes { background: #ff3b30; }
.age-actions .no { background: #2b2b30; }

@media (min-width: 720px) {
  .topbar { padding-inline: max(24px, calc((100vw - 1060px) / 2)); }
  .content { padding: 24px 24px 48px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 16px; }
  .switcher { width: 360px; margin: 0 0 26px; }
  .section-head h1 { font-size: 26px; }
  .bottom-nav { left: 50%; width: 360px; translate: -50%; border: 1px solid #29292e; border-bottom: 0; border-radius: 18px 18px 0 0; }
  .watch { padding-top: 28px; }
  .link-page { padding-top: 28px; }
  .ad { min-height: 250px; }
  .link-panel { padding: 32px 34px; }
  .recommend-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
}

@media (min-width: 1040px) {
  body { background: #0c0c0f; }
  .shell { min-height: 100vh; padding: 0 0 0 248px; }
  .topbar {
    position: fixed; inset: 0 auto 0 0; z-index: 30;
    flex-direction: column; align-items: stretch;
    width: 248px; height: 100vh; padding: 34px 24px 24px;
    background: #111114; border: 0; border-right: 1px solid #29292e;
  }
  .brand { font-size: 29px; }
  .icon-btn { position: absolute; left: 24px; bottom: 24px; width: calc(100% - 48px); border-radius: 12px; }
  .bottom-nav {
    position: fixed; z-index: 31; top: 104px; bottom: auto; left: 0;
    display: grid; grid-template-columns: 1fr; gap: 6px;
    width: 248px; height: auto; padding: 0 16px;
    translate: none; background: transparent; border: 0;
  }
  .nav-item { grid-template-columns: 30px 1fr; place-content: initial; align-items: center; min-height: 52px; padding: 0 14px; border-radius: 12px; font-size: 14px; text-align: left; }
  .nav-item b { font-size: 23px; text-align: center; }
  .nav-item.active { color: #fff; background: #ff3b30; }
  .content { width: 100%; max-width: 1540px; margin: 0 auto; padding: 38px 42px 60px; }
  .content::before { content: "動画を見つける"; display: block; margin-bottom: 24px; color: #fafafa; font-size: 31px; font-weight: 900; letter-spacing: -.7px; }
  .switcher { top: 18px; width: 390px; }
  .period-bar { margin-bottom: 16px; }
  .period-bar button { min-width: 92px; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px 18px; }
  .thumb { border-radius: 11px; }
  .card-author { margin-top: 10px; font-size: 14px; }
  .watch { display: grid; grid-template-columns: minmax(480px, 1.45fr) minmax(350px, .75fr); gap: 18px 30px; width: 100%; max-width: 1460px; padding: 34px 42px 60px; }
  .watch > .back { grid-column: 1 / -1; }
  .watch > .ad, .watch > .link-panel { grid-column: 1; }
  .watch > .ad { margin: 0; min-height: 116px; }
  .watch > .link-panel { padding: 38px 44px; }
  .recommendations { grid-column: 2; grid-row: 2 / span 3; margin: 0; padding-left: 4px; }
  .recommendations .section-head { margin-top: 0; }
  .recommend-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
  .auth-box { margin-top: 72px; }
}

@media (min-width: 1440px) {
  .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
