:root {
  --bg: #0f0f0f;
  --bg-elevated: #1c1c1c;
  --text: #f1f1f1;
  --text-dim: #aaaaaa;
  --accent: #10b981;
  --border: #2a2a2a;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Roboto", "Helvetica Neue", "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", Meiryo, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(15, 15, 15, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.3px;
}
.brand-mark {
  color: var(--accent);
  font-size: 18px;
}
.header-meta {
  font-size: 13px;
  color: var(--text-dim);
}

/* ---------- grid ---------- */
.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px 16px;
}

.card {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  overflow: hidden;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}
.card:hover .thumb img { transform: scale(1.03); }
.thumb-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 32px;
}
.badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: 4px;
  line-height: 1.4;
}
.badge-new {
  bottom: auto;
  right: auto;
  top: 8px;
  left: 8px;
  background: var(--accent);
  font-weight: 700;
  letter-spacing: 0.5px;
}
.source-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
}

.meta { padding: 0 2px; }
.title {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  margin: 0 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sub {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.4;
}
.sub .dot { margin: 0 5px; }

.empty {
  text-align: center;
  color: var(--text-dim);
  padding: 80px 20px;
  font-size: 15px;
}

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox[hidden] { display: none; }
.lightbox-frame {
  width: min(1100px, 100%);
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}
.lightbox-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.22); }

@media (max-width: 600px) {
  .grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .thumb { border-radius: 8px; }
}
