:root {
  --bg: #fdf9f2;
  --card: #ffffff;
  --ink: #2e2a26;
  --muted: #8a8074;
  --accent: #b5563c;
  --accent-soft: #f2ddd3;
  --good: #5b8a72;
  --border: #e8ddd0;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  display: flex;
  justify-content: center;
  padding: 24px 16px;
}
.wrap { width: 100%; max-width: 560px; }
h1 { font-size: 1.4rem; margin: 0 0 4px; text-align: center; }
.subtitle { text-align: center; color: var(--muted); font-size: 0.9rem; margin-bottom: 20px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 6px; color: var(--muted); }
textarea {
  width: 100%;
  min-height: 200px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  background: #fffdf9;
  line-height: 1.5;
}
.row { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
button {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: transform 0.05s ease;
}
button:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: white; }
.btn-secondary { background: var(--accent-soft); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-danger { background: transparent; color: var(--accent); border: 1px solid var(--accent-soft); }
.section-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 14px;
  background: var(--accent-soft);
  color: var(--accent);
}
.section-tag.recap { background: #e4efe8; color: var(--good); }
.phrase-card {
  background: var(--card);
  border: 2px solid var(--accent);
  border-radius: 16px;
  padding: 32px 20px;
  text-align: center;
  font-size: 1.5rem;
  line-height: 1.6;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  white-space: pre-line;
}
.phrase-card.recap { font-size: 1.2rem; border-color: var(--good); }
.progress-dots { display: flex; justify-content: center; gap: 6px; margin: 14px 0; flex-wrap: wrap; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.dot.done { background: var(--good); }
.dot.current { background: var(--accent); }
.nav-row { display: flex; gap: 10px; justify-content: center; margin-top: 10px; }
.hint { text-align: center; color: var(--muted); font-size: 0.8rem; margin-top: 8px; }
.done-banner {
  text-align: center; padding: 24px; background: #e4efe8;
  border-radius: 14px; color: var(--good); font-weight: 700; display: none;
}
.example { font-size: 0.8rem; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.song-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.song-item-title { font-weight: 600; margin-bottom: 10px; }
.song-item-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.song-item-actions button { padding: 8px 14px; font-size: 0.85rem; }
.empty-state { text-align: center; color: var(--muted); font-size: 0.9rem; padding: 20px; }

/* Large screens / TV display — every size below is clamp()'d against
   min(vw, vh) so it scales with whichever dimension is tighter. A wide
   4K TV and a wide-but-short tablet in landscape both hit this query;
   without the vh half of the min(), the tablet case overflows vertically
   and forces a scrollbar instead of shrinking to fit. */
@media (min-width: 900px) {
  body { padding: clamp(16px, 2vh, 40px) 40px; }
  .wrap { max-width: min(1600px, 92vw); }
  h1 { font-size: clamp(1.6rem, min(3vw, 3.2vh), 3.4rem); }
  .subtitle { font-size: clamp(1rem, min(1.4vw, 1.6vh), 1.7rem); margin-bottom: clamp(10px, 2vh, 28px); }
  .card { padding: clamp(16px, min(3vw, 2.5vh), 48px); border-radius: 24px; }
  .section-tag { font-size: clamp(1rem, min(1.6vw, 2vh), 1.9rem); padding: clamp(6px, 1vh, 10px) 24px; margin-bottom: clamp(10px, 1.8vh, 24px); }
  .phrase-card {
    font-size: clamp(2.6rem, min(7vw, 8vh), 9rem);
    padding: clamp(20px, min(8vw, 4vh), 120px) clamp(30px, 4vw, 60px);
    min-height: clamp(140px, 22vh, 420px);
    border-radius: 28px;
    border-width: 4px;
  }
  .phrase-card.recap { font-size: clamp(1.8rem, min(5vw, 6vh), 6.5rem); }
  .progress-dots { margin: clamp(10px, 1.8vh, 26px) 0; gap: 12px; }
  .dot { width: 16px; height: 16px; }
  .nav-row { margin-top: clamp(10px, 1.6vh, 22px); gap: 20px; }
  button { font-size: clamp(1rem, min(1.6vw, 1.8vh), 1.7rem); padding: clamp(10px, 1.6vh, 18px) 34px; border-radius: 14px; }
  .hint { font-size: clamp(0.9rem, min(1.2vw, 1.3vh), 1.35rem); margin-top: clamp(8px, 1.2vh, 16px); }
  .done-banner { font-size: clamp(1.2rem, 2vw, 2.1rem); padding: clamp(20px, 3vh, 40px); }
  .song-item { padding: 18px 22px; }
  .song-item-title { font-size: 1.2rem; margin-bottom: 14px; }
  .song-item-actions button { padding: 12px 20px; font-size: 1rem; }
}
