:root {
  --bg: #0f0f12; --panel: #1a1a20; --line: #2a2a33;
  --text: #ececf1; --muted: #9a9aa8; --accent: #ff3d6e; --accent-ink: #fff;
  --topbar-h: 84px;
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--topbar-h) + 12px); }
body { margin: 0; background: var(--bg); color: var(--text);
       font-family: system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", sans-serif; line-height: 1.5; }

/* 固定メニュー */
.topbar { position: sticky; top: 0; z-index: 5; background: rgba(15,15,18,.96);
          border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.notice { margin: 0; padding: 4px 16px; text-align: center; color: var(--muted); font-size: 11px;
          border-bottom: 1px solid var(--line); }
.nav { max-width: 1400px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center;
       justify-content: space-between; gap: 12px; }
.logo { color: var(--text); text-decoration: none; font-weight: 800; font-size: 18px; white-space: nowrap; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; padding: 8px 36px 8px 14px; border: 1px solid var(--line);
                border-radius: 8px; background: var(--panel); font-weight: 700; font-size: 14px; position: relative; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: ""; position: absolute; right: 14px; top: 50%; margin-top: -3px;
                       border-style: solid; border-width: 6px 5px 0 5px; border-color: var(--muted) transparent transparent; }
.menu[open] summary::after { transform: rotate(180deg); }
.menu ul { position: absolute; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none;
           min-width: 160px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
           box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.menu li a { display: block; padding: 10px 12px; color: var(--text); text-decoration: none; border-radius: 6px; font-size: 14px; }
.menu li a:hover { background: var(--line); }
.menu li a[aria-current="page"] { color: var(--accent); font-weight: 700; }

main { max-width: 1400px; margin: 0 auto; padding: 8px 16px 40px; }
.head { padding: 12px 0 8px; }
h1 { margin: 0; font-size: 22px; }
.sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

/* 動画ブロック */
.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px;
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
        display: flex; flex-direction: column; }
.card:target, .card.shared { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.shared-label { background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; padding: 4px 10px; }
.media { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0;
         background: #000; cursor: pointer; overflow: hidden; }
.media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.media:hover img { transform: scale(1.03); }
.media iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.media.embed { aspect-ratio: auto; height: 290px; background: #fff; cursor: auto; }
.media.blank { display: flex; align-items: center; justify-content: center; text-decoration: none;
               background: linear-gradient(135deg, #2a1830, #10202e); color: #fff; font-weight: 800; font-size: 22px; }
.play { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px;
        border-radius: 50%; background: rgba(0,0,0,.6); border: 2px solid #fff; }
.play::after { content: ""; position: absolute; left: 21px; top: 15px;
               border-style: solid; border-width: 12px 0 12px 18px; border-color: transparent transparent transparent #fff; }
.rank { position: absolute; left: 8px; top: 8px; background: var(--accent); color: var(--accent-ink);
        font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.title { margin: 0; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.desc { margin: 0; font-size: 12px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meta { margin: 0; font-size: 12px; color: var(--muted); }
.actions { margin-top: auto; display: flex; gap: 8px; }
.cta { flex: 1; text-align: center; background: var(--accent); color: var(--accent-ink);
       text-decoration: none; font-size: 13px; font-weight: 700; padding: 8px; border-radius: 6px; }
.cta:hover { filter: brightness(1.1); }
.copy { font: inherit; font-size: 12px; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--line);
        background: transparent; color: var(--muted); cursor: pointer; white-space: nowrap; }
.copy:hover { color: var(--text); border-color: var(--muted); }
.empty { color: var(--muted); padding: 40px 0; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #fff; color: #000;
         font-size: 13px; font-weight: 700; padding: 8px 16px; border-radius: 20px; opacity: 0; pointer-events: none;
         transition: opacity .2s; z-index: 20; }
#toast.show { opacity: 1; }

/* 年齢確認 */
#age { position: fixed; inset: 0; background: rgba(0,0,0,.92); display: none; align-items: center;
       justify-content: center; z-index: 30; padding: 16px; }
#age.show { display: flex; }
#age .box { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 28px 24px;
            max-width: 420px; text-align: center; }
#age h2 { margin: 0 0 8px; font-size: 20px; }
#age p { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
#age .btns { display: flex; gap: 12px; justify-content: center; }
#age button, #age a { font: inherit; font-weight: 700; padding: 10px 20px; border-radius: 6px; border: 0;
                      cursor: pointer; text-decoration: none; }
#age .yes { background: var(--accent); color: var(--accent-ink); }
#age .no { background: var(--line); color: var(--text); }
