
/* The 3D world page: a full-screen canvas with a small HUD. The joystick is big (.big) for small hands. */
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--cz-plum-deep); color: var(--cz-cream);
  font-family: 'Baloo 2', system-ui, sans-serif; touch-action: none; user-select: none; -webkit-user-select: none; }
[hidden] { display: none !important; }
/* fx.js adds a floating sound button on pages without Nav; the world has its own in Settings. */
#fx-mute { display: none !important; }
.stage, .stage canvas { position: fixed; inset: 0; display: block; }

.w-hud { position: fixed; left: 16px; right: 16px; top: max(14px, env(safe-area-inset-top)); display: flex;
  justify-content: space-between; align-items: center; gap: 8px; pointer-events: none; }
.w-hud-right { display: flex; gap: 8px; }
.w-hud-left { display: flex; gap: 6px; }
.w-level { position: relative; pointer-events: none; overflow: hidden; padding-bottom: 9px; }
.w-barya { display: inline-flex; align-items: center; gap: 5px; pointer-events: none; }
.w-barya-coin { width: 1.1em; height: 1.1em; flex: none; }
.w-level-bar { position: absolute; left: 0; bottom: 0; height: 4px; width: 0; background: var(--cz-hud-accent); }
.w-pill { pointer-events: auto; background: var(--cz-hud); border: 0; border-radius: 999px; padding: 6px 16px;
  font: 800 18px 'Baloo 2', system-ui, sans-serif; color: var(--cz-on-hud); box-shadow: 0 4px 0 var(--cz-ledge); text-decoration: none; cursor: pointer;
  white-space: nowrap; }
@media (max-width: 420px) {
  .w-pill { font-size: 14px; padding: 5px 7px; }
  .w-hud { left: 10px; right: 10px; gap: 4px; }
  .w-hud-left, .w-hud-right { gap: 4px; }
}
@media (max-width: 360px) { .w-pill { font-size: 13px; padding: 5px 5px; } }

.w-joy { position: fixed; left: 24px; bottom: max(24px, env(safe-area-inset-bottom)); width: 132px; height: 132px;
  border-radius: 50%; background: color-mix(in srgb, var(--cz-hud) 20%, transparent); border: 4px dashed color-mix(in srgb, var(--cz-hud-accent) 90%, transparent); touch-action: none; }
.w-joy.big { width: 168px; height: 168px; }
.w-knob { position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%;
  background: var(--cz-hud-accent); box-shadow: 0 5px 0 var(--cz-ledge); display: grid; place-items: center;
  font-size: 26px; pointer-events: none; }
.w-joy.big .w-knob { width: 74px; height: 74px; margin: -37px 0 0 -37px; }

.w-act { position: fixed; left: 212px; right: 212px; width: max-content; max-width: calc(100% - 424px); margin: 0 auto; bottom: 40px; transform: scale(.5); opacity: 0; pointer-events: none;
  text-align: center; line-height: 1.1;
  transition: transform .3s cubic-bezier(.3,1.7,.5,1), opacity .2s; background: var(--cz-main); color: var(--cz-on-main);
  border: 4px solid var(--cz-line); border-radius: 999px; padding: 12px 30px; font: 800 24px 'Baloo 2', system-ui, sans-serif;
  box-shadow: 0 6px 0 var(--cz-ledge), var(--cz-shadow); cursor: pointer; }
.w-act.show { opacity: 1; transform: scale(1); pointer-events: auto; }
@keyframes w-act-pulse { 0%, 100% { box-shadow: 0 6px 0 var(--cz-ledge), 0 0 0 0 color-mix(in srgb, var(--cz-main) 75%, transparent); } 50% { box-shadow: 0 6px 0 var(--cz-ledge), 0 0 0 14px transparent; } }
@media (max-width: 600px) {
  .w-act { left: auto; right: 16px; margin: 0; transform: scale(.5); max-width: calc(100% - 228px); font-size: 19px; padding: 10px 18px; }
  .w-act.show { transform: scale(1); }
}
/* A narrow phone has no room beside the big joystick: the button sits just above it, clear of the right-hand buttons. */
@media (max-width: 600px) and (min-height: 521px) {
  .w-act { left: 12px; right: 80px; bottom: calc(var(--arc-h, 200px) + 64px); max-width: calc(100% - 92px); }
}
/* Wider screens: just above the town row, left of the skill arc (the arc sets --arc-w on body). */
@media (min-width: 601px) {
  .w-act { left: auto; right: var(--arc-w, 196px); bottom: calc(var(--thumb-b, max(24px, env(safe-area-inset-bottom))) + 56px); margin: 0;
    max-width: calc(100% - 212px - var(--arc-w, 196px)); }
}

.w-waking { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center;
  background: color-mix(in srgb, var(--cz-cream) 88%, transparent); color: var(--cz-ink); font-size: 26px; font-weight: 800; }
.w-overlay { position: fixed; inset: 0; z-index: 40; background: var(--cz-scrim); display: grid; place-items: center; padding: 16px; }
.w-card { background: var(--cz-surface); border-radius: var(--cz-r-lg); padding: 18px; width: min(560px, 100%); max-height: calc(100vh - 32px);
  overflow-y: auto; box-shadow: 0 6px 0 var(--cz-ledge); box-sizing: border-box; }
.w-card-title { margin: 0 0 12px; text-align: center; font-size: 24px; }
.w-travel { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.w-travel-btn, .w-btn, .w-choice { font: 800 17px 'Baloo 2', system-ui, sans-serif; border: 0; border-radius: var(--cz-r-sm); padding: 10px 12px;
  background: var(--cz-sunk); color: var(--cz-ink); box-shadow: 0 3px 0 var(--cz-ledge); cursor: pointer; text-decoration: none; min-height: 44px; }
.w-close { display: block; margin: 14px auto 0; }
.w-sign-lines { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.w-sign-line { display: flex; gap: 10px; align-items: flex-start; font-size: 17px; line-height: 1.35; color: var(--cz-ink); }
.w-sign-icon { font-size: 26px; line-height: 1.1; }
@keyframes w-sign-explore-tap { 0% { transform: scale(1); } 40% { transform: scale(1.04) rotate(-1deg); } 70% { transform: scale(.98) rotate(1deg); } 100% { transform: scale(1); } }
@keyframes w-sign-explore-in { from { opacity: 0; transform: translateY(-8px) scale(.96); } to { opacity: 1; transform: none; } }

.w-sign-board { display: grid; gap: 8px; justify-items: center; margin: 4px 0; }
.w-sign-board-row { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.w-sign-tile { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 44px; min-height: 56px; padding: 4px 6px; border-radius: 14px; font-size: 22px; line-height: 1; }
.w-sign-tile.still { background: var(--cz-sunk); color: var(--cz-ink); }
.w-sign-tile-text { margin-top: 2px; font-size: 15px; font-weight: 800; }
.w-sign-tile.wrong { opacity: .55; animation: w-sign-shake .3s; }
.w-sign-tile.right { outline: 3px solid var(--cz-ok); animation: w-sign-pop .5s ease-out; }
@keyframes w-sign-pop { 50% { transform: scale(1.18); } }
@keyframes w-sign-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .w-sign-tile.wrong, .w-sign-tile.right { animation: none; } }
@keyframes w-sign-fb-in { from { opacity: 0; transform: translateY(10px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes w-sign-bounce { 0%, 100% { transform: translateY(0) rotate(0); } 40% { transform: translateY(-8px) rotate(-12deg); } 70% { transform: translateY(0) rotate(10deg); } }
@keyframes w-sign-fall { 0% { opacity: 1; transform: translateY(0) rotate(0); } 100% { opacity: 0; transform: translateY(90px) rotate(260deg); } }

.w-sign-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.w-sign-foot .w-close { margin: 0; }
.w-sign-foot .w-sign-go.play { flex: 1 1 100%; padding: 12px 16px; font-size: 20px; background: var(--cz-main); color: var(--cz-on-main); box-shadow: 0 5px 0 var(--cz-ledge); }
/* One standard: the gold button that glows is the one thing to do next; the soft purple ones are extras; Close and "read again" stay quiet. */
@keyframes w-sign-glow { 0%, 100% { filter: none; } 50% { filter: drop-shadow(0 0 9px var(--cz-main)) brightness(1.06); } }
.w-sign-foot .w-sign-go.play{ animation: w-sign-glow 1.6s ease-in-out infinite; border-radius: 18px; }
.w-sign-foot .w-sign-go:not(.play) { background: var(--cz-main); color: var(--cz-on-main); box-shadow: 0 5px 0 var(--cz-ledge); animation: w-sign-glow 1.6s ease-in-out infinite; }
.w-sign-foot .w-sign-read { background: var(--cz-sunk); font-size: 16px; }
.w-sign-foot .w-close { background: transparent; color: var(--cz-ink-soft); box-shadow: inset 0 0 0 2px var(--cz-ledge); font-size: 15px; }
@media (prefers-reduced-motion: reduce) { .w-sign-go{ animation: none !important; } }
/* Sign cards: the painted plank. --sign-tint is set on the card from the sign's own colour. */
.w-card.w-sign { --sign-tint: var(--cz-main); padding-top: 0; overflow-x: hidden; border: 4px solid var(--cz-line); }
.w-sign .w-card-title { position: relative; margin: 0 -18px 12px; padding: 14px 44px; color: var(--cz-ink); text-shadow: none;
  background: var(--sign-tint);
  background: color-mix(in srgb, var(--sign-tint) 38%, var(--cz-cream));
  border-bottom: 5px solid var(--cz-line); }
@keyframes w-sign-glow { 50% { box-shadow: 0 0 0 6px var(--cz-ledge); } }
.w-sign-line { padding: 8px 10px; border-radius: var(--cz-r-sm); background: var(--cz-surface); border: 2px solid var(--cz-ledge); }
.w-sign-story { margin: 10px 0 0; padding: 8px 12px; border-radius: 16px; background: var(--cz-sunk); border: 2px solid var(--cz-ledge); color: var(--cz-ink); font-size: 16px; line-height: 1.35; }

@keyframes w-sign-shine { 50% { box-shadow: 0 3px 0 var(--cz-ledge), 0 0 20px var(--cz-main); } }

.w-sign-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.w-sign-row { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 12px; background: var(--cz-sunk); color: var(--cz-ink); font-weight: 800; }
.w-sign-row.read { background: var(--cz-surface); }
@media (max-width: 420px) { .w-sign-line { font-size: 16px; } }
.w-setting { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; padding: 8px 0; border-bottom: 2px solid var(--cz-sunk); font-weight: 800; flex-wrap: wrap; }
.w-setting > span { flex: 1 1 110px; }
.w-setting-options { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.w-setting-options .w-choice { min-width: 64px; padding: 6px 12px; min-height: 40px; }
.w-install-btn { margin-top: 10px; }
.w-install { margin: 8px 0 0; padding: 10px 12px; border-radius: 14px; background: var(--cz-sunk); font-weight: 700; line-height: 1.35; }
.w-install[hidden] { display: none; }
.w-install p { margin: 0 0 8px; }
.w-install p:last-child { margin: 0; }
.w-install-step:first-of-type { font-weight: 800; }
.w-settings-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.w-settings-actions .w-btn { display: block; width: 100%; }
.w-settings-actions .w-logout { background: var(--cz-surface); color: var(--cz-danger); box-shadow: 0 3px 0 var(--cz-ledge); }.w-choice[aria-pressed="true"] { background: var(--cz-main); box-shadow: 0 3px 0 var(--cz-ledge); }

.maker { position: fixed; left: 0; right: 0; bottom: 0; max-height: 58%; overflow-y: auto; background: var(--cz-surface);
  border-radius: var(--cz-r-lg) var(--cz-r-lg) 0 0; padding: 14px 16px max(16px, env(safe-area-inset-bottom)); box-shadow: 0 -6px 24px var(--cz-ledge);
  box-sizing: border-box; }
.maker-title { text-align: center; font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.maker-row { display: block; margin: 8px 0; }
.maker-label { font-weight: 800; margin-bottom: 4px; }
.maker-options { display: flex; flex-wrap: wrap; gap: 8px; }
.maker-opt { font: 800 16px 'Baloo 2', system-ui, sans-serif; border: 3px solid transparent; border-radius: var(--cz-r-sm); padding: 6px 12px;
  background: var(--cz-sunk); color: var(--cz-ink); cursor: pointer; min-height: 44px; }
.maker-opt.swatch { width: 44px; padding: 0; }
.maker-opt[aria-pressed="true"] { border-color: var(--cz-line); box-shadow: 0 0 0 3px var(--cz-ok); }
.maker-name { font: 700 18px 'Baloo 2', system-ui, sans-serif; padding: 8px 12px; border-radius: var(--cz-r-sm); border: 2px solid var(--cz-line);
  width: min(260px, 100%); box-sizing: border-box; margin-top: 4px; user-select: text; -webkit-user-select: text; }
.maker-done { display: block; margin: 14px auto 4px; font: 800 22px 'Baloo 2', system-ui, sans-serif; border: 4px solid var(--cz-line);
  border-radius: var(--cz-r-pill); padding: 10px 34px; background: var(--cz-main); color: var(--cz-on-main); box-shadow: 0 6px 0 var(--cz-ledge); cursor: pointer; }
/* The creator's buttons stay in sight at the bottom of the panel while the rows scroll. */
.maker-bar { display: flex; gap: 10px; justify-content: center; align-items: center; position: sticky; bottom: calc(-1 * max(16px, env(safe-area-inset-bottom)));
  margin: 8px -16px calc(-1 * max(16px, env(safe-area-inset-bottom))); padding: 8px 16px max(16px, env(safe-area-inset-bottom)); background: var(--cz-surface); box-shadow: 0 -6px 8px -6px var(--cz-ledge); z-index: 2; }
.maker-bar button { margin: 0; min-height: 48px; }
.maker-bar .maker-done { font-size: 20px; padding: 8px 30px; box-shadow: 0 5px 0 var(--cz-ledge); }
.maker-bar .maker-back { margin: 0; }
.maker [hidden] { display: none; }
.maker-step { text-align: center; font-weight: 800; font-size: 17px; }
.maker-dots { display: flex; gap: 8px; justify-content: center; margin: 4px 0 6px; }
.maker-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--cz-surface); border: 2px solid var(--cz-line); box-sizing: border-box; }
.maker-dot[aria-current="true"] { background: var(--cz-line); }
.maker-opt { position: relative; }
.maker-opt[aria-pressed="true"]::after { content: '✓'; position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; border-radius: 50%; background: var(--cz-ok); color: var(--cz-on-ok);
  font: 800 13px/20px system-ui, sans-serif; text-align: center; box-shadow: 0 0 0 2px var(--cz-surface); }
@media (orientation: portrait) { .maker { max-height: 45%; } }

.resting { z-index: 50; position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; background: var(--cz-sunk); }
.resting-card { background: var(--cz-surface); border-radius: var(--cz-r-lg); padding: 24px; text-align: center; max-width: 420px; box-shadow: 0 6px 0 var(--cz-ledge); }
.resting-emoji { font-size: 56px; }
.resting-card h1 { font-size: 26px; margin: 6px 0; }
.resting-card .w-btn { display: inline-block; margin-top: 10px; }
@media (prefers-reduced-motion: reduce) { .w-act { transition: none; } }

/* Speech bubble (talk.js). It sits under the top bar (--hud) and scrolls inside itself when the words are long. */
.talk { --hud: calc(max(14px, env(safe-area-inset-top)) + 54px); --pad: 16px;
  position: fixed; left: 50%; top: var(--hud); transform: translateX(-50%); width: min(560px, calc(100% - 32px)); box-sizing: border-box;
  background: var(--cz-surface); border-radius: var(--cz-r-lg); padding: 14px 20px var(--pad); text-align: center; color: var(--cz-ink);
  box-shadow: 0 0 0 3px var(--cz-line), 0 6px 0 3px var(--cz-ledge), var(--cz-shadow); z-index: 20; max-height: calc(100% - var(--hud) - 16px);
  overflow-y: auto; overscroll-behavior: contain; }
.talk { --k-focus: var(--cz-line); border: 3px solid var(--cz-line); animation: talkPop .28s ease-out; }
.talk-who { display: inline-block; font-weight: 800; color: var(--cz-on-main); font-size: 15px; letter-spacing: .3px; padding: 2px 14px;
  border-radius: var(--cz-r-pill); background: var(--cz-main); box-shadow: inset 0 0 0 2px var(--cz-line), 0 2px 0 var(--cz-ledge); }
.talk-btn.main { animation: talkGlow 1.8s ease-in-out infinite; }
@keyframes talkPop { from { opacity: 0; transform: translateX(-50%) scale(.92); } to { opacity: 1; transform: translateX(-50%) scale(1); } }
@keyframes talkGlow { 0%, 100% { box-shadow: 0 4px 0 var(--cz-ledge), 0 0 0 0 transparent; }
  50% { box-shadow: 0 4px 0 var(--cz-ledge), 0 0 14px 4px var(--cz-main); } }
@media (prefers-reduced-motion: reduce) { .talk, .talk-btn.main { animation: none; } }
.talk-say { font-size: 21px; font-weight: 800; line-height: 1.3; margin: 6px 0 10px; white-space: pre-line; overflow-wrap: anywhere; }
.talk-sub { font-size: 16px; font-weight: 600; line-height: 1.4; margin: -4px 0 12px; color: var(--cz-ink-soft); overflow-wrap: anywhere; }
.talk-sub p { margin: 0 0 6px; }
.talk-sub.long { text-align: left; background: var(--cz-sunk); color: var(--cz-ink); border-radius: var(--cz-r-sm); padding: 10px 14px 4px; }
.talk-sub.ask { font-size: 20px; font-weight: 800; color: var(--cz-ink); background: var(--cz-sunk); border: 2px solid var(--cz-line);
  border-radius: var(--cz-r-sm); padding: 10px 14px 4px; margin: 4px 0 14px; }
/* The pet teacher (teach.js): her pick in soft red, the right answer in green, then numbered steps. */
.talk-teach { text-align: left; margin: 0 0 10px; }
.talk-chip { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0 0 6px; padding: 8px 12px;
  border-radius: var(--cz-r-sm); font-size: 16px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.talk-chip.bad { background: var(--cz-sunk); color: var(--cz-ink); box-shadow: inset 5px 0 0 var(--cz-terracotta); }
.talk-chip.good { background: var(--cz-ok); color: var(--cz-on-ok); }
.talk-chip-label { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; opacity: .85; }
.talk-steps { margin: 8px 0 0; padding: 10px 14px 4px 34px; background: var(--cz-sunk); border-radius: var(--cz-r-sm); color: var(--cz-ink);
  font-size: 16px; font-weight: 600; line-height: 1.4; }
.talk-steps li { margin: 0 0 6px; white-space: pre-line; overflow-wrap: anywhere; }
/* The buttons stay in sight at the bottom of a long bubble while the words scroll. */
.talk-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; position: sticky; bottom: calc(-1 * var(--pad));
  margin: 0 -8px calc(-1 * var(--pad)); padding: 8px 8px var(--pad); background: var(--cz-surface); }
.talk-btn { font: 800 17px 'Baloo 2', system-ui, sans-serif; border: 0; border-radius: var(--cz-r-sm); padding: 8px 20px; min-height: 44px;
  background: var(--cz-sunk); color: var(--cz-ink); box-shadow: inset 0 0 0 2px var(--cz-line), 0 3px 0 var(--cz-ledge); cursor: pointer; }
.talk-btn.main { background: var(--cz-main); color: var(--cz-on-main); box-shadow: inset 0 0 0 2px var(--cz-line), 0 4px 0 var(--cz-ledge); }
.talk-btn.alt { font-size: 15px; min-height: 40px; background: var(--cz-surface); color: var(--cz-ink); box-shadow: inset 0 0 0 2px var(--cz-line); }
.talk-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; padding-top: 12px;
  border-top: 2px dashed var(--cz-ledge); }
.talk-row.stack { flex-direction: column; align-items: stretch; position: static; }
.talk-row.stack .talk-btn { border-radius: var(--cz-r-sm); padding: 10px 16px; line-height: 1.3; overflow-wrap: anywhere; }
@media (max-width: 420px) {
  .talk { --hud: calc(max(14px, env(safe-area-inset-top)) + 48px); padding: 12px 14px var(--pad); width: calc(100% - 24px); --pad: 14px; }
  .talk-say { font-size: 19px; }
  .talk-sub { font-size: 15px; }
  .talk-sub.ask { font-size: 18px; }
  .talk-btn { font-size: 16px; padding: 8px 16px; }
}
/* Phones turned sideways: smaller words, and answers in two columns so they fit. */
@media (max-height: 520px) {
  .talk { --hud: calc(max(10px, env(safe-area-inset-top)) + 50px);
    width: min(640px, calc(100% - 232px)); padding: 10px 16px var(--pad); --pad: 12px; }
  .talk-say { font-size: 18px; margin: 4px 0 8px; }
  .talk-sub { font-size: 14px; margin-bottom: 8px; }
  .talk-sub.ask { font-size: 16px; margin-bottom: 8px; }
  .talk-btn.alt { font-size: 14px; min-height: 36px; }
  .talk-actions { margin-top: 8px; padding-top: 8px; }
  .talk-btn { font-size: 15px; min-height: 40px; padding: 6px 16px; }
  .talk-row.stack { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .talk-row.stack .talk-btn { padding: 6px 12px; }
  .talk-row.stack .talk-btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
.maker-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.maker-tab { font: 800 15px 'Baloo 2', system-ui, sans-serif; border: 3px solid transparent; border-radius: var(--cz-r-pill); padding: 4px 12px;
  background: var(--cz-sunk); color: var(--cz-ink); cursor: pointer; min-height: 40px; }
.maker-tab[aria-pressed="true"] { border-color: var(--cz-line); background: var(--cz-ok); color: var(--cz-on-ok); }
.maker-shop { display: block; margin: 8px auto 0; font: 800 16px 'Baloo 2', system-ui, sans-serif; border: 3px solid var(--cz-line); border-radius: var(--cz-r-pill); background: var(--cz-sunk); box-shadow: 0 3px 0 var(--cz-ledge);
  color: var(--cz-ink); cursor: pointer; min-height: 44px; padding: 4px 18px; }
.maker-shop:active { transform: translateY(3px); box-shadow: none; }
.maker { color: var(--cz-ink); }
.w-treat { position: fixed; right: 16px; bottom: 124px; }
@media (max-height: 520px) { .w-treat { bottom: 92px; } }
/* Sprint: a round button in the bottom-right corner, under the Treat stack. */
.w-sprint { position: fixed; right: 16px; bottom: max(24px, env(safe-area-inset-bottom)); width: 56px; height: 56px; border: 0;
  border-radius: 50%; background: var(--cz-hud); box-shadow: 0 4px 0 var(--cz-ledge); font-size: 28px; line-height: 1; cursor: pointer; }
.w-sprint[aria-pressed="true"] { background: var(--cz-hud-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--cz-hud-accent) 40%, transparent), 0 4px 0 var(--cz-ledge); }
.w-sprint[aria-disabled="true"] { opacity: .45; }
/* The heart: left of the run button on wide screens; the rail puts it above the button on a narrow phone. */
.w-heart { position: fixed; right: 80px; bottom: calc(max(24px, env(safe-area-inset-bottom)) + 12px); z-index: 5;
  animation: w-heart 1.2s ease-in-out infinite; }
.w-heart[hidden] { display: none; }
@keyframes w-heart { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@media (prefers-reduced-motion: reduce) { .w-heart { animation: none; } }
/* On a mid-width screen the tired label could reach the centred action button: sit beside Treat instead. */
@media (min-width: 601px) and (max-width: 760px) {
  .w-heart { right: 136px; bottom: 124px; }
}
@media (min-width: 601px) and (max-width: 760px) and (max-height: 520px) { .w-heart { bottom: 92px; } }
/* Zoom gauge: + at the top, the level in the middle (full = zoomed in), − at the bottom; on the left edge, clear of the joystick. */
.w-zoom { position: fixed; left: 12px; top: 50%; transform: translateY(-50%); z-index: 5; display: flex; flex-direction: column;
  align-items: center; gap: 8px; padding: 8px; border-radius: 999px; background: var(--cz-hud); box-shadow: 0 3px 0 var(--cz-ledge); }
.w-zoom[hidden] { display: none; }
.w-zoom-btn { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--cz-plum-deep); color: var(--cz-on-hud); font: 800 24px/1 'Baloo 2', system-ui, sans-serif; cursor: pointer; }
.w-zoom-track { position: relative; width: 10px; height: 84px; border-radius: 999px; background: var(--cz-plum-deep); overflow: hidden; }
.w-zoom-track span { position: absolute; left: 0; right: 0; bottom: 0; background: var(--cz-hud-accent); }
@media (max-height: 520px) { .w-zoom-track { height: 40px; } }
.w-speed { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity .2s;
  background: repeating-conic-gradient(from 0deg at 50% 50%, color-mix(in srgb, var(--cz-cream) 60%, transparent) 0deg 1.2deg, transparent 1.2deg 7deg);
  -webkit-mask-image: radial-gradient(ellipse at center, transparent 58%, var(--cz-plum) 88%);
  mask-image: radial-gradient(ellipse at center, transparent 58%, var(--cz-plum) 88%); }
.w-speed.on { opacity: .75; animation: w-speed .3s linear infinite alternate; }
@keyframes w-speed { to { transform: scale(1.05); } }
@media (prefers-reduced-motion: reduce) { .w-speed { display: none; } }
.w-play { position: fixed; right: 16px; bottom: 180px; }
.w-emote { position: fixed; right: 16px; bottom: 236px; }
.w-use { position: fixed; right: 16px; bottom: 292px; }
.w-playrow, .w-emoterow { position: fixed; right: 16px; bottom: 348px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; max-width: calc(100vw - 32px);
  max-height: min(34vh, max(44px, calc(100vh - 348px - 72px))); overflow-y: auto; }
.w-play-item { min-height: 44px; }
@media (max-height: 520px) {
  .w-play { bottom: 148px; }
  .w-emote { bottom: 204px; }
  .w-use { bottom: 260px; }
  .w-playrow, .w-emoterow { bottom: 316px; max-height: max(44px, calc(100vh - 316px - 72px)); }
}

/* Game cards (gamecards.js): every playground game as a card; two columns on a wide screen, one on a phone. */
.gc { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; box-sizing: border-box;
  padding: max(16px, env(safe-area-inset-top)) 16px 16px; background: var(--cz-scrim); }
.gc-panel { width: min(640px, 100%); max-height: 100%; box-sizing: border-box; overflow-y: auto; overscroll-behavior: contain;
  background: var(--cz-surface); color: var(--cz-ink); border-radius: var(--cz-r-lg); padding: 14px 16px 16px; text-align: center;
  box-shadow: 0 6px 0 var(--cz-ledge), var(--cz-shadow); }
.gc-who { font-weight: 800; color: var(--cz-ink-soft); font-size: 15px; letter-spacing: .3px; }
.gc-title { font-size: 21px; font-weight: 800; line-height: 1.3; margin: 6px 0 4px; overflow-wrap: anywhere; }
.gc-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 10px 0 14px; }
@media (min-width: 560px) { .gc-grid { grid-template-columns: 1fr 1fr; } }
.gc-card { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; text-align: left; min-height: 64px;
  border: 0; border-radius: var(--cz-r-md); padding: 10px 14px; background: var(--cz-sunk); color: var(--cz-ink); cursor: pointer;
  font: 600 15px/1.3 'Baloo 2', system-ui, sans-serif; box-shadow: inset 0 0 0 2px var(--cz-line), 0 4px 0 var(--cz-ledge); }
.gc-card:active { transform: translateY(2px); box-shadow: inset 0 0 0 2px var(--cz-line), 0 2px 0 var(--cz-ledge); }
.gc-card:focus-visible, .gc-bye:focus-visible { outline: 3px solid var(--cz-line); outline-offset: 2px; }
.gc-icon { grid-row: 1 / span 4; font-size: 40px; line-height: 1; }
.gc-name { font-size: 19px; font-weight: 800; overflow-wrap: anywhere; }
.gc-desc { overflow-wrap: anywhere; }
.gc-tag { justify-self: start; margin-top: 4px; padding: 1px 10px; border-radius: 999px; background: var(--cz-cream); color: var(--cz-ink);
  font-size: 12px; font-weight: 800; letter-spacing: .3px; }
.gc-ribbon { grid-column: 2; justify-self: start; margin-top: 4px; padding: 2px 8px; border-radius: 999px; background: var(--cz-ok);
  color: var(--cz-on-ok); font-size: 12px; font-weight: 800; }
.gc-bye { font: 800 17px 'Baloo 2', system-ui, sans-serif; border: 2px solid var(--cz-line); border-radius: var(--cz-r-pill); padding: 8px 24px; min-height: 44px;
  background: var(--cz-surface); color: var(--cz-ink); cursor: pointer; }

/* Playground games (games3d.js): the pill with the game and the time, the big count, Disguise and Boo!. */
.g-pill { position: fixed; left: 50%; width: max-content; transform: translateX(-50%); top: calc(max(14px, env(safe-area-inset-top)) + 56px); z-index: 12;
  display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px); box-sizing: border-box;
  background: var(--cz-hud); color: var(--cz-on-hud); border-radius: 999px; padding: 6px 8px 6px 16px;
  font: 800 16px 'Baloo 2', system-ui, sans-serif; box-shadow: 0 4px 0 var(--cz-ledge); }
.g-pill-text { overflow-wrap: anywhere; line-height: 1.25; }
.tb-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(max(14px, env(safe-area-inset-bottom)) + 8px); z-index: 12;
  display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: calc(100% - 24px); box-sizing: border-box;
  padding: 4px 8px; border-radius: 18px; background: color-mix(in srgb, var(--cz-hud) 55%, transparent); box-shadow: none; }
.tb-bar.tb-free { bottom: calc(max(24px, env(safe-area-inset-bottom)) + 184px); }
.tb-meter { width: min(240px, 60vw); height: 14px; border-radius: 999px; background: var(--cz-plum-deep); border: 2px solid var(--cz-on-hud); overflow: hidden; }
.tb-fill { width: 0; height: 100%; border-radius: 999px; background: repeating-linear-gradient(115deg, var(--cz-teal) 0 10px, color-mix(in srgb, var(--cz-teal) 70%, var(--cz-cream)) 10px 20px); background-size: 28px 100%; animation: tb-flow .5s linear infinite; }
.tb-row { display: flex; gap: 10px; align-items: center; }
.rt-pad { position: fixed; inset: 0; z-index: 11; touch-action: none; user-select: none; -webkit-user-select: none; }
.rt-bar { pointer-events: none; }
.bd-pad { position: fixed; inset: 0; z-index: 11; touch-action: none; user-select: none; -webkit-user-select: none; }
.bd-bar { pointer-events: none; }
.bd-bar .tb-meter { position: relative; }
.bd-label { margin-bottom: 4px; text-align: center; color: var(--cz-on-hud); font: 800 15px/1.2 'Baloo 2', system-ui, sans-serif; text-shadow: 0 1px 3px var(--cz-plum-deep); }
.sh-pad { position: fixed; inset: 0; z-index: 11; touch-action: none; user-select: none; -webkit-user-select: none; }
.tb-hold, .tb-stand { min-height: 48px; border: 3px solid var(--cz-line); border-radius: 18px; background: var(--cz-sunk); color: var(--cz-ink); box-shadow: 0 4px 0 var(--cz-ledge);
  font: 800 18px 'Baloo 2', system-ui, sans-serif; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; transition: transform .1s ease-out, box-shadow .1s ease-out; }
.tb-hold, .tb-stand { padding: 0 20px; }
.tb-hold { min-width: 150px; background: var(--cz-main); box-shadow: 0 5px 0 var(--cz-ledge); font-size: 20px; }
.tb-stand:active, .tb-hold:active { transform: translateY(4px); box-shadow: 0 0 0 transparent; }
.tb-hold.tb-charging { background: color-mix(in srgb, var(--cz-main) 78%, var(--cz-terracotta)); box-shadow: 0 0 0 transparent; transform: translateY(4px) scale(1.04); animation: tb-throb .45s ease-in-out infinite alternate; }
@keyframes tb-flow { to { background-position: 28px 0; } }
@keyframes tb-throb { to { filter: brightness(1.12); } }
@media (prefers-reduced-motion: reduce) { .tb-fill, .tb-hold.tb-charging { animation: none; } }
.tb-hold:focus-visible, .tb-stand:focus-visible { outline: 3px solid var(--cz-hud-accent); outline-offset: 2px; }
.pk-bar .tb-meter { position: relative; }
.pk-band { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--cz-leaf) 60%, transparent); }
.pk-foot { min-width: 92px; padding: 0 8px; flex: 1; min-height: 64px; border: 3px solid var(--cz-plum-deep); border-radius: 18px; background: var(--cz-hud); color: var(--cz-on-hud); box-shadow: 0 4px 0 var(--cz-ledge);
  font: 800 22px 'Baloo 2', system-ui, sans-serif; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; transition: transform .1s ease-out, box-shadow .1s ease-out; }
.pk-foot:active { transform: translateY(4px); box-shadow: 0 0 0 transparent; }
.pk-foot:focus-visible { outline: 3px solid var(--cz-hud-accent); outline-offset: 2px; }
/* Jump owns the bottom-right corner, the easiest place for the right thumb. Sprint, the heart and the Treat stack step aside
   only while the lane is open. */
.lk-bar { position: fixed; right: 16px; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 12; }
.lk-jump { position: relative; display: grid; place-items: center; align-content: center; width: 100px; height: 100px; padding: 0;
  border: 5px solid var(--cz-line); border-radius: 50%; color: var(--cz-on-main); cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none;
  background: var(--cz-main);
  box-shadow: 0 8px 0 var(--cz-ledge), 0 14px 22px var(--cz-ledge), inset 0 -6px 10px transparent;
  font: 800 20px/1 'Baloo 2', system-ui, sans-serif; letter-spacing: .3px; transition: transform .08s, box-shadow .08s;
  animation: lk-pulse 1.6s ease-out infinite; }
.lk-jump::before { content: ''; position: absolute; left: 18%; top: 8%; width: 64%; height: 30%; border-radius: 50%;
  background: none; pointer-events: none; }
.lk-jump-arrow { position: relative; width: 26px; height: 26px; margin-top: 4px; animation: lk-hop .8s ease-in-out infinite; }
.lk-jump-arrow::before, .lk-jump-arrow::after { content: ''; position: absolute; left: 4px; width: 18px; height: 18px; box-sizing: border-box;
  border: solid var(--cz-on-main); border-width: 5px 0 0 5px; border-radius: 3px 0 0 0; transform: rotate(45deg); }
.lk-jump-arrow::before { top: 8px; }
.lk-jump-arrow::after { top: 0; opacity: .55; }
.lk-bar.is-idle .lk-jump { opacity: .55; animation: none; }
/* Tree Hoop team games: the Pass button sits above the shot meter, clear of the dock window; in portrait it sits left of Shoot, because the rail (Run and skills) fills the column above Shoot. */
.lk-pass { position: absolute; right: 12px; bottom: 130px; width: 60px; height: 60px; padding: 0; border: 4px solid var(--cz-plum-deep); border-radius: 50%; color: var(--cz-on-hud);
  background: var(--cz-blue-deep); box-shadow: 0 6px 0 var(--cz-ledge), 0 10px 16px var(--cz-ledge);
  font: 800 14px/1.05 'Baloo 2', system-ui, sans-serif; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }
.lk-pass:active { transform: translateY(3px); box-shadow: 0 3px 0 var(--cz-ledge); }
.lk-pass.is-off { display: none; }
/* Tree Hoop Block: the same slot as Pass, but red with a hand, bigger, glowing when the shooter is in reach, and a dark sweep while it recharges. */
.lk-side-icon { display: block; font-size: 24px; line-height: 1; }
.lk-side-icon:empty { display: none; }
.lk-pass.is-block { width: 72px; height: 72px; display: grid; place-items: center; align-content: center; gap: 1px; position: absolute; transition: transform .08s, box-shadow .08s, opacity .15s;
  background: var(--cz-danger); box-shadow: 0 6px 0 var(--cz-ledge), 0 10px 16px var(--cz-ledge); }
.lk-pass.is-block:active { box-shadow: 0 3px 0 var(--cz-ledge); }
.lk-pass.is-rebound { background: var(--cz-ok); box-shadow: 0 6px 0 var(--cz-ledge), 0 10px 16px var(--cz-ledge); }
.lk-pass.is-rebound:active { box-shadow: 0 3px 0 var(--cz-ledge); }
.lk-pass.is-block.is-near { animation: lk-block-ready .7s ease-out infinite; }
.lk-pass.is-block.is-cool { opacity: .6; }
.lk-pass.is-block.is-cool::after { content: ''; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: conic-gradient(color-mix(in srgb, var(--cz-plum-deep) 55%, transparent) calc(var(--cool, 0) * 360deg), transparent 0); }
@keyframes lk-block-ready { 0% { box-shadow: 0 6px 0 var(--cz-ledge), 0 10px 16px var(--cz-ledge), 0 0 0 0 color-mix(in srgb, var(--cz-terracotta) 85%, transparent); }
  100% { box-shadow: 0 6px 0 var(--cz-ledge), 0 10px 16px var(--cz-ledge), 0 0 0 18px transparent; } }
@media (prefers-reduced-motion: reduce) { .lk-pass.is-block.is-near { animation: none; outline: 4px solid var(--cz-hud-accent); } }
@media (max-height: 520px) { .lk-pass { bottom: 112px; width: 56px; height: 56px; font-size: 12px; } .lk-pass.is-block { width: 64px; height: 64px; } .lk-side-icon { font-size: 20px; } }
@media (max-width: 600px) and (min-height: 521px) { .lk-pass { right: 112px; bottom: 20px; } }
.lk-jump-label { position: relative; text-shadow: none; }
.lk-jump:active { transform: translateY(6px) scale(.97); box-shadow: 0 2px 0 var(--cz-ledge), 0 6px 12px var(--cz-ledge), inset 0 -4px 8px transparent; animation: none; }
.lk-jump:focus-visible { outline: 4px solid var(--cz-hud-accent); outline-offset: 4px; }
@keyframes lk-pulse { 0% { box-shadow: 0 8px 0 var(--cz-ledge), 0 14px 22px var(--cz-ledge), inset 0 -6px 10px transparent, 0 0 0 0 color-mix(in srgb, var(--cz-main) 80%, transparent); }
  70%, 100% { box-shadow: 0 8px 0 var(--cz-ledge), 0 14px 22px var(--cz-ledge), inset 0 -6px 10px transparent, 0 0 0 22px transparent; } }
@keyframes lk-hop { 0%, 100% { transform: translateY(2px); } 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .lk-jump, .lk-jump-arrow { animation: none; } }
body:has(> .lk-bar) .w-sprint { right: 128px; }
body:has(> .lk-bar) .w-heart { right: 192px; }
body:has(> .lk-bar) .w-treat { bottom: 140px; }
@media (max-height: 520px) {
  .lk-jump { width: 80px; height: 80px; font-size: 17px; }
  .lk-jump-arrow { transform: scale(.8); margin-top: 0; }
  body:has(> .lk-bar) .w-sprint { right: 108px; }
  body:has(> .lk-bar) .w-heart { right: 172px; }
  body:has(> .lk-bar) .w-treat { bottom: 112px; }
}
@media (max-width: 600px) and (max-height: 520px) { body:has(> .lk-bar) > .w-rail { right: 108px; } }
@media (max-width: 600px) { body:has(> .lk-bar) .w-rail > * { right: auto; bottom: auto; } }
/* Sipa's Kick button is a little bigger (120, or 96 on a short screen); the other buttons move out by the same 20 or 16. */
.lk-bar.is-sipa .lk-jump { width: 120px; height: 120px; font-size: 23px; }
.lk-bar.is-sipa .lk-jump-arrow { transform: scale(1.2); }
body:has(> .lk-bar.is-sipa) .w-sprint { right: 148px; }
body:has(> .lk-bar.is-sipa) .w-heart { right: 212px; }
body:has(> .lk-bar.is-sipa) .w-treat { bottom: 160px; }
@media (max-height: 520px) {
  .lk-bar.is-sipa .lk-jump { width: 96px; height: 96px; font-size: 19px; }
  .lk-bar.is-sipa .lk-jump-arrow { transform: scale(.95); }
  body:has(> .lk-bar.is-sipa) .w-sprint { right: 124px; }
  body:has(> .lk-bar.is-sipa) .w-heart { right: 188px; }
  body:has(> .lk-bar.is-sipa) .w-treat { bottom: 128px; }
}
@media (max-width: 600px) and (min-height: 521px) {
  body:has(> .lk-bar.is-sipa) > .w-rail { bottom: calc(max(24px, env(safe-area-inset-bottom)) + 138px); gap: 6px; }
  body:has(> .lk-bar.is-sipa) > .w-rail > .w-skills { gap: 6px; padding: 4px; }
}
@media (max-width: 600px) and (max-height: 520px) { body:has(> .lk-bar.is-sipa) > .w-rail { right: 124px; } }
.g-count { position: fixed; inset: 0; z-index: 11; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 45%, var(--cz-plum), var(--cz-plum-deep) 75%); color: var(--cz-on-hud); font: 800 120px 'Baloo 2', system-ui, sans-serif;
  text-shadow: 0 6px 0 var(--cz-plum-deep), 0 10px 30px var(--cz-ledge); }
.g-count-eyes { font-size: 72px; line-height: 1; text-shadow: none; }
.g-count-n { line-height: 1.1; }
.g-hint { position: fixed; left: 50%; width: max-content; transform: translateX(-50%); top: calc(max(14px, env(safe-area-inset-top)) + 108px); z-index: 12;
  max-width: calc(100% - 32px); box-sizing: border-box; padding: 6px 16px; border-radius: 16px; text-align: center;
  background: var(--cz-hud); color: var(--cz-on-hud); font: 800 15px 'Baloo 2', system-ui, sans-serif; box-shadow: 0 3px 0 var(--cz-ledge); }
/* The referee's call sits in a slim strip at the top, under the pill, so the play in the middle stays clear. */
.g-ref { position: fixed; left: 50%; transform: translateX(-50%); top: calc(max(14px, env(safe-area-inset-top)) + 56px); z-index: 12; opacity: .94; width: max-content; max-width: calc(100% - 32px);
  box-sizing: border-box; padding: 4px 14px; border-radius: 14px; text-align: center; pointer-events: none;
  background: var(--cz-surface); color: var(--cz-ink); border: 2px solid var(--cz-line); font: 800 18px 'Baloo 2', system-ui, sans-serif; box-shadow: 0 4px 0 var(--cz-ledge); }
.g-ref[hidden] { display: none; }
.g-ref-skip ~ .g-ref-skip { margin-top: 6px; }
.g-ref-skip { margin-left: 10px; min-height: 44px; padding: 0 16px; border: 0; border-radius: 22px; pointer-events: auto; cursor: pointer;
  background: var(--cz-ink); color: var(--cz-surface); font: inherit; font-size: 16px; vertical-align: middle; }
@media (max-width: 420px) { .g-ref { font-size: 16px; } }
/* Who is playing, under the hint: one row of chips (two in Patintero, blue and red); the one who is "it" is gold. */
.g-roster { position: fixed; left: 50%; width: max-content; max-width: calc(100% - 72px); transform: translateX(-50%); top: calc(max(14px, env(safe-area-inset-top)) + 150px); z-index: 12;
  display: flex; flex-direction: column; gap: 4px; align-items: center; max-width: calc(100% - 16px); pointer-events: none; }
.g-roster[hidden] { display: none; }
.g-roster-row { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; padding: 3px 6px; border-radius: 16px; background: var(--cz-hud); }
.g-roster-row.blue { box-shadow: 0 0 0 2px var(--cz-blue); }
.g-roster-row.red { box-shadow: 0 0 0 2px var(--cz-terracotta); }
.g-chip { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px 1px 4px; border-radius: 999px; background: var(--cz-sunk); color: var(--cz-ink);
  font: 800 12px 'Baloo 2', system-ui, sans-serif; line-height: 1.3; }
.g-chip.sis { background: var(--cz-cream); }
.g-chip.it { background: var(--cz-main); box-shadow: 0 0 0 2px var(--cz-on-hud); }
.g-chip-face { font-size: 14px; }
/* A small speaker at the right that flashes when a hidden kid makes a noise; more waves when closer. */
.g-noise { position: fixed; right: 12px; top: calc(max(14px, env(safe-area-inset-top)) + 150px); z-index: 12;
  padding: 8px 18px; border-radius: 22px; background: var(--cz-main); box-shadow: 0 0 0 4px var(--cz-line), 0 4px 0 4px var(--cz-ledge); font-size: 44px; line-height: 1.1;
  pointer-events: none; animation: g-noise-pop .35s ease-out infinite alternate; }
@keyframes g-noise-pop { from { transform: scale(0.9) rotate(-6deg); } to { transform: scale(1.15) rotate(6deg); } }
@media (prefers-reduced-motion: reduce) { .g-noise { animation: none; } }
.g-danger { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
/* The pulse fades a fixed shadow: animating the shadow itself repaints the whole screen every frame. */
.g-danger::before { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 100px 34px color-mix(in srgb, var(--cz-terracotta) 80%, transparent);
  animation: g-pulse .5s ease-in-out infinite alternate; will-change: opacity; }
@keyframes g-pulse { from { opacity: .65; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .g-danger::before { animation: none; } }
.g-act { position: fixed; left: 50%; transform: translateX(-50%); bottom: 112px; z-index: 12; font: 800 19px 'Baloo 2', system-ui, sans-serif;
  border: 0; border-radius: 999px; padding: 10px 22px; min-height: 48px; cursor: pointer; color: var(--cz-on-main);
  background: var(--cz-main); box-shadow: 0 4px 0 var(--cz-ledge); }
/* A contextual button bounces in when it appears (games/hud.js pop); `scale` keeps each button's own transform. */
.g-pop { animation: g-pop .18s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes g-pop { from { scale: .6; } to { scale: 1; } }
@media (prefers-reduced-motion: reduce) { .g-pop { animation: none; } }
@keyframes sb-pop { from { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.12); } to { transform: scale(1); opacity: 1; } }
@keyframes sb-glow { 0%, 100% { box-shadow: 0 5px 0 var(--cz-ledge), 0 0 14px 3px color-mix(in srgb, var(--cz-main) 60%, transparent); } 50% { box-shadow: 0 5px 0 var(--cz-ledge), 0 0 28px 9px color-mix(in srgb, var(--cz-main) 95%, transparent); } }
@keyframes sb-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
@keyframes sb-danger { 0% { opacity: 0; } 15% { opacity: 1; } 35% { opacity: .35; } 55% { opacity: .9; } 100% { opacity: 0; } }
@keyframes sb-bob { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-4px) rotate(1.5deg); } }
@keyframes sb-nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(5px); } }

.g-boo { background: var(--cz-main); box-shadow: 0 4px 0 var(--cz-ledge); }
/* The Patintero replay: in the hint's place (hidden meanwhile), at most 40px tall so it stays clear of the roster. */
.g-replay { position: fixed; left: 50%; width: max-content; transform: translateX(-50%); top: calc(max(14px, env(safe-area-inset-top)) + 108px); z-index: 12;
  display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px); box-sizing: border-box; padding: 2px 2px 2px 14px;
  border-radius: 999px; background: var(--cz-hud); color: var(--cz-on-hud); font: 800 15px 'Baloo 2', system-ui, sans-serif; white-space: nowrap; }
.g-replay-skip { flex: none; font: 800 14px 'Baloo 2', system-ui, sans-serif; border: 0; border-radius: 999px; padding: 6px 14px; min-height: 36px;
  background: var(--cz-sunk); color: var(--cz-ink); cursor: pointer; }
@media (max-width: 420px) { .g-pill { font-size: 14px; } .g-count { font-size: 90px; } .g-hint { font-size: 13px; top: calc(max(14px, env(safe-area-inset-top)) + 116px); } .g-replay { top: calc(max(14px, env(safe-area-inset-top)) + 116px); } .g-roster, .g-noise { top: calc(max(14px, env(safe-area-inset-top)) + 170px); } .g-roster { max-width: calc(100% - 72px); } }
/* Phones and tablets: a slim HUD so it stays out of the play view. Roster chips keep only the face (the one who is "it" keeps the name). */
@media (max-width: 900px), (max-height: 520px) {
  .g-pill { font-size: 13px; padding: 2px 4px 2px 12px; gap: 6px; background: var(--cz-hud); box-shadow: 0 2px 0 var(--cz-ledge); }
  .g-hint { font-size: 12px; padding: 3px 12px; background: var(--cz-hud); box-shadow: none; }
  .g-hint, .g-replay { top: calc(max(10px, env(safe-area-inset-top)) + 92px); }
  .g-roster, .g-noise { top: calc(max(10px, env(safe-area-inset-top)) + 122px); }
  .g-roster { gap: 2px; }
  .g-roster-row { gap: 2px; padding: 2px 4px; background: var(--cz-hud); }
  .g-chip { padding: 0 4px; font-size: 11px; }
  .g-chip:not(.it) .g-chip-name { display: none; }
  .g-chip-face { font-size: 16px; }
}
@media (max-height: 520px) { .g-pill { top: calc(max(10px, env(safe-area-inset-top)) + 50px); } .g-hint, .g-replay { top: calc(max(10px, env(safe-area-inset-top)) + 96px); } .g-roster, .g-noise { top: calc(max(10px, env(safe-area-inset-top)) + 136px); } .g-roster { max-width: calc(100% - 72px); } .g-act { bottom: 90px; } }
/* Tumbang Preso turned sideways: the throw bar drops to the bottom edge, between the joystick and the buttons, and is slim,
   so the field and her stay clear in the middle; the referee's call is smaller and sits just under the pill. */
@media (max-height: 520px) {
  .tb-bar, .tb-bar.tb-free { bottom: max(8px, env(safe-area-inset-bottom)); gap: 4px; padding: 4px 10px; border-radius: 16px; }
  .tb-meter { width: min(200px, 30vw); height: 10px; }
  .tb-hold, .tb-stand { min-height: 38px; font-size: 16px; }
  .pk-foot { min-height: 46px; font-size: 15px; min-width: 80px; }
  .tb-hold, .tb-stand { padding: 0 14px; }
  .g-ref { top: calc(max(10px, env(safe-area-inset-top)) + 96px); font-size: 16px; }
}

/* Action buttons. Wide screens keep each button where it is (the rail is transparent). On a narrow phone the joystick
   keeps the left thumb and the buttons stack in one tidy column for the right thumb, above the action button; a button
   that is hidden leaves no gap. */
.w-rail { display: contents; }
@media (max-width: 600px) {
  .w-rail { position: fixed; right: 12px; bottom: calc(max(24px, env(safe-area-inset-bottom)) + 124px); display: flex;
    flex-direction: column-reverse; align-items: flex-end; gap: 10px; z-index: 5; }
  .w-rail > * { position: static; right: auto; left: auto; bottom: auto; width: 68px; min-height: 58px; box-sizing: border-box;
    display: grid; place-content: center; padding: 4px; border-radius: 20px; text-align: center; white-space: normal;
    line-height: 1.1; font-size: 14px; }
  .w-rail > .w-sprint { width: 58px; height: 58px; border-radius: 50%; font-size: 28px; }
  .w-rail > .w-heart { width: auto; min-height: 0; padding: 2px 10px; border-radius: 999px; font-size: 13px; }
  .w-playrow, .w-emoterow { right: 90px; left: auto; justify-content: flex-end;
    bottom: calc(max(24px, env(safe-area-inset-bottom)) + 124px); max-width: calc(100vw - 106px);
    max-height: max(44px, calc(100vh - max(24px, env(safe-area-inset-bottom)) - 124px - 72px)); }
}
/* A phone on its side has no height for a column of rows above the buttons: the Play and Emote rows open to the left of
   the button column and grow upward from the bottom, and a narrow rail wraps into a second column. */
@media (max-height: 520px) {
  .w-playrow, .w-emoterow { right: 80px; bottom: 92px; max-width: calc(100vw - 260px); max-height: calc(100vh - 92px - 64px); }
}
@media (max-width: 600px) and (max-height: 520px) {
  .w-rail { bottom: max(12px, env(safe-area-inset-bottom)); max-height: calc(100vh - 76px); flex-wrap: wrap-reverse; justify-content: flex-start; align-content: flex-start; }
  .w-playrow, .w-emoterow { right: 170px; bottom: max(12px, env(safe-area-inset-bottom)); max-width: calc(100vw - 330px); max-height: calc(100vh - 76px); }
}

/* A game inside the world (portal.js): a playful frame over the frozen, blurred town. */
.w-portal-on #stage canvas { filter: blur(6px) saturate(1.1); }
.w-portal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 8px;
  background: var(--cz-scrim); }
.w-portal-card { position: relative; width: min(900px, 100%); height: min(100dvh - 16px, 1100px);
  border: 3px solid var(--cz-line); border-radius: var(--cz-r-lg); background: var(--cz-surface); overflow: hidden;
  box-shadow: 0 6px 0 var(--cz-ledge), var(--cz-shadow); animation: w-portal-pop .28s ease-out; }
.w-portal-frame { display: block; width: 100%; height: 100%; border: 0; }
.w-portal-x { position: absolute; top: 7px; right: 8px; width: 42px; height: 42px; border-radius: 50%;
  border: 2px solid var(--cz-line); border-bottom-width: 4px; background: var(--cz-sunk); color: var(--cz-ink);
  font: 800 1.15rem 'Baloo 2', system-ui, sans-serif; line-height: 1; cursor: pointer; transition: transform .08s; }
.w-portal-x:active { transform: scale(.9); border-bottom-width: 2px; }
.w-portal-x:focus-visible { outline: 3px solid var(--cz-line); outline-offset: 2px; }
@keyframes w-portal-pop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .w-portal-card { animation: none; } }

/* Sungka: the bar along the bottom while she plays at the table. */
.sgbar { position: fixed; inset: 0; z-index: 30; pointer-events: none; font: 700 15px 'Baloo 2', system-ui, sans-serif; color: var(--cz-ink); --k-focus: var(--cz-main); }
.sgbar > * { pointer-events: auto; }
/* Just above the score at the bottom, so the board stays clear. */
.sgbar-msg { position: absolute; left: 50%; bottom: calc(66px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: max-content; max-width: min(460px, calc(100% - 24px)); box-sizing: border-box;
  margin: 0; padding: 4px 14px; text-align: center; line-height: 1.25; font-size: 15px; background: var(--cz-hud); color: var(--cz-on-hud); border: 3px solid var(--cz-plum-deep); border-radius: var(--cz-r-md); box-shadow: 0 3px 0 var(--cz-ledge); pointer-events: none; }
@keyframes sgbar-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.sgbar-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.sgbar > .sgbar-row { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(10px + env(safe-area-inset-bottom)); width: max-content; max-width: calc(100% - 260px); pointer-events: none; }
.sgbar > .sgbar-row > * { pointer-events: auto; }
.sgbar-score { background: var(--cz-hud); color: var(--cz-on-hud); border: 3px solid var(--cz-plum-deep); border-radius: var(--cz-r-pill); padding: 2px 12px; box-shadow: 0 3px 0 var(--cz-ledge); pointer-events: none; }
.sgbar-btn, .sgbar-x { font: 800 14px 'Baloo 2', system-ui, sans-serif; min-height: 44px; padding: 6px 14px; border-radius: var(--cz-r-sm); border: 3px solid var(--cz-line); box-shadow: 0 3px 0 var(--cz-ledge); background: var(--cz-sunk); color: var(--cz-ink); cursor: pointer; }
.sgbar-btn:disabled { opacity: .5; cursor: default; }
.sgbar-main { border-color: var(--cz-line); box-shadow: 0 3px 0 var(--cz-ledge); background: var(--cz-main); color: var(--cz-on-main); }
.sgbar-x { min-height: 36px; }
.sgbar-keys { font-size: 14px; }
.sgbar-sum { cursor: pointer; padding: 6px 0; min-height: 36px; }
.sgbar-steps { margin: 0; padding: 0 0 4px 20px; line-height: 1.35; }
.sgbar-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 24vh; overflow: auto; padding-bottom: 4px; }
.sgbar [hidden] { display: none; }
@media (max-width: 420px) { .sgbar > .sgbar-row { max-width: calc(100% - 16px); } .sgbar-btn { padding: 6px 10px; font-size: 13px; } }
/* The pause drawer every game shares (games/pausemenu.js), in the cozy look (engine/cozy.css): a cream board with a plum
   outline, a mango header and sand buttons. The frame is a real border and only .pm-body scrolls, so buttons never
   slide over the frame or the title. */
.pm { position: fixed; inset: 0; z-index: 30; font: 700 15px 'Baloo 2', system-ui, sans-serif; color: var(--cz-ink); }
.pm[hidden], .pm [hidden] { display: none; }
.pm-shade { position: absolute; inset: 0; background: var(--cz-scrim); }
body .pm-menu:not(#k) { position: absolute; right: max(12px, env(safe-area-inset-right)); top: max(12px, env(safe-area-inset-top)); bottom: calc(14px + env(safe-area-inset-bottom));
  width: min(320px, calc(100% - 24px)); box-sizing: border-box; display: flex; flex-direction: column; overflow: hidden; padding: 0;
  background: var(--cz-surface);
  color: var(--cz-ink); border: 3px solid var(--cz-line); border-radius: var(--cz-r-lg); box-shadow: 0 6px 0 var(--cz-ledge), var(--cz-shadow); animation: sgbar-in .2s ease-out; }
.pm-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px 6px 14px;
  background: var(--cz-main); border-bottom: 3px solid var(--cz-line); }
.pm-title { font: 800 19px/1.2 'Baloo 2', system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--cz-on-main); }
.pm-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 8px; padding: 12px 12px 10px;
  scrollbar-width: thin; scrollbar-color: var(--cz-ink-soft) transparent; }
.pm-body > * { flex: none; }
.pm-row, .pm-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pm-row > * { grid-column: 1 / -1; }
.pm-row > .pm-half { grid-column: auto; }
.pm-foot { padding-top: 8px; border-top: 2px dashed var(--cz-ledge); }
.pm-ic { display: inline-block; flex: none; width: 20px; height: 20px; background: currentColor; -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
.pm-ic-play { --ic: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2.4'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M8%205.5v13l10.5-6.5z'%20fill%3D'black'%2F%3E%3C%2Fsvg%3E"); }
.pm-ic-close { --ic: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2.4'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M6%206l12%2012M18%206L6%2018'%20stroke-width%3D'3'%2F%3E%3C%2Fsvg%3E"); }
.pm-ic-gear { --ic: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2.4'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Ccircle%20cx%3D'12'%20cy%3D'12'%20r%3D'3.2'%2F%3E%3Cpath%20d%3D'M12%202.5v3M12%2018.5v3M2.5%2012h3M18.5%2012h3M5.3%205.3l2.1%202.1M16.6%2016.6l2.1%202.1M5.3%2018.7l2.1-2.1M16.6%207.4l2.1-2.1'%2F%3E%3Ccircle%20cx%3D'12'%20cy%3D'12'%20r%3D'6.6'%2F%3E%3C%2Fsvg%3E"); }
.pm-ic-door { --ic: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2.4'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M5%2021V4.5A1.5%201.5%200%200%201%206.5%203h8A1.5%201.5%200%200%201%2016%204.5V21M3%2021h15'%2F%3E%3Ccircle%20cx%3D'12.5'%20cy%3D'12.5'%20r%3D'1'%20fill%3D'black'%2F%3E%3Cpath%20d%3D'M19%209l2.5%203-2.5%203M21.5%2012H17'%2F%3E%3C%2Fsvg%3E"); }
.pm-ic-help { --ic: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2.4'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Ccircle%20cx%3D'12'%20cy%3D'12'%20r%3D'9.5'%2F%3E%3Cpath%20d%3D'M9.4%209.2a2.7%202.7%200%201%201%203.8%202.5c-.8.4-1.2%201-1.2%201.8v.6'%2F%3E%3Ccircle%20cx%3D'12'%20cy%3D'17.2'%20r%3D'.6'%20fill%3D'black'%2F%3E%3C%2Fsvg%3E"); }
.pm-ic-down { --ic: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2.4'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M12%204v15M6%2013l6%206%206-6'%2F%3E%3C%2Fsvg%3E"); }
.pm-ic-up { --ic: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2.4'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M12%2020V5M6%2011l6-6%206%206'%2F%3E%3C%2Fsvg%3E"); }
.pm-ic-fast { --ic: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2.4'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'M3%206.5l8%205.5-8%205.5zM12.5%206.5l8%205.5-8%205.5z'%20fill%3D'black'%2F%3E%3C%2Fsvg%3E"); }
.pm-ic-keys { --ic: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'black'%20stroke-width%3D'2.4'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Crect%20x%3D'2.5'%20y%3D'6'%20width%3D'19'%20height%3D'12'%20rx%3D'2.5'%2F%3E%3Cpath%20d%3D'M6.5%2010h.01M10%2010h.01M14%2010h.01M17.5%2010h.01M7.5%2014h9'%2F%3E%3C%2Fsvg%3E"); }
body .pm .pm-menu :is(.sgbar-btn, .sgbar-x):not(#k) { --sg: var(--cz-sunk); --sh: var(--cz-cream); --sd: var(--cz-plum); gap: 7px; min-height: 42px; padding: 6px 10px; border-radius: var(--cz-r-sm);
  font: 800 15px/1.1 'Baloo 2', system-ui, sans-serif; color: var(--cz-ink); text-shadow: none; background-color: var(--sg); background-image: none;
  box-shadow: inset 0 0 0 2px var(--cz-line), 0 3px 0 var(--cz-ledge); }
body .pm .pm-menu :is(.sgbar-btn, .sgbar-x):not(#k):focus-visible { outline: 3px solid var(--cz-line); outline-offset: 2px; }
body .pm .pm-menu :is(.sgbar-btn, .sgbar-x):not(#k):not(:disabled):active { transform: translateY(3px); box-shadow: inset 0 0 0 2px var(--cz-line); }
body .pm .pm-menu .sgbar-main:not(#k) { --sg: var(--cz-main); --sh: var(--cz-main); min-height: 48px; font-size: 18px; color: var(--cz-on-main); box-shadow: inset 0 0 0 2px var(--cz-line), 0 4px 0 var(--cz-ledge); }
body .pm .pm-menu .pm-x:not(#k) { --sg: var(--cz-cream); display: grid; place-items: center; width: 36px; height: 36px; min-height: 36px; padding: 0; gap: 0; border-radius: 50%; color: var(--cz-ink); box-shadow: inset 0 0 0 2px var(--cz-line), 0 3px 0 var(--cz-ledge); }
body .pm .pm-menu .pm-x .pm-ic { width: 16px; height: 16px; }
body .pm .pm-menu .pm-leave:not(#k) { --sg: var(--cz-cream); color: var(--cz-danger); }
body .pm .pm-menu .pm-leave.is-sure:not(#k) { --sg: var(--cz-danger); --sh: var(--cz-danger); color: var(--cz-on-danger); box-shadow: inset 0 0 0 2px var(--cz-line), 0 3px 0 var(--cz-ledge); }
.pm-menu .sgbar-keys { font-size: 15px; }
.pm-menu .sgbar-sum { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 6px; border-radius: 10px; list-style: none; color: var(--cz-ink); }
.pm-menu .sgbar-sum::-webkit-details-marker { display: none; }
.pm-menu .sgbar-sum::after { content: ''; margin-left: auto; width: 8px; height: 8px; border: solid currentColor; border-width: 0 3px 3px 0; transform: rotate(-45deg); transition: transform .15s ease; }
.pm-menu details[open] > .sgbar-sum::after { transform: rotate(45deg); }
.pm-menu .sgbar-steps { margin: 4px 0 0; padding: 8px 10px 8px 28px; border-radius: var(--cz-r-sm); background: var(--cz-sunk); color: var(--cz-ink); font-size: 14px; line-height: 1.35; }
.pm-menu .sgbar-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; max-height: none; margin-top: 4px; }
body .pm .pm-menu .sgbar-choice:not(#k) { min-height: 38px; padding: 4px 6px; font-size: 13px; }
body .pm .pm-menu :is(.pm-half, .pm-foot > .sgbar-btn):not(#k) { padding: 6px 8px; font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .pm-menu { animation: none; } .pm-menu .sgbar-sum::after { transition: none; } }




/* Cuter stalls: a sunny panel, chunky tabs, and item cards with a round picture badge that bounces when picked. */
.maker { background: var(--cz-surface); border-top: 4px solid var(--cz-line); }
.maker-tab { border-width: 2px; box-shadow: 0 3px 0 var(--cz-ledge); transition: transform .12s ease-out; }
.maker-tab:active { transform: translateY(3px); box-shadow: none; }
.maker-tab[aria-pressed="true"] { background: var(--cz-ok); box-shadow: 0 3px 0 var(--cz-ledge); }
@keyframes bt-bounce { 0% { transform: scale(.8); } 55% { transform: scale(1.18) rotate(-6deg); } 100% { transform: scale(1); } }

/* Shop windows share one look: grass-edged rounded sheet, grab handle, pill tabs, candy buttons, coin pill. */
.maker { background: var(--cz-surface); border-top: 5px solid var(--cz-line); border-radius: var(--cz-r-lg) var(--cz-r-lg) 0 0; animation: maker-up .28s cubic-bezier(.3, 1.5, .5, 1); scrollbar-width: thin; scrollbar-color: var(--cz-ledge) transparent; }
.maker::before { content: ''; display: block; width: 44px; height: 5px; margin: -6px auto 8px; border-radius: 3px; background: var(--cz-ledge); }
@keyframes maker-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.maker-tabs { gap: 8px; padding-bottom: 4px; }
.maker-tab { border: 0; background: var(--cz-sunk); min-height: 42px; padding: 0 16px; }
.maker-tab[aria-pressed="true"] { border: 0; }
.maker-done { border: 0; background: var(--cz-main); color: var(--cz-on-main); box-shadow: 0 5px 0 var(--cz-ledge); }
.maker-done:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--cz-ledge); }
.maker-opt { border-radius: var(--cz-r-sm); background: var(--cz-sunk); box-shadow: 0 3px 0 var(--cz-ledge); }
.maker-opt[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--cz-ok), 0 3px 0 var(--cz-ledge); }
@media (max-height: 480px) { .maker::before { display: none; } }
@media (prefers-reduced-motion: reduce) { .maker { animation: none; } }

/* Button polish: one chunky, glossy look for the joystick and the right-hand buttons. Geometry stays in the rules above; this
   block only paints, and on a small screen it shrinks the buttons so they stay clear of each other and of the view. */
.w-joy { border: 3px solid color-mix(in srgb, var(--cz-hud-accent) 90%, transparent); background: color-mix(in srgb, var(--cz-hud) 20%, transparent);
  box-shadow: 0 5px 0 color-mix(in srgb, var(--cz-hud) 18%, transparent), 0 10px 22px color-mix(in srgb, var(--cz-hud) 20%, transparent), inset 0 0 0 9px color-mix(in srgb, var(--cz-hud) 14%, transparent); transition: background .12s; }
.w-joy.on { background: color-mix(in srgb, var(--cz-hud) 35%, transparent); }
.w-joy::before { content: ''; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; opacity: .9;
  background: radial-gradient(circle at 50% 10px, var(--cz-on-hud) 0 3.5px, transparent 4px), radial-gradient(circle at 50% calc(100% - 10px), var(--cz-on-hud) 0 3.5px, transparent 4px),
    radial-gradient(circle at 10px 50%, var(--cz-on-hud) 0 3.5px, transparent 4px), radial-gradient(circle at calc(100% - 10px) 50%, var(--cz-on-hud) 0 3.5px, transparent 4px); }
.w-knob { box-sizing: border-box; border: 3px solid var(--cz-line); will-change: transform; color: var(--cz-on-main);
  background: var(--cz-hud-accent); box-shadow: 0 5px 0 var(--cz-ledge), 0 9px 14px var(--cz-ledge);
  transition: scale .1s; }
.w-knob svg { width: 62%; height: 62%; fill: currentColor; transform: rotate(var(--dir, 0deg)); }
.w-joy.on .w-knob { scale: 1.08; }
@media (prefers-reduced-motion: reduce) { .w-joy, .w-knob { transition: none; } }

.w-treat, .w-play, .w-emote, .w-use, .w-sprint { border: 3px solid var(--cz-plum-deep); transition: transform .08s, box-shadow .08s;
  background: var(--cz-hud); box-shadow: 0 4px 0 var(--cz-ledge), 0 8px 16px var(--cz-ledge); }
.w-use { background: var(--cz-hud); box-shadow: 0 4px 0 var(--cz-ledge), 0 8px 16px var(--cz-ledge); }
.w-sprint[aria-pressed="true"] { background: var(--cz-hud-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--cz-hud-accent) 40%, transparent), 0 4px 0 var(--cz-ledge); }
.w-treat:active, .w-play:active, .w-emote:active, .w-use:active, .w-sprint:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--cz-ledge); }
.w-pill .ic { font-size: 1.15em; line-height: 1; }
@media (prefers-reduced-motion: reduce) { .w-treat, .w-play, .w-emote, .w-use, .w-sprint { transition: none; } }

/* The Play and Emote rows: a small panel of icon tiles, so twenty emotes read as a tidy grid, not a long ragged strip. */
.w-playrow, .w-emoterow { padding: 10px; box-sizing: border-box; border-radius: 24px; background: var(--cz-hud); overscroll-behavior: contain;
  box-shadow: 0 4px 0 var(--cz-ledge), var(--cz-shadow); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.w-playrow .w-play-item, .w-emoterow .w-play-item { flex: 0 0 60px; display: grid; place-content: center; justify-items: center; gap: 1px;
  min-height: 52px; padding: 4px 2px; border-radius: 16px; white-space: normal; text-align: center; }
.w-play-item .ic { font-size: 28px; }
.w-play-item .lb { font-size: 11px; line-height: 1.05; }

/* Phone upright: the rail tiles are icon over name, a little smaller than before. */
@media (max-width: 600px) and (min-height: 521px) {
  .w-rail > .w-pill:not(.w-heart) { width: 62px; min-height: 58px; border-radius: 20px; padding: 4px 2px; }
  .w-rail .ic { display: block; font-size: 24px; }
  .w-rail .lb { display: block; font-size: 11px; }
}
/* A short screen (a phone on its side): the buttons keep their icon only, round and small, so five of them never crowd the view. */
@media (max-height: 520px) {
  .w-pill.w-treat, .w-pill.w-play, .w-pill.w-emote, .w-pill.w-use { width: 48px; height: 48px; min-height: 0; padding: 0; border-radius: 50%; display: grid; place-items: center; }
  .w-pill.w-treat .lb, .w-pill.w-play .lb, .w-pill.w-emote .lb, .w-pill.w-use .lb { display: none; }
  .w-pill.w-treat .ic, .w-pill.w-play .ic, .w-pill.w-emote .ic, .w-pill.w-use .ic { font-size: 24px; }
  .w-sprint, .w-rail > .w-sprint { width: 48px; height: 48px; font-size: 24px; }
  .w-joy { width: 116px; height: 116px; }
  .w-joy.big { width: 132px; height: 132px; }
  .w-joy.big .w-knob { width: 58px; height: 58px; margin: -29px 0 0 -29px; }
}
@keyframes w-gate-drift{from{transform:translateX(-6%)}to{transform:translateX(6%)}}
@keyframes w-gate-pulse{50%{opacity:.55;transform:scale(.88)}}
@keyframes w-gate-ring{from{transform:scale(1);opacity:.9}to{transform:scale(1.9);opacity:0}}
@keyframes w-gate-bob{50%{transform:translateY(-6px)}}

/* Reset view while a game's camera is turned by her drag (gameview.js): right edge, clear of the top bar and the bottom row. */
.game-reset { position: fixed; top: 22%; right: 10px; z-index: 14; min-height: 36px; padding: 2px 14px; font-size: 14px; }
.game-reset[hidden] { display: none; }

/* Sign board windows, one button family: a gold main action on top, two soft chips under it, a quiet Close last; answers
   wear letter badges. Order is set here so the markup (and its focus keys) stays as it is. */
.w-sign .w-btn { border-radius: 18px; transition: transform .12s ease, box-shadow .12s ease, filter .12s ease; -webkit-tap-highlight-color: transparent; }
.w-sign .w-btn:not(:disabled):hover { transform: translateY(-2px); }
.w-sign .w-btn:not(:disabled):active { transform: translateY(2px) scale(.98); filter: brightness(.97); }
.w-sign .w-sign-foot { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; padding: 12px 10px 4px; border-top: 3px dotted var(--cz-ledge); }
.w-sign .w-sign-foot .w-sign-go { order: 1; flex: 1 1 100%; position: relative; overflow: hidden; padding: 14px 18px; font-size: 21px; font-weight: 800; letter-spacing: .01em; border-radius: 22px; }
.w-sign .w-sign-foot .w-sign-go::before { content: '▶'; display: inline-block; margin-right: 8px; font-size: .8em; }
.w-sign .w-sign-foot .w-sign-go::after { content: ''; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%; transform: skewX(-20deg); background: linear-gradient(90deg, transparent, var(--cz-cream), transparent); animation: w-sign-sheen 2.8s ease-in-out infinite; pointer-events: none; }
@keyframes w-sign-sheen { 0%, 55% { left: -40%; } 100% { left: 130%; } }
.w-sign .w-sign-foot .w-sign-read{ order: 2; flex: 1 1 calc(50% - 5px); min-height: 48px; padding: 8px 10px; font-size: 16px; font-weight: 800; border: 2px solid var(--cz-line); background: var(--cz-sunk); color: var(--cz-ink); box-shadow: 0 4px 0 var(--cz-ledge); }
.w-sign .w-sign-foot .w-sign-read:only-of-type{ flex-basis: 100%; }
@keyframes w-read-hint { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
body .w-sign .w-sign-foot .w-sign-read.w-sign-read-hint:not(#k) { animation: w-read-hint 1s ease-in-out 2; }
@media (prefers-reduced-motion: reduce) { body .w-sign .w-sign-foot .w-sign-read.w-sign-read-hint:not(#k) { animation: none; } }
.w-sign .w-sign-foot .w-close { order: 3; flex: 1 1 100%; min-height: 40px; margin: 2px 0 0; font-size: 15px; font-weight: 700; border-radius: 999px; }
.w-sign .w-sign-foot .w-close::before { content: '✕'; margin-right: 6px; font-size: .85em; }
.w-sign .w-sign-foot .w-diff { order: 1; flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.w-sign .w-diff-label { flex: 1 1 100%; text-align: center; font-size: 14px; font-weight: 800; color: var(--cz-ink-soft); }
.w-sign .w-diff-btn { flex: 1 1 88px; min-height: 44px; padding: 8px 10px; font-size: 16px; font-weight: 800; border: 2px solid var(--cz-line); background: var(--cz-surface); color: var(--cz-ink); box-shadow: 0 3px 0 var(--cz-ledge); }
.w-sign .w-diff-btn.on { background: var(--cz-ok); box-shadow: inset 0 0 0 3px var(--cz-line); }
@media (max-width: 380px) { .w-sign .w-sign-foot .w-sign-go { font-size: 19px; } }
@media (prefers-reduced-motion: reduce) { .w-sign .w-sign-foot .w-sign-go::after { display: none; } .w-sign .w-btn { transition: none; } .w-sign .w-btn:not(:disabled):hover, .w-sign .w-btn:not(:disabled):active { transform: none; } }


/* Shop windows: breathing room so the close cross, tabs, cards, buttons and messages never touch. */
.maker-title { padding: 0 56px; }
.maker-tabs { gap: 10px; margin: 6px 0 12px; }
.maker-done { margin-top: 18px; }
.maker-hint { min-height: 22px; text-align: center; font-weight: 800; font-size: 15px; }
.maker-opt.locked { opacity: .5; filter: grayscale(1); cursor: default; }
.maker-lock { position: absolute; top: -6px; right: -6px; font-size: 13px; line-height: 1; }

/* The stamina bar: a thin pill by the Run button that fills as she runs and turns warm and shakes when she is tired. */
#stamina-bar { position: fixed; right: 16px; bottom: calc(max(24px, env(safe-area-inset-bottom)) + 66px); z-index: 5; width: 56px; height: 8px;
  box-sizing: border-box; border: 1px solid var(--cz-on-hud); border-radius: 999px; background: var(--cz-plum-deep); overflow: hidden; pointer-events: none; }
#stamina-bar[hidden] { display: none; }
#stamina-bar span { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--cz-hud-accent); transition: width .12s linear; }
#stamina-bar.tired { border-color: var(--cz-terracotta); animation: w-stamina-shake .5s ease-in-out infinite; }
#stamina-bar.tired span { background: var(--cz-terracotta); }
@keyframes w-stamina-shake { 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }
@media (prefers-reduced-motion: reduce) { #stamina-bar span { transition: none; } #stamina-bar.tired { animation: none; } }
@media (max-width: 600px) { .w-rail > #stamina-bar { position: absolute; right: 0; bottom: 59px; left: auto; width: 58px; min-height: 0; height: 8px; padding: 0; border-radius: 999px; display: block; } .w-rail > #stamina-bar[hidden] { display: none; } }
.w-level { cursor: pointer; pointer-events: auto; }
#hud-info { position: fixed; left: 50%; transform: translateX(-50%); top: calc(max(14px, env(safe-area-inset-top)) + 52px); z-index: 41; width: min(280px, calc(100vw - 32px)); box-sizing: border-box;
  max-height: calc(100vh - 66px - 130px); overflow: auto; padding: 12px 14px; border-radius: var(--cz-r-lg); background: var(--cz-surface); color: var(--cz-ink); box-shadow: 0 4px 0 var(--cz-ledge), var(--cz-shadow);
  font: 700 14px/1.3 'Baloo 2', system-ui, sans-serif; }
#hud-info[hidden] { display: none; }
@media (orientation: portrait) { #hud-info { max-height: calc(60vh - 78px); } }
.w-rail > .w-sprint[hidden] + #stamina-bar { position: static; }
.w-info-skill { display: block; padding: 2px 0; }
.w-info-skill .w-info-v { display: block; text-align: left; font-size: 12px; opacity: .75; }
.w-info-k { opacity: .75; }
.w-info-v { text-align: right; }
.w-info-head { margin-top: 6px; font-weight: 800; }
.w-info-none { opacity: .75; }

/* The cozy surfaces of every window. The body prefix wins over dock.css, which loads later. */
.w-overlay { background: var(--cz-scrim); }
.w-card, .resting-card, .gc-panel, .talk, body #hud-info {
  background: var(--cz-surface);
  color: var(--cz-ink); border: 0; border-radius: var(--cz-r-lg);
  box-shadow: 0 0 0 3px var(--cz-line), 0 6px 0 3px var(--cz-ledge), var(--cz-shadow); }
.resting-card, .gc-panel { background: var(--cz-surface); color: var(--cz-ink); border-radius: var(--cz-r-lg); --k-focus: var(--cz-line);
  box-shadow: 0 0 0 3px var(--cz-line), 0 6px 0 3px var(--cz-ledge), var(--cz-shadow); }
.w-card-title { color: var(--cz-ink); }
.talk-who { color: var(--cz-on-main); background: var(--cz-main); box-shadow: inset 0 0 0 2px var(--cz-line), 0 2px 0 var(--cz-ledge); }
.talk-actions { border-top: 3px dashed var(--cz-ledge); }
.talk-row { background: var(--cz-surface); }
.g-dock > .talk { background: var(--cz-surface); box-shadow: inset 0 0 0 3px var(--cz-line), 0 4px 0 var(--cz-ledge); }
.talk-sub.ask { background: var(--cz-sunk); border: 2px solid var(--cz-line); color: var(--cz-ink); }
.w-sign-line { background: var(--cz-surface); border: 0; border-left: 6px solid var(--sign-tint); color: var(--cz-ink); }
.w-sign-story { background: var(--cz-sunk); border: 2px dashed var(--cz-line); color: var(--cz-ink); }
.w-sign .w-sign-foot { border-top-color: var(--cz-ledge); }
.w-sign .w-sign-foot .w-sign-read, .w-sign .w-diff-btn { background: var(--cz-sunk); border-color: var(--cz-line); color: var(--cz-ink); box-shadow: 0 3px 0 var(--cz-ledge); }
.w-sign .w-diff-btn.on { background: var(--cz-ok); box-shadow: inset 0 0 0 3px var(--cz-line); }
.w-sign .w-sign-foot .w-close { color: var(--cz-ink-soft); }
body .maker { background: var(--cz-surface); border-top: 4px solid var(--cz-line); }
body .maker-tab, body .maker-opt { background: var(--cz-sunk); color: var(--cz-ink); }
.gc-card { background: var(--cz-sunk); box-shadow: 0 4px 0 var(--cz-ledge), inset 0 0 0 2px var(--cz-line); }
.w-btn, .w-travel-btn { border-radius: 12px; }
.talk-btn { border-radius: var(--cz-r-sm); }
.talk-btn.main, .sgbar-main { color: var(--cz-on-main); text-shadow: none; background: var(--cz-main);
  box-shadow: inset 0 0 0 2px var(--cz-line), 0 4px 0 var(--cz-ledge); }
.talk-btn.alt, .sgbar-x { background: var(--cz-surface); color: var(--cz-ink); text-shadow: none; box-shadow: inset 0 0 0 2px var(--cz-line), 0 3px 0 var(--cz-ledge); }
body .w-pill, body .g-pill, body .w-zoom, body .g-roster-row, body .w-playrow, body .w-emoterow, body .sgbar-msg, body .sgbar-score {
  background: var(--cz-hud); color: var(--cz-on-hud); border-color: var(--cz-plum-deep); box-shadow: inset 0 0 0 2px var(--cz-plum-deep), 0 3px 0 var(--cz-ledge); }
/* Cozy stage 3: the message and score of the game bar are HUD pieces, plum with cream words. The rest of the list above waits for stage 4. */
body .sgbar-msg, body .sgbar-score { background: var(--cz-hud); color: var(--cz-on-hud); border-color: var(--cz-plum-deep); box-shadow: 0 3px 0 var(--cz-ledge); }
body .g-chip { background: var(--cz-sunk); color: var(--cz-ink); }
body .w-playrow, body .w-emoterow { box-shadow: inset 0 0 0 2px var(--cz-plum-deep), 0 4px 0 var(--cz-ledge), var(--cz-shadow); }
body .tb-bar { background: color-mix(in srgb, var(--cz-hud) 55%, transparent); }
body .g-hint { background: var(--cz-hud); color: var(--cz-on-hud); box-shadow: inset 0 0 0 2px var(--cz-plum-deep), 0 3px 0 var(--cz-ledge); }
body .g-ref { background: var(--cz-surface); color: var(--cz-ink); border-color: var(--cz-line); box-shadow: 0 4px 0 var(--cz-ledge); }
body .w-treat, body .w-play, body .w-emote, body .w-use, body .w-sprint, body .w-zoom-btn { background: var(--cz-hud); color: var(--cz-on-hud); border-color: var(--cz-plum-deep); box-shadow: 0 4px 0 var(--cz-ledge); }
/* Cozy stage 4: the + and − of the zoom gauge and the tiles of the Play and Emote rows sit on a plum piece, so they are a shade deeper. */
body .w-zoom-btn, body .w-playrow .w-play-item, body .w-emoterow .w-play-item { background: var(--cz-plum-deep); box-shadow: none; }
body .w-sprint[aria-pressed="true"] { background: var(--cz-hud-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--cz-hud-accent) 40%, transparent), 0 4px 0 var(--cz-ledge); }
body .w-portal-card { background: var(--cz-surface); }
body .w-portal-x { background: var(--cz-sunk); color: var(--cz-ink); }
body .w-joy { background: color-mix(in srgb, var(--cz-hud) 20%, transparent); border: 4px dashed color-mix(in srgb, var(--cz-hud-accent) 90%, transparent); }

/* The stamina shows on the Run button itself: a ring fills around it, the runner bobs while she runs, and it shakes red when she is tired. */
#stamina-bar { display: none; }
.w-sprint::before { content: ''; position: absolute; inset: -8px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 0deg, var(--cz-teal) 0%, var(--cz-hud-accent) calc(var(--heart, 0) * 1%), transparent calc(var(--heart, 0) * 1%)), linear-gradient(color-mix(in srgb, var(--cz-cream) 40%, transparent), color-mix(in srgb, var(--cz-cream) 40%, transparent));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), var(--cz-plum) calc(100% - 5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 6px), var(--cz-plum) calc(100% - 5px)); }
.w-sprint[aria-pressed="true"]:not(.tired) { animation: w-run-bob .34s ease-in-out infinite; }
.w-sprint.tired { animation: w-stamina-shake .5s ease-in-out infinite; }
.w-sprint.tired::before { background: conic-gradient(var(--cz-terracotta) 0 100%); }
@keyframes w-run-bob { 50% { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .w-sprint[aria-pressed="true"], .w-sprint.tired { animation: none; } }

/* Stamina lives on the Run button only: the old bar stays hidden even inside the phone rail, and the ring anchors to the button, not the whole rail. */
#stamina-bar, .w-rail > #stamina-bar { display: none !important; }
@media (max-width: 600px) { .w-rail > .w-sprint { position: relative; } }
/* The Read button is a yellow road warning sign: black inner line, bolts, a dark edge under it. */
.w-act { border: 0; border-radius: var(--cz-r-sm); background: var(--cz-main); color: var(--cz-on-main); text-shadow: none;
  box-shadow: inset 0 0 0 2px var(--cz-line), 0 6px 0 var(--cz-ledge), var(--cz-shadow); }
/* "Talk to" prompts keep the yellow sign look, a size smaller than the other prompts. */
.w-act.w-act-talk { font-size: 20px; padding: 9px 22px; }
@media (max-width: 600px) { .w-act.w-act-talk { font-size: 16px; padding: 8px 14px; } }

/* Sign boards and every other window card: the start page's TV screen with its case, bunting along the top, a blue street-name title and a red and white curb at the foot. */
.w-card { position: relative; padding-top: 26px; border: 0 !important; border-radius: var(--cz-r-lg); color: var(--cz-ink); --k-focus: var(--cz-line);
  background: var(--cz-surface);
  box-shadow: 0 0 0 3px var(--cz-line), 0 6px 0 3px var(--cz-ledge), var(--cz-shadow); }
.w-card::after { content: ''; display: block; height: 8px; margin-top: 14px; border-radius: 5px; background: transparent; }
.w-card .w-card-title { display: block; width: fit-content; max-width: 100%; margin: 0 auto 14px; padding: 8px 40px; border: 3px solid var(--cz-line); border-radius: var(--cz-r-sm);
  color: var(--cz-on-main); text-shadow: none; background: var(--cz-main); box-shadow: 0 3px 0 var(--cz-ledge); }
.w-card.w-sign { padding-top: 26px; }
.w-card.w-sign .w-card-title { margin: 0 auto 14px; }
.w-sign .w-sign-foot .w-sign-go, .w-sign .w-sign-foot .w-sign-go.play { border-radius: 12px; color: var(--cz-on-main); text-shadow: none;
  box-shadow: inset 0 0 0 2px var(--cz-line), 0 5px 0 var(--cz-ledge); }
.w-sign .w-btn { border-radius: 12px; }
.w-card .w-card-title { position: relative; }

/* ===== Standard sign UI kit =====
   The base of every window button: size, font and a sand face with a plum line (the cozy tokens). The rules after it
   give each kind its own colour. The :not(#k) keeps this block above the older rules earlier in this file. */
body :is(.w-btn, .w-close, .w-sign-go, .w-diff-btn, .w-sign-read, .maker-tab, .maker-opt, .maker-done, .maker-next, .maker-back, .maker-shop, .w-choice, .w-travel-btn, .talk-btn, .sgbar-btn, .sgbar-x, .g-replay-skip, .g-act):not(#k):where(:not(.w-sign-tile)) {
  --sg: var(--cz-sunk); --sd: var(--cz-ledge); --sh: var(--cz-cream);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-sizing: border-box;
  min-height: 46px; padding: 10px 18px; border: 0; border-radius: 10px;
  font: 800 17px/1.15 'Baloo 2', system-ui, sans-serif; text-align: center; color: var(--cz-ink); text-shadow: none;
  background-color: var(--sg);
  background-image: none;
  box-shadow: inset 0 0 0 2px var(--cz-line), 0 3px 0 var(--cz-ledge);
  filter: none; animation: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background-color .15s ease, transform .12s ease, box-shadow .12s ease; }
/* Cozy stage 2: the plain button of a town window. The other members of this kit follow in stages 3 to 6. */
body :where(.w-card:not(.w-unlock), .resting-card) :is(.w-btn, .w-close):not(#k) { --sg: var(--cz-sunk); --sd: var(--cz-ledge); --sh: var(--cz-cream);
  border-radius: var(--cz-r-sm); color: var(--cz-ink); text-shadow: none; box-shadow: inset 0 0 0 2px var(--cz-line), 0 3px 0 var(--cz-ledge); }
body :is(.maker-tab, .maker-opt):not(#k) { background-image: none; min-height: 42px; padding: 6px 14px; font-size: 16px; }
body .maker-opt.swatch:not(#k) { width: 46px; min-height: 46px; padding: 0; box-shadow: 0 0 0 2px var(--cz-surface), 0 0 0 4px var(--cz-ledge); }
body .maker-opt.swatch[aria-pressed="true"]:not(#k) { box-shadow: 0 0 0 2px var(--cz-surface), 0 0 0 5px var(--cz-line); }
body .maker-opt[aria-pressed="true"]:not(#k)::after { background: var(--cz-ok); box-shadow: 0 0 0 2px var(--cz-surface); }
body .maker-opt.locked:not(#k) { opacity: .55; }
/* Cozy stage 5: the maker's buttons are sand, Next and Done mango, a chosen tab or tile deep green with a thicker plum line. dock.css styles them above this layer; the yellow, grey and green lists above now colour nothing of the maker. */
body :is(.maker-tab, .maker-opt, .maker-back, .maker-shop):not(#k) { --sg: var(--cz-sunk); --sd: var(--cz-ledge); --sh: var(--cz-cream); border-radius: var(--cz-r-sm); color: var(--cz-ink); text-shadow: none; box-shadow: inset 0 0 0 2px var(--cz-line), 0 3px 0 var(--cz-ledge); }
body :is(.maker-done, .maker-next):not(#k) { --sg: var(--cz-main); --sd: var(--cz-ledge); --sh: var(--cz-main); border-radius: var(--cz-r-sm); color: var(--cz-on-main); text-shadow: none; box-shadow: inset 0 0 0 2px var(--cz-line), 0 4px 0 var(--cz-ledge); }
body :is(.maker-tab[aria-pressed="true"], .maker-opt[aria-pressed="true"]):not(#k) { --sg: var(--cz-ok); --sd: var(--cz-ledge); --sh: var(--cz-ok); color: var(--cz-on-ok); box-shadow: inset 0 0 0 3px var(--cz-line), 0 3px 0 var(--cz-ledge); }
body .w-sign .w-sign-foot .w-sign-go:not(#k)::after { display: none; }
body .w-sign .w-sign-foot .w-sign-go:not(#k) { font-size: 21px; min-height: 54px; }
@media (hover: hover) {
  body :is(.w-btn, .w-close, .w-sign-go, .w-diff-btn, .w-sign-read, .maker-tab, .maker-opt, .maker-done, .maker-next, .maker-back, .maker-shop, .w-choice, .w-travel-btn, .talk-btn, .sgbar-btn, .sgbar-x, .g-replay-skip):not(#k):where(:not(.w-sign-tile)):not(:disabled):not(.locked):hover { --sg: var(--sh); transform: translateY(-2px); }
}
body :is(.w-btn, .w-close, .w-sign-go, .w-diff-btn, .w-sign-read, .maker-tab, .maker-opt, .maker-done, .maker-next, .maker-back, .maker-shop, .w-choice, .w-travel-btn, .talk-btn, .sgbar-btn, .sgbar-x, .g-replay-skip):not(#k):where(:not(.w-sign-tile)):not(:disabled):active { transform: translateY(4px); box-shadow: inset 0 0 0 2px var(--cz-line); }
body :where(.w-card:not(.w-unlock), .resting-card) :is(.w-btn, .w-close):not(#k):not(:disabled):active { box-shadow: inset 0 0 0 2px var(--cz-line); }
body :is(.w-btn, .w-close, .w-sign-go, .w-diff-btn, .w-sign-read, .maker-tab, .maker-opt, .maker-done, .maker-next, .maker-back, .maker-shop, .w-choice, .w-travel-btn, .talk-btn, .sgbar-btn, .sgbar-x, .g-replay-skip, .g-act):not(#k):where(:not(.w-sign-tile)):focus-visible { outline: 3px solid var(--k-focus, var(--cz-hud-accent)); outline-offset: 3px; }
body :is(.w-btn, .w-close, .w-sign-go, .w-diff-btn, .w-sign-read, .maker-tab, .maker-opt, .maker-done, .maker-next, .maker-back, .maker-shop, .w-choice, .w-travel-btn, .talk-btn, .sgbar-btn, .sgbar-x, .g-replay-skip, .g-act):not(#k):where(:not(.w-sign-tile)):disabled { opacity: .5; cursor: default; }

/* Sign card body: info lines are green guide signs, the note under them is a yellow warning sign. */
body .w-sign-line:not(#k) { padding: 12px 18px; border: 0; border-radius: 10px; color: var(--cz-ink); text-shadow: none; background-color: var(--cz-surface);
  box-shadow: inset 0 0 0 2px var(--cz-line), 0 3px 0 var(--cz-ledge); }
body .w-sign-story:not(#k) { padding: 10px 16px; border: 0; border-radius: 10px; color: var(--cz-ink); background: var(--cz-sunk); font-weight: 800;
  box-shadow: inset 0 0 0 2px var(--cz-line), 0 3px 0 var(--cz-ledge); }

/* Character maker: the same dark board, white painted edge, blue title sign and bolted buttons as a sign card. */
body .maker:not(#k) { color: var(--cz-ink); --k-focus: var(--cz-line); border: 0; border-radius: var(--cz-r-lg) var(--cz-r-lg) 0 0;
  background: var(--cz-surface);
  box-shadow: 0 -10px 30px var(--cz-ledge), 0 0 0 3px var(--cz-line); }
body .maker:not(#k)::before { display: none; }
body .maker-title:not(#k) { position: relative; display: block; width: fit-content; max-width: 100%; margin: 0 auto 10px; padding: 6px 40px; border: 3px solid var(--cz-line); border-radius: var(--cz-r-sm);
  font-size: 22px; color: var(--cz-on-main); text-shadow: none; background: var(--cz-main); box-shadow: 0 3px 0 var(--cz-ledge); }
body .maker-label:not(#k) { color: var(--cz-ink-soft); }
body .maker-step:not(#k), body .maker-hint:not(#k) { color: var(--cz-ink); }
body .maker-dot:not(#k) { background: var(--cz-surface); border-color: var(--cz-line); }
body .maker-dot[aria-current="true"]:not(#k) { background: var(--cz-line); border-color: var(--cz-line); }
body .maker-name:not(#k) { border: 3px solid var(--cz-line); border-radius: var(--cz-r-sm); background: var(--cz-surface); color: var(--cz-ink); }
body .maker-bar:not(#k) { background: var(--cz-surface); box-shadow: 0 -6px 8px -6px var(--cz-ledge); }

/* Other windows: talk bubbles, quick travel, choices and the game bar use the same buttons. Compact bars keep their small size. */
body :is(.w-choice.on, .w-choice[aria-pressed="true"], .sgbar-choice.on, .sgbar-choice[aria-pressed="true"]):not(#k) { --sg: var(--cz-ok); --sd: var(--cz-ledge); --sh: var(--cz-ok); color: var(--cz-on-ok); }
body :is(.sgbar-btn, .sgbar-x, .g-replay-skip, .talk-btn.alt):not(#k) { min-height: 40px; padding: 6px 14px; font-size: 15px; background-image: none; }
body .g-act:not(#k) { min-height: 54px; padding: 10px 26px; font-size: 20px; }
/* Cozy stage 3: the buttons of a talk bubble, quick travel and the game bar (sand, mango for the main one, cream for a quiet one).
   The yellow and grey lists above keep .g-act and .g-replay-skip as they are for stage 4. */
body :is(.talk-btn, .sgbar-btn, .sgbar-x, .w-travel-btn, .w-choice):not(#k) { --sg: var(--cz-sunk); --sd: var(--cz-ledge); --sh: var(--cz-cream);
  border-radius: var(--cz-r-sm); color: var(--cz-ink); text-shadow: none; box-shadow: inset 0 0 0 2px var(--cz-line), 0 3px 0 var(--cz-ledge); }
body :is(.talk-btn.main, .sgbar-main):not(#k) { --sg: var(--cz-main); --sh: var(--cz-main); color: var(--cz-on-main); box-shadow: inset 0 0 0 2px var(--cz-line), 0 4px 0 var(--cz-ledge); }
body :is(.talk-btn.alt, .sgbar-x):not(#k) { --sg: var(--cz-surface); --sh: var(--cz-sunk); color: var(--cz-ink); text-shadow: none; }
body :is(.talk-btn, .sgbar-btn, .sgbar-x, .w-travel-btn, .w-choice):not(#k):not(:disabled):active { box-shadow: inset 0 0 0 2px var(--cz-line); }
/* Cozy stage 4: the action button of a game is a mango main button and Skip of the replay a sand one. Both sit over the 3D view, so the focus ring is mango. The class is written twice to sit above the yellow and grey lists. */
body .g-act.g-act:not(#k) { --sg: var(--cz-main); --sd: var(--cz-ledge); --sh: var(--cz-main); --k-focus: var(--cz-hud-accent); border-radius: var(--cz-r-sm); color: var(--cz-on-main); text-shadow: none; box-shadow: inset 0 0 0 2px var(--cz-line), 0 4px 0 var(--cz-ledge); }
body .g-replay-skip.g-replay-skip:not(#k) { --sg: var(--cz-sunk); --sd: var(--cz-ledge); --sh: var(--cz-cream); --k-focus: var(--cz-hud-accent); border-radius: var(--cz-r-pill); color: var(--cz-ink); text-shadow: none; box-shadow: inset 0 0 0 2px var(--cz-line); }
body .g-replay-skip.g-replay-skip:not(#k):not(:disabled):active { box-shadow: inset 0 0 0 2px var(--cz-line); }
/* Cozy stage 6: Reset view of a game (gameview.js) sits over the 3D view, so it is a plum HUD pill with cream words that turns mango while pressed. The class is written twice to sit above the kit base rule. */
body .game-reset.game-reset:not(#k) { --sg: var(--cz-hud); --sd: var(--cz-ledge); --sh: var(--cz-hud); --k-focus: var(--cz-hud-accent); border-radius: var(--cz-r-pill); color: var(--cz-on-hud); text-shadow: none; box-shadow: inset 0 0 0 2px var(--cz-plum-deep), 0 3px 0 var(--cz-ledge); }
body .game-reset.game-reset:not(#k):not(:disabled):active { --sg: var(--cz-hud-accent); color: var(--cz-on-main); box-shadow: inset 0 0 0 2px var(--cz-plum-deep); }

/* Settings card: one grouped panel, segmented choices (green = selected), quiet secondary buttons. */
body .w-settings .w-setting:not(#k) { gap: 10px; padding: 10px 6px; border-bottom: 1px solid var(--cz-ledge); flex-wrap: nowrap; }
body .w-settings .w-setting:not(#k) > span { flex: 1 1 auto; font-size: 16px; color: var(--cz-ink); white-space: nowrap; }
body .w-settings .w-setting-options:not(#k) { flex: 0 0 auto; flex-wrap: nowrap; gap: 2px; padding: 3px; border-radius: var(--cz-r-sm); background: var(--cz-sunk); box-shadow: inset 0 0 0 2px var(--cz-line); }
body .w-settings .w-choice:not(#k) { min-width: 56px; min-height: 36px; padding: 4px 12px; border-radius: 9px; font-size: 15px; background: transparent; background-image: none; box-shadow: none;
  color: var(--cz-ink); text-shadow: none; transform: none; }
body .w-settings .w-choice:not(#k):not(:disabled):hover { background: var(--cz-cream); color: var(--cz-ink); transform: none; }
body .w-settings .w-choice[aria-pressed="true"]:not(#k) { background: var(--cz-ok); color: var(--cz-on-ok); box-shadow: inset 0 0 0 2px var(--cz-line), 0 2px 0 var(--cz-ledge); }
body .w-settings .w-choice:not(#k):not(:disabled):active { transform: none; box-shadow: none; }
body .w-settings .w-btn:not(#k), body .w-settings .w-close:not(#k) { min-height: 44px; border-radius: var(--cz-r-sm); font-size: 16px; background-image: none; text-shadow: none;
  background-color: var(--cz-sunk); color: var(--cz-ink); box-shadow: inset 0 0 0 2px var(--cz-line), 0 3px 0 var(--cz-ledge); }
body .w-settings .w-btn:not(#k):not(:disabled):hover, body .w-settings .w-close:not(#k):not(:disabled):hover { background-color: var(--cz-cream); transform: none; }
body .w-settings .w-btn:not(#k):not(:disabled):active, body .w-settings .w-close:not(#k):not(:disabled):active { transform: translateY(1px); box-shadow: inset 0 0 0 2px var(--cz-line); }
body .w-settings .w-install-btn:not(#k) { width: 100%; margin-top: 14px; }
body .w-settings .w-settings-actions:not(#k) { margin-top: 10px; }
body .w-settings .w-settings-actions .w-logout:not(#k) { background-color: var(--cz-surface); color: var(--cz-danger); box-shadow: inset 0 0 0 2px var(--cz-danger), 0 3px 0 var(--cz-ledge); }
body .w-settings .w-settings-actions .w-logout:not(#k):not(:disabled):hover { background-color: var(--cz-cream); }
body .w-settings .w-close:not(#k) { display: flex; width: 100%; margin: 10px 0 0; background-color: var(--cz-main); box-shadow: inset 0 0 0 2px var(--cz-line), 0 3px 0 var(--cz-ledge); }
body .w-settings .w-close:not(#k):not(:disabled):hover { background-color: var(--cz-sunk); }
body .w-settings .w-install:not(#k) { background: var(--cz-sunk); color: var(--cz-ink); }
body .w-settings .w-install:not(#k) { margin-top: 10px; padding: 14px; border-radius: 14px; font-weight: 600; line-height: 1.4; }
body .w-settings .w-install-why:not(#k) { margin: 0 0 12px; color: var(--cz-ink); font-size: 15px; }
body .w-settings .w-install-label:not(#k) { margin: 0 0 6px; font: 800 12px 'Baloo 2', system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--cz-ink); }
body .w-settings .w-install-done:not(#k) { margin: 0; font-weight: 800; font-size: 16px; }
body .w-settings .w-install-device h4 { margin: 0 0 8px; font: 800 17px 'Baloo 2', system-ui, sans-serif; color: var(--cz-ink); }
body .w-settings .w-install-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
body .w-settings .w-install-steps li { position: relative; margin: 0 0 8px; padding: 2px 0 2px 38px; min-height: 28px; font-size: 16px; color: var(--cz-ink); counter-increment: step; }
body .w-settings .w-install-steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--cz-ok); color: var(--cz-on-ok);
  font: 800 15px/28px 'Baloo 2', system-ui, sans-serif; text-align: center; }
body .w-settings .w-install-more { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--cz-ledge); }
body .w-settings .w-install-more summary { cursor: pointer; font: 800 15px 'Baloo 2', system-ui, sans-serif; color: var(--cz-ink); padding: 4px 0 8px; }
body .w-settings .w-install-more .w-install-device { margin-bottom: 12px; }

/* Sign boards: calm dark rows with a coloured edge, one yellow Play button, segmented difficulty, quiet Read and Close. */
body .w-card:is(.w-sign, .w-settings) .w-card-title:not(#k) { width: auto; margin: 0 auto 14px; padding: 0 10px 8px; border: 0; border-radius: 0; background: transparent; box-shadow: none;
  font-size: 26px; line-height: 1.2; color: var(--cz-ink); text-shadow: none; border-bottom: 4px solid var(--sign-tint, var(--cz-main)); }
body .w-sign .w-sign-lines { gap: 8px; margin-bottom: 10px; }
body .w-sign .w-sign-line:not(#k) { padding: 12px 14px; border-radius: 12px; background-color: var(--cz-surface); background-image: none; color: var(--cz-ink); text-shadow: none;
  box-shadow: inset 6px 0 0 var(--sign-tint, var(--cz-main)); padding-left: 20px; }
body .w-sign .w-sign-story:not(#k) { padding: 10px 14px; border-radius: 12px; background: var(--cz-sunk); color: var(--cz-ink); font-weight: 700; box-shadow: inset 0 0 0 2px var(--cz-ledge); }
body .w-sign .w-sign-foot:not(#k) { gap: 10px; margin-top: 14px; padding: 14px 0 0; border-top: 1px solid var(--cz-ledge); }
body .w-sign .w-sign-foot .w-sign-go:not(#k) { min-height: 54px; background-image: none; background-color: var(--cz-main); color: var(--cz-on-main); border-radius: 14px; animation: none;
  box-shadow: inset 0 0 0 2px var(--cz-line), 0 4px 0 var(--cz-ledge); }
body .w-sign .w-sign-foot .w-sign-go:not(#k):not(:disabled):hover { background-color: var(--cz-main); }
body .w-sign .w-sign-foot .w-sign-go:not(#k):not(:disabled):active { box-shadow: inset 0 0 0 2px var(--cz-line), 0 1px 0 var(--cz-ledge); }
body .w-sign .w-sign-foot .w-diff:not(#k) { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
body .w-sign .w-diff-label:not(#k) { grid-column: 1 / -1; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--cz-ink-soft); }
body .w-sign .w-diff-btn:not(#k) { min-height: 42px; padding: 6px 8px; border-radius: 10px; background-image: none; background-color: var(--cz-surface); color: var(--cz-ink); text-shadow: none;
  box-shadow: inset 0 0 0 2px var(--cz-line); }
body .w-sign .w-diff-btn:not(#k):not(:disabled):hover { background-color: var(--cz-sunk); color: var(--cz-ink); transform: none; }
body .w-sign .w-diff-btn.on:not(#k) { background-color: var(--cz-ok); color: var(--cz-on-ok); box-shadow: inset 0 0 0 2px var(--cz-line), 0 2px 0 var(--cz-ledge); }
body .w-sign .w-diff-btn:not(#k):not(:disabled):active { transform: none; }
body .w-sign .w-sign-foot .w-sign-read:not(#k) { min-height: 46px; border-radius: 12px; background-image: none; background-color: var(--cz-sunk); color: var(--cz-ink); text-shadow: none;
  box-shadow: inset 0 0 0 2px var(--cz-line), 0 3px 0 var(--cz-ledge); }
body .w-sign .w-sign-foot .w-sign-read:not(#k):not(:disabled):hover { background-color: var(--cz-cream); transform: none; }
body .w-sign .w-sign-foot .w-close:not(#k) { min-height: 42px; border-radius: 12px; background-image: none; background-color: transparent; color: var(--cz-ink-soft); text-shadow: none; box-shadow: none; }
body .w-sign .w-sign-foot .w-close:not(#k):not(:disabled):hover { background-color: var(--cz-sunk); color: var(--cz-ink); transform: none; }

.g-howto { position: fixed; left: 50%; top: 34%; transform: translateX(-50%); z-index: 12; width: min(88%, 380px); display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 18px; background: var(--cz-hud); color: var(--cz-on-hud); font: 800 17px/1.3 'Baloo 2', system-ui, sans-serif; text-align: left; pointer-events: none; box-shadow: inset 0 0 0 2px var(--cz-plum-deep), 0 4px 0 var(--cz-ledge); }
.g-howto[hidden] { display: none; }
.g-howto-icon { font-size: 44px; animation: g-howto-up 1.1s ease-in-out infinite; }
@keyframes g-howto-up { 0% { transform: translateY(14px); } 60% { transform: translateY(-14px); } 100% { transform: translateY(-14px); } }
@media (prefers-reduced-motion: reduce) { .g-howto-icon { animation: none; } }

/* Tree Hoop: the shot timing bar sits just above the Shoot button, at the bottom-right edge. */
.th-meter { position: absolute; right: 0; bottom: 112px; width: 112px; height: 16px; border-radius: 8px; border: 3px solid var(--cz-on-hud); background: color-mix(in srgb, var(--cz-plum-deep) 55%, transparent); overflow: hidden; box-shadow: 0 2px 8px var(--cz-ledge); }
.th-zone { position: absolute; top: 0; bottom: 0; background: var(--cz-leaf); opacity: .9; }
.th-swish { position: fixed; left: 50%; top: 26%; z-index: 20; transform: translate(-50%, 0) scale(.4); opacity: 0; pointer-events: none; font: 800 46px/1 system-ui, sans-serif; color: var(--cz-hud-accent); text-shadow: 0 0 14px color-mix(in srgb, var(--cz-hud-accent) 95%, transparent), 0 3px 0 var(--cz-plum-deep), 0 0 30px color-mix(in srgb, var(--cz-cream) 70%, transparent); }
.th-swish.is-on { animation: th-pop 1.1s ease-out; }
@keyframes th-pop { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.4); } 18% { opacity: 1; transform: translate(-50%, 0) scale(1.25); } 35% { transform: translate(-50%, 0) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -14px) scale(1.05); } }
.th-flash { position: fixed; inset: 0; z-index: 19; opacity: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 40%, color-mix(in srgb, var(--cz-hud-accent) 55%, transparent), transparent 65%); }
.th-flash.is-on { animation: th-flash .6s ease-out; }
@keyframes th-flash { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .th-flash { display: none; } }
/* The dayo's entrance (treehoop/adapter.js intro): film bars, a soft glow at the screen edge only (never a full white screen), a name card
   in the lower band and the title in the upper one. All four are gone before tip-off. */
.dayo-bars { position: fixed; inset: 0; z-index: 18; pointer-events: none; }
.dayo-bars::before, .dayo-bars::after { content: ''; position: absolute; left: 0; right: 0; height: 12vh; background: var(--cz-plum-deep); animation: dayo-bar .45s ease-out both; }
.dayo-bars::before { top: 0; transform-origin: top; }
.dayo-bars::after { bottom: 0; transform-origin: bottom; }
@keyframes dayo-bar { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.dayo-glow { position: fixed; inset: 0; z-index: 19; opacity: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 58%, var(--cz-cream) 100%); }
.dayo-glow.is-on { animation: dayo-glow .26s ease-out; }
@keyframes dayo-glow { 0% { opacity: 0; } 30% { opacity: var(--dayo-peak, .35); } 100% { opacity: 0; } }
.dayo-card { position: fixed; left: 50%; bottom: 12%; z-index: 20; transform: translate(-50%, 0); pointer-events: none; padding: 6px 22px; border: 3px solid var(--cz-line); border-radius: 999px; background: var(--cz-plum-deep); color: var(--cz-cream); font: 800 26px/1.1 system-ui, sans-serif; letter-spacing: .5px; white-space: nowrap; }
.dayo-card:empty { display: none; }
.dayo-title { position: fixed; left: 50%; top: var(--hud-top, 68px); z-index: 20; transform: translate(-50%, 0); pointer-events: none; max-width: 92vw; text-align: center; font: 800 28px/1.1 system-ui, sans-serif; letter-spacing: 1px; color: var(--cz-cream); text-shadow: 0 2px 0 var(--cz-plum-deep), 0 0 12px color-mix(in srgb, var(--cz-plum-deep) 70%, transparent); animation: dayo-title .3s ease-out both; }
@keyframes dayo-title { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (max-width: 600px) { .dayo-title { font-size: 22px; } .dayo-card { font-size: 22px; } }
@media (max-height: 520px) { .dayo-title { top: calc(var(--top-edge, 6px) + 8px); } }
@media (prefers-reduced-motion: reduce) { .dayo-bars, .dayo-glow { display: none; } .dayo-title { animation: none; } }
.th-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: color-mix(in srgb, var(--cz-hud-accent) 85%, transparent); mix-blend-mode: screen; }
@media (max-height: 520px) { .th-meter { bottom: 92px; width: 92px; } }
/* The after-payment cards (thanks, rejected): a short line and a trust line, in the same screen style as every other card. */
/* The unlock card: a short promise, numbered steps and a trust line, in the same screen style as every other window. */
body .w-unlock .w-unlock-lead:not(#k) { margin: 0 0 12px; color: var(--cz-ink); font-size: 15px; line-height: 1.45; text-align: center; }
body .w-unlock .w-unlock-trust:not(#k) { margin: 0 0 12px; color: var(--cz-ink-soft); font-size: 12px; line-height: 1.4; text-align: center; }
body .w-unlock .w-btn:not(#k):not(.w-close) { display: flex; justify-content: center; width: 100%; --sg: var(--cz-main); --sd: var(--cz-ledge); --sh: var(--cz-main); border-radius: var(--cz-r-sm); color: var(--cz-on-main); text-shadow: none; box-shadow: inset 0 0 0 2px var(--cz-line), 0 4px 0 var(--cz-ledge); }
body .w-unlock .w-close:not(#k) { display: flex; justify-content: center; width: 100%; margin: 10px 0 0; --sg: var(--cz-surface); --sd: var(--cz-ledge); --sh: var(--cz-sunk); border-radius: var(--cz-r-sm); color: var(--cz-ink); text-shadow: none; background-color: var(--sg); box-shadow: inset 0 0 0 2px var(--cz-line); }
/* Cozy stage 6: the buttons above are a mango main button and a quiet cream Not now; pressed, each keeps its plum line. */
body .w-unlock .w-btn:not(#k):not(:disabled):active { box-shadow: inset 0 0 0 2px var(--cz-line); }

.lk-turn {
  position: fixed;
  top: max(8px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  max-width: calc(100vw - 32px);
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--cz-hud);
  color: var(--cz-on-hud);
  font: 600 13px/1.2 system-ui, sans-serif;
  box-shadow: 0 2px 8px var(--cz-ledge);
}
.lk-turn[hidden] { display: none; }

.k-hint { display: none; }
body.pc-keys .k-hint { display: block; position: absolute; top: -6px; left: -6px; min-width: 18px; padding: 1px 5px; border-radius: 9px; background: var(--cz-plum-deep); color: var(--cz-on-hud);
  font: 700 11px/16px system-ui, sans-serif; text-align: center; pointer-events: none; box-shadow: 0 1px 3px var(--cz-ledge); z-index: 2; }
.w-keys { margin-top: 10px; text-align: left; }
.w-keys summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.w-keys-row { margin: 4px 0; font-size: 14px; line-height: 1.4; }
.w-keys-row kbd { display: inline-block; min-width: 22px; padding: 1px 7px; border-radius: 6px; background: var(--cz-hud); color: var(--cz-on-hud); font: 700 12px/18px system-ui, sans-serif; text-align: center; }

/* Tumbang's throw button is a round Hold button in the bottom-right corner (Run and the skills take the arc beside it); a ring
   around it fills while she holds. */
.tb-hold.tb-hold-round { position: fixed; right: var(--thumb-r, 16px); bottom: var(--thumb-b, max(24px, env(safe-area-inset-bottom))); z-index: 12;
  width: 84px; height: 84px; min-width: 0; min-height: 0; padding: 0; border-radius: 50%; touch-action: none;
  font: 800 19px/1 'Baloo 2', system-ui, sans-serif; letter-spacing: .02em; color: var(--cz-on-main); text-shadow: none;
  border: 4px solid var(--cz-line); background: var(--cz-main);
  box-shadow: 0 6px 0 var(--cz-ledge), 0 8px 16px var(--cz-ledge); }
.tb-hold.tb-hold-round:active, .tb-hold.tb-hold-round.tb-charging { transform: translateY(4px) scale(1.04); box-shadow: 0 2px 0 var(--cz-ledge), 0 0 18px color-mix(in srgb, var(--cz-main) 80%, transparent); animation: none; filter: none; }
.tb-hold-round > .tb-meter { position: absolute; inset: -12px; width: auto; height: auto; border: 0; border-radius: 50%; overflow: visible; pointer-events: none;
  --ring: color-mix(in srgb, var(--cz-terracotta) var(--h, 0%), color-mix(in srgb, var(--cz-mango) var(--w, 0%), var(--cz-teal)));
  background: conic-gradient(transparent var(--s0, 0%), color-mix(in srgb, var(--cz-cream) 70%, transparent) var(--s0, 0%) var(--s1, 0%), transparent var(--s1, 0%)),
    conic-gradient(var(--ring) calc(var(--p, 0%) - 9%), color-mix(in srgb, var(--ring) 45%, var(--cz-cream)) var(--p, 0%), color-mix(in srgb, var(--cz-cream) 30%, transparent) 0); -webkit-mask: radial-gradient(circle, transparent 60%, var(--cz-plum) 62%); mask: radial-gradient(circle, transparent 60%, var(--cz-plum) 62%); }
.tb-hold-round > .tb-meter.tb-turn-a { animation: tb-turn-a .22s ease-out; }
.tb-hold-round > .tb-meter.tb-turn-b { animation: tb-turn-b .22s ease-out; }
@keyframes tb-turn-a { 0% { transform: scale(1.14); filter: brightness(1.5); } 100% { transform: scale(1); filter: none; } }
@keyframes tb-turn-b { 0% { transform: scale(1.14); filter: brightness(1.5); } 100% { transform: scale(1); filter: none; } }
/* The ring's look (owner, 2026-11-18): it heats up as it fills (--w, --h), a spark rides its tip (--a), the pale mark (--s0 to --s1)
   is the part that knocks the can and the ring beats while the sweep is inside it, and the button trembles from hot on. */
.tb-hold-round > .tb-spark { position: absolute; inset: -12px; border-radius: 50%; pointer-events: none; opacity: 0; transform: rotate(var(--a, 0deg)); }
.tb-hold-round > .tb-spark::after { content: ''; position: absolute; left: 50%; top: -3px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%;
  background: var(--cz-cream); box-shadow: 0 0 6px 2px var(--cz-mango), 0 0 14px 4px color-mix(in srgb, var(--cz-terracotta) 70%, transparent); }
.tb-hold-round.tb-charging > .tb-spark { opacity: 1; }
.tb-hold-round.tb-sweet > .tb-meter { filter: brightness(1.35) drop-shadow(0 0 5px var(--cz-cream)); animation: tb-sweet .16s ease-in-out infinite alternate; }
@keyframes tb-sweet { to { transform: scale(1.1); } }
.tb-hold.tb-hold-round.tb-charging.tb-hot { box-shadow: 0 2px 0 var(--cz-ledge), 0 0 22px var(--cz-terracotta); animation: tb-tremble .09s linear infinite; }
@keyframes tb-tremble { 0%, 100% { transform: translateY(4px) scale(1.05) rotate(-2.5deg); } 50% { transform: translateY(4px) scale(1.05) rotate(2.5deg); } }
@media (prefers-reduced-motion: reduce) { .tb-hold-round > .tb-meter.tb-turn-a, .tb-hold-round > .tb-meter.tb-turn-b, .tb-hold-round.tb-sweet > .tb-meter, .tb-hold.tb-hold-round.tb-charging.tb-hot { animation: none; } }
/* The taya's Stand sits where Hold does (Hold is hidden while she is taya): green, a can over the word, a soft pulse. */
.tb-stand.tb-stand-round { position: fixed; right: var(--thumb-r, 16px); bottom: var(--thumb-b, max(24px, env(safe-area-inset-bottom))); z-index: 12;
  width: 84px; height: 84px; min-width: 0; min-height: 0; padding: 0; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  font: 800 19px/1 'Baloo 2', system-ui, sans-serif; letter-spacing: .02em; color: var(--cz-on-ok); text-shadow: none;
  border: 4px solid var(--cz-plum-deep); background: var(--cz-ok);
  box-shadow: 0 6px 0 var(--cz-ledge), 0 8px 16px var(--cz-ledge); animation: tb-ready 1.1s ease-in-out infinite; }
.tb-stand-icon { font-size: 26px; line-height: 1; text-shadow: none; }
.tb-stand.tb-stand-round:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--cz-ledge); animation: none; }
@keyframes tb-ready { 0%, 100% { box-shadow: 0 6px 0 var(--cz-ledge), 0 0 0 0 color-mix(in srgb, var(--cz-leaf) 70%, transparent); } 50% { box-shadow: 0 6px 0 var(--cz-ledge), 0 0 0 12px transparent; } }
@media (prefers-reduced-motion: reduce) { .tb-stand.tb-stand-round { animation: none; } }
@media (max-height: 520px) {
  .tb-hold.tb-hold-round, .tb-stand.tb-stand-round { width: 76px; height: 76px; min-height: 0; font-size: 17px; }
}
@media (max-width: 600px) and (min-height: 521px) {
  .tb-hold.tb-hold-round, .tb-stand.tb-stand-round { right: 12px; bottom: max(24px, env(safe-area-inset-bottom)); width: 76px; height: 76px; }
}

.w-fit-btn { display: inline-grid; place-items: center; }
.w-fit-btn svg { width: 20px; height: 20px; }
.w-fit-tip { position: fixed; z-index: 14; left: 50%; transform: translateX(-50%); top: calc(max(14px, env(safe-area-inset-top)) + 54px);
  width: max-content; max-width: calc(100% - 32px); display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px;
  border-radius: 999px; background: var(--cz-hud); color: var(--cz-on-hud); font: 700 15px/1.3 'Baloo 2', system-ui, sans-serif;
  box-shadow: 0 4px 0 var(--cz-ledge); }
.w-fit-tip button { min-height: 36px; padding: 4px 14px; border: 0; border-radius: 999px; background: var(--cz-sunk); color: var(--cz-ink);
  font: inherit; cursor: pointer; }
body:has(> .g-pause:not([hidden])) :is(.w-fit-btn, .w-gear) { display: none; }

/* The 📸 highlight card: the button sits beside full screen; the sheet copies the pause drawer's wood frame and cream buttons. */
.w-share { display: inline-grid; place-items: center; font-size: 20px; line-height: 1; }
body:has(> .g-pause:not([hidden])) .w-share { display: none; }
.w-share-wrap { position: fixed; inset: 0; z-index: 31; display: grid; place-items: center; padding: 16px; box-sizing: border-box;
  font: 800 15px/1.1 'Baloo 2', system-ui, sans-serif; color: var(--cz-ink); }
.w-share-shade { position: absolute; inset: 0; background: var(--cz-scrim); }
.w-share-sheet { position: relative; width: min(92vw, 420px); max-height: calc(100% - 8px); box-sizing: border-box; display: flex; flex-direction: column;
  align-items: center; gap: 10px; padding: 12px; overflow-y: auto; overscroll-behavior: contain; background: var(--cz-surface);
  border: 3px solid var(--cz-line); border-radius: var(--cz-r-lg); box-shadow: var(--cz-shadow); animation: sgbar-in .2s ease-out; }
.w-share-img { display: block; max-width: 100%; max-height: 60vh; border-radius: var(--cz-r-sm); box-shadow: 0 0 0 2px var(--cz-line), 0 5px 0 var(--cz-ledge); }
.w-share-row { width: 100%; display: flex; flex-wrap: wrap; gap: 8px; }
.w-share-act { flex: 1 1 30%; display: inline-grid; place-items: center; min-height: 44px; padding: 6px 10px; border: 0; border-radius: var(--cz-r-sm); box-sizing: border-box;
  font: inherit; color: var(--cz-ink); text-decoration: none; background: var(--cz-sunk); box-shadow: inset 0 0 0 2px var(--cz-line), 0 3px 0 var(--cz-ledge); cursor: pointer; }
.w-share-act:active { transform: translateY(3px); box-shadow: inset 0 0 0 2px var(--cz-line); }
.w-share-go, .w-share-dare { background: var(--cz-main); box-shadow: inset 0 0 0 2px var(--cz-line), 0 4px 0 var(--cz-ledge); }
.w-share-save.is-hint { background: var(--cz-main); }

/* Thumb arc, town extras: Treat, Play, Emote and Use are one short row of 48px round keys. Upright, the row sits just above the
   skill arc, right-aligned (the rail becomes that row; the tired heart joins it). Wider screens: on the bottom line left of the
   arc, Use nearest; the tired heart sits left of Treat. --arc-w and --arc-h come from skill-rail.js. */
@media (max-width: 600px) and (min-height: 521px) {
  body:not(#k) > .w-rail { right: 12px; bottom: calc(var(--arc-h, 200px) + 8px); flex-direction: row-reverse; align-items: center; gap: 8px; }
  body:not(#k) > .w-rail > :is(.w-treat, .w-play, .w-emote, .w-use) { width: 48px; height: 48px; min-height: 0; padding: 0; border-radius: 50%; display: grid; place-items: center; }
  .w-rail > .w-use { order: 1; }
  .w-rail > .w-emote { order: 2; }
  .w-rail > .w-play { order: 3; }
  .w-rail > .w-treat { order: 4; }
  .w-rail > .w-heart { order: 5; }
  body:not(#k) .w-playrow, body:not(#k) .w-emoterow { right: 12px; bottom: calc(var(--arc-h, 200px) + 64px); max-width: calc(100vw - 24px);
    max-height: max(44px, calc(100vh - var(--arc-h, 200px) - 64px - 72px)); }
}
@media (min-width: 601px) {
  body:not(#k) .w-rail > :is(.w-treat, .w-play, .w-emote, .w-use) { position: fixed; bottom: var(--thumb-b, max(24px, env(safe-area-inset-bottom)));
    width: 48px; height: 48px; min-height: 0; padding: 0; border-radius: 50%; display: grid; place-items: center; }
  body:not(#k) .w-rail > .w-use { right: var(--arc-w, 196px); }
  body:not(#k) .w-rail > .w-emote { right: calc(var(--arc-w, 196px) + 56px); }
  body:not(#k) .w-rail > .w-play { right: calc(var(--arc-w, 196px) + 112px); }
  body:not(#k) .w-rail > .w-treat { right: calc(var(--arc-w, 196px) + 168px); }
  body:not(.in-game):not(#k) .w-heart { right: calc(var(--arc-w, 196px) + 224px); bottom: calc(var(--thumb-b, max(24px, env(safe-area-inset-bottom))) + 12px); }
  body:not(#k) .w-playrow, body:not(#k) .w-emoterow { right: var(--arc-w, 196px); bottom: calc(var(--thumb-b, max(24px, env(safe-area-inset-bottom))) + 56px);
    max-width: calc(100vw - var(--arc-w, 196px) - 16px); max-height: calc(100vh - var(--thumb-b, 24px) - 56px - 64px); }
}
@media (max-width: 600px) and (min-height: 521px), (min-width: 601px) {
  body:not(#k) .w-rail > :is(.w-treat, .w-play, .w-emote, .w-use) .lb { display: none; }
  body:not(#k) .w-rail > :is(.w-treat, .w-play, .w-emote, .w-use) .ic { display: block; font-size: 24px; }
}
