/* What's Missing? — the scene where things vanish, and Kiki's case card beside it: her words, the four steps (Look,
   Hide, Choose, See), the things to choose from and the friend's button. Warm coral paper; mobile first; a side panel
   on wide screens. */
.wm-body { background: #5a2a3a; }
.wm-wrap { position: absolute; inset: 0; display: flex; }
.wm-wrap.wm-side { flex-direction: row; }
.wm-wrap.wm-stack { flex-direction: column; }
.wm-stage { position: relative; flex: 1 1 auto; min-width: 0; min-height: 0; overflow: hidden; background: #2d8fb3; touch-action: manipulation; }
.wm-stack .wm-stage { flex: 0 0 auto; height: 56%; min-height: 240px; }
.wm-cv { position: absolute; left: 0; top: 0; display: block; }
.wm-fx { z-index: 4; pointer-events: none; }
.wm-mid { z-index: 2; pointer-events: none; }
.wm-items { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.wm-actors { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.wm-actor { position: absolute; }
.wm-actor .dk-puppet { filter: drop-shadow(0 5px 0 rgba(0,30,40,.22)); }

/* every thing on stage is a button: its picture, and its name while you learn it */
.wm-item { position: absolute; left: 0; top: 0; padding: 0; margin: 0; border: 0; background: transparent; pointer-events: auto; cursor: pointer; border-radius: 18px; transform-origin: 50% 50%; will-change: transform; }
.wm-item img { width: 100%; height: 100%; display: block; pointer-events: none; filter: drop-shadow(0 3px 0 rgba(29,24,19,.18)); }
.wm-item:focus-visible { outline: 4px solid var(--focus); outline-offset: 3px; }
.wm-item:disabled { cursor: default; }
.wm-tag { position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); display: none; white-space: nowrap; padding: 2px 9px; font: 700 13.5px/1.25 var(--display); color: var(--text); background: #fffdf5; border: 2px solid var(--ink); border-radius: 999px; box-shadow: 0 2px 0 var(--ink); pointer-events: none; }
.wm-item.tagged .wm-tag { display: block; }
.wm-ghost { position: absolute; left: 0; top: 0; pointer-events: none; filter: brightness(0) opacity(.34); z-index: 1; }
.wm-peek { position: absolute; z-index: 5; padding: 0; border: 0; background: transparent; border-radius: 50%; cursor: zoom-in; }
.wm-peek:focus-visible { outline: 4px dashed var(--focus); outline-offset: 2px; }

/* Kiki's notebook: the lineup as it was (Look again) */
.wm-note { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; padding: 12px; background: rgba(20, 30, 40, .45); }
.wm-note-in { max-width: min(640px, 100%); display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 14px 16px 16px; background: #fffaf0; border: 3px solid var(--ink); border-radius: 20px; box-shadow: 0 6px 0 var(--ink);
  background-image: repeating-linear-gradient(180deg, transparent 0 27px, rgba(63,143,224,.18) 27px 28px); }
.wm-note-h { margin: 0; font: 700 17px/1.2 var(--display); color: var(--text); text-align: center; }
.wm-note-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.wm-note-t { display: flex; flex-direction: column; align-items: center; gap: 2px; width: clamp(64px, 16vw, 104px); }
.wm-note-t img { width: 100%; aspect-ratio: 1; display: block; }
.wm-note-t small { font: 700 12.5px/1.2 var(--display); color: #4a3f36; text-align: center; }

/* ---------- Kiki's case card ---------- */
.wm-panel { position: relative; z-index: 3; display: flex; flex-direction: column; gap: 8px; min-height: 0; color: var(--text);
  padding: 10px max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) 12px; background: linear-gradient(180deg, #fff6f1, #fde3da); }
.wm-side .wm-panel { flex: 0 0 auto; width: clamp(300px, 34vw, 440px); border-left: 3px solid var(--ink); }
.wm-stack .wm-panel { flex: 1 1 auto; border-top: 3px solid var(--ink); padding-left: max(12px, env(safe-area-inset-left)); }
.wm-say { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; background: #fffdf8; border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 4px 0 var(--ink); min-height: 64px; flex-shrink: 0; }
.wm-say img { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--ink); background: #fff; flex: 0 0 auto; }
.wm-say p { flex: 1 1 auto; margin: 0; font: 600 16px/1.3 var(--display); text-wrap: pretty; }
.wm-say.pop { animation: wm-pop .22s ease-out; }
@keyframes wm-pop { from { transform: scale(.96); opacity: .6; } to { transform: none; opacity: 1; } }
.wm-speak { flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center; border: 3px solid var(--ink); border-radius: 12px; background: var(--yellow); color: var(--text); cursor: pointer; }
.wm-speak svg { width: 22px; height: 22px; }

/* the four steps of every round */
.wm-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; flex-shrink: 0; }
.wm-steps li { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 34px; padding: 2px 6px; border: 2px solid rgba(29,24,19,.25); border-radius: 999px; font: 700 13.5px/1 var(--display); color: #7a6a60; background: rgba(255,253,248,.6); }
.wm-steps li svg { width: 18px; height: 18px; flex: 0 0 auto; opacity: .55; }
.wm-steps li.on { color: var(--text); background: var(--yellow); border-color: var(--ink); box-shadow: 0 2px 0 var(--ink); }
.wm-steps li.on svg { opacity: 1; }
.wm-steps li.done { color: #3d5a4a; background: #dff5e6; border-color: rgba(29,24,19,.4); }

.wm-main { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 2px 2px 4px; display: flex; flex-direction: column; gap: 10px; }
.wm-help { margin: 2px; font: 600 15.5px/1.35 var(--body); color: #5a3f3a; }
.wm-help b { font-family: var(--display); color: var(--text); }

/* Challenge's look clock */
.wm-clock { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: #fffdf8; border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 3px 0 var(--ink); }
.wm-clock svg { width: 52px; height: 52px; flex: 0 0 auto; transform: rotate(-90deg); }
.wm-clock .bgc { fill: #fff1c8; stroke: var(--ink); stroke-width: 3; }
.wm-clock .fgc { fill: none; stroke: #e8543c; stroke-width: 5; stroke-dasharray: 113.1; stroke-dashoffset: 0; stroke-linecap: round; }
.wm-clock b { display: block; font: 800 26px/1 var(--display); }
.wm-clock small { display: block; margin-top: 2px; font: 600 13.5px/1.2 var(--body); color: #5a3f3a; }

/* the things to choose from */
.wm-opts { display: grid; gap: 8px; }
.wm-opts.pics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wm-opts.pics.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.wm-opts.pics.n5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.wm-opts.names { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* (under the stage, on a tablet held upright, the offered pictures stay a comfortable card size, centred) */
.wm-stack .wm-opts.pics { grid-template-columns: repeat(3, minmax(0, 118px)); justify-content: center; }
.wm-stack .wm-opts.pics.n4 { grid-template-columns: repeat(4, minmax(0, 118px)); }
.wm-stack .wm-opts.pics.n5 { grid-template-columns: repeat(5, minmax(0, 118px)); }
.wm-opt { position: relative; min-width: 0; padding: 4px; background: #fffdf5; border: 3px solid var(--ink); border-radius: 16px; box-shadow: 0 4px 0 var(--ink); cursor: pointer; color: var(--text); transition: transform .08s; }
.wm-opts.pics .wm-opt { aspect-ratio: 1; min-height: 64px; }
.wm-opt img { width: 100%; height: 100%; display: block; pointer-events: none; }
.wm-opts.names .wm-opt { display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 6px 10px 6px 8px; text-align: left; }
.wm-say-ic { flex: 0 0 auto; width: 32px; height: 32px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 10px; background: var(--yellow); }
.wm-say-ic svg { width: 18px; height: 18px; }
.wm-word { font: 700 17px/1.15 var(--display); }
.wm-opt:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.wm-opt.on { background: var(--yellow); box-shadow: 0 0 0 4px #fffdf5, 0 0 0 7px var(--ink); }
.wm-opt.show { animation: wm-glow 1.2s ease-in-out infinite; }
@keyframes wm-glow { 50% { box-shadow: 0 0 0 4px #fff3a8, 0 0 0 8px #e8a040; } }
.wm-opt.struck { background: repeating-linear-gradient(135deg, #f1ece2, #f1ece2 6px, #e6dfd2 6px, #e6dfd2 12px); cursor: default; box-shadow: 0 2px 0 rgba(29,24,19,.4); }
.wm-opt.struck img, .wm-opt.struck .wm-word { opacity: .45; }
.wm-opt.struck .wm-x { position: absolute; inset: 14%; pointer-events: none; background: linear-gradient(45deg, transparent 44%, #e8452c 44%, #e8452c 56%, transparent 56%), linear-gradient(-45deg, transparent 44%, #e8452c 44%, #e8452c 56%, transparent 56%); opacity: .85; }
.wm-opts.names .wm-opt.struck .wm-x { inset: 30% 8%; }
.wm-opt.found { background: #dff5e6; cursor: default; }
.wm-opt:disabled { cursor: default; }
.wm-opt:focus-visible { outline: 4px solid var(--focus); outline-offset: 3px; }

.wm-done { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: #fffdf8; border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 3px 0 var(--ink); }
.wm-done-pics { display: flex; gap: 4px; flex: 0 0 auto; }
.wm-done-pics img { width: 60px; height: 60px; display: block; }
.wm-done b { display: block; font: 700 19px/1.2 var(--display); }
.wm-done small { display: block; margin-top: 4px; font: 600 14px/1.35 var(--body); color: #5a3f3a; }

.wm-actions { display: flex; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }
.wm-actions .btn { min-height: 52px; font-size: 16px; padding: 8px 12px; }
.wm-actions .wm-tool { flex: 1 1 auto; background: #fffdf5; }
.wm-actions .wm-gobtn { flex: 1 1 100%; order: 5; min-width: 0; font-size: 19px; }
.wm-actions .wm-gobtn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-actions .btn-icon { flex: 0 0 auto; width: 52px; padding: 0; }
.wm-actions .btn-icon span { display: none; }

.wm-goals span { display: inline-grid; place-items: center; opacity: .35; }
.wm-goals span.on { opacity: 1; }
.wm-goals svg { width: 22px; height: 22px; }

/* phones upright: the tools become icon buttons beside the friend's button */
@media (max-width: 519px), (max-height: 760px) {
  .wm-stack .wm-actions { flex-wrap: nowrap; }
  .wm-stack .wm-actions .wm-gobtn { flex: 1 1 auto; order: 0; }
  .wm-stack .wm-actions .wm-tool { flex: 0 0 auto; width: 50px; padding: 0; justify-content: center; }
  .wm-stack .wm-actions .wm-tool span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .wm-stack .wm-say { min-height: 56px; padding-top: 6px; padding-bottom: 6px; }
  .wm-stack .wm-steps li { min-height: 30px; font-size: 12.5px; padding: 2px 4px; gap: 3px; }
  .wm-stack .wm-steps li svg { width: 15px; height: 15px; }
  .wm-stack .wm-main { gap: 8px; }
  .wm-stack .wm-opts.pics .wm-opt { min-height: 60px; }
}
@media (max-width: 420px) {
  .wm-say p { font-size: 15px; }
  .wm-actions .wm-gobtn { font-size: 15.5px; padding-left: 8px; padding-right: 8px; gap: 6px; }
  .wm-steps li span { font-size: 12px; }
}
@media (max-width: 360px) {
  .wm-steps li svg { display: none; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .wm-side .wm-panel { width: clamp(270px, 46vw, 400px); gap: 6px; padding-top: 6px; }
  .wm-say { min-height: 50px; padding: 5px 6px 5px 8px; }
  .wm-say p { font-size: 14px; }
  .wm-say img { width: 36px; height: 36px; }
  .wm-steps li { min-height: 28px; font-size: 12px; }
  .wm-steps li svg { width: 14px; height: 14px; }
  .wm-opts.pics .wm-opt { min-height: 52px; }
  .wm-actions .btn { min-height: 46px; }
  .wm-side .wm-actions { flex-wrap: nowrap; }
  .wm-side .wm-actions .wm-gobtn { flex: 1 1 auto; order: 0; }
  .wm-side .wm-actions .wm-tool { flex: 0 0 auto; width: 46px; padding: 0; justify-content: center; }
  .wm-side .wm-actions .wm-tool span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .wm-clock svg { width: 40px; height: 40px; }
  .wm-clock b { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .wm-say.pop { animation: none; }
  .wm-opt.show { animation: none; box-shadow: 0 0 0 4px #fff3a8, 0 0 0 8px #e8a040; }
}
