:root {
  --color-bg: #f4f6f5;
  --color-surface: #ffffff;
  --color-primary: #0f6e5c;
  --color-primary-dark: #0a5648;
  --color-accent: #2e8b6f;
  --color-text: #1c2723;
  --color-text-muted: #5b6b64;
  --color-border: #dbe4e0;
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  background: var(--color-primary);
  color: #fff;
}

.brand {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.home-button {
  font-size: 1.05rem;
  padding: 12px 24px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.home-button:active {
  background: rgba(255, 255, 255, 0.15);
}

.app-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.loading {
  text-align: center;
  font-size: 1.2rem;
  color: var(--color-text-muted);
  margin-top: 60px;
}

.error {
  text-align: center;
  font-size: 1.1rem;
  color: #a33;
  margin-top: 60px;
  line-height: 1.8;
}

/* ホーム画面: 展示カード */
.station-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
  margin-top: 16px;
}

.station-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(15, 110, 92, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.station-card:active {
  transform: scale(0.98);
  box-shadow: 0 1px 4px rgba(15, 110, 92, 0.1);
}

.station-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.station-card h2 {
  margin: 0 0 6px;
  font-size: 1.5rem;
}

.station-card p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 1.05rem;
}

.station-card .chapter-count {
  margin-top: 18px;
  font-size: 0.95rem;
  color: var(--color-accent);
  font-weight: 600;
}

/* 展示詳細画面 */
.station-title {
  font-size: 1.9rem;
  margin: 0 0 4px;
}

.station-subtitle {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  margin: 0 0 24px;
}

.play-all-button {
  width: 100%;
  padding: 22px;
  font-size: 1.3rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  background: var(--color-primary);
  color: #fff;
  cursor: pointer;
  margin-bottom: 28px;
}

.play-all-button:active {
  background: var(--color-primary-dark);
}

.chapter-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chapter-button {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  padding: 20px 22px;
  border-radius: 16px;
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  text-align: left;
  font-size: 1.15rem;
}

.chapter-button .chapter-icon {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--color-accent);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
}

.chapter-button .chapter-heading {
  flex: 1;
  font-weight: 600;
}

.chapter-button .chapter-status {
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.chapter-button.playing {
  border-color: var(--color-primary);
  background: #eaf5f1;
}

.chapter-button.playing .chapter-icon {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.chapter-button.played .chapter-icon {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

.chapter-button.unavailable {
  opacity: 0.5;
}

.chapter-script {
  margin: 10px 0 0;
  font-size: 1rem;
  line-height: 1.9;
  color: var(--color-text-muted);
  display: none;
}

.chapter-button.playing + .chapter-script,
.chapter-item.expanded .chapter-script {
  display: block;
}

.chapter-item {
  display: flex;
  flex-direction: column;
}

/* プレイヤーバー */
.player-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-primary-dark);
  color: #fff;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.15);
}

.player-bar[hidden] {
  display: none;
}

.player-bar .player-label {
  flex: none;
  font-size: 1rem;
  font-weight: 600;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-bar .player-progress {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  overflow: hidden;
}

.player-bar .player-progress-fill {
  height: 100%;
  width: 0%;
  background: #fff;
}

.player-bar button {
  flex: none;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 999px;
  width: 52px;
  height: 52px;
  font-size: 1.3rem;
  cursor: pointer;
}

.player-bar button:active {
  background: rgba(255, 255, 255, 0.3);
}
