:root {
  --sky-horizon: #ffe3b0;
  --grass-dark: #2f6e3a;
  --trunk: #5a3b24;
  --cloud: #ffffff;
  --sun: #ffd34d;
  --ink: #1b2016;
  --window-bg: #1f2b1a;
  --window-bg-2: #26331f;
  --paper: #eee3c2;
  --paper-text: #2a2210;
  --text: #f1f3e8;
  --text-muted: #c7d0ba;
  --green: #4caf6e;
  --green-dark: #2f6e3a;
  --amber: #ffb627;
  --danger: #e2584a;
  --pixel: 3px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sky-horizon: #4a3a68;
    --sun: #d8d8e8;
    --grass-dark: #0e2114;
    --trunk: #3a2718;
    --cloud: #6b7099;
    --window-bg: #14180f;
    --window-bg-2: #1c2316;
  }
}

:root[data-theme="dark"] {
  --sky-horizon: #4a3a68;
  --sun: #d8d8e8;
  --grass-dark: #0e2114;
  --trunk: #3a2718;
  --cloud: #6b7099;
  --window-bg: #14180f;
  --window-bg-2: #1c2316;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.4;
  image-rendering: pixelated;
}

.hidden { display: none !important; }

.pixel-font {
  font-family: "Press Start 2P", monospace;
}

/* --- the scene is the stage: HUD pieces float on top, pinned to the edges,
   nothing sits centered over it anymore (see .hud / .hud-dock below) --- */
.page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  background: var(--grass-dark);
}

.sky {
  position: absolute;
  inset: 0;
  background: var(--sky-horizon);
}

/* --- illustrated day/night backdrops, crossfaded by theme --- */
.backdrop-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center bottom;
  transition: opacity 0.6s ease;
}

.backdrop-day { background-image: url(assets/backdrop-day.jpg); opacity: 1; }
.backdrop-night { background-image: url(assets/backdrop-night.jpg); opacity: 0; }

:root[data-theme="dark"] .backdrop-day { opacity: 0; }
:root[data-theme="dark"] .backdrop-night { opacity: 1; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .backdrop-day { opacity: 0; }
  :root:not([data-theme="light"]) .backdrop-night { opacity: 1; }
}

.stars {
  position: absolute;
  inset: 0 0 50% 0;
  opacity: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 10% 20%, #fff 100%, transparent),
    radial-gradient(1.5px 1.5px at 25% 10%, #fff 100%, transparent),
    radial-gradient(1.5px 1.5px at 40% 30%, #fff 100%, transparent),
    radial-gradient(1.5px 1.5px at 60% 15%, #fff 100%, transparent),
    radial-gradient(1.5px 1.5px at 75% 25%, #fff 100%, transparent),
    radial-gradient(1.5px 1.5px at 85% 8%, #fff 100%, transparent),
    radial-gradient(1.5px 1.5px at 92% 35%, #fff 100%, transparent),
    radial-gradient(1.5px 1.5px at 15% 40%, #fff 100%, transparent),
    radial-gradient(1.5px 1.5px at 50% 5%, #fff 100%, transparent);
  transition: opacity 0.4s ease;
}

:root[data-theme="dark"] .stars { opacity: 1; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .stars { opacity: 1; }
}

.sun-moon {
  position: absolute;
  top: 10%;
  left: 14%;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--sun) 25%, transparent);
  transition: background 0.8s ease, box-shadow 0.8s ease, left 0.8s ease, top 0.8s ease;
}

.sun-moon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-image:
    radial-gradient(circle at 32% 30%, rgba(0, 0, 0, 0.16) 0 20%, transparent 21%),
    radial-gradient(circle at 65% 55%, rgba(0, 0, 0, 0.13) 0 15%, transparent 16%),
    radial-gradient(circle at 45% 72%, rgba(0, 0, 0, 0.11) 0 11%, transparent 12%);
  opacity: 0;
  transition: opacity 0.8s ease;
}

:root[data-theme="dark"] .sun-moon { left: 72%; top: 8%; }
:root[data-theme="dark"] .sun-moon::after { opacity: 1; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sun-moon { left: 72%; top: 8%; }
  :root:not([data-theme="light"]) .sun-moon::after { opacity: 1; }
}

.clouds { position: absolute; inset: 0; }

.cloud {
  position: absolute;
  background: var(--cloud);
  opacity: 0.95;
  filter: drop-shadow(0 2px 0 var(--ink));
  clip-path: polygon(
    10% 100%, 10% 70%, 0% 70%, 0% 40%, 20% 40%, 20% 10%, 50% 10%, 50% 0%,
    80% 0%, 80% 30%, 100% 30%, 100% 60%, 90% 60%, 90% 100%
  );
}

.cloud-1 { top: 14%; width: 64px; height: 28px; left: -90px; animation: drift 38s linear infinite; }
.cloud-2 { top: 26%; width: 46px; height: 20px; left: -70px; animation: drift 52s linear infinite; animation-delay: -20s; }
.cloud-3 { top: 8%; width: 38px; height: 17px; left: -60px; animation: drift 44s linear infinite; animation-delay: -10s; }

/* each completed dare leaves a cloud drifting in the sky, duration/delay set inline per cloud */
.dare-cloud {
  animation-name: drift;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.cloud-new {
  animation-name: cloud-pop-in, drift;
  animation-duration: 0.6s, var(--cloud-drift-duration, 50s);
  animation-timing-function: ease-out, linear;
  animation-iteration-count: 1, infinite;
}

@keyframes cloud-pop-in {
  from { opacity: 0; transform: scale(0.3) translateY(10px); }
  to { opacity: 0.95; transform: scale(1) translateY(0); }
}

@keyframes drift {
  from { transform: translateX(0); }
  to { transform: translateX(calc(100vw + 160px)); }
}

/* --- the world grows with you: sparse at zero dares, lush later (flowers only — the painted backdrop already supplies the trees) --- */
.flower {
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.scene[data-tier="2"] .flower-1,
.scene[data-tier="2"] .flower-2,
.scene[data-tier="3"] .flower-1,
.scene[data-tier="3"] .flower-2 { opacity: 1; transform: scale(1); }

.scene[data-tier="3"] .flower-3,
.scene[data-tier="3"] .flower-4,
.scene[data-tier="3"] .flower-5 { opacity: 1; transform: scale(1); }

.flower {
  position: absolute;
  bottom: 9%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--ink);
}

.flower::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: var(--ink);
}

.flower-1 { left: 12%; background: #f2c2e0; }
.flower-2 { left: 29%; background: #fff2a8; bottom: 8.5%; }
.flower-3 { right: 32%; background: #f2c2e0; bottom: 8.7%; }
.flower-4 { right: 15%; background: #fff2a8; }
.flower-5 { left: 48%; background: #f2c2e0; bottom: 8.3%; }

/* --- the player, standing on the foreground grass off to the left, clear of
   the centered bottom dock. scaled up so he reads as a character, grounded on
   the ground plane (not floating in the sky). `scale` is its own property so it
   composes with the translateY() the idle/listen/cheer animations set. --- */
.player {
  position: absolute;
  bottom: 13%;
  left: 17%;
  width: 20px;
  height: 30px;
  scale: 1.7;
  animation: player-idle 2.4s ease-in-out infinite;
  transform-origin: bottom center;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.45));
}

/* a little ground shadow so he reads as standing ON the grass, not pasted on */
.player::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -3px;
  width: 22px;
  height: 5px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.35);
  border-radius: 50%;
  filter: blur(1px);
}

.player-head {
  position: absolute;
  top: 0; left: 5px;
  width: 10px; height: 10px;
  background: #e8b48a;
  border: 2px solid var(--ink);
}

.player-body {
  position: absolute;
  top: 9px; left: 3px;
  width: 14px; height: 12px;
  background: var(--amber);
  border: 2px solid var(--ink);
}

.player-arm {
  position: absolute;
  top: 10px; left: 15px;
  width: 5px; height: 9px;
  background: var(--amber);
  border: 2px solid var(--ink);
  transform-origin: top center;
  transition: transform 0.2s ease;
}

.player-leg {
  position: absolute;
  bottom: 0;
  width: 5px; height: 9px;
  background: var(--trunk);
  border: 2px solid var(--ink);
}

.player-leg-l { left: 3px; }
.player-leg-r { left: 12px; }

@keyframes player-idle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.player.listening { animation: player-listen 0.5s ease-in-out infinite; }
.player.listening .player-arm { transform: rotate(-70deg) translate(2px, -2px); }

@keyframes player-listen {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.player.celebrating { animation: player-cheer 0.5s ease-in-out 2; }
.player.celebrating .player-arm { transform: rotate(-150deg) translate(1px, -4px); }

@keyframes player-cheer {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.05); }
}

/* --- proof celebration: a little retro sparkle burst --- */
.sparkle-burst {
  position: fixed;
  z-index: 20;
  pointer-events: none;
  font-family: "Press Start 2P", monospace;
  font-size: 11px;
  color: var(--amber);
  text-shadow: 2px 2px 0 var(--ink);
  animation: sparkle-rise 1.1s ease-out forwards;
}

@keyframes sparkle-rise {
  0% { opacity: 0; transform: translateY(0) scale(0.6); }
  15% { opacity: 1; transform: translateY(-6px) scale(1.1); }
  80% { opacity: 1; transform: translateY(-34px) scale(1); }
  100% { opacity: 0; transform: translateY(-44px) scale(1); }
}

/* --- HUD: small chips pinned to the screen edges, like a game overlay —
   the scene (painted backdrop + player) stays the open stage in the middle,
   nothing floats centered over it anymore. --- */
.hud {
  position: fixed;
  z-index: 2;
}

.hud-top-left {
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 170px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--window-bg) 100%, white 6%) 0%, var(--window-bg) 100%);
  border: 2px solid var(--ink);
  box-shadow: 0 3px 0 0 var(--ink), 0 0 0 2px var(--paper);
  padding: 6px 10px 6px 6px;
}

.hud-top-right {
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.hud-stats {
  top: 66px;
  left: 12px;
  display: flex;
  gap: 10px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--window-bg) 100%, white 6%) 0%, var(--window-bg) 100%);
  border: 2px solid var(--ink);
  box-shadow: 0 3px 0 0 var(--ink), 0 0 0 2px var(--paper);
  padding: 6px 10px;
}

.hud-badges {
  top: 110px;
  left: 12px;
  max-width: 170px;
}

.level-badge {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--amber) 100%, white 30%) 0%, var(--amber) 55%);
  border: 2px solid var(--ink);
  box-shadow: inset 0 2px 0 0 color-mix(in srgb, var(--amber) 100%, white 45%);
}

.level-num {
  font-family: "Press Start 2P", monospace;
  font-size: 13px;
  color: var(--ink);
}

.level-info { flex: 1; min-width: 0; }

.rank-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.xp-bar {
  height: 7px;
  width: 100%;
  background: var(--window-bg-2);
  border: 2px solid var(--ink);
  overflow: hidden;
}

.xp-fill {
  height: 100%;
  background: var(--green);
  width: 0%;
  transition: width 0.4s ease;
  background-image: repeating-linear-gradient(90deg, transparent 0 4px, rgba(0,0,0,0.15) 4px 5px);
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.streak-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--window-bg) 100%, white 6%) 0%, var(--window-bg) 100%);
  border: 2px solid var(--ink);
  box-shadow: 0 3px 0 0 var(--ink), 0 0 0 2px var(--paper);
  padding: 6px 8px;
}

.streak-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.streak-pips {
  display: flex;
  gap: 3px;
  flex: 1;
}

.pip {
  width: 12px;
  height: 12px;
  border: 2px solid var(--ink);
  background: var(--window-bg-2);
  color: var(--window-bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pip svg { width: 8px; height: 8px; }

.pip.lit {
  background: var(--amber);
  color: var(--ink);
  animation: bump 0.3s ease;
}

.streak-count {
  font-family: "Press Start 2P", monospace;
  font-size: 13px;
  color: var(--amber);
}

.streak-count.bump { animation: bump 0.4s ease; }

.badges {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.badge {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--window-bg-2);
  border: 2px solid var(--ink);
  color: var(--text-muted);
  opacity: 0.4;
  filter: grayscale(1);
  transition: opacity 0.3s ease, filter 0.3s ease, transform 0.3s ease;
}

.badge svg { width: 14px; height: 14px; }

.badge.unlocked {
  opacity: 1;
  filter: none;
  color: var(--ink);
  background: var(--green);
}

.badge.unlocked.just-unlocked { animation: badge-pop 0.5s ease; }

@keyframes badge-pop {
  0% { transform: scale(0.4) rotate(-10deg); }
  60% { transform: scale(1.2) rotate(5deg); }
  100% { transform: scale(1) rotate(0); }
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--window-bg-2) 100%, white 15%) 0%, var(--window-bg-2) 60%);
  border: 2px solid var(--ink);
  box-shadow: inset 0 2px 0 0 color-mix(in srgb, var(--window-bg-2) 100%, white 25%), 0 3px 0 0 var(--ink);
  width: 38px;
  height: 38px;
  color: var(--text-muted);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.icon-btn:hover { color: var(--text); }
.icon-btn:active {
  transform: translateY(3px);
  box-shadow: inset 0 2px 0 0 color-mix(in srgb, var(--window-bg-2) 100%, white 25%), 0 0 0 0 var(--ink);
}

/* --- bottom dock: the dare ribbon slides up above the always-present mic --- */
.hud-dock {
  position: fixed;
  z-index: 2;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 420px;
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.quest-ribbon {
  width: 100%;
  background: linear-gradient(180deg, color-mix(in srgb, var(--paper) 100%, white 20%) 0%, var(--paper) 50%, color-mix(in srgb, var(--paper) 100%, black 6%) 100%);
  color: var(--paper-text);
  border: 2px solid var(--ink);
  box-shadow: inset 0 2px 0 0 color-mix(in srgb, var(--paper) 100%, white 35%), 0 -6px 16px -8px rgba(0, 0, 0, 0.5);
  padding: 14px;
  margin-bottom: 10px;
  position: relative;
  animation: ribbon-up 0.3s ease;
}

@keyframes ribbon-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.quest-label {
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--green-dark);
  margin: 0 0 12px;
  text-align: center;
}

.dare-text {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.55;
  margin: 0 0 14px;
}

.dare-tags { display: flex; gap: 7px; flex-wrap: wrap; }

.tag {
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  letter-spacing: 0.02em;
  background: var(--window-bg);
  color: var(--text);
  border: 2px solid var(--ink);
  padding: 5px 7px;
}

.mic-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pitch {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  text-align: center;
  max-width: 260px;
  margin: 0 0 20px;
  line-height: 1.5;
}

.mic-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--green) 100%, white 25%) 0%, var(--green) 45%, var(--green) 100%);
  border: var(--pixel) solid var(--ink);
  box-shadow: inset 0 3px 0 0 color-mix(in srgb, var(--green) 100%, white 40%), 0 6px 0 0 var(--green-dark), 0 6px 0 var(--pixel) var(--ink);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.mic-btn:hover:not(:disabled) { filter: brightness(1.08); }

.mic-btn:active:not(:disabled) {
  transform: translateY(6px);
  box-shadow: inset 0 3px 0 0 color-mix(in srgb, var(--green) 100%, white 40%), 0 0 0 0 var(--green-dark), 0 0 0 var(--pixel) var(--ink);
}

.mic-btn:disabled { opacity: 0.6; cursor: default; }

.mic-btn.listening {
  animation: mic-pulse 1s steps(2) infinite;
}

.mic-hint {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 12px;
  text-align: center;
  line-height: 1.4;
  min-height: 15px;
}

.proof-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px;
  margin-bottom: 10px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--window-bg-2) 100%, white 12%) 0%, var(--window-bg-2) 60%);
  border: 2px solid var(--ink);
  box-shadow: inset 0 2px 0 0 color-mix(in srgb, var(--window-bg-2) 100%, white 22%), 0 4px 0 0 var(--ink);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.proof-btn:hover:not(:disabled) { color: var(--amber); }
.proof-btn:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: inset 0 2px 0 0 color-mix(in srgb, var(--window-bg-2) 100%, white 22%), 0 0 0 0 var(--ink);
}
.proof-btn:disabled { opacity: 0.5; cursor: default; box-shadow: inset 0 2px 0 0 color-mix(in srgb, var(--window-bg-2) 100%, white 22%), 0 4px 0 0 var(--ink); }

.proof-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: center;
  margin: -4px 0 10px;
  line-height: 1.4;
}

.proof-thumb {
  width: 100%;
  margin: -4px 0 10px;
  display: block;
  border: 2px solid var(--ink);
  animation: dare-in 0.3s ease;
}

.stat { text-align: center; }
.stat-num {
  font-family: "Press Start 2P", monospace;
  font-size: 13px;
  color: var(--amber);
  margin: 0;
  display: inline-block;
}
.stat-num.bump { animation: bump 0.4s ease; }
.stat-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 3px 0 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 8, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10;
}

.modal-inner {
  background: var(--window-bg);
  color: var(--text);
  border: var(--pixel) solid var(--ink);
  box-shadow: 0 0 0 var(--pixel) var(--paper);
  padding: 20px;
  width: 100%;
  max-width: 380px;
  max-height: 85vh;
  overflow-y: auto;
  animation: modal-in 0.15s ease;
}

/* --- settings/help slide in from the side instead of popping up centered —
   keeps the "nothing covers the middle" rule even for secondary screens --- */
.drawer-modal {
  justify-content: flex-end;
  padding: 0;
  background: rgba(10, 12, 8, 0.5);
}

.drawer-inner {
  max-width: 320px;
  height: 100%;
  max-height: 100%;
  border-width: var(--pixel) 0 0 var(--pixel);
  border-radius: 0;
  animation: drawer-in 0.22s ease;
}

@keyframes drawer-in {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

#camera-feed, #camera-canvas {
  width: 100%;
  margin-bottom: 14px;
  background: #000;
  border: 2px solid var(--ink);
}

.modal-actions { display: flex; gap: 10px; }

.btn {
  flex: 1;
  padding: 10px;
  border: 2px solid var(--ink);
  box-shadow: inset 0 2px 0 0 color-mix(in srgb, var(--window-bg-2) 100%, white 22%), 0 4px 0 0 var(--ink);
  background: linear-gradient(180deg, color-mix(in srgb, var(--window-bg-2) 100%, white 12%) 0%, var(--window-bg-2) 60%);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.btn:active {
  transform: translateY(4px);
  box-shadow: inset 0 2px 0 0 color-mix(in srgb, var(--window-bg-2) 100%, white 22%), 0 0 0 0 var(--ink);
}

.btn-primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--green) 100%, white 25%) 0%, var(--green) 55%);
  color: var(--ink);
  box-shadow: inset 0 2px 0 0 color-mix(in srgb, var(--green) 100%, white 40%), 0 4px 0 0 var(--green-dark), 0 4px 0 2px var(--ink);
}

.btn-primary:active { box-shadow: inset 0 2px 0 0 color-mix(in srgb, var(--green) 100%, white 40%), 0 0 0 0 var(--green-dark), 0 0 0 2px var(--ink); }

.settings-inner h2 {
  font-family: "Press Start 2P", monospace;
  font-size: 13px;
  margin: 0 0 16px;
}

.field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 6px;
}

.field {
  width: 100%;
  padding: 9px 10px;
  border: 2px solid var(--ink);
  background: var(--window-bg-2);
  color: var(--text);
  margin-bottom: 6px;
  font-size: 13px;
}

.field:focus {
  outline: 2px solid var(--amber);
  outline-offset: 1px;
}

.field-hint {
  font-size: 10px;
  color: var(--text-muted);
  margin: 0 0 16px;
  line-height: 1.5;
}

.settings-inner details {
  border-bottom: 1px solid var(--window-bg-2);
  padding: 8px 0;
}

.settings-inner details:last-of-type { border-bottom: none; }

.settings-inner summary {
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.settings-inner summary::-webkit-details-marker { display: none; }

.settings-inner summary::before {
  content: "+ ";
  color: var(--green);
}

.settings-inner details[open] summary::before { content: "– "; }

.settings-inner details p {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 8px 0 0;
}

@keyframes bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

@keyframes dare-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes mic-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.25); }
}

@media (max-width: 480px) {
  .sun-moon { width: 40px; height: 40px; }
  .hud-top-left, .hud-stats, .hud-badges { max-width: 130px; }
  /* on a narrow screen the bottom dock goes full-width and the dare ribbon +
     proof button stack tall enough to clip the player. when a dare is up he's
     "gone outside to do it" — fade him out so nothing gets half-covered. he's
     back standing on the grass once the dare clears. desktop keeps him since
     the dock there is narrow and centered, player stands clear to the left. */
  .player { transition: opacity 0.35s ease; }
  .page:has(#dare-card:not(.hidden)) .player { opacity: 0; }
}

/* --- respect reduced-motion: kill decorative infinite loops, keep essential feedback snappy --- */
@media (prefers-reduced-motion: reduce) {
  .player, .player.listening, .player.celebrating,
  .cloud-1, .cloud-2, .cloud-3, .dare-cloud, .cloud-new,
  .mic-btn.listening {
    animation: none;
  }
  .sun-moon, .sky, .backdrop-img, .xp-fill, .badge {
    transition-duration: 0.01ms;
  }
  .quest-ribbon, .drawer-inner, .proof-thumb {
    animation: none;
  }
}
