/* ---------- 共有部品: 再生ボタン・長押しボタン・進捗・トースト・オーバーレイ ---------- */

.listen-button {
  justify-self: start;
  width: min(22vw, 88px);
  height: min(22vw, 88px);
  min-width: 64px;
  min-height: 64px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 24px rgba(39, 50, 72, 0.22);
  cursor: pointer;
}

.listen-button span {
  display: inline-block;
  margin-left: 4px;
  font-size: clamp(1.8rem, 8vw, 3rem);
}

.hold-button {
  justify-self: end;
  width: 72px;
  height: 72px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.58);
  color: rgba(39, 50, 72, 0.42);
  font-size: 1.85rem;
  font-weight: 900;
  cursor: pointer;
}

.hold-button.holding {
  background: rgba(255, 207, 86, 0.86);
  color: var(--ink);
  transform: scale(0.94);
}

.progress-panel {
  display: grid;
  gap: 6px;
  align-content: center;
  min-width: 0;
  pointer-events: none;
}

.mini-stats {
  display: flex;
  gap: 8px;
  justify-content: center;
  min-width: 0;
}

.mini-stats span,
.progress-text {
  color: rgba(39, 50, 72, 0.62);
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.mini-stats b,
.progress-text b {
  color: var(--ink);
  font-size: 1.05rem;
}

.progress-track {
  width: min(240px, 100%);
  height: 9px;
  justify-self: center;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 220ms ease;
}

.back-button {
  min-height: 52px;
  padding: 0 18px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow);
  font-weight: 900;
  cursor: pointer;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 40;
  transform: translate(-50%, 16px);
  min-width: min(420px, calc(100% - 32px));
  padding: 14px 18px;
  border-radius: 8px;
  color: #fff;
  background: rgba(39, 50, 72, 0.92);
  text-align: center;
  font-size: 1.2rem;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- オーバーレイ(保護者パネル・じゅんびちゅう) ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(39, 50, 72, 0.4);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 180ms ease;
}

.overlay[hidden] {
  display: none; /* これが無いと透明なオーバーレイが全クリックを吸ってしまう */
}

.overlay.open {
  opacity: 1;
}

.overlay-card {
  display: grid;
  gap: 14px;
  width: min(460px, 100%);
  max-height: min(86svh, 640px);
  overflow-y: auto;
  padding: 22px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  background: rgba(255, 253, 246, 0.98);
  box-shadow: var(--shadow);
}

.overlay-card h2 {
  margin: 0;
}

.setting-row {
  display: grid;
  grid-template-columns: 5.2rem 1fr auto;
  align-items: center;
  gap: 10px;
}

.setting-row > span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.setting-row input[type="text"] {
  grid-column: 2 / -1;
  min-height: 48px;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

.setting-row input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

#settingChoiceCountLabel {
  min-width: 2.5rem;
  padding: 4px 10px;
  border-radius: 999px;
  text-align: center;
  background: #fff3bd;
}

.setting-check {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 12px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.setting-check input {
  width: 24px;
  height: 24px;
  accent-color: var(--accent);
}

.setting-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.setting-actions button {
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: var(--sun);
  font-weight: 900;
  cursor: pointer;
}

.setting-actions button:last-child {
  background: #e7e9f4;
}

.overlay-close {
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 900;
  cursor: pointer;
}

.soon-card {
  justify-items: center;
  text-align: center;
}

.soon-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.soon-emoji {
  font-size: 3.4rem;
}
