:root {
  --bg: #f2eadf;
  --bg-deep: #d9cab6;
  --paper: rgba(255, 250, 243, 0.82);
  --paper-strong: rgba(255, 248, 239, 0.94);
  --ink: #352b24;
  --muted: #75675d;
  --line: rgba(79, 59, 44, 0.12);
  --accent: #b06c45;
  --accent-soft: #d8a27e;
  --shadow: 0 22px 60px rgba(86, 55, 29, 0.12);
  --radius: 28px;
  --serif: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "STSong", serif;
  --sans: "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.4), transparent 35%),
    radial-gradient(circle at 80% 15%, rgba(227, 197, 174, 0.45), transparent 25%),
    linear-gradient(135deg, #efe4d7 0%, var(--bg) 45%, var(--bg-deep) 100%);
  overflow-x: hidden;
}

.ambient {
  position: fixed;
  width: 38vw;
  height: 38vw;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.45;
  pointer-events: none;
}

.ambient-left {
  top: -10vw;
  left: -12vw;
  background: rgba(255, 240, 221, 0.75);
}

.ambient-right {
  right: -10vw;
  bottom: -12vw;
  background: rgba(195, 157, 130, 0.28);
}

.app-shell {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 20px 56px;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  padding: 28px 30px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.hero h1,
.panel h2,
.stage h2,
.notes h2,
.notes h3 {
  font-family: var(--serif);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.08;
  max-width: 12ch;
}

.hero-copy {
  max-width: 760px;
  line-height: 1.75;
  color: var(--muted);
  margin: 18px 0 0;
}

.source-link {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.source-link a,
.notes-head a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(176, 108, 69, 0.28);
}

.source-link a:hover,
.notes-head a:hover {
  border-bottom-color: currentColor;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.hero-points span,
.status-label,
.stage-label {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-points span {
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(176, 108, 69, 0.12);
  color: #8e5435;
}

.control-grid {
  display: grid;
  grid-template-columns: minmax(320px, 380px) 1fr;
  gap: 20px;
}

.panel,
.stage,
.notes {
  padding: 26px;
}

.panel-head p,
.notes-head p,
.prompt-note,
.prompt-subtext,
.voice-hint,
.field span,
.status-label,
.stage-label {
  color: var(--muted);
}

.panel-head p,
.notes-head p {
  margin: 8px 0 0;
  line-height: 1.6;
}

.field {
  display: block;
  margin-top: 18px;
}

.field > span {
  display: block;
  margin-bottom: 8px;
}

.field-inline {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}

.random-range {
  margin-top: 14px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 250, 243, 0.62);
  border: 1px solid rgba(95, 74, 56, 0.08);
}

.range-field + .range-field {
  margin-top: 14px;
}

.range-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

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

select,
button {
  font: inherit;
}

select {
  width: 100%;
  border: 1px solid rgba(95, 74, 56, 0.18);
  background: var(--paper-strong);
  color: var(--ink);
  border-radius: 16px;
  padding: 12px 14px;
  outline: none;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  flex-wrap: wrap;
}

button {
  border: 0;
  border-radius: 16px;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.primary {
  background: linear-gradient(135deg, var(--accent) 0%, #8d5230 100%);
  color: #fff8f1;
}

.secondary {
  background: rgba(176, 108, 69, 0.14);
  color: #8d5230;
}

.ghost {
  background: rgba(69, 48, 34, 0.08);
  color: var(--ink);
}

.voice-hint {
  margin: 14px 0 0;
  font-size: 0.92rem;
  line-height: 1.6;
}

.mobile-tip {
  margin: 10px 0 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--accent);
}

.stage {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 420px;
}

.stage-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.stage h2 {
  margin: 8px 0 0;
  font-size: clamp(2.1rem, 4vw, 4.4rem);
  line-height: 1.05;
}

.timer-wrap {
  flex-shrink: 0;
}

.timer-ring {
  position: relative;
  width: 154px;
  height: 154px;
}

.timer-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-bg,
.timer-progress {
  fill: none;
  stroke-width: 10;
}

.timer-bg {
  stroke: rgba(90, 65, 48, 0.1);
}

.timer-progress {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 0.45s ease;
}

.timer-copy {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.timer-copy strong {
  font-size: 1.4rem;
  font-family: var(--serif);
}

.prompt-card {
  margin-top: 28px;
  padding: 22px 24px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 251, 245, 0.96), rgba(247, 237, 225, 0.88));
  border: 1px solid rgba(95, 74, 56, 0.1);
}

.prompt-note {
  margin: 0;
  font-size: 0.95rem;
}

.prompt-subtext {
  margin: 10px 0 0;
  line-height: 1.7;
  font-size: 1.04rem;
}

.status-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(95, 74, 56, 0.08);
}

.status-row strong {
  display: block;
  margin-top: 8px;
  font-size: 1.08rem;
}

.notes {
  margin-top: 20px;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.notes-grid article {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 250, 243, 0.7);
  border: 1px solid rgba(95, 74, 56, 0.08);
}

.notes-grid h3 {
  margin: 0 0 10px;
  font-size: 1.12rem;
}

.notes-grid p {
  margin: 0;
  line-height: 1.7;
  color: var(--muted);
}

@media (max-width: 920px) {
  .control-grid {
    grid-template-columns: 1fr;
  }

  .notes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 22px 14px 36px;
  }

  .hero,
  .panel,
  .stage,
  .notes {
    padding: 20px;
    border-radius: 24px;
  }

  .stage-top {
    flex-direction: column;
  }

  .timer-wrap {
    align-self: center;
  }

  .notes-grid {
    grid-template-columns: 1fr;
  }

  .actions {
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}
