/* ─────────────────────────────────────────────
   村上春樹ファン — スタイルシート
   モバイルファースト（390px基準）
───────────────────────────────────────────── */

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

:root {
  --bg:            #F8F6F0;
  --accent:        #0F6E56;
  --accent-dark:   #0a5240;
  --accent-light:  rgba(15, 110, 86, 0.08);
  --accent-border: rgba(15, 110, 86, 0.25);
  --text:          #2c2c2c;
  --text-sub:      #6b6b6b;
  --card:          #ffffff;
  --border:        #e0ddd5;
  --tab-h:         62px;
  --header-h:      68px;
  --serif: 'Yu Mincho', '游明朝', 'YuMincho', 'Hiragino Mincho ProN',
           'HGS明朝E', Georgia, 'Times New Roman', serif;
  --sans:  -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --radius:  12px;
  --radius-s: 8px;
  --shadow:  0 2px 12px rgba(0, 0, 0, 0.07);
  --shadow-up: 0 4px 20px rgba(0, 0, 0, 0.11);
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Site Header ───────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--accent);
  color: #fff;
  z-index: 200;
  display: flex;
  align-items: center;
  padding: 0 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.site-title {
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  line-height: 1.2;
}

.site-subtitle {
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  opacity: 0.65;
  font-family: var(--sans);
  margin-top: 3px;
}

/* ── Main Scroll Area ──────────────────────── */
#app {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  bottom: var(--tab-h);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.tab-panel {
  padding: 20px 16px 28px;
  max-width: 640px;
  margin: 0 auto;
}

/* ── Bottom Tab Bar ────────────────────────── */
#tab-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--tab-h);
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-sub);
  font-family: var(--sans);
  transition: color 0.18s ease;
  padding: 6px 4px;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.tab-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.tab-btn.active {
  color: var(--accent);
}

.tab-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-icon svg {
  width: 100%;
  height: 100%;
}

.tab-label {
  font-size: 0.6rem;
  letter-spacing: 0.04em;
  line-height: 1;
}

/* ── Section Headings ──────────────────────── */
.section-title {
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--accent);
  border-bottom: 1px solid var(--accent-border);
  padding-bottom: 7px;
  margin-bottom: 18px;
}

/* ── Buttons ───────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  transition: all 0.18s ease;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}

.btn:disabled {
  cursor: default;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(15, 110, 86, 0.35);
}

.btn-primary:hover:not(:disabled),
.btn-primary:active:not(:disabled) {
  background: var(--accent-dark);
  box-shadow: 0 4px 14px rgba(15, 110, 86, 0.4);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

.btn-outline:hover:not(:disabled),
.btn-outline:active:not(:disabled) {
  background: var(--accent-light);
}

/* ───────────────────────────────────────────
   TAB 1: 村上RADIO
─────────────────────────────────────────── */

/* Countdown */
.countdown-block {
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  padding: 22px 16px 18px;
  text-align: center;
  margin-bottom: 18px;
  box-shadow: 0 4px 16px rgba(15, 110, 86, 0.3);
}

.countdown-label {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  opacity: 0.8;
  margin-bottom: 14px;
  font-family: var(--sans);
}

.countdown-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 14px;
}

.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 56px;
}

.countdown-num {
  font-size: 2.2rem;
  font-weight: 700;
  font-family: var(--sans);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.countdown-unit-label {
  font-size: 0.62rem;
  opacity: 0.72;
  letter-spacing: 0.08em;
  margin-top: 5px;
  font-family: var(--sans);
}

.countdown-sep {
  font-size: 1.8rem;
  font-weight: 300;
  opacity: 0.4;
  padding-bottom: 14px;
  user-select: none;
}

.countdown-date-line {
  font-size: 0.78rem;
  opacity: 0.8;
  font-family: var(--sans);
  letter-spacing: 0.05em;
}

/* Notification */
.notification-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
}

.notif-hint {
  font-size: 0.72rem;
  color: var(--text-sub);
  font-family: var(--sans);
}

/* Episode List */
.episode-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 13px 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.episode-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-family: var(--sans);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: -0.03em;
}

.episode-info {
  flex: 1;
  min-width: 0;
}

.episode-theme {
  font-size: 0.92rem;
  line-height: 1.35;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.episode-date {
  font-size: 0.72rem;
  color: var(--text-sub);
  font-family: var(--sans);
}

/* ── 見逃し配信 ─────────────────────────── */
.stream-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

.stream-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow 0.18s, transform 0.18s;
}

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

.stream-card-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}

.audee-logo {
  background: #ff6b00;
  color: #fff;
}

.tfm-logo {
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
}

.radiko-logo {
  background: #0080ff;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
}

.next-broadcast-block {
  text-align: center;
  padding: 2rem 1rem 1.5rem;
}

.next-broadcast-label {
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.next-broadcast-date {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

.stream-card-body {
  flex: 1;
  min-width: 0;
}

.stream-card-name {
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--sans);
  margin-bottom: 2px;
}

.stream-card-desc {
  font-size: 0.75rem;
  color: var(--text-sub);
  font-family: var(--sans);
}

.stream-card-arrow {
  font-size: 1.4rem;
  color: var(--text-sub);
  flex-shrink: 0;
}

/* ───────────────────────────────────────────
   TAB 2: 曲リスト
─────────────────────────────────────────── */
.select-wrap {
  position: relative;
  margin-bottom: 20px;
}

.episode-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 44px 13px 16px;
  font-family: var(--serif);
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
  outline: none;
  transition: border-color 0.18s;
}

.episode-select:focus {
  border-color: var(--accent);
}

.select-chevron {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-sub);
  font-size: 0.75rem;
}

.episode-description {
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--text);
}

.songs-count {
  font-size: 0.78rem;
  color: var(--text-sub);
  font-family: var(--sans);
  margin-bottom: 14px;
}

.song-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 10px;
}

.song-num {
  font-size: 0.65rem;
  color: var(--accent);
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 1px;
}

.song-title {
  font-size: 0.97rem;
  line-height: 1.4;
  margin-bottom: 2px;
}

.song-artist {
  font-size: 0.78rem;
  color: var(--text-sub);
  font-family: var(--sans);
  margin-bottom: 10px;
}

.song-links {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.spotify-section {
  margin-bottom: 24px;
}
.spotify-label {
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin: 0 0 8px 4px;
}

.btn-spotify {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 13px;
  background: #1DB954;
  color: #fff;
  border-radius: 50px;
  font-size: 0.72rem;
  font-family: var(--sans);
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.18s;
  letter-spacing: 0.03em;
}

.btn-apple {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 13px;
  background: #fc3c44;
  color: #fff;
  border-radius: 50px;
  font-size: 0.72rem;
  font-family: var(--sans);
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.18s;
  letter-spacing: 0.03em;
}

.btn-spotify:hover, .btn-apple:hover { opacity: 0.82; }

/* ───────────────────────────────────────────
   TAB 3: 著書一覧
─────────────────────────────────────────── */

/* Filter bar */
.filter-bar {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.filter-btn {
  padding: 5px 13px;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--text-sub);
  font-family: var(--sans);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.18s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.filter-btn:hover:not(.active) {
  border-color: var(--accent);
  color: var(--accent);
}

.books-count {
  font-size: 0.75rem;
  color: var(--text-sub);
  font-family: var(--sans);
  margin-bottom: 14px;
}

.book-year-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
}

.book-category {
  font-size: 0.62rem;
  color: var(--text-sub);
  font-family: var(--sans);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
}

.book-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.book-card:hover {
  box-shadow: var(--shadow-up);
}

.book-header {
  display: flex;
  gap: 14px;
  padding: 16px 14px 16px 16px;
  align-items: flex-start;
}

.book-spine {
  width: 48px;
  height: 68px;
  border-radius: 3px 6px 6px 3px;
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 6px;
  font-size: 0.55rem;
  color: rgba(255,255,255,0.6);
  font-family: var(--sans);
  font-weight: 600;
  box-shadow: inset -3px 0 6px rgba(0,0,0,0.15);
}

.book-meta {
  flex: 1;
  min-width: 0;
}

.book-title-ja {
  font-size: 1.02rem;
  line-height: 1.4;
  margin-bottom: 2px;
}

.book-title-en {
  font-size: 0.72rem;
  color: var(--text-sub);
  font-family: var(--sans);
  font-style: italic;
  margin-bottom: 5px;
}

.book-year {
  display: inline-block;
  font-size: 0.67rem;
  color: var(--accent);
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--accent-light);
  border-radius: 3px;
  padding: 1px 6px;
}

.book-synopsis {
  font-size: 0.8rem;
  color: var(--text-sub);
  line-height: 1.55;
}

.book-chevron {
  font-size: 0.7rem;
  color: var(--text-sub);
  transition: transform 0.28s ease;
  align-self: center;
  flex-shrink: 0;
  padding: 4px;
}

.book-card.expanded .book-chevron {
  transform: rotate(180deg);
}

/* Accordion */
.book-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, border-top 0s 0.35s;
  border-top: 0px solid var(--border);
}

.book-card.expanded .book-details {
  max-height: 900px;
  border-top: 1px solid var(--border);
  transition: max-height 0.35s ease;
}

.book-details-inner {
  padding: 16px;
}

.detail-heading {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-family: var(--sans);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 8px;
  margin-top: 18px;
}

.detail-heading:first-child {
  margin-top: 0;
}

.detail-song-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.detail-song-row:last-child {
  border-bottom: none;
}

.detail-song-text {
  flex: 1;
  min-width: 0;
}

.detail-song-title {
  font-size: 0.83rem;
  line-height: 1.35;
}

.detail-song-artist {
  font-size: 0.7rem;
  color: var(--text-sub);
  font-family: var(--sans);
}

.detail-song-links {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.68rem;
  font-family: var(--sans);
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.18s;
  flex-shrink: 0;
}

.btn-icon:hover { opacity: 0.82; }
.btn-icon.spotify { background: #1DB954; color: #fff; }
.btn-icon.apple   { background: #fc3c44; color: #fff; }

.detail-book-item {
  font-size: 0.8rem;
  color: var(--text-sub);
  padding: 5px 0 5px 14px;
  position: relative;
  line-height: 1.45;
  border-bottom: 1px solid var(--border);
}

.detail-book-item:last-child {
  border-bottom: none;
}

.detail-book-item::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.7rem;
  top: 6px;
}

/* ───────────────────────────────────────────
   TAB 4: 最新情報
─────────────────────────────────────────── */
.news-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow 0.2s, transform 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.news-card:hover {
  box-shadow: var(--shadow-up);
  transform: translateY(-1px);
}

.news-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.news-card-body {
  flex: 1;
  min-width: 0;
}

.news-card-title {
  font-size: 0.95rem;
  margin-bottom: 3px;
  line-height: 1.35;
}

.news-card-desc {
  font-size: 0.76rem;
  color: var(--text-sub);
  font-family: var(--sans);
  line-height: 1.45;
}

.news-card-arrow {
  color: var(--text-sub);
  font-size: 1rem;
  flex-shrink: 0;
}

.search-wrap {
  text-align: center;
  padding-top: 8px;
}

/* ───────────────────────────────────────────
   Utility / Empty States
─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-sub);
  font-size: 0.88rem;
  font-family: var(--sans);
}

/* ───────────────────────────────────────────
   Responsive: Tablet & Desktop
─────────────────────────────────────────── */
@media (min-width: 480px) {
  .countdown-num  { font-size: 2.6rem; }
  .countdown-unit { min-width: 64px; }
  .site-title     { font-size: 1.35rem; }
}

@media (min-width: 640px) {
  .tab-panel { padding: 28px 24px 36px; }

  .episode-theme {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  #tab-bar { padding-bottom: 0; }
}

@media (min-width: 768px) {
  :root { --header-h: 74px; --tab-h: 66px; }

  .tab-label { font-size: 0.65rem; }
  .site-title { font-size: 1.45rem; }
}
