/* =====================================================================
 * fan.fuwamu.com - 宵夢ふわむ ファンサイト
 * 世界観: 淡いピンク・水色・桜色を基調にした「ゆめかわ」テイスト
 * ===================================================================== */

:root {
  --fuwamu-pink: #FFD9E5;
  --fuwamu-blue: #C8E0F4;
  --fuwamu-rose: #FF7BA0;
  --fuwamu-sakura: #FFAFCC;
  --fuwamu-cream: #FFFBF5;
  --fuwamu-purple: #5C4B7A;
  --fuwamu-purple-soft: #9C8FB4;
  --fuwamu-purple-light: #E8DFF0;
  --fuwamu-gold: #F5C97B;
  
  /* Shadow */
  --shadow-soft: 0 4px 20px rgba(255, 175, 204, 0.2);
  --shadow-card: 0 2px 12px rgba(92, 75, 122, 0.08);
  --shadow-hover: 0 8px 24px rgba(255, 123, 160, 0.25);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Klee One', 'Hiragino Maru Gothic ProN', 'Yu Gothic', sans-serif;
  background:
    radial-gradient(circle at 20% 10%, var(--fuwamu-pink) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, var(--fuwamu-blue) 0%, transparent 40%),
    var(--fuwamu-cream);
  background-attachment: fixed;
  color: var(--fuwamu-purple);
  line-height: 1.7;
  min-height: 100vh;
}

/* 英数字は Outfit に切り替え (sans-serif) */
.font-en {
  font-family: 'Outfit', sans-serif;
}

a {
  color: var(--fuwamu-rose);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--fuwamu-purple);
}

/* =====================================================================
 * Layout
 * ===================================================================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.site-header {
  background: rgba(255, 251, 245, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--fuwamu-sakura);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-card);
}

.site-header .header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.site-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--fuwamu-rose);
}

.site-title .emoji {
  font-size: 1.6rem;
}

.site-nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.site-nav a {
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border-radius: 12px;
  transition: all 0.2s;
}

.site-nav a:hover {
  background: var(--fuwamu-pink);
  color: var(--fuwamu-purple);
}

.site-nav a.active {
  background: var(--fuwamu-rose);
  color: white;
}

/* Footer */
.site-footer {
  background: var(--fuwamu-purple-light);
  margin-top: 4rem;
  padding: 2.5rem 0;
  border-top: 2px solid var(--fuwamu-sakura);
  text-align: center;
  color: var(--fuwamu-purple-soft);
}

.site-footer .footer-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}

.site-footer .footer-links {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.5rem;
}

/* =====================================================================
 * Hero (トップ)
 * ===================================================================== */

.hero {
  text-align: center;
  padding: 4rem 0 3rem;
  position: relative;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--fuwamu-rose), var(--fuwamu-purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.5rem;
}

.hero .subtitle {
  color: var(--fuwamu-purple-soft);
  font-size: 1.1rem;
}

.hero .channel-link {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.6rem 1.5rem;
  background: linear-gradient(135deg, var(--fuwamu-rose), var(--fuwamu-sakura));
  color: white;
  border-radius: 24px;
  font-weight: 600;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s, box-shadow 0.2s;
}

.hero .channel-link:hover {
  transform: translateY(-2px);
  color: white;
  box-shadow: var(--shadow-hover);
}

/* =====================================================================
 * Stats (統計ボード)
 * ===================================================================== */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  margin: 3rem 0;
}

.stat-card {
  background: white;
  border-radius: 20px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--fuwamu-purple-light);
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.stat-card .label {
  font-size: 0.85rem;
  color: var(--fuwamu-purple-soft);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.stat-card .value {
  font-family: 'Outfit', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--fuwamu-rose), var(--fuwamu-purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.1;
}

.stat-card .unit {
  font-size: 0.9rem;
  color: var(--fuwamu-purple-soft);
  margin-left: 0.2rem;
  font-weight: 500;
}

/* =====================================================================
 * Section Title
 * ===================================================================== */

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--fuwamu-purple);
  margin: 3rem 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title::before {
  content: "❀";
  color: var(--fuwamu-sakura);
}

/* =====================================================================
 * Stream Card
 * ===================================================================== */

.stream-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.stream-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--fuwamu-purple-light);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.stream-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.stream-card .thumbnail {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--fuwamu-purple-light);
  overflow: hidden;
}

.stream-card .thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.stream-card:hover .thumbnail img {
  transform: scale(1.05);
}

.stream-card .duration {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  background: rgba(92, 75, 122, 0.85);
  color: white;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
}

.stream-card .info {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.stream-card .title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--fuwamu-purple);
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.stream-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-top: auto;
  font-size: 0.8rem;
  color: var(--fuwamu-purple-soft);
}

.stream-card .date {
  font-family: 'Outfit', sans-serif;
}

/* Category badges */
.category-badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.category-badge.cover_video      { background: #FFE4F0; color: #C44769; }
.category-badge.original_song    { background: #E4F0FF; color: #4769C4; }
.category-badge.singing          { background: #FFF0E4; color: #C47B45; }
.category-badge.shorts           { background: #F0E4FF; color: #7B45C4; }
.category-badge.chat             { background: #E4FFE4; color: #45C47B; }
.category-badge.game             { background: #FFFCE4; color: #C4A645; }
.category-badge.event            { background: #FFE4E4; color: #C44545; }
.category-badge.collab           { background: #E4FFFC; color: #45C4A6; }
.category-badge.asmr             { background: #F8E4FF; color: #A645C4; }
.category-badge.member_only      { background: #FFD1A4; color: #C4632E; }

/* =====================================================================
 * Filters (配信一覧用)
 * ===================================================================== */

.filters {
  background: white;
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--fuwamu-purple-light);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.filter-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fuwamu-purple-soft);
  margin-right: 0.3rem;
}

.filter-btn {
  background: var(--fuwamu-cream);
  border: 1.5px solid var(--fuwamu-purple-light);
  color: var(--fuwamu-purple);
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover {
  background: var(--fuwamu-pink);
  border-color: var(--fuwamu-sakura);
}

.filter-btn.active {
  background: var(--fuwamu-rose);
  border-color: var(--fuwamu-rose);
  color: white;
}

.filter-search {
  flex: 1;
  min-width: 200px;
  background: var(--fuwamu-cream);
  border: 1.5px solid var(--fuwamu-purple-light);
  color: var(--fuwamu-purple);
  padding: 0.5rem 1rem;
  border-radius: 24px;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s;
}

.filter-search:focus {
  border-color: var(--fuwamu-rose);
  background: white;
}

.filter-search::placeholder {
  color: var(--fuwamu-purple-soft);
}

.results-count {
  text-align: center;
  color: var(--fuwamu-purple-soft);
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

/* =====================================================================
 * Pagination
 * ===================================================================== */

.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 3rem 0 2rem;
  flex-wrap: wrap;
}

.pagination button {
  background: white;
  border: 1.5px solid var(--fuwamu-purple-light);
  color: var(--fuwamu-purple);
  padding: 0.4rem 0.85rem;
  border-radius: 10px;
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 38px;
}

.pagination button:hover:not(:disabled) {
  background: var(--fuwamu-pink);
  border-color: var(--fuwamu-sakura);
}

.pagination button.active {
  background: var(--fuwamu-rose);
  border-color: var(--fuwamu-rose);
  color: white;
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* =====================================================================
 * Empty state
 * ===================================================================== */

.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--fuwamu-purple-soft);
}

.empty-state .emoji {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}

/* =====================================================================
 * Song list (楽曲一覧)
 * ===================================================================== */

.songs-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.song-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 1rem;
  background: white;
  border-radius: 12px;
  padding: 0.85rem 1.25rem;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--fuwamu-purple-light);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
}

.song-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  color: inherit;
}

.song-item .rank {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--fuwamu-purple-soft);
  min-width: 2.5rem;
  text-align: right;
}

.song-item .song-info .title {
  font-weight: 600;
  color: var(--fuwamu-purple);
  margin-bottom: 0.15rem;
}

.song-item .song-info .artist {
  font-size: 0.85rem;
  color: var(--fuwamu-purple-soft);
}

.song-item .song-count {
  font-family: 'Outfit', sans-serif;
  background: linear-gradient(135deg, var(--fuwamu-rose), var(--fuwamu-sakura));
  color: white;
  border-radius: 16px;
  padding: 0.25rem 0.85rem;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}

.song-item .arrow {
  color: var(--fuwamu-purple-soft);
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .song-item {
    grid-template-columns: auto 1fr auto;
    gap: 0.6rem;
    padding: 0.7rem 0.9rem;
  }
  .song-item .arrow { display: none; }
  .song-item .rank { min-width: 1.8rem; font-size: 0.95rem; }
  .song-item .song-info .title { font-size: 0.92rem; }
}

/* =====================================================================
 * Song detail (楽曲詳細)
 * ===================================================================== */

.song-detail-hero {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  margin: 1rem 0 2rem;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--fuwamu-purple-light);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.song-detail-title {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--fuwamu-rose), var(--fuwamu-purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.4rem;
}

.song-detail-artist {
  color: var(--fuwamu-purple-soft);
  font-size: 1.05rem;
}

.song-stats {
  display: flex;
  gap: 1rem;
}

.song-stat {
  text-align: center;
  padding: 0.5rem 1.5rem;
  background: var(--fuwamu-cream);
  border-radius: 14px;
  border: 1px solid var(--fuwamu-purple-light);
}

.song-stat .label {
  font-size: 0.75rem;
  color: var(--fuwamu-purple-soft);
}

.song-stat .value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--fuwamu-rose);
  line-height: 1;
}

.song-stat .unit {
  font-size: 0.8rem;
  color: var(--fuwamu-purple-soft);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.history-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  background: white;
  border-radius: 12px;
  padding: 0.9rem 1.25rem;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--fuwamu-purple-light);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
}

.history-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  color: inherit;
}

.history-date {
  color: var(--fuwamu-rose);
  font-weight: 600;
  white-space: nowrap;
}

.history-title {
  color: var(--fuwamu-purple);
  font-weight: 500;
  margin-bottom: 0.2rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.history-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
}

.history-meta .timestamp {
  color: var(--fuwamu-purple-soft);
  background: var(--fuwamu-cream);
  padding: 0.1rem 0.5rem;
  border-radius: 6px;
}

.history-arrow {
  color: var(--fuwamu-purple-soft);
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .song-detail-hero {
    padding: 1.25rem;
    flex-direction: column;
    align-items: flex-start;
  }
  .song-stat {
    padding: 0.4rem 1rem;
  }
  .history-item {
    grid-template-columns: 1fr;
    padding: 0.85rem;
  }
  .history-arrow { display: none; }
}

/* =====================================================================
 * Calendar
 * ===================================================================== */

.calendar-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin: 1.5rem 0 1rem;
}

.calendar-current-month {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--fuwamu-purple);
  min-width: 9rem;
  text-align: center;
}

.calendar-grid {
  background: white;
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--fuwamu-purple-light);
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
}

.calendar-grid .cal-header {
  text-align: center;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--fuwamu-purple-soft);
  padding: 0.4rem 0;
  border-bottom: 2px solid var(--fuwamu-purple-light);
  margin-bottom: 0.3rem;
}

.calendar-grid .cal-header.sun { color: var(--fuwamu-rose); }
.calendar-grid .cal-header.sat { color: #7BA0C4; }

.cal-cell {
  aspect-ratio: 1 / 1;
  background: var(--fuwamu-cream);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  color: var(--fuwamu-purple-soft);
  cursor: default;
  position: relative;
  transition: transform 0.15s;
}

.cal-cell.has-stream {
  cursor: pointer;
  font-weight: 600;
  color: var(--fuwamu-purple);
}

.cal-cell.has-stream:hover {
  transform: scale(1.08);
  z-index: 1;
}

.cal-cell.has-stream.cnt-1 { background: var(--fuwamu-pink); }
.cal-cell.has-stream.cnt-2 { background: var(--fuwamu-sakura); }
.cal-cell.has-stream.cnt-3 {
  background: var(--fuwamu-rose);
  color: white;
}

.cal-cell.outside {
  visibility: hidden;
}

.cal-cell.selected {
  outline: 3px solid var(--fuwamu-purple);
  outline-offset: -1px;
}

.calendar-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1rem 0;
  font-size: 0.85rem;
  color: var(--fuwamu-purple-soft);
  flex-wrap: wrap;
}

.calendar-legend .legend-label {
  font-weight: 600;
}

.calendar-legend .legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.calendar-legend .cal-cell {
  width: 1.5rem;
  height: 1.5rem;
  aspect-ratio: 1 / 1;
  cursor: default;
}

.calendar-day-detail {
  margin-top: 1.5rem;
}

.calendar-day-detail h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--fuwamu-purple);
}

.calendar-day-detail .day-stream-item {
  display: block;
  background: white;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--fuwamu-purple-light);
  color: var(--fuwamu-purple);
  text-decoration: none;
  transition: transform 0.15s;
}

.calendar-day-detail .day-stream-item:hover {
  transform: translateY(-2px);
  color: var(--fuwamu-rose);
}

/* =====================================================================
 * Stats charts
 * ===================================================================== */

.chart-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  margin: 1rem 0 2rem;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--fuwamu-purple-light);
}

/* =====================================================================
 * Responsive
 * ===================================================================== */

@media (max-width: 640px) {
  .site-header .header-inner {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .site-nav {
    width: 100%;
    justify-content: center;
  }
  
  .hero {
    padding: 2.5rem 0 2rem;
  }
  
  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .stat-card {
    padding: 1rem;
  }
  
  .stat-card .value {
    font-size: 1.8rem;
  }
  
  .stream-grid {
    grid-template-columns: 1fr;
  }
  
  .filter-row {
    flex-direction: column;
    align-items: stretch;
  }
}

/* =====================================================================
 * Decorative
 * ===================================================================== */

.deco-sparkle::after {
  content: "✦";
  margin-left: 0.3em;
  color: var(--fuwamu-sakura);
}


/* =====================================================================
 * Hamburger nav (スマホ向け)
 * ===================================================================== */

.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  width: 44px;
  height: 44px;
  position: relative;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2.5px;
  background: var(--fuwamu-rose);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle.is-active .nav-toggle-bar:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}
.nav-toggle.is-active .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle.is-active .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* スマホでハンバーガー有効化 */
@media (max-width: 720px) {
  .site-header .header-inner {
    flex-direction: row;
    gap: 0.5rem;
    flex-wrap: nowrap;
  }
  
  .site-title {
    font-size: 1.1rem;
    flex: 1;
    min-width: 0;
  }
  
  .site-title-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .site-title .emoji {
    font-size: 1.3rem;
  }
  
  .nav-toggle {
    display: flex;
    flex-shrink: 0;
  }
  
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 251, 245, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--fuwamu-sakura);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1rem 1rem;
    box-shadow: 0 4px 12px rgba(92, 75, 122, 0.1);
  }
  
  .site-nav.is-open {
    display: flex;
  }
  
  .site-nav a {
    padding: 0.65rem 0.8rem;
    border-radius: 10px;
    text-align: center;
  }
}

/* =====================================================================
 * フィルタ: セレクトボックス (楽曲ソート用)
 * ===================================================================== */

.filter-select {
  background: var(--fuwamu-cream);
  border: 1.5px solid var(--fuwamu-purple-light);
  color: var(--fuwamu-purple);
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M0 0l5 6 5-6z' fill='%235C4B7A'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  padding-right: 2rem;
  transition: border-color 0.2s;
}

.filter-select:focus,
.filter-select:hover {
  border-color: var(--fuwamu-rose);
  outline: none;
}

/* =====================================================================
 * 配信カード タイトル: スマホで 3 行表示
 * ===================================================================== */

@media (max-width: 720px) {
  .stream-card .title {
    -webkit-line-clamp: 3;
  }
}

/* =====================================================================
 * ボタン版 stream-card (モーダル誘発用)
 * ===================================================================== */

button.stream-card {
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  border: 1px solid var(--fuwamu-purple-light);
  padding: 0;
  width: 100%;
}

button.stream-card:focus-visible {
  outline: 3px solid var(--fuwamu-rose);
  outline-offset: 2px;
}

/* =====================================================================
 * 配信モーダル
 * ===================================================================== */

.video-modal[hidden] { display: none; }

.video-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(92, 75, 122, 0.7);
  backdrop-filter: blur(4px);
}

.video-modal-content {
  position: relative;
  background: var(--fuwamu-cream);
  border-radius: 20px;
  width: 100%;
  max-width: 1100px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 16px 64px rgba(92, 75, 122, 0.4);
  border: 1px solid var(--fuwamu-purple-light);
}

.video-modal-close {
  position: sticky;
  top: 0.75rem;
  margin-left: auto;
  margin-right: 0.75rem;
  display: block;
  background: white;
  border: 1.5px solid var(--fuwamu-purple-light);
  color: var(--fuwamu-purple);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  z-index: 2;
  box-shadow: var(--shadow-card);
  transition: background 0.15s;
}

.video-modal-close:hover {
  background: var(--fuwamu-pink);
}

.video-modal-body {
  padding: 0 1.5rem 1.5rem;
  margin-top: -36px;  /* close ボタンと被らないように負マージン */
}

.video-player-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  margin-top: 1rem;
  margin-bottom: 1.25rem;
}

.video-player {
  position: absolute;
  inset: 0;
}

.video-player iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.video-info-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--fuwamu-purple);
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.video-info-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
}

.video-info-date {
  color: var(--fuwamu-rose);
  font-weight: 600;
}

.video-info-categories {
  display: inline-flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.video-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fuwamu-purple);
  margin: 1.25rem 0 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--fuwamu-purple-light);
}

.video-section-title::before {
  content: "❀ ";
  color: var(--fuwamu-sakura);
}

/* セットリスト */
.video-setlist {
  display: flex;
  flex-direction: column;
}

.setlist-item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.85rem;
  background: white;
  border: 1px solid var(--fuwamu-purple-light);
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  margin-bottom: 0.4rem;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.setlist-item:hover {
  transform: translateX(2px);
  box-shadow: var(--shadow-card);
}

.setlist-ts {
  color: var(--fuwamu-rose);
  font-weight: 600;
  font-size: 0.85rem;
  background: var(--fuwamu-pink);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  min-width: 3.5rem;
  text-align: center;
}

.setlist-song {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.setlist-title {
  font-weight: 500;
  color: var(--fuwamu-purple);
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.setlist-artist {
  font-size: 0.8rem;
  color: var(--fuwamu-purple-soft);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 説明文 */
.video-description-text {
  background: white;
  border: 1px solid var(--fuwamu-purple-light);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--fuwamu-purple);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow-y: auto;
  line-height: 1.6;
}

/* 関連動画 */
.video-related {
  display: flex;
  flex-direction: column;
}

.related-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 0.75rem;
  background: white;
  border: 1px solid var(--fuwamu-purple-light);
  border-radius: 10px;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.related-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.related-thumb {
  aspect-ratio: 16 / 9;
  background: var(--fuwamu-purple-light);
  border-radius: 6px;
  overflow: hidden;
}

.related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--fuwamu-purple-soft);
}

.related-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.related-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--fuwamu-purple);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.25rem;
}

.related-date {
  font-size: 0.75rem;
  color: var(--fuwamu-purple-soft);
}

/* YouTube リンクボタン */
.video-open-youtube {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.55rem 1.25rem;
  background: linear-gradient(135deg, var(--fuwamu-rose), var(--fuwamu-sakura));
  color: white;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s, box-shadow 0.15s;
}

.video-open-youtube:hover {
  transform: translateY(-2px);
  color: white;
  box-shadow: var(--shadow-hover);
}

.empty-line {
  color: var(--fuwamu-purple-soft);
  font-size: 0.9rem;
  padding: 0.5rem 0;
}

/* スマホ: モーダル */
@media (max-width: 720px) {
  .video-modal {
    padding: 0.5rem;
  }
  .video-modal-content {
    max-height: 95vh;
    border-radius: 16px;
  }
  .video-modal-body {
    padding: 0 1rem 1rem;
  }
  .video-info-title {
    font-size: 1.05rem;
  }
  .related-item {
    grid-template-columns: 80px 1fr;
  }
}

/* =====================================================================
 * 統計ページ: 円グラフ凡例を下に (スマホ)
 * ===================================================================== */
@media (max-width: 720px) {
  .chart-card {
    padding: 1rem;
  }
}


/* =====================================================================
 * ダークモード
 * ===================================================================== */

html[data-theme="dark"] {
  --fuwamu-pink: #2d1f2c;
  --fuwamu-blue: #1e2a3a;
  --fuwamu-rose: #FF9DBB;
  --fuwamu-sakura: #D689B0;
  --fuwamu-cream: #1a1424;
  --fuwamu-purple: #E8DFF0;
  --fuwamu-purple-soft: #B8AEC8;
  --fuwamu-purple-light: #3d2f4d;
  --fuwamu-gold: #F5C97B;
  
  --shadow-soft: 0 4px 20px rgba(255, 175, 204, 0.08);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 8px 24px rgba(255, 123, 160, 0.15);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 20% 10%, #2a1f30 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, #1c2638 0%, transparent 40%),
    #14101c;
}

html[data-theme="dark"] .stream-card,
html[data-theme="dark"] .song-item,
html[data-theme="dark"] .history-item,
html[data-theme="dark"] .chart-card,
html[data-theme="dark"] .calendar-grid,
html[data-theme="dark"] .video-description-text,
html[data-theme="dark"] .setlist-item,
html[data-theme="dark"] .related-item,
html[data-theme="dark"] .calendar-day-detail .day-stream-item,
html[data-theme="dark"] .song-detail-hero,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .highlight-card,
html[data-theme="dark"] .video-modal-content,
html[data-theme="dark"] .video-modal-close {
  background: #221a30;
}

html[data-theme="dark"] .stream-card .info .title,
html[data-theme="dark"] .song-item .song-info .title,
html[data-theme="dark"] .history-title,
html[data-theme="dark"] .setlist-title,
html[data-theme="dark"] .related-title,
html[data-theme="dark"] .video-info-title {
  color: var(--fuwamu-purple);
}

html[data-theme="dark"] .filter-btn,
html[data-theme="dark"] .filter-select,
html[data-theme="dark"] .filter-search {
  background: #221a30;
  color: var(--fuwamu-purple);
}

html[data-theme="dark"] .cal-cell {
  background: #2a2238;
  color: var(--fuwamu-purple-soft);
}
html[data-theme="dark"] .cal-cell.has-stream { color: var(--fuwamu-purple); }
html[data-theme="dark"] .cal-cell.has-stream.cnt-3 { color: white; }

html[data-theme="dark"] mark {
  background: #5a4220;
  color: var(--fuwamu-gold);
}

/* =====================================================================
 * テーマ切替ボタン
 * ===================================================================== */

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  font-size: 1.1rem;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--fuwamu-pink);
}

.theme-icon-light, .theme-icon-dark { display: none; }
html[data-theme="light"] .theme-icon-light { display: inline; }
html[data-theme="dark"] .theme-icon-dark { display: inline; }

/* =====================================================================
 * トースト通知
 * ===================================================================== */

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--fuwamu-purple);
  color: white;
  padding: 0.7rem 1.4rem;
  border-radius: 24px;
  font-size: 0.9rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}

.toast[hidden] { display: none; }

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =====================================================================
 * 検索ハイライト
 * ===================================================================== */

mark {
  background: #FFF3A0;
  color: var(--fuwamu-purple);
  padding: 0 2px;
  border-radius: 3px;
}

/* =====================================================================
 * 人気曲バッジ
 * ===================================================================== */

.popular-badge {
  display: inline-block;
  margin-left: 0.4rem;
  color: var(--fuwamu-gold);
  font-size: 0.85rem;
}

/* =====================================================================
 * 楽曲一覧: お気に入りボタン + グループヘッダー
 * ===================================================================== */

.song-item-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  align-items: center;
}

.song-item-wrap .song-item {
  margin-bottom: 0;
}

.favorite-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.5rem;
  color: var(--fuwamu-purple-soft);
  transition: transform 0.15s, color 0.15s;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.favorite-toggle:hover {
  transform: scale(1.15);
}

.favorite-toggle.is-fav {
  color: var(--fuwamu-gold);
}

.songs-group-header {
  font-weight: 600;
  font-size: 1rem;
  color: var(--fuwamu-rose);
  margin: 1rem 0 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--fuwamu-purple-light);
}

.filter-btn.active {
  background: linear-gradient(135deg, var(--fuwamu-rose), var(--fuwamu-sakura));
  color: white;
}

/* =====================================================================
 * 配信モーダル: アクション ボタン群
 * ===================================================================== */

.video-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 1.5rem;
}

.video-action-btn {
  background: white;
  border: 1.5px solid var(--fuwamu-purple-light);
  color: var(--fuwamu-purple);
  padding: 0.45rem 0.95rem;
  border-radius: 20px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.video-action-btn:hover {
  background: var(--fuwamu-pink);
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
  color: var(--fuwamu-purple);
}

a.video-action-btn {
  background: linear-gradient(135deg, var(--fuwamu-rose), var(--fuwamu-sakura));
  color: white;
  border-color: transparent;
}

a.video-action-btn:hover {
  color: white;
  box-shadow: var(--shadow-hover);
}

/* =====================================================================
 * カレンダー: 月ナビバッジ + 今日マーク + ジャンプパネル
 * ===================================================================== */

.month-badge {
  font-size: 0.75rem;
  background: var(--fuwamu-pink);
  color: var(--fuwamu-rose);
  padding: 0.1rem 0.4rem;
  border-radius: 8px;
  margin-left: 0.3rem;
}

.calendar-controls .filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.calendar-month-picker {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calendar-month-jump-btn {
  padding: 0.4rem 0.55rem;
  font-size: 0.9rem;
}

.calendar-jump-panel {
  background: white;
  border: 1px solid var(--fuwamu-purple-light);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-card);
}

.cal-cell.today {
  outline: 2px dashed var(--fuwamu-purple-soft);
  outline-offset: -3px;
}

/* day-stream-item: button 化 */
button.day-stream-item {
  width: 100%;
  border: 1px solid var(--fuwamu-purple-light);
  background: white;
  color: var(--fuwamu-purple);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s;
  display: block;
}

button.day-stream-item:hover {
  transform: translateY(-2px);
  color: var(--fuwamu-rose);
}

/* =====================================================================
 * 統計: ハイライトカード + メン限カード
 * ===================================================================== */

.highlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1rem 0 2rem;
}

.highlight-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--fuwamu-purple-light);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.highlight-card::before {
  content: "";
  position: absolute;
  top: -20px;
  right: -20px;
  width: 80px;
  height: 80px;
  background: var(--fuwamu-pink);
  border-radius: 50%;
  opacity: 0.4;
  z-index: 0;
}

.highlight-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.highlight-label {
  font-size: 0.85rem;
  color: var(--fuwamu-purple-soft);
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.highlight-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fuwamu-rose);
  line-height: 1.3;
  margin-bottom: 0.3rem;
  position: relative;
  z-index: 1;
  overflow-wrap: break-word;
}

.highlight-sub {
  font-size: 0.8rem;
  color: var(--fuwamu-purple-soft);
  position: relative;
  z-index: 1;
}

.highlight-unit {
  font-size: 0.85rem;
  color: var(--fuwamu-purple-soft);
  font-weight: 500;
}

.stat-card.member-stat {
  background: linear-gradient(135deg, var(--fuwamu-cream), var(--fuwamu-pink));
  border-style: dashed;
}

.member-note {
  font-size: 0.7rem;
  color: var(--fuwamu-purple-soft);
  margin-top: 0.25rem;
}

/* =====================================================================
 * モーダル: スマホでも快適
 * ===================================================================== */

@media (max-width: 720px) {
  .video-actions {
    flex-direction: column;
  }
  .video-action-btn {
    justify-content: center;
  }
  .highlight-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }
  .highlight-card {
    padding: 1rem 0.75rem;
  }
  .highlight-value {
    font-size: 1rem;
  }
  .calendar-controls {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .calendar-month-picker {
    order: -1;
    width: 100%;
    justify-content: center;
  }
}
