html[data-style="ivory"] {
  --wax-top: #fffaf0;
  --wax: #f0e2c8;
  --wax-deep: #c9b28a;
  --flame-outer: #ff9a3c;
  --flame-mid: #ffd27a;
  --flame-core: #fff6df;
  --glow: rgba(255, 196, 120, 0.45);
  --accent: #e6d3a3;
}

html[data-style="deep-red"] {
  --wax-top: #8a1a22;
  --wax: #4f0404;
  --wax-deep: #2a0203;
  --flame-outer: #ff4d2e;
  --flame-mid: #ffb15a;
  --flame-core: #fff1d2;
  --glow: rgba(255, 90, 50, 0.5);
  --accent: #ee1f30;
}

html[data-style="sage"] {
  --wax-top: #e4f0e1;
  --wax: #9aaf96;
  --wax-deep: #5e735c;
  --flame-outer: #f0b45a;
  --flame-mid: #ffe0a0;
  --flame-core: #fff8ea;
  --glow: rgba(232, 196, 120, 0.42);
  --accent: #9cba96;
}

html[data-style="midnight"] {
  --wax-top: #2c3a62;
  --wax: #141a2e;
  --wax-deep: #070910;
  --flame-outer: #3d8fd6;
  --flame-mid: #b9e3ff;
  --flame-core: #ffffff;
  --glow: rgba(140, 200, 255, 0.42);
  --accent: #1ba39c;
}

.page-candle h1 {
  font-family: Arvo, Georgia, serif;
  font-weight: 400;
  font-size: 42px;
  letter-spacing: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ritual {
  margin-top: 8px;
  padding: 28px 28px 22px;
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid #333;
  border-top: 2px solid var(--accent);
  border-radius: 12px;
}

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 12px;
}

.candle {
  position: relative;
  width: 180px;
  height: 250px;
}

.glow {
  position: absolute;
  left: 50%;
  top: 18px;
  width: 150px;
  height: 150px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow) 0%, transparent 68%);
  opacity: 0;
  pointer-events: none;
}

.flame {
  position: absolute;
  left: 50%;
  top: 28px;
  width: 46px;
  height: 78px;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
}

.flame i {
  position: absolute;
  left: 50%;
  bottom: 0;
  display: block;
  border-radius: 50% 50% 46% 46%;
  transform: translateX(-50%);
  transform-origin: center bottom;
}

.flame i:nth-child(1) {
  width: 46px;
  height: 78px;
  background: radial-gradient(ellipse at 50% 78%, var(--flame-outer), transparent 72%);
  animation: flick 1.15s ease-in-out infinite;
}

.flame i:nth-child(2) {
  width: 26px;
  height: 58px;
  background: radial-gradient(ellipse at 50% 80%, var(--flame-mid), transparent 70%);
  animation: flick 0.9s ease-in-out infinite reverse;
}

.flame i:nth-child(3) {
  width: 12px;
  height: 36px;
  background: radial-gradient(ellipse at 50% 80%, var(--flame-core), transparent 68%);
  animation: flick 0.7s ease-in-out infinite;
}

.wick {
  position: absolute;
  left: 50%;
  top: 104px;
  width: 3px;
  height: 18px;
  transform: translateX(-50%);
  background: #2a2118;
  border-radius: 2px;
  z-index: 2;
}

.wax {
  position: absolute;
  left: 50%;
  top: 118px;
  width: 84px;
  height: 124px;
  transform: translateX(-50%);
  border-radius: 8px 8px 18px 18px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.38), transparent 26%, rgba(255, 255, 255, 0.16) 48%, transparent 72%, rgba(0, 0, 0, 0.45)),
    linear-gradient(180deg, var(--wax-top), var(--wax) 28%, var(--wax-deep));
  box-shadow: inset 0 -16px 20px rgba(0, 0, 0, 0.35), 0 18px 28px rgba(0, 0, 0, 0.45);
}

.pool {
  position: absolute;
  left: 8px;
  right: 8px;
  top: -7px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, var(--wax-top), var(--wax) 72%);
}

.candle.is-lit .flame,
.candle.is-lit .glow {
  opacity: 1;
}

.candle.is-lit .wick {
  background: #1a100c;
  box-shadow: 0 -6px 10px var(--flame-mid);
}

.candle.is-snuffing .flame,
.candle.is-snuffing .glow {
  animation: snuff 1.4s ease forwards;
}

.remain {
  margin: 8px 0 0;
  text-align: center;
  color: #c8c8c8;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.remain strong {
  display: block;
  margin-top: 4px;
  color: #f4f4f4;
  font-family: Arvo, Georgia, serif;
  font-size: 44px;
  font-weight: 400;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  text-transform: none;
}

.choices,
.actions,
.sound {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.choice,
.btn-ghost,
.sound select {
  appearance: none;
  background: #0c0c0c;
  color: #f2f2f2;
  border: 1px solid #333;
  border-top: 2px solid transparent;
  border-radius: 8px;
  font-family: "Open Sans", Calibri, sans-serif;
  font-size: 14px;
  letter-spacing: 0.04em;
  padding: 10px 14px;
  cursor: pointer;
}

.choice[aria-pressed="true"],
.choice:hover,
.btn-ghost:hover,
.sound select:hover {
  background: #111;
  border-top-color: var(--accent);
  color: #1ba39c;
}

.choice:disabled,
.btn-ghost:disabled,
.btn-light:disabled {
  opacity: 0.45;
  cursor: default;
}

.btn-light {
  appearance: none;
  min-width: 180px;
  height: 54px;
  padding: 0 18px;
  border: 1px solid #000;
  border-radius: 10px;
  background: #4f0404;
  color: #fff;
  font-family: "28DaysLater", sans-serif;
  font-size: 28px;
  letter-spacing: 0.5px;
  cursor: pointer;
}

.btn-light:hover {
  background: #6d0808;
  color: #fff;
}

.sound label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a6a8a8;
}

.sound input[type="range"] {
  width: 140px;
  accent-color: #ee1f30;
}

.mantra {
  margin-top: 22px;
  padding-top: 8px;
  text-align: center;
}

.call-line {
  margin: 0 0 8px;
  color: #f3efe6;
  font-family: Arvo, Georgia, serif;
  font-style: italic;
  font-size: 22px;
  line-height: 1.45;
}

.disclaimer {
  margin: 22px 0 0;
  color: #c8c8c8;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

.disclaimer strong {
  color: #f4d03f;
  font-weight: 600;
}

.noscript {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto 32px;
}

@keyframes flick {
  0%, 100% { transform: translateX(-50%) scaleY(1) rotate(-1deg); }
  35% { transform: translateX(-50%) scaleY(1.06) rotate(1.4deg); }
  70% { transform: translateX(-50%) scaleY(0.94) rotate(-1.2deg); }
}

@keyframes snuff {
  to {
    opacity: 0;
    transform: translateX(-50%) scale(0.45) translateY(10px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .flame i,
  .glow,
  .candle.is-snuffing .flame,
  .candle.is-snuffing .glow {
    animation: none;
  }

  .candle.is-snuffing .flame,
  .candle.is-snuffing .glow {
    opacity: 0;
  }
}

@media (max-width: 700px) {
  .page-candle h1 { font-size: 32px; }
  .ritual { padding: 16px 14px 18px; }
  .remain strong { font-size: 36px; }
  .call-line { font-size: 18px; }
  .btn-light { width: 100%; }
  .actions .btn-ghost { flex: 1 1 140px; }
}
