.candle-ritual {
  --candle-progress: 0;
  --candle-sound: 0;
  position: relative;
  width: min(100%, 420px);
  margin-inline: auto;
  color: #fff9ec;
  text-align: center;
  font-family: inherit;
  font-weight: 400;
  line-height: 1.8;
  text-shadow: 0 1px 5px #23170ec2;
}

.candle-ritual *,
.candle-ritual *::before,
.candle-ritual *::after { box-sizing: border-box; }

.candle-heading {
  margin: 0;
  color: inherit;
  font-family: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(17px, 3vw, 20px);
  font-weight: 400;
  line-height: 1.9;
  letter-spacing: .1em;
  text-wrap: balance;
  transition: opacity 900ms ease;
}
.candle-heading:focus { outline: none; }
.candle-ritual[data-stage="eyes"] .candle-heading { font-size: 16px; letter-spacing: .15em; }
.candle-ritual[data-stage="complete"] .candle-heading { font-size: 15px; letter-spacing: .05em; }
.candle-message-faded .candle-heading { opacity: 0; }

.candle-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  column-gap: 22px;
  margin: 5px auto 0;
}
.candle-controls:empty { display: none; }
.candle-ritual[data-stage="blowing"] .candle-controls { flex-direction: column; gap: 0; }
.candle-ritual button {
  appearance: none;
  position: relative;
  min-height: 44px;
  padding: 7px 10px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: inherit;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.8;
  letter-spacing: .08em;
  text-shadow: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color .25s ease, opacity .25s ease;
}
.candle-ritual button:hover { color: #fff; text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.candle-ritual button:focus-visible { outline: 1px solid #fff6dd; outline-offset: 2px; }
.candle-ritual .candle-secondary-button { opacity: .75; }
.candle-ritual .candle-mic-button { font-size: 11px; opacity: .72; letter-spacing: .06em; }
.candle-ritual .candle-restart-button { font-size: 12px; opacity: .8; }
.candle-ritual .candle-hold-button { min-width: 150px; touch-action: none; user-select: none; -webkit-user-select: none; }
.candle-is-holding .candle-hold-button { opacity: calc(.7 + var(--candle-progress) * .3); }
.candle-mic-active .candle-mic-button { opacity: calc(.72 + var(--candle-sound) * .28); }

.candle-status {
  max-width: 300px;
  margin: 4px auto 0;
  color: #f5ebd8;
  font-size: 11px;
  line-height: 1.8;
  letter-spacing: .025em;
}
.candle-status:empty { display: none; }
.candle-progress {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 480px) {
  .candle-heading { font-size: 17px; }
  .candle-ritual[data-stage="complete"] .candle-heading { font-size: 13px; }
  .candle-controls { margin-top: 2px; column-gap: 15px; }
  .candle-ritual button { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .candle-ritual *, .candle-ritual *::before, .candle-ritual *::after { animation: none !important; transition: none !important; }
}
