:root {
  /* Default Light Theme */
  --bg-body: #FFFFFF;    /* メインコンテンツは白で清潔感を */
  --bg-hero: #F7F5F0;    /* ヒーローセクションは従来のベージュで深みを */
  --text-main: #2C2C2A;
  --text-muted: #888780;
  --text-sub: #5F5E5A;
  --accent: #D85A30;
  --accent-rgb: 216, 90, 48;
  --accent-hover: #993C1D;
  --border-light: #D3D1C7;
  --border-dark: #2C2C2A;
  --card-bg: #FFFFFF;
  --featured-bg: #2C2C2A;
  --featured-text: #F7F5F0;
  --btn-join-bg: #2C2C2A;
  --btn-join-text: #F7F5F0;
  --btn-join-hover: #444441;
  --rank-num: #D3D1C7;
  --genre-tag-bg: #F1EFE8;
  --genre-tag-active-bg: #2C2C2A;
  --genre-tag-active-text: #F7F5F0;
  --vinyl-gradient: repeating-conic-gradient(#555 0deg 10deg, #333 10deg 20deg);
}

[data-theme="dark"] {
  --bg-body: #18181A;    /* ボディは少し上げる */
  --bg-hero: #0D0D0E;    /* ヒーローはより深い黒に */
  --text-main: #E8E6E0;
  --text-muted: #888780;
  --text-sub: #888780;
  --accent: #EF9F27;
  --accent-rgb: 239, 159, 39;
  --accent-hover: #FAC775;
  --border-light: #2C2C2A;
  --border-dark: #444441;
  --card-bg: #111113;
  --featured-bg: #111113;
  --featured-text: #E8E6E0;
  --btn-join-bg: #EF9F27;
  --btn-join-text: #18181A;
  --btn-join-hover: #FAC775;
  --rank-num: #444441;
  --genre-tag-bg: #2C2C2A;
  --genre-tag-active-bg: #EF9F27;
  --genre-tag-active-text: #18181A;
  --vinyl-gradient: repeating-conic-gradient(#333 0deg 10deg, #1a1a1a 10deg 20deg);
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-body);
  color: var(--text-main);
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}

a {
  text-decoration: none;
  transition: color 0.2s;
  color: inherit;
}

a:visited:not(.btn-amazon) {
  color: inherit;
}

/* ボタンの基本スタイル（ヘッダー等で使用） */
nav .btn-join, 
.hero .btn-join,
.auth-container .btn-auth {
  color: var(--btn-join-text) !important;
}

[data-theme="light"] .btn-secondary {
  color: var(--text-muted) !important;
}

/* NAV */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  background: var(--bg-body);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.logo {
  font-family: 'DM Sans', sans-serif;
  font-size: 24px;
  font-weight: 800;
  font-style: italic;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
}

.logo .rev {
  color: var(--featured-bg);
}

.logo .log {
  color: var(--accent);
}

[data-theme="dark"] .logo .rev {
  color: var(--text-main);
}

.nav-links {
  display: flex;
  gap: 24px;
  font-size: 13px;
}

.nav-links a {
  color: var(--text-muted);
}

.nav-links a:hover {
  color: var(--text-main);
}

.nav-right {
  display: flex;
  gap: 12px;
  align-items: center;
}

.nav-right > div {
  gap: 8px !important;
}

/* Search Bar */
.search-container {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 300px;
  margin: 0 20px;
}

.search-input {
  width: 100%;
  padding: 8px 16px 8px 36px;
  background: var(--bg-hero);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-main);
  transition: all 0.3s ease;
  outline: none;
}

.search-input:focus {
  border-color: var(--accent);
  background: var(--bg-body);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

/* Share Buttons */
.share-section {
  margin-top: 40px;
  text-align: center;
}
.share-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 20px;
  font-weight: 600;
}
.share-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
}
.btn-share {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  background: var(--card-bg);
  color: var(--text-main) !important; /* 成功メッセージ等の緑色の継承を阻止 */
  position: relative;
  text-decoration: none !important;
}
.btn-share:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  color: var(--accent);
}
.btn-share.x-color:hover {
  background: #000 !important;
  color: #fff !important;
  border-color: #000 !important;
}
.btn-share.line-color:hover {
  background: #06C755 !important;
  color: #fff !important;
  border-color: #06C755 !important;
}
.btn-share.copy-color:hover {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
}

/* Tooltip for copy */
.share-tooltip {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-main);
  color: var(--bg-body);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
}
.share-tooltip.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-5px);
}

.btn-login {
  font-size: 13px;
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  padding: 6px 14px;
  border-radius: 20px;
  background: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-login:hover {
  border-color: var(--text-muted);
  color: var(--text-main);
}

.btn-join {
  font-size: 13px;
  color: var(--btn-join-text);
  background: var(--btn-join-bg);
  padding: 6px 16px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-join:hover {
  background: var(--btn-join-hover);
}

/* Theme Toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 6px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
}

/* HERO */
.hero-outer {
  background: var(--bg-hero);
  border-bottom: 1px solid var(--border-light);
  width: 100%;
  margin-bottom: 80px; /* ここを増やしてメインコンテンツとの距離を確保 */
}

.hero {
  padding: 64px 32px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 48px;
  max-width: 1100px;
  margin: 0 auto;
}

.hero-eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: 48px;
  line-height: 1.1;
  color: var(--text-main);
  margin-bottom: 16px;
}

.hero-title em {
  font-style: italic;
  color: var(--accent);
}

.hero-sub {
  font-size: 15px;
  color: var(--text-sub);
  line-height: 1.7;
  max-width: 500px;
  margin-bottom: 28px;
}

.hero-stats { 
  display: flex; 
  gap: 12px; 
  margin-top: 24px; 
  max-width: 480px;
}

.stat-item { 
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  padding: 10px 14px;
  border-radius: 10px;
  flex: 1;
  display: flex;
  flex-direction: column; /* 改修: 縦並びにしてラベルを左端へ */
  align-items: flex-start;
  gap: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.stat-top {
  display: flex;
  align-items: center; /* アイコンと数値を中央で揃える */
  gap: 8px;
}

.stat-item svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
  flex-shrink: 0;
}

.stat-num { 
  font-family: 'Playfair Display', serif; 
  font-size: 22px; 
  color: var(--accent); 
  font-weight: 600;
  line-height: 1;
}

.stat-label { 
  font-size: 10px; 
  color: var(--text-muted); 
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin-top: 2px; /* 数値との微調整 */
}

/* FEATURED CARD */
.featured-card {
  background: var(--featured-bg);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 24px;
  color: var(--featured-text);
  transition: all 0.3s ease;
}

.fc-tag {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.album-art {
  width: 120px;
  height: 120px;
  background: var(--border-light);
  border-radius: 8px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.album-vinyl {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--vinyl-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
}

.vinyl-hole {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--featured-bg);
}

.fc-artist {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.fc-album {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  color: var(--featured-text);
  margin-bottom: 8px;
}

.fc-stars {
  color: var(--accent);
  font-size: 14px;
  margin-bottom: 8px;
}

.fc-excerpt {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.6;
  margin-bottom: 16px;
}

.fc-reviewer {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--bg-body);
}

.reviewer-name {
  font-size: 12px;
  color: var(--text-muted);
}

/* SECTIONS */
.section {
  padding: 0 32px 40px;
  max-width: 1100px;
  margin: 0 auto;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 12px;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  color: var(--text-main);
}

.section-more {
  font-size: 12px;
  color: var(--accent);
}

.section-more:hover {
  color: var(--accent-hover);
}

/* REVIEW CARDS */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.review-card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.2s;
  cursor: pointer;
}

.review-card:hover {
  border-color: var(--text-muted);
}

.rc-genre {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.rc-album {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  color: var(--text-main);
  margin-bottom: 2px;
}

.rc-artist {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.rc-body {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.6;
  margin-bottom: 12px;
}

.rc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rc-reviewer {
  font-size: 12px;
  color: var(--text-muted);
}

.rc-likes {
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
}

.rc-likes:hover {
  color: var(--accent-hover);
}

/* TWO COL */
.two-col {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  padding: 0 32px 48px;
  max-width: 1100px;
  margin: 0 auto;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.rank-num {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  color: var(--rank-num);
  min-width: 32px;
}

.rank-info {
  flex: 1;
}

.rank-album {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
}

.rank-artist {
  font-size: 12px;
  color: var(--text-muted);
}

.rank-likes {
  font-size: 13px;
  color: var(--accent);
}

/* GENRE */
.genre-cloud {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 20px;
}

.genre-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.genre-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.genre-tag {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--genre-tag-bg);
  color: var(--text-sub);
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.genre-tag:hover {
  background: var(--border-light);
  color: var(--text-main);
}

.genre-tag.active {
  background: var(--genre-tag-active-bg);
  color: var(--genre-tag-active-text);
}

/* 星評価 */
.star-rating {
  color: #f1c40f;
  font-size: 18px;
  letter-spacing: 2px;
}

.star-rating.small {
  font-size: 14px;
}

.star-gray {
  color: var(--border-light);
}

/* レビュー画像 */
.review-image-wrapper {
  width: 100%;
  max-width: 250px;
  aspect-ratio: 1/1;
  background: var(--bg-body);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  margin-bottom: 24px;
}

.review-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* FOOTER */
footer {
  border-top: 1px solid var(--border-light);
  padding: 24px 32px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 48px 24px;
    gap: 40px;
  }
  .hero-sub { margin: 0 auto 28px; }
  .hero-stats { justify-content: center; margin: 24px auto 0; }

  .reviews-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .two-col {
    grid-template-columns: 1fr;
  }
  
  .search-container {
    display: none; /* 900px以下で検索窓は一旦隠す（ヘッダーをスッキリさせる） */
  }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  nav { padding: 12px 16px; }
  .logo { font-size: 18px; }
}

@media (max-width: 500px) {
  .reviews-grid {
    grid-template-columns: 1fr;
  }

  nav {
    padding: 10px 12px;
  }
  
  .nav-right {
    gap: 6px;
  }
  
  /* モバイルで不要なアイコンを隠すか、整理する */
  .nav-right a[title="設定"], 
  .nav-right a[title="ログアウト"] {
    display: none !important; /* モバイルではアバタークリック等で遷移させる想定（今回は一旦隠す） */
  }
  
  .btn-join, .btn-login, .btn-post {
    padding: 6px 12px;
    font-size: 11px;
  }
  
  .theme-toggle {
    padding: 4px;
    margin-right: 0;
  }

  .hero-title { font-size: 32px; }
  .hero-stats { gap: 8px; }
  .stat-item { padding: 8px; }
  .stat-num { font-size: 18px; }
}