/* The five toys. Each lives in a .toy-stage (a size container). */
.toy { width: 100%; height: 100%; }

/* ---------- Raumwerk: a dollhouse room on a turntable ---------- */
.toy-room { display: grid; place-items: center; }
.room-stage {
  --s: min(64cqmin, 320px);
  width: 100%; height: 100%;
  display: grid; place-items: center;
  perspective: 1000px;
  cursor: grab; touch-action: none; user-select: none;
  border-radius: 18px;
}
.is-grabbing .room-stage { cursor: grabbing; }
.room-stage:focus-visible { outline-offset: -6px; }
.room-camera { transform-style: preserve-3d; transform: translateY(calc(var(--s) * .28)); }
.room {
  --h: calc(var(--s) * .42);
  --line-art: light-dark(rgb(40 30 22 / .55), rgb(0 0 0 / .7));
  --wall: light-dark(#f4ece0, #3a342e);
  --wall-green: light-dark(#4f7d66, #2f4d40);
  --floor: light-dark(#e6c9a0, #5b4430);
  --plank: light-dark(rgb(120 80 40 / .16), rgb(0 0 0 / .22));
  --wood: light-dark(#c99766, #7a5838);
  --soft: light-dark(#fffaf2, #4a433c);
  --leaf: light-dark(#3f8a5c, #4f9c6c);
  position: relative; width: 0; height: 0;
  transform-style: preserve-3d;
  transform: rotateX(-28deg) rotateY(var(--ry));
}
.rf { position: absolute; left: 0; top: 0; transform-style: preserve-3d; }
.floor {
  width: var(--s); height: var(--s);
  transform: translate(-50%, -50%) rotateX(90deg);
  background-color: var(--floor);
  background-image: repeating-linear-gradient(90deg, var(--plank) 0 1.5px, transparent 1.5px calc(var(--s) / 9));
  border: 1.5px solid var(--line-art);
}
.disk {
  width: calc(var(--s) * 1.62); height: calc(var(--s) * 1.62); border-radius: 50%;
  transform: translate(-50%, -50%) translateY(calc(var(--s) * .05)) rotateX(90deg);
  border: 2px dashed color-mix(in oklab, var(--ink) 30%, transparent);
  background: color-mix(in oklab, var(--a) 12%, transparent);
}
.rug {
  width: calc(var(--s) * .42); height: calc(var(--s) * .3); border-radius: 50%;
  transform: translate(-50%, -50%) translate(calc(var(--s) * .04), 0) translateY(-1px) rotateX(90deg);
  background: color-mix(in oklab, var(--a) 55%, var(--soft));
  border: 1.5px solid var(--line-art);
}
.wall {
  width: var(--s); height: var(--h);
  background: var(--wall);
  border: 1.5px solid var(--line-art);
  backface-visibility: hidden;
}
.wall-0, .wall-180 { background: var(--wall-green); }
.piece { position: absolute; left: 0; top: 0; transform-style: preserve-3d; }
.piece .rf { border: 1px solid var(--line-art); backface-visibility: hidden; }
.piece.accent .top { background: var(--a); }
.piece.accent .side { background: color-mix(in oklab, var(--a) 76%, #000); }
.piece.soft .top { background: var(--soft); }
.piece.soft .side { background: color-mix(in oklab, var(--soft) 84%, #000); }
.piece.wood .top { background: var(--wood); }
.piece.wood .side { background: color-mix(in oklab, var(--wood) 80%, #000); }
.piece.books .side.end, .piece.books .side.front {
  background:
    repeating-linear-gradient(0deg, transparent 0 22%, var(--wood) 22% 26%),
    repeating-linear-gradient(90deg, var(--a) 0 9%, #3d6b8f 9% 15%, #e8c15a 15% 21%, #6f9a5d 21% 30%);
}
.piece.leaf .top { background: var(--leaf); }
.piece.leaf .side { background: color-mix(in oklab, var(--leaf) 75%, #000); }
.piece.hearth .side { background: light-dark(#e9e2d6, #5d554c); }
.piece.hearth .top { background: light-dark(#d9d0c2, #4a433c); }
.piece.hearth .side.front::after {
  content: ''; position: absolute; left: 22%; right: 22%; bottom: 0; height: 52%;
  border-radius: 40% 40% 0 0 / 50% 50% 0 0; background: #2a211b;
  box-shadow: inset 0 -10px 0 -2px var(--a);
}
.toy-room .piece { scale: 1; }
@media (prefers-reduced-motion: no-preference) {
  .toy-room:not(.is-on) .piece { scale: 0.001; }
  .toy-room.is-on .piece { transition: scale .55s var(--spring) calc(var(--i) * 90ms + 200ms); }
}

/* ---------- Chessy: Springi on a 5x5 board ---------- */
.toy-board { display: grid; place-items: center; }
.board {
  position: relative;
  width: min(84cqmin, 300px); aspect-ratio: 1;
  border-radius: 14px; overflow: hidden;
  border: 3px solid light-dark(#0f231c, #04140d);
  box-shadow: 0 5px 0 light-dark(#0a6e49, #04140d);
}
.board-grid { display: grid; grid-template-columns: repeat(5, 1fr); width: 100%; height: 100%; }
.sq-light { background: light-dark(#eef4e4, #c7d6c1); }
.sq-dark { background: light-dark(#4fa585, #3b8a6b); }
.sq.is-last { box-shadow: inset 0 0 0 100px rgba(255, 197, 61, .62); }
.board-piece, .board-target {
  position: absolute; left: 0; top: 0; width: 20%; height: 20%;
  transform: translate(calc(var(--x) * 100%), calc(var(--y) * 100%));
}
.board-piece { display: grid; place-items: center; pointer-events: none; z-index: 2; transition: transform .3s cubic-bezier(.25, .9, .3, 1.15); }
.board-piece img { width: 80%; height: auto; filter: drop-shadow(0 3px 0 rgb(0 0 0 / .25)); }
.board-piece.is-landing img { animation: slam .32s ease-out .24s; }
@keyframes slam { 40% { transform: scale(1.14, .86) translateY(6%); } }
.board-targets { position: absolute; inset: 0; z-index: 3; }
.board-target { display: grid; place-items: center; padding: 0; border: 0; background: transparent; cursor: pointer; touch-action: manipulation; border-radius: 6px; }
.board-target:focus-visible { outline-offset: -3px; outline-color: light-dark(#1d5fd1, #ffffff); }
.board-target .dot {
  width: 34%; height: 34%; border-radius: 50%;
  background: #0f231c; box-shadow: 0 0 0 3px #ffffff;
  transition: transform .15s var(--spring);
}
.board-target:hover .dot { transform: scale(1.25); }

/* ---------- Tandem: two rings in step ---------- */
.toy-rings {
  --a-ring: var(--a-ui);
  display: grid; justify-items: center; align-content: center; gap: 4px; padding: 10px;
}
.toy-rings.is-break { --a-ring: light-dark(#087463, #c0b6fe); }
.rings-svg { height: clamp(64px, 40cqh, 210px); width: auto; overflow: visible; }
.ring-track { fill: none; stroke: color-mix(in oklab, var(--a-ring) 20%, var(--card)); stroke-width: 9; transition: stroke .8s; }
.ring-arc { fill: none; stroke: var(--a-ring); stroke-width: 9; stroke-linecap: round; transition: stroke .8s; }
.ring + .ring .ring-arc { stroke: color-mix(in oklab, var(--a-ring) 62%, var(--card)); }
.ring-who { font: 700 16px var(--font); fill: var(--ink); }
.ring-ripple { fill: none; stroke: var(--a-ring); stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; }
.ring-ripple.is-on { animation: ripple 1.5s var(--ease); }
@keyframes ripple { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(3.2); } }
.rings-readout { text-align: center; display: grid; gap: 0; }
.rings-phase { font-weight: 600; font-size: .875rem; color: var(--muted); }
.rings-clock { font-size: clamp(1.75rem, 15cqh, 3.25rem); font-weight: 700; font-stretch: 85%; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.rings-go { min-width: 12ch; }
@container (max-height: 200px) {
  .toy-rings { grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 14px; row-gap: 2px; align-items: center; }
  .rings-svg { grid-row: 1 / 3; height: min(80cqh, 120px); }
  .rings-readout { text-align: left; align-self: end; }
  .rings-clock { font-size: clamp(1.5rem, 22cqh, 2.25rem); }
  .rings-go { align-self: start; min-width: 0; }
}

/* ---------- Mise: a pile of step cards ---------- */
.toy-cards { display: grid; place-items: center; }
.pile { position: relative; width: min(74cqw, 300px); height: min(66cqh, 190px); margin: -10px 14px 0 0; }
.step-card {
  position: absolute; inset: 0;
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto 1fr; align-content: start; gap: 4px 14px;
  padding: 14px 16px; border-radius: 18px;
  background: light-dark(#ffffff, #2a2a2f);
  border: 1.5px solid var(--line-strong);
  box-shadow: 0 4px 0 var(--edge);
  transform: translate(calc(var(--depth) * 7px), calc(var(--depth) * 8px)) rotate(calc(var(--depth) * 2.5deg));
  transition: transform .38s var(--spring);
}
.pile.is-dragging .step-card.is-top { transition: none; }
.step-card.is-flying { transform: translate(calc(var(--fly) * 150%), -8%) rotate(calc(var(--fly) * 20deg)) !important; transition: transform .26s ease-in; }
.step-no { grid-row: 1 / 4; font-size: clamp(2.5rem, 26cqh, 4.25rem); font-weight: 700; font-style: italic; line-height: .9; color: var(--a-text); font-variant-numeric: tabular-nums; }
.step-of { font-size: .8125rem; font-weight: 600; color: var(--muted); }
.step-text { grid-column: 2; font-size: .875rem; line-height: 1.35; color: var(--muted); display: none; }
@container (min-height: 330px) and (min-width: 300px) { .step-text { display: block; } .pile { height: min(70cqh, 250px); } }
.step-card .step-title { font-size: clamp(1.0625rem, 9cqh, 1.5rem); font-weight: 700; font-stretch: 85%; line-height: 1.1; align-self: start; }
.pile-hit { position: absolute; inset: 0; z-index: 20; background: transparent; border: 0; border-radius: 18px; cursor: grab; touch-action: none; }
.pile-hit:active { cursor: grabbing; }

/* ---------- dialed.: the grinder dial ---------- */
.toy-cup { display: flex; align-items: center; justify-content: center; gap: clamp(12px, 5cqw, 32px); padding: 12px 14px; }
.dial { flex: none; width: min(46cqw, 80cqh, 300px); aspect-ratio: 1; border-radius: 50%; cursor: grab; touch-action: none; }
.is-grabbing .dial { cursor: grabbing; }
.dial-svg { width: 100%; height: 100%; overflow: visible; }
.dial-face { fill: light-dark(#ffffff, #1f1c19); stroke: var(--line-strong); stroke-width: 1.5; }
.tick-major { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.tick-minor { stroke: var(--muted); stroke-width: 1.2; stroke-linecap: round; }
.dial-needle { stroke: var(--a-ui); stroke-width: 5; stroke-linecap: round; transform-box: view-box; transform-origin: 60px 60px; transition: transform .25s var(--spring); }
.dial-hub { fill: var(--ink); }
.cup-readout { display: grid; gap: 3px; flex: 0 1 220px; min-width: 0; }
.cup-label { font-size: .8125rem; font-weight: 600; color: var(--muted); }
.cup-grind { font-size: clamp(2rem, 22cqh, 3.5rem); font-weight: 700; font-stretch: 85%; line-height: 1; font-variant-numeric: tabular-nums; }
.cup-shot { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; gap: 8px; }
.cup-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.cup-bar { position: relative; height: 10px; margin: 6px 0 2px; border-radius: 5px; background: color-mix(in oklab, var(--ink) 14%, transparent); }
.cup-window {
  position: absolute; top: -4px; bottom: -4px; border-radius: 5px;
  border: 2px solid var(--ink);
  background: repeating-linear-gradient(45deg, color-mix(in oklab, var(--ink) 22%, transparent) 0 3px, transparent 3px 6px);
}
.cup-marker {
  position: absolute; top: 50%; left: var(--t); width: 18px; height: 18px; border-radius: 50%;
  background: var(--a-ui); border: 3px solid var(--card); box-shadow: 0 0 0 1.5px var(--ink);
  transform: translate(-50%, -50%); transition: left .25s var(--spring);
}
.cup-target { font-size: .8125rem; color: var(--muted); }
.cup-verdict { display: flex; align-items: center; gap: 8px; font-weight: 700; line-height: 1.2; margin-top: 4px; }
.cup-verdict-text { display: grid; min-width: 0; }
.cup-hint { font-weight: 600; font-size: .875rem; }
.cup-mark { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 7px; border: 2px solid currentColor; font-size: .875rem; }
.toy-cup[data-verdict="good"] .cup-verdict { color: light-dark(#2d6a3e, #8fd19e); }
.toy-cup[data-verdict="good"] .cup-marker { background: light-dark(#2d6a3e, #8fd19e); }
@container (max-width: 380px) {
  .toy-cup { gap: 12px; padding: 10px 12px; }
  .dial { width: min(40cqw, 80cqh, 300px); }
  .cup-readout { flex: 1 1 auto; }
  .cup-verdict { font-size: .9375rem; gap: 6px; }
  .cup-verdict-text { display: grid; min-width: 0; }
.cup-hint { font-weight: 600; font-size: .875rem; }
.cup-mark { width: 22px; height: 22px; }
}
@container (max-width: 300px) {
  .cup-grind { font-size: 2rem; }
}
/* Short stages (app page hero on small phones): the hatched window says "target" on its own. */
@container (max-height: 200px) {
  .toy-cup { padding-block: 8px; }
  .cup-target { display: none; }
  .cup-grind { font-size: 1.75rem; }
  .cup-shot { margin-top: 2px; }
  .cup-verdict { margin-top: 2px; }
}
