:root {
  --ink: #100e0c;
  --panel: #1c1814;
  --line: #3c342c;
  --cream: #f4eadc;
  --muted: #a89880;
  --amber: #e4a04a;
  --rec: #d4564a;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--ink);
  color: var(--cream);
  font-family: Outfit, ui-sans-serif, system-ui, sans-serif;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: 0.6; cursor: default; }

.stage, .scrim { position: fixed; inset: 0; }
.stage {
  background: #100e0c center / cover no-repeat;
  transform: scale(1.04);
}
.scrim {
  background: linear-gradient(180deg, rgb(16 14 12 / 72%), rgb(16 14 12 / 88%) 42%, rgb(16 14 12 / 94%));
}

.app {
  position: relative;
  z-index: 1;
  max-width: 32rem;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 1.25rem 1.25rem 2rem;
  display: flex;
  flex-direction: column;
}

.top, .row, .modes { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.brand { font-family: Fraunces, Georgia, serif; font-size: 1.9rem; line-height: 1; margin: 0; }
.muted { color: var(--muted); }
.tiny { font-size: 0.8rem; }
h1, h2 { font-family: Fraunces, Georgia, serif; font-weight: 560; }
h1 {
  font-size: clamp(2.7rem, 12vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  text-wrap: balance;
  margin: 1.4rem 0 0.6rem;
  text-align: center;
}
h1.prompt { font-family: Outfit, sans-serif; font-size: 1.15rem; font-weight: 400; color: var(--muted); letter-spacing: 0; }
h2 { font-size: 2rem; margin: 1.5rem 0 1rem; }

.tabs { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 0.2rem; }
.tabs button, .modes button, .ghost, .mini {
  min-height: 2.75rem;
  border-radius: 999px;
  border: 0;
  background: transparent;
  padding: 0 1rem;
}
.tabs button.on, .modes button.on { background: var(--cream); color: var(--ink); }
.modes { margin: 0.8rem 0; }
.modes button { flex: 1; border: 1px solid var(--line); }
.modes button.on { border-color: transparent; }

#view-train { display: flex; flex-direction: column; flex: 1; }
.hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 1.5rem 0; }
.ring-wrap { position: relative; width: 7rem; height: 7rem; display: grid; place-items: center; }
.ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--line); stroke-width: 3; }
.ring-value { fill: none; stroke: var(--amber); stroke-width: 3; stroke-linecap: round; }
#count { font-family: Fraunces, Georgia, serif; font-size: 1.4rem; }
.note { color: var(--amber); font-size: 0.92rem; }

.sheet {
  border-radius: 1.25rem;
  background: rgb(28 24 20 / 94%);
  border: 1px solid var(--line);
  padding: 1rem;
}
.slider-label, .field { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.92rem; }
.slider-label { flex-direction: row; justify-content: space-between; }
input[type="range"] { width: 100%; accent-color: var(--amber); height: 2.75rem; }
.field input, .take input {
  min-height: 2.75rem;
  width: 100%;
  border-radius: 0.8rem;
  border: 1px solid var(--line);
  background: var(--ink);
  padding: 0 0.8rem;
}
.take input { background: transparent; border: 0; padding: 0; min-height: 2rem; font-size: 1rem; }
.go, .mini.primary {
  width: 100%;
  min-height: 3.5rem;
  margin-top: 1rem;
  border: 0;
  border-radius: 999px;
  background: var(--amber);
  color: var(--ink);
  font-weight: 600;
}
.go.stop { background: var(--rec); color: var(--cream); }
.ghost { width: 100%; margin-top: 0.6rem; border: 1px solid var(--line); }
.status { min-height: 1.2rem; font-size: 0.92rem; }
#rec-label.live { color: var(--rec); }
#player, audio { width: 100%; margin-top: 0.6rem; }
#list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.take { border-radius: 1.25rem; background: rgb(28 24 20 / 94%); border: 1px solid var(--line); padding: 1rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.7rem; }
.mini { border: 1px solid var(--line); }
.mini.primary { width: auto; min-height: 2.75rem; margin: 0; }
.mini.danger { background: var(--rec); border: 0; }

.guide {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  background: rgb(16 14 12 / 82%);
}
.guide[hidden] { display: none; }
.guide-card { max-width: 32rem; max-height: 86dvh; overflow: auto; }
.guide-card p, .guide-card li { color: var(--muted); font-size: 0.95rem; line-height: 1.5; }
.guide-card ul { padding-left: 1.1rem; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.bunny {
  display: block;
  width: min(14rem, 64vw);
  margin: 0.4rem auto 0.2rem;
  aspect-ratio: 3 / 4;
  max-height: 14rem;
  border-radius: 1.35rem;
  object-fit: cover;
  object-position: center 12%;
  background: #1c1814;
}
.bunny.is-back {
  position: absolute;
  top: 0.2rem;
  left: 50%;
  z-index: 0;
  width: min(16rem, 72vw);
  max-height: 17rem;
  margin: 0;
  transform: translateX(-50%);
  opacity: 0.78;
  pointer-events: none;
}
.bunny.is-guide { width: min(10.5rem, 44vw); max-height: 9rem; }
.tap-info {
  position: relative;
  z-index: 1;
  margin: 0.8rem 0 0;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  background: rgb(28 24 20 / 92%);
  text-align: center;
  font-size: 0.92rem;
}
.center { text-align: center; margin: 0.75rem 0 0.2rem; }
.go.folder { background: var(--cream); color: var(--ink); margin-bottom: 0.9rem; }
#live { position: relative; min-height: 78vh; display: flex; flex-direction: column; gap: 0.75rem; }
#live[hidden], #setup[hidden] { display: none; }
.live-card {
  position: relative;
  z-index: 1;
  margin-top: 8.5rem;
  width: 100%;
  min-height: 15rem;
  border: 0;
  border-radius: 1.4rem;
  background: rgb(28 24 20 / 90%);
  color: var(--cream);
  padding: 1.6rem 1rem 1.4rem;
  text-align: center;
}
.live-card span { display: block; color: var(--muted); font-variant-numeric: tabular-nums; margin-bottom: 0.8rem; }
#live .tap-info, #live .go, #live .note, #live .status { position: relative; z-index: 1; }
#live h1 { margin: 0; }
@media (prefers-reduced-motion: reduce) { .word-in { animation: none; } }
