:root {
  --bg: #0e0f13;
  --bg-card: #17181f;
  --bg-card-hover: #1e2029;
  --text: #e8e9ed;
  --text-dim: #9a9db0;
  --accent: #7c5cff;
  --accent-2: #ff5c8a;
  --live: #ff4d4d;
  --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  line-height: 1.6;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

.site-header {
  background: linear-gradient(135deg, #16131f 0%, #1a1230 60%, #241236 100%);
  border-bottom: 1px solid #26283a;
  padding: 22px 0;
}
.header-inner { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.logo { font-size: 28px; letter-spacing: 0.5px; }
.logo span { color: var(--accent); }
.tagline { color: var(--text-dim); font-size: 14px; }

.mock-banner {
  background: #2b2410;
  color: #ffd166;
  text-align: center;
  padding: 8px 16px;
  font-size: 13px;
  border-bottom: 1px solid #3d3316;
}
.mock-banner code { background: #1c1808; padding: 1px 6px; border-radius: 4px; }

.tabs { display: flex; gap: 8px; padding-top: 20px; padding-bottom: 4px; flex-wrap: wrap; }
.tab {
  background: var(--bg-card);
  color: var(--text-dim);
  border: 1px solid #262838;
  border-radius: 999px;
  padding: 8px 22px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.tab:hover { color: var(--text); border-color: var(--accent); }
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.tab-live.active { background: var(--live); border-color: var(--live); }
.live-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--live); margin-right: 7px;
  animation: pulse 1.4s infinite;
}
.tab-live.active .live-dot { background: #fff; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

.updated { color: var(--text-dim); font-size: 12px; padding: 10px 2px; }

.len-filter { display: flex; gap: 8px; align-items: center; padding-top: 12px; color: var(--text-dim); font-size: 13px; }
.chip {
  background: var(--bg-card); border: 1px solid #262838; color: var(--text-dim);
  border-radius: 999px; padding: 5px 14px; font-size: 13px; cursor: pointer;
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.active { background: #2a2350; border-color: var(--accent); color: #fff; }

.dur-badge {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0, 0, 0, 0.8); color: #fff;
  font-size: 11px; padding: 2px 6px; border-radius: 4px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  padding-bottom: 48px;
}

.card {
  background: var(--bg-card);
  border: 1px solid #23253363;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.12s, background 0.12s;
  position: relative;
}
.card:hover { transform: translateY(-3px); background: var(--bg-card-hover); }

.thumb-wrap { position: relative; aspect-ratio: 16/9; background: #000; }
.thumb-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }

.rank-badge {
  position: absolute; top: 8px; left: 8px;
  min-width: 34px; height: 34px; padding: 0 8px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; font-weight: 800; font-size: 16px;
  background: rgba(14, 15, 19, 0.85); color: var(--text);
}
.rank-1 { background: linear-gradient(135deg, #f7c948, #b8860b); color: #1a1503; }
.rank-2 { background: linear-gradient(135deg, #d9dbe3, #8f95a3); color: #14161c; }
.rank-3 { background: linear-gradient(135deg, #e3a869, #9c5f28); color: #1f1204; }

.live-badge {
  position: absolute; top: 8px; right: 8px;
  background: var(--live); color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 6px;
}

.card-body { padding: 12px 14px 14px; }
.card-title {
  font-size: 14px; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 2.7em;
}
.card-meta { margin-top: 8px; font-size: 12px; color: var(--text-dim); display: flex; justify-content: space-between; gap: 8px; }
.views { color: var(--accent-2); font-weight: 700; white-space: nowrap; }

.empty { color: var(--text-dim); text-align: center; padding: 60px 0; }

.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.75); }
.modal-body {
  /* 画面の高さいっぱい（86vh）を上限に、16:9で可能な限り大きく表示 */
  position: relative; width: min(1500px, 94vw, calc(86vh * 1.7778));
  background: var(--bg-card); border-radius: var(--radius); padding: 14px;
}
.modal-close {
  position: absolute; top: -14px; right: -14px;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: #fff; border: none;
  font-size: 20px; cursor: pointer;
}
.player-slot { aspect-ratio: 16/9; background: #000; border-radius: 8px; overflow: hidden; }
.player-slot iframe { width: 100%; height: 100%; border: 0; }
.player-slot .no-play {
  height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 14px; padding: 20px; text-align: center;
}
.player-footer { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.player-title { padding: 10px 4px 2px; font-size: 14px; flex: 1; }
.share-btn {
  flex-shrink: 0; margin-top: 8px;
  background: #000; color: #fff; text-decoration: none;
  border: 1px solid #444; border-radius: 999px;
  padding: 6px 16px; font-size: 13px; font-weight: 700;
}
.share-btn:hover { border-color: #fff; }
.shorts-share {
  position: absolute; right: 14px; bottom: 150px; z-index: 3;
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.55); color: #fff; text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 50%;
  font-size: 17px; font-weight: 700;
}

.site-footer {
  border-top: 1px solid #26283a;
  padding: 20px 0 30px;
  color: var(--text-dim); font-size: 12px;
}

/* ---- ショートモード（縦スワイプ連続再生） ---- */
.tab-shorts { border-color: var(--accent-2); color: var(--accent-2); }
.tab-shorts:hover { background: var(--accent-2); color: #fff; }

.shorts { position: fixed; inset: 0; z-index: 100; background: #000; }
.shorts[hidden] { display: none; }
.shorts-feed {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.shorts-slide {
  position: relative;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #000;
}
.shorts-player, .shorts-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.shorts-tap { position: absolute; inset: 0; z-index: 2; }
.shorts-mute {
  position: absolute; top: 14px; left: 14px; z-index: 3;
  background: rgba(0, 0, 0, 0.55); color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 999px;
  padding: 8px 14px; font-size: 13px; cursor: pointer;
}
.shorts-info {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 60px 70px 28px 16px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  pointer-events: none;
}
.shorts-info .s-rank { color: var(--accent-2); font-weight: 800; font-size: 13px; }
.shorts-info h3 {
  color: #fff; font-size: 14px; font-weight: 600; margin: 4px 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.shorts-info .s-meta { color: #c8cbdc; font-size: 12px; }
.shorts-hint {
  position: absolute; right: 14px; bottom: 96px; z-index: 2;
  color: rgba(255, 255, 255, 0.85); font-size: 12px;
  background: rgba(0, 0, 0, 0.45); border-radius: 8px; padding: 6px 10px;
  pointer-events: none;
}
.shorts-close {
  position: fixed; top: 12px; right: 12px; z-index: 110;
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.6); color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 22px; cursor: pointer;
}
