/* The Chota's daily decision: a letter in the sede and a full scene sheet. */
.clubhouse-room .chota-story-line { display: none; }
.clubhouse-room .chota-decision-letter {
  position: absolute; z-index: 5; left: 2.5%; top: 2.5%; width: 12%; min-width: 44px; min-height: 44px;
  display: grid; justify-items: center; gap: 2px; padding: 0; border: 0; background: transparent; color: #f3ead8;
  font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.chota-decision-letter svg { width: 70%; height: auto; image-rendering: pixelated; transform: rotate(-8deg); filter: drop-shadow(2px 3px 0 #0006); }
.chota-decision-letter span {
  max-width: 120%; padding: 2px 5px; border: 1px solid #302a23; border-radius: 6px; background: #f3ead8; color: #292621;
  font-size: clamp(8px, 1.9vw, 11px); font-weight: 700; line-height: 1.2; white-space: nowrap;
}
.chota-decision-letter.is-pending svg { animation: chota-letter-wiggle 2.6s ease-in-out infinite; }
:is(.chota-decision-letter, .chota-decision-prop):disabled { cursor: default; }
.chota-decision-letter:disabled { filter: brightness(.6) saturate(.6); }
.chota-decision-letter:disabled svg { animation: none; }
.chota-decision-letter.is-opening svg { animation: chota-letter-open 220ms ease-in both; }
@keyframes chota-letter-open { to { transform: rotate(0) scale(1.35) translateY(-8px); opacity: .2; } }
/* The day's object is on show on the stump table in the bottom-left corner,
   beside the lamp, clear of the rug, the Chota and the shop's props. */
:is(.clubhouse-room, .chota-viewer-room-scene) .chota-decision-prop {
  position: absolute; z-index: 2; left: 12.6%; bottom: 22.6%; min-width: 24px; padding: 0; border: 0; background: transparent;
  transform: translateX(-50%); transform-origin: 50% 100%; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.chota-decision-prop canvas { display: block; width: 100%; height: auto; image-rendering: pixelated; filter: drop-shadow(2px 3px 0 #0006); }
.chota-decision-prop::after { content: ""; position: absolute; z-index: -1; left: 8%; right: 8%; bottom: -4%; height: 10%; border-radius: 50%; background: #0006; }
.chota-decision-prop.is-arriving { animation: chota-prop-drop 620ms cubic-bezier(.3,1.5,.5,1) both; }
@keyframes chota-prop-drop { from { transform: translateX(-50%) translateY(-60%) scale(.6); opacity: 0; } 60% { transform: translateX(-50%) translateY(0) scaleY(.9); opacity: 1; } }
.clubhouse-room.is-sleeping .chota-decision-prop { filter: brightness(.55) saturate(.5); }
/* Mood icons pop over his head now and then. */
.chota-mood {
  position: absolute; z-index: 6; left: 50%; top: -6%; width: clamp(22px, 5vw, 30px); aspect-ratio: 1; display: grid; place-items: center;
  margin-left: calc(clamp(22px, 5vw, 30px) / -2); border: 2px solid #1a1410; border-radius: 6px; background: #fffaf0; box-shadow: 2px 2px 0 #0005;
  animation: chota-mood-pop 2.8s cubic-bezier(.2,1.3,.4,1) both;
}
.chota-mood svg { width: 72%; height: 72%; image-rendering: pixelated; }
.chota-mood::after { content: ""; position: absolute; left: 40%; bottom: -6px; width: 6px; height: 6px; background: #fffaf0; border-right: 2px solid #1a1410; border-bottom: 2px solid #1a1410; transform: rotate(45deg); }
@keyframes chota-mood-pop { 0% { transform: translateY(6px) scale(.4); opacity: 0; } 12%, 82% { transform: none; opacity: 1; } 50% { transform: translateY(-3px); } 100% { transform: translateY(-8px); opacity: 0; } }
.chota-decision-mark {
  position: absolute; z-index: 6; left: 50%; top: -4%; width: 1.4em; height: 1.4em; display: grid; place-items: center;
  margin-left: -.7em; border: 2px solid #1a1410; border-radius: 4px; background: #f3ead8; color: #b8332a;
  font: 900 clamp(11px, 2.6vw, 16px)/1 ui-monospace, monospace; animation: chota-mark-bob 1.4s ease-in-out infinite;
}
.clubhouse-room.is-sleeping .chota-decision-mark { display: none; }
@keyframes chota-letter-wiggle { 0%, 70%, 100% { transform: rotate(-8deg); } 76% { transform: rotate(-2deg) translateY(-3px); } 82% { transform: rotate(-13deg); } 88% { transform: rotate(-6deg); } }
@keyframes chota-mark-bob { 50% { transform: translateY(-4px); } }

body.chota-decision-open { overflow: hidden; }
.chd-dialog {
  --cd-bg: #0f1115; --cd-card: #181b21; --cd-raised: #22262e; --cd-line: #2f343d; --cd-text: #f3efe7; --cd-muted: #a7a196;
  box-sizing: border-box; width: min(560px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0 auto; padding: 0;
  border: 0; background: var(--cd-bg); color: var(--cd-text); overflow: hidden;
}
.chd-dialog::backdrop { background: #000c; }
.chd-dialog[open] { display: flex; animation: chd-enter 260ms cubic-bezier(.2,.8,.2,1); }
@keyframes chd-enter { from { opacity: 0; transform: translateY(18px); } }
.chd-sheet {
  box-sizing: border-box; display: flex; flex-direction: column; gap: 12px; width: 100%; overflow-y: auto; overscroll-behavior: contain;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px));
}
/* The sheet scrolls; its parts keep their size instead of squeezing the scene. */
.chd-sheet > * { flex-shrink: 0; }
.chd-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.chd-kicker { display: block; color: var(--cd-muted); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.chd-title { margin: 2px 0 0; font-size: 22px; line-height: 1.2; }
.chd-close { flex: none; width: 44px; height: 44px; display: grid; place-items: center; margin: -6px -8px 0 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--cd-text); cursor: pointer; }
.chd-close svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.chd-tabs { display: flex; gap: 6px; }
.chd-tabs:empty { display: none; }
.chd-tabs button { min-height: 36px; padding: 0 14px; border: 1px solid var(--cd-line); border-radius: 999px; background: transparent; color: var(--cd-muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.chd-tabs button[aria-pressed="true"] { border-color: #e9e4d6; background: #e9e4d6; color: #15171b; }

.chd-stage { position: relative; margin: 0; aspect-ratio: 192 / 120; overflow: hidden; border: 2px solid #1a1410; border-radius: 10px; background: #1c2140; }
.chd-scene { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; cursor: pointer; }
.chd-actor { position: absolute; z-index: 3; left: -3%; bottom: 1%; height: 82%; aspect-ratio: 1; cursor: pointer; }
.chd-chota {
  position: absolute; inset: 0; transform-origin: 50% 92%;
  background: var(--chota-outfit-base, url("icons/mascot/chota-v2/chota-poses.webp")) 0 0 / 600% 400% no-repeat; image-rendering: pixelated;
  animation: chd-breathe 3.2s ease-in-out infinite;
}
.chd-chota.is-talking { background-image: var(--chota-outfit-talk, url("icons/mascot/chota-v2/chota-talk.webp")); background-size: 300% 100%; }
.chd-chota.is-facing-left { transform: scaleX(-1); }
.chd-shadow { position: absolute; left: 23%; bottom: 2%; width: 47%; height: 6%; border-radius: 50%; background: #0007; transition: transform 200ms ease; }
.chd-chota.is-airborne ~ .chd-shadow, .chd-actor:has(.is-airborne) .chd-shadow { transform: scale(.7); }
@keyframes chd-breathe { 50% { scale: 1 1.018; } }
/* While he waits for the vote, a "?" floats over his head. */
.chd-think {
  position: absolute; left: 52%; top: 4%; width: 1.5em; height: 1.5em; display: grid; place-items: center; border: 2px solid #1a1410; border-radius: 50%;
  background: #fffaf0; color: #1a1410; font: 900 clamp(12px, 3.4vw, 16px)/1 ui-monospace, monospace; font-style: normal;
  opacity: 0; transform: scale(.4); transition: opacity 200ms ease, transform 260ms cubic-bezier(.2,1.4,.4,1); pointer-events: none;
}
.chd-think.is-on { opacity: 1; transform: none; animation: chd-think-bob 1.6s ease-in-out infinite; }
.chd-chota.is-facing-left .chd-think { transform: scaleX(-1); }
@keyframes chd-think-bob { 50% { translate: 0 -4px; } }

/* Each place breathes: lights, water, steam and dust, in the scene's pixels. */
.chd-fxs, .chd-burst { position: absolute; inset: 0; z-index: 2; overflow: hidden; pointer-events: none; }
.chd-burst { z-index: 4; }
.chd-fx { position: absolute; left: var(--x); top: var(--y); width: 1.2%; aspect-ratio: 1; }
.chd-fx b { position: absolute; left: 0; top: 0; width: 100%; aspect-ratio: 1; }
.chd-fx--twinkle { background: #fff7d6; animation: chd-twinkle 2.4s steps(2) infinite; animation-delay: calc(var(--x) * -.03s); }
.chd-fx--window { width: 3.4%; height: 6%; background: #ffe08a; mix-blend-mode: screen; animation: chd-window 7s steps(1) infinite; }
.chd-fx--flicker { width: 5%; height: 3%; margin-left: -2.5%; background: #ffd77a; filter: blur(2px); animation: chd-flicker 3.8s steps(1) infinite; }
.chd-fx--glow { width: 18%; aspect-ratio: 1; margin: -9% 0 0 -9%; border-radius: 50%; background: radial-gradient(#ffe7a8aa, transparent 65%); animation: chd-glow 4s ease-in-out infinite; }
.chd-fx--shimmer { width: 12%; height: 1.4%; background: #cfe6ff; animation: chd-shimmer 3.6s ease-in-out infinite; animation-delay: calc(var(--x) * -.05s); }
.chd-fx--gull { width: 4%; height: 2%; background: linear-gradient(135deg, transparent 45%, #1a1410 46% 54%, transparent 55%) left / 50% 100% no-repeat, linear-gradient(45deg, transparent 45%, #1a1410 46% 54%, transparent 55%) right / 50% 100% no-repeat; animation: chd-gull 12s linear infinite; }
.chd-fx--blinds { width: 28%; height: 33%; margin-left: -14%; background: repeating-linear-gradient(#fff6 0 2px, transparent 2px 7px); animation: chd-glow 6s ease-in-out infinite; mix-blend-mode: overlay; }
.chd-fx--beam { width: 46%; height: 100%; margin-left: -23%; background: linear-gradient(#fff3b055, transparent 90%); clip-path: polygon(42% 0, 58% 0, 100% 100%, 0 100%); transform-origin: 50% 0; animation: chd-beam 6s ease-in-out infinite alternate; }
.chd-fx--ripple b { width: 7vw; max-width: 40px; height: auto; aspect-ratio: 3; margin: -2% 0 0 -3%; border: 2px solid #cfe6ff; border-radius: 50%; animation: chd-ripple 3s ease-out infinite; animation-delay: calc(var(--i) * 1.5s); }
.chd-fx--leaf { width: 1.6%; height: 1.2%; background: #8cc06a; animation: chd-leaf 9s linear infinite; }
.chd-fx--train { width: 0; height: 0; }
.chd-fx--train::before { content: ""; position: absolute; left: -60vw; top: -18vw; width: 50vw; max-width: 300px; height: 14vw; max-height: 80px; background: repeating-linear-gradient(90deg, #c8402f 0 30%, #f3ead8 30% 34%), #c8402f; border: 2px solid #1a1410; opacity: 0; animation: chd-train 16s linear infinite; }
.chd-fx--bulb { width: 2.6%; margin: -1.3% 0 0 -1.3%; border-radius: 50%; background: radial-gradient(var(--c), transparent 70%); animation: chd-bulb 1.6s steps(1) infinite; animation-delay: calc(var(--n) * -.4s); }
.chd-fx--motes b, .chd-fx--dust b { width: 100%; background: #fff3b0aa; animation: chd-mote 6s ease-in-out infinite; animation-delay: calc(var(--i) * -1.5s); left: calc(var(--i) * 900%); }
.chd-fx--dust b { background: #c9b79a; animation: chd-dust 2.4s ease-in infinite; animation-delay: calc(var(--i) * .7s); left: calc(var(--i) * 300%); }
.chd-fx--confetti b { width: 120%; background: hsl(calc(var(--i) * 47deg) 80% 65%); left: calc(var(--i) * 700% - 3000%); animation: chd-confetti 4.5s linear infinite; animation-delay: calc(var(--i) * -.45s); }
.chd-fx--steam b { width: 300%; margin-left: -100%; background: #e6ebef; opacity: 0; animation: chd-steam 2.4s ease-out infinite; animation-delay: calc(var(--i) * .8s); }
.chd-fx--zzz b::before, .chd-fx--notes b::before { position: absolute; left: 0; bottom: 0; color: #fff6e3; font: 900 clamp(10px, 3vw, 15px)/1 ui-monospace, monospace; text-shadow: 1px 1px 0 #1a1410; }
.chd-fx--zzz b::before { content: "z"; }
.chd-fx--notes b::before { content: "♪"; }
.chd-fx--zzz b, .chd-fx--notes b { opacity: 0; animation: chd-float 3s ease-out infinite; animation-delay: calc(var(--i) * 1s); }
.chd-fx--bubbles b { width: 60%; border: 1px solid #fff7d6; border-radius: 50%; opacity: 0; animation: chd-float 1.8s ease-out infinite; animation-delay: calc(var(--i) * .6s); }
.chd-fx--sparkle { width: 3%; margin: -1.5% 0 0 -1.5%; background: linear-gradient(#fff7d6, #fff7d6) center / 100% 22% no-repeat, linear-gradient(#fff7d6, #fff7d6) center / 22% 100% no-repeat; animation: chd-sparkle 2.2s ease-in-out infinite; animation-delay: calc(var(--x) * -.04s); }
.chd-fx--flame { width: 1.4%; height: 2.4%; margin-left: -.2%; background: #ffd36e; border-radius: 50% 50% 30% 30%; animation: chd-flame .5s steps(2) infinite alternate; }
.chd-fx--blink { width: 2%; margin: -1% 0 0 -1%; border-radius: 50%; background: var(--c); box-shadow: 0 0 6px var(--c); animation: chd-bulb 1s steps(1) infinite; }
.chd-fx--question, .chd-fx--alert, .chd-fx--anger { width: auto; translate: -50% -50%; color: #fffaf0; font: 900 clamp(14px, 4.4vw, 22px)/1 ui-monospace, monospace; text-shadow: 2px 2px 0 #1a1410; animation: chd-bob 1.4s ease-in-out infinite; }
.chd-fx--question::before { content: "?"; }
.chd-fx--alert::before { content: "!"; color: #f2c14e; }
.chd-fx--anger::before { content: "#"; color: #e5654a; }
.chd-fx--sweat b { width: 120%; height: auto; aspect-ratio: .7; background: #9fd3f0; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; left: calc(var(--i) * 500%); animation: chd-drip 1.6s ease-in infinite; animation-delay: calc(var(--i) * .7s); }
@keyframes chd-twinkle { 50% { opacity: .15; } }
@keyframes chd-window { 0%, 40% { opacity: 0; } 41%, 100% { opacity: .55; } }
@keyframes chd-flicker { 0%, 100% { opacity: .9; } 47% { opacity: .2; } 49% { opacity: .85; } 51% { opacity: .3; } }
@keyframes chd-glow { 50% { opacity: .55; transform: scale(1.08); } }
@keyframes chd-shimmer { 0%, 100% { translate: 0 0; opacity: .3; } 50% { translate: 30% 0; opacity: .9; } }
@keyframes chd-gull { from { translate: -40vw 0; } 50% { translate: 20vw 1vw; } to { translate: 80vw -1vw; } }
@keyframes chd-beam { from { rotate: -14deg; } to { rotate: 14deg; } }
@keyframes chd-ripple { from { transform: scale(.3); opacity: .9; } to { transform: scale(1.4); opacity: 0; } }
@keyframes chd-leaf { from { translate: 0 0; rotate: 0; } to { translate: 60vw 14vw; rotate: 720deg; } }
@keyframes chd-train { 0%, 70% { opacity: 0; transform: translateX(0); } 71% { opacity: .9; } 85% { opacity: .9; transform: translateX(170vw); } 86%, 100% { opacity: 0; transform: translateX(170vw); } }
@keyframes chd-bulb { 50% { opacity: .25; } }
@keyframes chd-mote { 0%, 100% { translate: 0 0; opacity: .2; } 50% { translate: 8px -14px; opacity: .8; } }
@keyframes chd-dust { from { translate: 0 0; opacity: 1; } to { translate: 0 18vw; opacity: 0; } }
@keyframes chd-confetti { from { translate: 0 -2vw; rotate: 0; } to { translate: 2vw 34vw; rotate: 540deg; } }
@keyframes chd-steam { 0% { translate: 0 0; opacity: 0; } 20% { opacity: .9; } 100% { translate: calc(var(--i) * 4px - 4px) -9vw; opacity: 0; scale: 1.8; } }
@keyframes chd-float { 0% { translate: 0 0; opacity: 0; } 20% { opacity: 1; } 100% { translate: calc(var(--i) * 6px + 4px) -10vw; opacity: 0; } }
@keyframes chd-sparkle { 0%, 100% { transform: scale(.3) rotate(0); opacity: .2; } 50% { transform: scale(1) rotate(45deg); opacity: 1; } }
@keyframes chd-flame { to { transform: scaleY(1.3) translateY(-12%); background: #f2a33a; } }
@keyframes chd-bob { 50% { translate: -50% -80%; } }
@keyframes chd-drip { from { translate: 0 0; opacity: 1; } to { translate: 0 6vw; opacity: 0; } }

/* Bursts: rewards, reactions and yesterday's outcome. */
.chd-piece { position: absolute; left: var(--x); top: 52%; width: 3%; aspect-ratio: 1; animation: chd-pop-out 1.2s cubic-bezier(.2,.7,.3,1) var(--d) both; }
.chd-piece--star { background: linear-gradient(#ffe48a, #ffe48a) center / 100% 30% no-repeat, linear-gradient(#ffe48a, #ffe48a) center / 30% 100% no-repeat; }
.chd-piece--heart { width: 3.4%; background: #f08fb0; clip-path: polygon(50% 100%, 0 40%, 12% 10%, 35% 6%, 50% 24%, 65% 6%, 88% 10%, 100% 40%); }
.chd-piece--coin, .chd-piece--drop { top: -6%; width: 3.6%; border: 2px solid #1a1410; border-radius: 50%; background: #f2c14e; box-shadow: inset -2px -2px 0 #c99a2e; animation: chd-rain 1.4s cubic-bezier(.5,0,.8,1) var(--d) both; }
.chd-piece--drop { background: #9aa3ad; box-shadow: none; }
.chd-piece--sweat { top: 22%; width: 2%; aspect-ratio: .7; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: #9fd3f0; animation: chd-drip 1s ease-in var(--d) both; }
.chd-piece--bolt { left: calc(var(--x) + 30%); top: 0; width: 9%; height: 70%; background: #ffe48a; clip-path: polygon(55% 0, 20% 52%, 46% 52%, 30% 100%, 82% 40%, 54% 40%, 74% 0); animation: chd-bolt .7s steps(2) var(--d) both; }
.chd-reward { position: absolute; left: 62%; top: 8%; translate: -50% 0; padding: 5px 11px; border: 2px solid #1a1410; border-radius: 999px; background: #f2c14e; color: #1a1410; font-weight: 800; font-size: 15px; white-space: nowrap; box-shadow: 3px 3px 0 #0006; animation: chd-reward 2.2s cubic-bezier(.2,1.3,.4,1) both; }
.chd-stage.is-flashing::after { content: ""; position: absolute; inset: 0; z-index: 5; background: #fff; animation: chd-flash .5s ease-out both; pointer-events: none; }
.chd-stage.is-shaking { animation: chd-shake .5s linear; }
@keyframes chd-pop-out { 0% { transform: translate(0, 0) scale(.3) rotate(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translate(var(--dx), -26vw) scale(1) rotate(var(--r)); opacity: 0; } }
@keyframes chd-rain { 0% { transform: translateY(0) rotate(0); opacity: 1; } 85% { opacity: 1; } 100% { transform: translateY(44vw) rotate(var(--r)); opacity: 0; } }
@keyframes chd-bolt { 0%, 100% { opacity: 0; } 30%, 70% { opacity: 1; } }
@keyframes chd-flash { 0% { opacity: .6; } 100% { opacity: 0; } }
@keyframes chd-shake { 20% { translate: -4px 1px; } 40% { translate: 4px -1px; } 60% { translate: -3px 0; } 80% { translate: 2px 1px; } }
@keyframes chd-reward { 0% { transform: translateY(14px) scale(.5); opacity: 0; } 15%, 75% { transform: none; opacity: 1; } 100% { transform: translateY(-24px); opacity: 0; } }
.chd-countdown { margin: 2px 0 0; color: var(--cd-muted); font-size: 13px; }
.chd-countdown strong { color: var(--cd-text); font-variant-numeric: tabular-nums; }
.chd-meter.is-changed b { animation-name: chd-fill-from; animation-duration: 900ms; }
@keyframes chd-fill-from { from { width: var(--from); } }
.chd-bubble {
  position: relative; z-index: 3; min-height: 3.1em; margin: 2px 0 0; padding: 10px 13px;
  border: 2px solid #1a1410; border-radius: 12px; background: #fffaf0; color: #1f1b16; box-shadow: 3px 3px 0 #0005;
  font-size: 15px; font-weight: 600; line-height: 1.4;
}
.chd-ghost { visibility: hidden; }
.chd-line { position: absolute; inset: 10px 13px; }
.chd-bubble::after { content: ""; position: absolute; left: 17%; top: -9px; width: 14px; height: 14px; background: #fffaf0; border-left: 2px solid #1a1410; border-top: 2px solid #1a1410; transform: rotate(45deg); }
.chd-bubble { transform-origin: 20% 0; }
.chd-bubble.is-popping { animation: chd-pop 220ms cubic-bezier(.2,1.4,.4,1); }
@keyframes chd-pop { from { transform: scale(.86); opacity: 0; } }

.chd-meters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; margin: 0; padding: 0; list-style: none; }
.chd-meter { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 7px; font-size: 13px; }
.chd-meter span { color: var(--cd-muted); }
.chd-meter i { height: 8px; overflow: hidden; border: 1px solid #1a1410; border-radius: 2px; background: var(--cd-raised); }
.chd-meter b { display: block; width: var(--value); height: 100%; background: #e9e4d6; animation: chd-fill 700ms cubic-bezier(.2,.8,.2,1) both; }
.chd-meter[data-meter="trouble"] b { background: #e5654a; }
.chd-meter strong { min-width: 2ch; font-variant-numeric: tabular-nums; text-align: right; }
.chd-meter em { font-style: normal; font-size: 12px; font-weight: 700; }
.chd-meter em.is-better { color: #8cc06a; }
.chd-meter em.is-worse { color: #f08a7a; }
@keyframes chd-fill { from { width: 0; } }

.chd-content { display: grid; gap: 10px; }
.chd-body { margin: 0; color: var(--cd-text); font-size: 15px; line-height: 1.5; }
.chd-ask { margin: 2px 0 0; font-size: 16px; font-weight: 700; }
.chd-note { margin: 0; color: var(--cd-muted); font-size: 13px; line-height: 1.45; }
.chd-options { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chd-option {
  position: relative; isolation: isolate; width: 100%; min-height: 52px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  overflow: hidden; padding: 8px 12px; border: 1px solid var(--cd-line); border-radius: 12px; background: var(--cd-card); color: var(--cd-text);
  font: inherit; font-size: 15px; font-weight: 600; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: transform 140ms ease, background-color 140ms ease;
}
.chd-option:active { transform: scale(.98); }
.chd-option[aria-pressed="true"] { border-color: #e9e4d6; }
.chd-option:disabled { cursor: progress; opacity: .72; }
.chd-option-key { width: 28px; height: 28px; display: grid; place-items: center; border: 2px solid #1a1410; border-radius: 6px; background: #e9e4d6; color: #15171b; font-size: 13px; font-weight: 900; }
.chd-option[aria-pressed="true"] .chd-option-key { background: #fffaf0; }
.chd-option-votes { font-variant-numeric: tabular-nums; color: var(--cd-muted); }
.chd-option-mine { grid-column: 2 / 4; margin-top: -4px; color: var(--cd-muted); font-size: 12px; font-weight: 600; }
.chd-option-bar { position: absolute; z-index: -1; inset: 0 auto 0 0; width: var(--share); background: #ffffff12; animation: chd-fill 700ms cubic-bezier(.2,.8,.2,1) both; }
.chd-secondary { justify-self: start; min-height: 40px; padding: 0 14px; border: 1px solid var(--cd-line); border-radius: 999px; background: transparent; color: var(--cd-text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.chd-streak { margin-top: 4px; }
.chd-dialog :is(button):focus { outline: none; }
.chd-dialog :is(button):focus-visible { outline: 2px solid #e9e4d6; outline-offset: 2px; }
.chd-dialog, .chd-dialog * { -webkit-user-select: none; user-select: none; }

@media (min-width: 600px) {
  .chd-dialog { height: auto; max-height: min(92dvh, 900px); margin: auto; border-radius: 18px; }
  .chd-sheet { padding: 18px 20px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .chota-decision-letter.is-pending svg, .chota-decision-mark, .chd-dialog[open], .chd-bubble.is-popping, .chd-meter b, .chd-option-bar,
  .chd-chota, .chd-think.is-on, .chota-decision-prop.is-arriving, .chd-stage.is-shaking { animation: none; }
  .chd-fxs, .chd-burst, .chota-mood { display: none; }
}
/* Modest phones keep the scene and the Chota, without the heavier layers. */
:root[data-motion-quality=low] :is(.chd-fx--flicker, .chd-fx--blinds, .chd-fx--window, .chd-fx--glow, .chd-fx--beam, .chd-fx--motes, .chd-fx--train) { display: none; }
:root[data-motion-quality=low] .chd-chota { animation: none; }

/* The Chota's money jar, on the floor behind the bottom-right plant. The zone is
   the room's 820–1000 × 780–960 px; its mask is the plant's leaves, which stay in front. */
:is(.clubhouse-room, .chota-viewer-room-scene) .chota-jar-zone {
  position: absolute; z-index: 2; left: 80.08%; top: 76.17%; width: 17.58%; height: 17.58%; pointer-events: none;
  -webkit-mask: url("icons/clubhouse/props/jar-plant-mask.png") 0 0 / 100% 100% no-repeat; mask: url("icons/clubhouse/props/jar-plant-mask.png") 0 0 / 100% 100% no-repeat;
}
.chota-jar { position: absolute; left: 4%; top: 24%; width: 42%; aspect-ratio: 14 / 18; display: block; transform-origin: 50% 100%; }
.chota-jar svg { display: block; width: 100%; height: 100%; image-rendering: pixelated; filter: drop-shadow(2px 2px 0 #0005); }
.chota-jar::after { content: ""; position: absolute; z-index: -1; left: 4%; right: -6%; bottom: -5%; height: 12%; border-radius: 50%; background: #0006; }
.chota-jar.is-clinking { animation: chota-jar-clink 520ms cubic-bezier(.3,1.6,.5,1); }
@keyframes chota-jar-clink { 30% { transform: scale(1.08, .92); } 60% { transform: scale(.96, 1.05) translateY(-4%); } }
:is(.clubhouse-room, .chota-viewer-room-scene).is-sleeping .chota-jar-zone { filter: brightness(.55) saturate(.5); }
.chota-viewer-room-scene .chota-decision-prop { pointer-events: none; }
.chota-viewer-room-scene.is-sleeping .chota-decision-prop { filter: brightness(.55) saturate(.5); }

/* The dilemma sign hangs from the beam in the top-left corner. */
.clubhouse-room .chota-decision-sign {
  position: absolute; z-index: 5; left: 2.6%; top: 0; width: 17%; aspect-ratio: .72; padding: 0; border: 0; background: none;
  transform-origin: 50% 0; animation: cds-sway 7s ease-in-out infinite; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.chota-decision-sign.is-pending { animation-duration: 2.6s; animation-name: cds-swing; }
.cds-rope { position: absolute; top: 0; height: 22%; width: 2px; background: repeating-linear-gradient(#5b4632 0 3px, #3a2a1d 3px 5px); }
.cds-rope--left { left: 24%; transform: rotate(-6deg); transform-origin: 50% 0; }
.cds-rope--right { right: 24%; transform: rotate(6deg); transform-origin: 50% 0; }
.cds-board {
  position: absolute; left: 0; right: 0; top: 20%; bottom: 8%; display: grid; grid-template-rows: auto minmax(0, 1fr); justify-items: center; gap: 3%;
  padding: 9% 7% 12%; border: 2px solid #2a1d17; border-radius: 3px; box-sizing: border-box;
  background: repeating-linear-gradient(#94612f 0 7px, #85552a 7px 8px), #8a5a32; box-shadow: inset 0 2px 0 #b07a44, 2px 3px 0 #0007;
}
.cds-board::before, .cds-board::after { content: ""; position: absolute; top: 3%; width: 4px; height: 4px; border-radius: 50%; background: #2a1d17; box-shadow: inset 1px 1px 0 #c9a46b; }
.cds-board::before { left: 6%; }
.cds-board::after { right: 6%; }
.cds-board small { color: #fff3dc; font: 800 clamp(5.5px, 1.35vw, 8.5px)/1.05 var(--ds-font, system-ui); letter-spacing: .02em; text-align: center; text-shadow: 1px 1px 0 #3a2414; text-transform: uppercase; }
.cds-thumb { align-self: center; width: auto; height: 100%; max-width: 86%; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(1px 2px 0 #0006); }
.cds-status {
  position: absolute; left: 50%; bottom: 0; translate: -50% 0; padding: 2px 7px; border: 1.5px solid #1a1410; border-radius: 999px;
  background: #f3ead8; color: #1a1410; font: 800 clamp(7px, 1.7vw, 10.5px)/1.2 var(--ds-font, system-ui); white-space: nowrap; box-shadow: 1px 2px 0 #0006;
}
.chota-decision-sign.is-pending .cds-status { background: #e5654a; color: #fff; }
.chota-decision-sign.is-asleep { filter: brightness(.6) saturate(.6); animation: none; }
.chota-decision-sign:disabled { cursor: default; }
.chota-decision-sign.is-pulled { animation: cds-pull 240ms ease-out; }
@keyframes cds-sway { 0%, 100% { rotate: -1deg; } 50% { rotate: 1deg; } }
@keyframes cds-swing { 0%, 100% { rotate: -4deg; } 50% { rotate: 4deg; } }
@keyframes cds-pull { 40% { translate: 0 6%; rotate: 0deg; } }

/* The chest on the low cabinet is the Chota's drawer. */
.clubhouse-room .chota-drawer {
  position: absolute; z-index: 4; left: 70.4%; top: 45.8%; width: 9.8%; height: 4%; padding: 0; border: 0; border-radius: 3px; background: transparent;
  cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.chota-drawer::before { content: ""; position: absolute; inset: -12px -6px; }
.chota-drawer-glint { position: absolute; inset: -1px; border-radius: 3px; opacity: 0; box-shadow: 0 0 0 1.5px #fff6dfcc, 0 0 12px #fff2c9aa; }
.chota-drawer.has-new .chota-drawer-glint { animation: chota-drawer-glow 2.2s ease-in-out infinite; }
.chota-drawer-badge { position: absolute; right: -10%; bottom: 115%; padding: 1px 6px; border: 1.5px solid #1a1410; border-radius: 999px; background: #f3ead8; color: #1a1410; font: 800 clamp(8px, 1.8vw, 11px)/1.2 var(--ds-font, system-ui); box-shadow: 1px 2px 0 #0006; }
.chota-drawer-badge:empty { display: none; }
.chota-drawer.has-new .chota-drawer-badge { animation: chota-mark-bob 1.4s ease-in-out infinite; }
.chota-drawer.is-opening .chota-drawer-glint { animation: chota-drawer-open 260ms ease-out; }
.clubhouse-room.is-sleeping .chota-drawer-badge { filter: brightness(.7); }
@keyframes chota-drawer-glow { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes chota-drawer-open { 0% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.4); } }

/* The drawer's sheet reuses the Repetidas look from card-economy.css. */
.chota-drawer-dialog .cdr-art { display: grid; place-items: center; aspect-ratio: 4 / 5; background: radial-gradient(circle at 50% 60%, #2a2f3a, #14161b 70%); cursor: default; }
.chota-drawer-dialog button.cdr-art { cursor: pointer; }
.chota-drawer-dialog .cdr-art canvas { width: 72%; height: 72%; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(2px 3px 0 #0007); }
.chota-drawer-dialog .cdr-card.is-good { --rarity: #8cc06a; }
.chota-drawer-dialog .cdr-card.is-bad { --rarity: #e5654a; }
.chota-drawer-dialog .cdr-card.is-today { --rarity: #f3ead8; }
.chota-drawer-dialog .cdr-card p { white-space: normal; }
.chota-drawer-dialog .cdr-result { color: #ffffff99; font-weight: 500; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cdr-deltas { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.cdr-delta { padding: 1px 6px; border-radius: 999px; background: #ffffff12; font-size: 10px; font-weight: 800; }
.cdr-delta.is-better { color: #8cc06a; }
.cdr-delta.is-worse { color: #f08a7a; }

/* The room shows how the Chota is doing. */
.chota-statdecor { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.chota-decor { position: absolute; display: block; opacity: 0; transform: translateY(6%); transition: opacity .8s ease, transform .8s ease; }
.chota-decor svg { display: block; width: 100%; height: auto; image-rendering: pixelated; filter: drop-shadow(1px 2px 0 #0006); }
.chota-decor--papers { left: 22%; top: 88%; width: 13%; }
.chota-decor--blanket { left: 81.5%; top: 54.5%; width: 11%; }
.chota-decor--star { left: 76.6%; top: 16.4%; width: 3.4%; }
.chota-statdecor.show-papers .chota-decor--papers, .chota-statdecor.show-blanket .chota-decor--blanket, .chota-statdecor.show-star .chota-decor--star { opacity: 1; transform: none; }
.chota-statdecor.show-star .chota-decor--star svg { animation: chota-star-shine 4s ease-in-out infinite; }
:is(.clubhouse-room, .chota-viewer-room-scene).is-sleeping .chota-statdecor { filter: brightness(.55) saturate(.5); }
@keyframes chota-star-shine { 0%, 100% { filter: drop-shadow(1px 2px 0 #0006); } 50% { filter: drop-shadow(1px 2px 0 #0006) drop-shadow(0 0 4px #fff3b0); } }
/* Press flashes behind the window when he is famous. */
.chota-press-flash { position: absolute; left: var(--x); top: var(--y); width: 10%; aspect-ratio: 1; margin: -5% 0 0 -5%; border-radius: 50%; background: radial-gradient(#ffffff, #ffffff00 65%); opacity: 0; animation: chota-press 1.3s steps(1) both; pointer-events: none; }
@keyframes chota-press { 0% { opacity: 1; } 8% { opacity: 0; } 30% { opacity: .9; } 38%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .clubhouse-room .chota-decision-sign, .chota-drawer.has-new .chota-drawer-glint, .chota-drawer.has-new .chota-drawer-badge, .chota-statdecor.show-star .chota-decor--star svg { animation: none; }
  .chota-drawer.has-new .chota-drawer-glint { opacity: .8; }
}

/* Simpler dilemma flow: read, pick, confirm; then a final, locked choice. */
.chd-meters.chd-meters { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.chd-meters .chd-meter { grid-template-columns: 1fr; justify-items: center; gap: 2px; padding: 7px 4px 6px; border-radius: 12px; background: var(--cd-card); text-align: center; }
.chd-meters .chd-meter span { font-size: 11px; }
.chd-meters .chd-meter i { width: 100%; height: 4px; border: 0; }
.chd-meters .chd-meter strong { order: -1; font-size: 17px; font-weight: 800; }
.chd-meters .chd-meter em { font-size: 11px; }
.chd-situation { margin: 0; color: var(--cd-muted); font-size: 14px; line-height: 1.5; }
.chd-dialog .chd-ask { margin: 6px 0 0; font-size: 17px; font-weight: 800; }
.chd-confirm {
  position: sticky; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 4; display: grid; gap: 10px; margin-top: 4px; padding: 14px;
  border: 1px solid #e9e4d6; border-radius: 16px; background: #1d2027f5; box-shadow: 0 16px 36px -12px #000; animation: chd-pop 220ms cubic-bezier(.2,1.3,.4,1);
}
.chd-confirm p { margin: 0; font-size: 14px; line-height: 1.4; }
.chd-confirm div { display: flex; justify-content: flex-end; gap: 8px; }
.chd-primary { min-height: 44px; padding: 0 22px; border: 0; border-radius: 999px; background: #fff; color: #000; font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; }
.chd-primary:disabled { background: #ffffff1a; color: #ffffff66; cursor: progress; }
.chd-confirm .chd-secondary { min-height: 44px; }
.chd-mine { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: #fffaf0; color: #1f1b16; }
.chd-mine svg { flex: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chd-mine small { display: block; color: #6b6253; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.chd-mine strong { display: block; font-size: 17px; line-height: 1.25; }
.chd-mine.is-past { background: var(--cd-card); color: var(--cd-text); }
.chd-mine.is-past small { color: var(--cd-muted); }
.chd-results { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chd-result { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; overflow: hidden; isolation: isolate; padding: 11px 14px; border: 1px solid var(--cd-line); border-radius: 14px; background: var(--cd-card); }
.chd-result.is-mine { border-color: #e9e4d6; }
.chd-result > div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; font-size: 15px; font-weight: 700; }
.chd-result em { padding: 1px 7px; border-radius: 999px; background: #ffffff1a; color: var(--cd-text); font-size: 11px; font-style: normal; font-weight: 700; }
.chd-result em.is-lead { background: #8cc06a33; color: #b8e09f; }
.chd-result strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.chd-result small { grid-column: 1 / -1; color: var(--cd-muted); font-size: 12px; }
.chd-result i { position: absolute; z-index: -1; inset: 0 auto 0 0; width: var(--share); background: #ffffff12; animation: chd-fill 700ms cubic-bezier(.2,.8,.2,1) both; }
.chd-twist { justify-self: start; }
.chd-verdict { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--cd-card); color: var(--cd-muted); font-size: 14px; font-weight: 700; }
.chd-verdict.is-hit { background: #8cc06a26; color: #b8e09f; }
@media (prefers-reduced-motion: reduce) { .chd-confirm, .chd-result i { animation: none; } }
/* His clothes from the sede, cell for cell over the sprite. */
.chd-wear { position: absolute; inset: 0; display: block; background-repeat: no-repeat; image-rendering: pixelated; pointer-events: none; }

/* Modular sheets contain the whole committed outfit, including the exact default cache. */
:root[data-chota-modular="true"] .chd-wear { display: none; }
