:root {
  --bg: #0c0814;
  --card: rgba(24, 14, 38, 0.86);
  --card-border: rgba(190, 160, 255, 0.22);
  --text: #f1eaff;
  --muted: #b3a6cc;
  --accent: #9d7bff;
  --accent-2: #ffb347;
  --danger: #ff6b81;
  --ghost: #d9c8ff;
  --hunter: #ffd27a;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'Fredoka', system-ui, sans-serif;
  user-select: none;
}

#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}
.small {
  font-size: 13px;
}
.center {
  text-align: center;
}

kbd {
  display: inline-block;
  font-family: inherit;
  font-size: 11px;
  padding: 0 5px;
  margin-left: 3px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--muted);
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.screen,
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 20;
}
.overlay {
  background: rgba(8, 4, 16, 0.35);
  pointer-events: none;
}
.overlay .card {
  pointer-events: auto;
}

/* ---------- Menu ---------- */
.menu-card {
  width: min(400px, 100%);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.logo {
  font-family: 'Creepster', 'Fredoka', cursive;
  font-weight: 400;
  font-size: 64px;
  line-height: 1;
  margin: 0;
  text-align: center;
  letter-spacing: 2px;
  color: #f4efff;
  text-shadow: 0 0 24px rgba(157, 123, 255, 0.8);
}
.logo span {
  color: var(--accent-2);
  text-shadow: 0 0 24px rgba(255, 140, 40, 0.7);
}
.tagline {
  margin: 0 0 6px;
  text-align: center;
  color: var(--muted);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}
input[type='text'],
input:not([type]),
.field input {
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  user-select: text;
}
input:focus {
  border-color: var(--accent);
}
.join-row {
  display: flex;
  gap: 8px;
}
.join-row input {
  flex: 1;
  min-width: 0;
  text-transform: uppercase;
  letter-spacing: 4px;
  text-align: center;
  font-weight: 600;
}
.error {
  color: var(--danger);
  min-height: 1em;
  margin: 0;
  font-size: 14px;
  text-align: center;
}
.howto {
  font-size: 14px;
  color: var(--muted);
}
.howto summary {
  cursor: pointer;
  color: var(--text);
}
.howto p {
  margin: 8px 0;
}

.btn {
  font: inherit;
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 11px 16px;
  cursor: pointer;
  transition: transform 0.08s, background 0.15s;
}
.btn:hover {
  background: rgba(255, 255, 255, 0.14);
}
.btn:active {
  transform: scale(0.97);
}
.btn.primary {
  background: linear-gradient(135deg, #8f6bff, #c86bff);
  border-color: transparent;
  box-shadow: 0 6px 20px rgba(143, 107, 255, 0.4);
}
.btn.primary:hover {
  filter: brightness(1.1);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn.small {
  font-size: 13px;
  padding: 7px 10px;
  border-radius: 9px;
}

/* ---------- Lobby ---------- */
.lobby-card {
  width: min(420px, 100%);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.lobby-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.room-code {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 6px;
  color: var(--accent-2);
}
.player-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 40vh;
  overflow: auto;
}
.player-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
}
.player-list .tag {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- HUD ---------- */
#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}
#hud .card,
#hud button {
  pointer-events: auto;
}
#topbar {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
}
.phase-box {
  text-align: center;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 6px 22px;
  min-width: 170px;
}
#phaseLabel {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
}
#timer {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
#timer.urgent {
  color: var(--danger);
}
.pill {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 7px 14px;
  font-weight: 600;
  white-space: nowrap;
}
.pill:empty {
  display: none;
}
.pill.ghost {
  color: var(--ghost);
}
.pill.hunter {
  color: var(--hunter);
}

.side {
  position: absolute;
  top: 90px;
  width: 230px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 170px);
  overflow: auto;
}
.side.left {
  left: 12px;
}
.side.right {
  right: 12px;
}
.side h3 {
  margin: 0;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
}
.color-row {
  display: flex;
  gap: 10px;
}
.swatch-big {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  cursor: pointer;
  flex: none;
  position: relative;
  overflow: hidden;
  background: #f2f0f7;
}
.swatch-big input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.tool-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.tool-row {
  display: flex;
  gap: 6px;
}
.tool-row .btn {
  flex: 1;
}
.tool {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  border-radius: 9px;
  padding: 6px 8px;
  cursor: pointer;
}
.tool.active {
  background: rgba(157, 123, 255, 0.35);
  border-color: var(--accent);
}
.slider {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  color: var(--muted);
}
.slider input {
  width: 100%;
  accent-color: var(--accent);
}
.swatches {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
}
.swatches button {
  aspect-ratio: 1;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  padding: 0;
}
.swatches button:hover {
  transform: scale(1.1);
}

#crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 26px;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
}
#crosshair::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  margin: -2px;
  border-radius: 50%;
  background: #fff;
}
#cooldownRing {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--accent-2);
  opacity: 0;
}
#cooldownRing.on {
  opacity: 1;
  animation: spin 0.8s linear;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#booBox {
  position: absolute;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}
#booBox .btn {
  font-size: 20px;
  padding: 12px 26px;
}

#blackout {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, #1a1028, #050208);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: auto;
}
.blackout-inner .big {
  font-size: 28px;
  font-weight: 600;
}
.blackout-inner .huge {
  font-size: 72px;
  font-weight: 700;
  margin-top: 10px;
  color: var(--accent-2);
  font-variant-numeric: tabular-nums;
}

#lockPrompt {
  position: absolute;
  left: 50%;
  top: 64%;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 10px 18px;
  font-weight: 600;
}

#banner {
  position: absolute;
  top: 110px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 10px 20px;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
}

#hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  color: var(--muted);
  background: rgba(12, 8, 20, 0.7);
  border-radius: 10px;
  padding: 6px 12px;
  white-space: nowrap;
  max-width: calc(100vw - 32px);
  overflow: hidden;
  text-overflow: ellipsis;
}
#hint:empty {
  display: none;
}

#pickPreview {
  position: fixed;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  transform: translate(14px, -44px);
  z-index: 30;
}

/* ---------- Feed + chat ---------- */
#feed {
  position: fixed;
  top: 80px;
  right: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  z-index: 15;
  pointer-events: none;
}
.feed-item {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 14px;
  animation: feedIn 0.25s ease-out;
}
@keyframes feedIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
}

#chat {
  position: fixed;
  left: 12px;
  bottom: 52px;
  width: min(330px, calc(100vw - 24px));
  z-index: 25;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#chatLog {
  max-height: 160px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  font-size: 14px;
  text-shadow: 0 1px 3px #000;
  pointer-events: none;
}
#chatLog .sys {
  color: var(--muted);
  font-style: italic;
}
#chatLog b {
  color: var(--accent-2);
}
#chatInput {
  font-size: 14px;
  padding: 7px 10px;
  opacity: 0.55;
}
#chatInput:focus {
  opacity: 1;
}
body.hud-tools #chat {
  left: 254px;
}

.icon-btn {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 25;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: var(--card);
  font-size: 18px;
  cursor: pointer;
}

/* ---------- Reveal + scores ---------- */
.reveal-card {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: min(560px, calc(100% - 32px));
  padding: 16px 20px;
  text-align: center;
}
.reveal-card h2,
.scores-card h2 {
  margin: 0 0 4px;
  font-size: 26px;
}
.reveal-card p {
  margin: 0 0 10px;
}
.vote-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.vote-list .btn.voted {
  background: linear-gradient(135deg, #ffb347, #ff7a59);
  border-color: transparent;
}
.scores-card {
  width: min(460px, 100%);
  padding: 22px;
}
#bestHaunt {
  text-align: center;
  color: var(--accent-2);
  font-weight: 600;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
td,
th {
  padding: 7px 8px;
  text-align: left;
}
th {
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
}
tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.04);
}
td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
tr.me td {
  color: var(--accent-2);
}

@media (max-width: 760px) {
  .side {
    width: 190px;
    padding: 10px;
    top: 120px;
  }
  #topbar {
    gap: 6px;
  }
  .phase-box {
    min-width: 120px;
    padding: 4px 12px;
  }
  .pill {
    font-size: 12px;
    padding: 5px 9px;
  }
  .logo {
    font-size: 52px;
  }
}

/* ---------- v2: lobby bar ---------- */
#lobby {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  width: min(760px, calc(100vw - 24px));
}
.lobby-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
}
.lobby-code .room-code {
  font-size: 26px;
  line-height: 1;
}
.lobby-mid {
  flex: 1;
  min-width: 0;
}
.lobby-mid p {
  margin: 4px 0 0;
}
.player-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.player-chips li {
  font-size: 13px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}
.player-chips li.me {
  background: rgba(157, 123, 255, 0.35);
}
.lobby-actions {
  display: flex;
  gap: 6px;
}
body.in-lobby .side {
  top: 110px;
}

.decoy-btn {
  background: linear-gradient(135deg, rgba(255, 179, 71, 0.25), rgba(255, 122, 89, 0.25));
}

/* ---------- v2: juice ---------- */
#vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(5, 2, 12, 0.55) 100%);
}
#heartVignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  opacity: 0;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(200, 20, 50, 0.55) 100%);
}
#bigText {
  position: absolute;
  top: 34%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Creepster', 'Fredoka', cursive;
  font-size: 110px;
  letter-spacing: 3px;
  color: #fff;
  text-shadow: 0 0 30px rgba(157, 123, 255, 0.9), 0 6px 0 rgba(0, 0, 0, 0.4);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
}
#bigText.show {
  animation: bigPop 1s ease-out forwards;
}
#bigText.orange {
  color: var(--accent-2);
  text-shadow: 0 0 30px rgba(255, 140, 40, 0.9), 0 6px 0 rgba(0, 0, 0, 0.4);
}
#bigText.red {
  color: var(--danger);
  text-shadow: 0 0 30px rgba(255, 60, 90, 0.9), 0 6px 0 rgba(0, 0, 0, 0.4);
}
#bigText.cyan {
  color: #7dffe1;
  text-shadow: 0 0 30px rgba(60, 255, 210, 0.9), 0 6px 0 rgba(0, 0, 0, 0.4);
}
@keyframes bigPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2.2);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.95);
  }
  28% {
    transform: translate(-50%, -50%) scale(1);
  }
  75% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.05);
  }
}
#popups {
  position: absolute;
  left: 50%;
  top: 46%;
  pointer-events: none;
}
.popup {
  position: absolute;
  transform: translateX(-50%);
  font-size: 30px;
  font-weight: 700;
  color: #7dffa8;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  animation: popUp 1.3s ease-out forwards;
}
.popup.neg {
  color: var(--danger);
}
@keyframes popUp {
  0% {
    opacity: 0;
    transform: translate(-50%, 10px) scale(0.6);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1.15);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -70px) scale(1);
  }
}
#crosshair.hit {
  border-color: #7dffe1;
  transform: translate(-50%, -50%) scale(1.5) rotate(45deg);
  transition: transform 0.08s;
  box-shadow: 0 0 14px #7dffe1;
}
#crosshair.near {
  border-color: var(--accent-2);
}
#hunterBar {
  position: absolute;
  left: 50%;
  bottom: 54px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
}
#stamina {
  width: 160px;
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  border: 1px solid var(--card-border);
}
#staminaFill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ffb347, #ffe07a);
}
#staminaFill.tired {
  background: var(--danger);
}
#scanBox.ready {
  color: #7dffe1;
  border-color: #7dffe1;
}
#qualityBtn {
  right: 60px;
}

/* ---------- v3: haunting chores ---------- */
#chore {
  position: fixed;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: min(420px, calc(100vw - 32px));
  padding: 14px 16px 16px;
  z-index: 18;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: choreIn 0.25s ease-out;
}
@keyframes choreIn {
  from {
    opacity: 0;
    transform: translate(40px, -50%);
  }
}
#chore.shake {
  animation: choreShake 0.35s;
}
@keyframes choreShake {
  20%, 60% {
    transform: translate(-8px, -50%);
  }
  40%, 80% {
    transform: translate(8px, -50%);
  }
}
.chore-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chore-title {
  font-size: 18px;
  font-weight: 700;
}
.chore-noise span {
  opacity: 0.2;
  font-size: 15px;
}
.chore-noise span.on {
  opacity: 1;
  filter: drop-shadow(0 0 6px #ff6b81);
}
.chore-sub,
.chore-status {
  font-size: 13px;
  color: var(--muted);
}
.chore-status {
  text-align: center;
  color: var(--text);
}
.chore-body {
  position: relative;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
}
.chore-timer {
  height: 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.chore-timer div {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #7dffe1, #9d7bff);
}
.chore-timer div.low {
  background: var(--danger);
}
.chore-msg {
  min-height: 18px;
  text-align: center;
  font-weight: 600;
  color: var(--danger);
  font-size: 14px;
}
.chore-result {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  font-size: 26px;
  font-weight: 700;
  border-radius: var(--radius);
  background: rgba(16, 8, 28, 0.85);
  animation: choreIn 0.2s ease-out;
}
.chore-result.ok {
  color: #7dffa8;
}
.chore-result.bad {
  color: var(--danger);
}
.chore-svg {
  width: 100%;
  touch-action: none;
}
.wire-node {
  cursor: grab;
}
.rune-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 40px;
}
.rune {
  --c: #fff;
  font-size: 40px;
  height: 78px;
  border-radius: 16px;
  border: 2px solid var(--c);
  background: rgba(255, 255, 255, 0.04);
  color: var(--c);
  cursor: pointer;
  transition: all 0.1s;
}
.rune.lit {
  background: var(--c);
  color: #120a1e;
  box-shadow: 0 0 30px var(--c);
  transform: scale(1.05);
}
.needle-bar {
  position: relative;
  height: 54px;
  border-radius: 12px;
  background: linear-gradient(90deg, #3a2416, #5a3520, #3a2416);
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  overflow: hidden;
}
.needle-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(125, 255, 168, 0.45);
  box-shadow: inset 0 0 12px #7dffa8;
}
.needle-mark {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 5px;
  margin-left: -2px;
  background: #fff;
  box-shadow: 0 0 10px #fff;
}
.needle-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
}
.needle-dots span {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
}
.needle-dots span.on {
  background: #7dffa8;
  box-shadow: 0 0 10px #7dffa8;
}
.swipe-track {
  position: relative;
  height: 76px;
  border-radius: 14px;
  background: repeating-linear-gradient(90deg, #241634 0 18px, #2c1c40 18px 36px);
  border: 2px solid rgba(157, 123, 255, 0.5);
  padding: 3px;
  touch-action: none;
}
.swipe-track::after {
  content: '🔒';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 30px;
  opacity: 0.7;
}
.swipe-key {
  width: 66px;
  height: 66px;
  border-radius: 12px;
  background: linear-gradient(135deg, #9d7bff, #c86bff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  cursor: grab;
  touch-action: none;
  position: relative;
  z-index: 1;
}
.potion-wrap {
  display: flex;
  gap: 12px;
  align-items: center;
}
.recipe {
  flex: 1;
  font-size: 14px;
  background: #efe3c4;
  color: #3a2416;
  border-radius: 10px;
  padding: 8px 10px;
  line-height: 1.6;
}
.recipe .ok {
  text-decoration: line-through;
  opacity: 0.5;
}
.recipe .cur {
  font-weight: 700;
  color: #8c1c2c;
}
.cauldron {
  position: relative;
  width: 120px;
  height: 100px;
  border-radius: 50% 50% 46% 46%;
  background: #1a1420;
  border: 4px solid #3a3040;
  overflow: hidden;
  touch-action: none;
}
.cauldron.stir {
  cursor: grab;
  box-shadow: 0 0 18px #7dffe1;
}
.liquid {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 22%;
  bottom: 12%;
  border-radius: 50%;
  background: #2a5a4a;
  transition: background 0.3s;
}
.cauldron.bubble .liquid {
  animation: bubble 0.5s;
}
@keyframes bubble {
  50% {
    transform: scale(1.12);
    filter: brightness(1.6);
  }
}
.stir-ring {
  --p: 0;
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(rgba(125, 255, 225, 0.6) calc(var(--p) * 360deg), transparent 0);
  mix-blend-mode: screen;
}
.jars {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
}
.jar {
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  padding: 4px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: inherit;
}
.jar span {
  font-size: 24px;
}
.jar small {
  font-size: 9px;
  color: var(--muted);
}
.jar:hover {
  background: rgba(157, 123, 255, 0.25);
}
.candle-area {
  position: relative;
  height: 210px;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 120%, #2a1a10, #120a14);
}
.candle {
  position: absolute;
  width: 46px;
  height: 50px;
  border-radius: 8px 8px 4px 4px;
  border: none;
  background: linear-gradient(#f4ecd6, #cfc2a0);
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  color: #3a2416;
  font-size: 18px;
  padding-top: 14px;
}
.candle .flame {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 20px;
  opacity: 0;
}
.candle.lit .flame {
  opacity: 1;
  filter: drop-shadow(0 0 8px #ffb347);
}
.candle.lit {
  box-shadow: 0 0 22px rgba(255, 180, 70, 0.6);
}
#noiseInd {
  position: absolute;
  left: 50%;
  top: 50%;
}
.noise-arrow {
  position: absolute;
  left: -16px;
  top: -16px;
  width: 32px;
  height: 32px;
  font-size: 26px;
  text-align: center;
  filter: drop-shadow(0 0 8px #ffb347);
  animation: noiseFade 2.6s ease-out forwards;
}
.noise-arrow.loud {
  font-size: 36px;
  filter: drop-shadow(0 0 12px #ff5a3c);
}
@keyframes noiseFade {
  0% {
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
