:root {
  --bg-primary: #0a0a0f;
  --bg-card: #12121a;
  --bg-card-hover: #1a1a28;
  --accent-pink: #ff3366;
  --accent-cyan: #00ccff;
  --accent-green: #00ff88;
  --accent-yellow: #ffcc00;
  --accent-purple: #b366ff;
  --accent-vtuber: #bb33ff;
  --text-primary: #e8e8f0;
  --text-secondary: #8888aa;
  --text-dim: #555570;
  --border: #2a2a3a;
}

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

body {
  font-family: 'Outfit', 'Noto Sans JP', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
}

/* Header */
.header {
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(10px);
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
}

.logo-text {
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -0.5px;
}

.logo-text span {
  color: var(--accent-pink);
}

.nav {
  display: flex;
  gap: 8px;
}

.nav-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.nav-btn:hover,
.nav-btn.active {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--accent-cyan);
}

/* Search */
.search-bar {
  max-width: 900px;
  margin: 32px auto 24px;
  padding: 0 24px;
}

.search-input {
  width: 100%;
  padding: 14px 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.search-input::placeholder {
  color: var(--text-dim);
}

.search-input:focus {
  border-color: var(--accent-cyan);
}

/* Stats */
.stats-bar {
  max-width: 900px;
  margin: 0 auto 24px;
  padding: 0 24px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.stat-chip {
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
}

.stat-chip strong {
  color: var(--accent-cyan);
  margin-right: 4px;
}

/* Category Tabs */
.category-tabs {
  max-width: 900px;
  margin: 0 auto 24px;
  padding: 0 24px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.cat-tab {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cat-tab:hover {
  border-color: var(--text-secondary);
}

.cat-tab.active {
  background: var(--accent-pink);
  border-color: var(--accent-pink);
  color: white;
}

.cat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Cards Grid */
.cards-grid {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 48px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.card {
  background: var(--bg-card);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}

.card-thumb {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  margin-top: 10px;
  margin-bottom: 12px;
  display: block;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
}

.card-category {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.cat-cafe {
  background: rgba(255, 51, 102, 0.15);
  color: var(--accent-pink);
}

.cat-figure {
  background: rgba(0, 204, 255, 0.15);
  color: var(--accent-cyan);
}

.cat-event {
  background: rgba(0, 255, 136, 0.15);
  color: var(--accent-green);
}

.cat-anime {
  background: rgba(255, 204, 0, 0.15);
  color: var(--accent-yellow);
}

.cat-game {
  background: rgba(179, 102, 255, 0.15);
  color: var(--accent-purple);
}

.cat-vtuber {
  background: rgba(187, 51, 255, 0.15);
  color: var(--accent-vtuber);
}

.cat-otaku-news {
  background: rgba(255, 140, 0, 0.2);
  color: #ff8c00;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 12px;
}

.card-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.meta-label {
  color: var(--text-dim);
}

.meta-value {
  color: var(--text-secondary);
  text-align: right;
  max-width: 70%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.card-toolbar .card-categories {
  margin-bottom: 0;
}

.card-status {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}

.status-active {
  background: rgba(0, 255, 136, 0.15);
  color: var(--accent-green);
}

.status-upcoming {
  background: rgba(0, 204, 255, 0.15);
  color: var(--accent-cyan);
}

.status-ended {
  background: rgba(85, 85, 112, 0.3);
  color: var(--text-dim);
}

/* Detail Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 32px;
}

.modal-close {
  float: right;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-title {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 8px;
  padding-right: 40px;
}

.modal-thumb {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 12px;
  margin: 8px 0 16px;
  display: block;
}

.modal-category {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.modal-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.modal-section {
  margin-bottom: 16px;
}

.modal-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.modal-section-content {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Series Journey */
.journey-section {
  background: rgba(0, 204, 255, 0.05);
  border: 1px solid rgba(0, 204, 255, 0.15);
  border-radius: 10px;
  padding: 16px;
}

.journey-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.journey-item {
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(0, 204, 255, 0.08);
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.journey-item:hover {
  background: rgba(0, 204, 255, 0.15);
}

.journey-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.journey-cats {
  font-size: 11px;
  color: var(--text-dim);
}

.modal-link {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 20px;
  border-radius: 8px;
  background: var(--accent-pink);
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  transition: opacity 0.2s;
}

.modal-link:hover {
  opacity: 0.85;
}

/* Footer */
.footer {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
}

.footer a {
  color: var(--accent-cyan);
  text-decoration: none;
}

/* About specific */
.about-content {
  max-width: 900px;
  margin: 32px auto;
  padding: 0 24px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.about-content h1 {
  color: var(--text-primary);
  margin-bottom: 24px;
}

.about-content h2 {
  color: var(--text-primary);
  margin-top: 32px;
  margin-bottom: 16px;
  font-size: 20px;
}

.about-content p {
  margin-bottom: 16px;
}

/* Loading & Empty State */
.loading-spinner {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 0;
  gap: 16px;
  color: var(--text-dim);
  font-size: 14px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  color: var(--text-dim);
  font-size: 15px;
}

/* Load More */
.load-more-btn {
  display: block;
  max-width: 900px;
  margin: 24px auto;
  padding: 12px 32px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.load-more-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  color: var(--text-primary);
}

/* カテゴリタブ: 769px以上は横スクロール（コンテナ900pxでは8タブが収まらないため常に1行） */
@media (min-width: 769px) {
  .category-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .cat-tab {
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* Mobile (768px以下) */
@media (max-width: 768px) {

  /* カードを縦1列に */
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0 12px;
  }

  /* ヘッダーのナビを非表示 */
  .nav {
    display: none;
  }

  .header {
    padding: 12px 16px;
  }

  /* 検索バーのパディング調整 */
  .search-bar {
    padding: 0 12px;
    margin: 20px auto 16px;
  }

  /* カテゴリタブの横スクロール対応 */
  .category-tabs {
    padding: 0 12px;
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
  }

  .cat-tab {
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* stats barの調整 */
  .stats-bar {
    padding: 0 12px;
    gap: 8px;
  }

  /* ロゴサイズ調整 */
  .logo-text {
    font-size: 15px;
  }

  /* モーダルの全画面表示 */
  .modal {
    max-height: 90vh;
    padding: 20px;
    border-radius: 12px;
  }

  .modal-title {
    font-size: 20px;
  }

  /* フッターの調整 */
  .footer {
    padding: 16px 12px;
  }

  .about-content {
    padding: 0 16px;
  }
}

/* タブレット表示 (769px〜1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}