/* Fun Room round 2: the mirror, Personality (fr-mirror.js; classes start mr-). The scene stands in its own painted corner
   (art/corner/mirror.webp, Codex batch 46: a blank panel of wall). The wide brass mirror hangs on it. One question to a screen,
   the answer a big painting in the glass; at the end your type's face fills the glass, the painted famous person you are most
   like hangs in the dock, and one sliding row of five faces picks what visitors see. Nothing scrolls. */

/* ---------- the stage ---------- */
/* --rest = what the stage needs besides the mirror (title, words, slider...). The mirror is as tall as is left, never wider than the phone. */
.mr-col{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;--rest:120px}
.mr-mirror{position:relative;flex:none;height:max(150px,min(calc(100cqh - var(--rest)),calc(92cqw / .9)));aspect-ratio:.9;outline:none}
.mr-mirror.r{cursor:pointer}
.mr-mirror:focus-visible .mr-ring{filter:drop-shadow(0 0 8px rgba(255,210,90,.9))}
.mr-ring{position:absolute;inset:0;border-radius:50%;padding:4.4%;
  background:conic-gradient(from 200deg,#fff0b8,#c98f2a,#7a4d12,#e8c46a,#fff0b8 40%,#a8731f 62%,#e8c46a 82%,#fff0b8);
  box-shadow:0 14px 26px rgba(0,0,0,.6),inset 0 0 0 2px rgba(60,30,4,.6)}
.mr-glass{position:relative;width:100%;height:100%;border-radius:50%;overflow:hidden;
  background:radial-gradient(ellipse 60% 16% at 74% 14%,rgba(255,206,120,.30),transparent 70%),radial-gradient(ellipse at 40% 30%,#4a6c94,#1a2f4e 60%,#0b1829);
  box-shadow:inset 0 0 26px rgba(0,0,0,.8),0 0 0 3px rgba(60,30,4,.7)}
.mr-refl{position:absolute;inset:0;pointer-events:none;opacity:.5;
  background:linear-gradient(104deg,transparent 44%,rgba(255,222,160,.1) 46%,rgba(255,222,160,.1) 58%,transparent 60%),linear-gradient(0deg,rgba(90,52,22,.45),transparent 30%)}
.mr-content{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}
.mr-content.q{}
.mr-mirror.slide-r .mr-content{animation:mrIn .38s cubic-bezier(.2,.8,.3,1)}
.mr-mirror.slide-l .mr-content{animation:mrInL .38s cubic-bezier(.2,.8,.3,1)}
@keyframes mrIn{from{opacity:0;transform:translateX(34px)}to{opacity:1;transform:none}}
@keyframes mrInL{from{opacity:0;transform:translateX(-34px)}to{opacity:1;transform:none}}

/* life: the candles' reflections flicker, a soft shimmer crosses the glass now and then */
.mr-candle{position:absolute;bottom:15%;width:5%;height:9%;pointer-events:none;mix-blend-mode:screen;border-radius:50% 50% 45% 45% / 70% 70% 30% 30%;
  background:radial-gradient(ellipse at 50% 70%,#fff0b0 0,#ffb040 45%,rgba(255,120,30,.5) 70%,transparent 100%);box-shadow:0 0 12px 5px rgba(255,160,60,.35);
  animation:mrFlick var(--dur,1s) ease-in-out var(--delay,0s) infinite alternate}
.mr-candle.l{left:20%}.mr-candle.r{right:20%}
@keyframes mrFlick{0%{opacity:.55;transform:scale(.9,.84) translateX(-1px)}35%{opacity:.95;transform:scale(1.04,1.08)}70%{opacity:.7;transform:scale(.94,.92) translateX(1px)}100%{opacity:1;transform:scale(1,1.12)}}
.mr-glint{position:absolute;top:-10%;bottom:-10%;left:-60%;width:34%;pointer-events:none;transform:skewX(-18deg);
  background:linear-gradient(90deg,transparent,rgba(255,244,214,.22),transparent);animation:mrGlint var(--dur,10s) ease-in-out var(--delay,2s) infinite}
@keyframes mrGlint{0%,60%{left:-60%}100%{left:130%}}

/* ---------- the questions ---------- */
.mr-title{margin:0;flex:none;max-width:94%;text-align:center;text-wrap:balance;font:700 20px/1.15 var(--display);letter-spacing:.05em;text-transform:uppercase;color:var(--gold);text-shadow:0 1px 6px rgba(0,0,0,.9)}
/* the answer: a big painting in the glass, whole */
.mr-ans{width:68%;height:64%;object-fit:contain;display:block;filter:drop-shadow(0 6px 10px rgba(0,0,0,.55));transition:opacity .25s}
.mr-ans.unset{opacity:.55;filter:saturate(.7) drop-shadow(0 6px 10px rgba(0,0,0,.55))}
.mr-ans.tick{animation:mrTick .26s ease-out}
.mr-say{margin:0;flex:none;min-height:24px;max-width:94%;font:600 16px/1.2 var(--display);letter-spacing:.03em;text-align:center;color:var(--cream);text-shadow:0 2px 8px rgba(0,0,0,.9);text-wrap:balance}
.mr-say.unset{opacity:.6}
.mr-say.tick{animation:mrTick .22s ease-out}
@keyframes mrTick{from{transform:scale(.93);opacity:.55}to{transform:none;opacity:1}}

/* the brass slider: a brass knob on a walnut rail, as wide as the phone allows; the knob moves inside the track, never past it */
.mr-rail{position:relative;flex:none;width:min(94%,420px);height:52px;touch-action:none;cursor:pointer;outline:none}
.mr-track{position:absolute;left:24px;right:24px;top:50%;height:12px;margin-top:-6px;border-radius:6px;
  background:linear-gradient(#3a2208,#6b4418 55%,#4a2c0e);box-shadow:inset 0 2px 3px rgba(0,0,0,.7),0 1px 0 rgba(255,226,160,.35),0 0 0 1px rgba(216,178,92,.35)}
.mr-kz{position:absolute;left:24px;right:24px;top:0;bottom:0;pointer-events:none}
.mr-ticks{position:absolute;left:0;right:0;top:50%;height:12px;margin-top:-6px;display:flex;justify-content:space-between;align-items:center}
.mr-ticks i{width:4px;height:4px;border-radius:50%;background:#e8c46a;box-shadow:0 0 3px rgba(255,210,90,.8)}
.mr-knob{position:absolute;top:50%;width:44px;height:44px;margin:-22px 0 0 -22px;border-radius:50%;pointer-events:none;display:block;
  background:url(art/scene/brass-button.webp) center/cover,radial-gradient(circle at 35% 30%,#fff2c0,#d8a845 50%,#6e4a14);
  filter:drop-shadow(0 3px 5px rgba(0,0,0,.6));transition:left .16s ease-out}
.mr-rail.drag .mr-knob{transition:none;transform:scale(1.08)}
.mr-rail.unset .mr-knob{opacity:.75;filter:drop-shadow(0 3px 5px rgba(0,0,0,.6)) saturate(.6)}
.mr-rail:focus-visible .mr-knob{filter:drop-shadow(0 0 8px rgba(255,210,90,.9))}
.mr-rail:not(.unset) .mr-knob{box-shadow:0 0 14px rgba(255,210,90,.35)}

/* the dock while answering: arrows and eleven small lamps, one for each question */
.k-dock .mr-nb{flex:none;width:48px;height:48px;border-radius:50%;display:grid;place-items:center;color:#3a2408;
  background:radial-gradient(circle at 35% 30%,#fff3c4,#e0b858 55%,#9a6e22);border:1.5px solid #3a2408;box-shadow:0 3px 7px rgba(0,0,0,.6)}
.k-dock .mr-nb:active{transform:scale(.94)}
.mr-dots{flex:1;display:flex;justify-content:center;align-items:center;gap:9px;min-height:44px}
.mr-dot{width:7px;height:7px;border-radius:50%;background:rgba(243,234,214,.22);transition:all .25s}
.mr-dot.on{background:#e8c46a;box-shadow:0 0 6px rgba(255,210,90,.7)}
.mr-dot.cur{width:11px;height:11px;box-shadow:0 0 0 2px rgba(255,236,170,.9),0 0 8px rgba(255,210,90,.8)}

/* ---------- the mist, then the type ---------- */
.mr-mist{position:absolute;inset:-4%;z-index:4;opacity:0;pointer-events:none;
  background:radial-gradient(ellipse at 50% 45%,rgba(214,200,172,.9),rgba(176,166,146,.82) 70%);backdrop-filter:blur(7px)}
.mr-mist.in{opacity:1;transition:opacity .75s ease-in}
.mr-mist.out{opacity:0;transition:opacity 1.5s ease-out .1s}

/* the type's face, big and whole in the glass (the painted card, 3 x 4) */
.mr-face{width:64%;height:auto;max-height:78%;aspect-ratio:3/4;object-fit:contain;display:block;border-radius:6px;background:#1a0f08;
  box-shadow:0 0 0 2px rgba(255,230,170,.6),0 8px 16px rgba(0,0,0,.6);animation:mrBreathe 7s ease-in-out infinite}
.mr-face.swap{animation:mrSwap .45s ease-out, mrBreathe 7s ease-in-out .45s infinite}
@keyframes mrBreathe{0%,100%{transform:scale(1)}50%{transform:scale(1.02)}}
@keyframes mrSwap{from{opacity:0;transform:scale(.92)}to{opacity:1;transform:none}}
.mr-facetxt{font:700 22px/1.15 var(--display);letter-spacing:.06em;color:var(--lamp);text-shadow:0 2px 8px rgba(0,0,0,.9);max-width:70%}

/* the brass plate with the type's name, what the face is called, and the line to see who else is one */
.mr-plate{flex:none;display:flex;flex-direction:column;align-items:center;min-width:56%;max-width:94%;padding:3px 22px 4px;border-radius:5px;
  background:linear-gradient(#f6e29c,#c8922f);box-shadow:inset 0 0 0 1.5px rgba(74,46,12,.5),0 3px 6px rgba(0,0,0,.5);color:#2a1604}
.mr-plate b{font:700 clamp(16px,5vw,21px)/1.15 var(--display);letter-spacing:.1em;text-transform:uppercase;white-space:nowrap}
.mr-plate span{font:700 12px/1.2 var(--display);letter-spacing:.1em;text-transform:uppercase;opacity:.75;white-space:nowrap}
.mr-pill{flex:none;min-height:44px;max-width:94%;padding:0 18px;border-radius:999px;font:600 13px/1.2 var(--display);letter-spacing:.04em;color:var(--cream);text-wrap:balance;
  background:rgba(20,12,6,.72);border:1px solid rgba(216,178,92,.5);text-shadow:0 1px 3px rgba(0,0,0,.8)}
.mr-pill:active{transform:scale(.97)}
.mr-pill.gold{color:#ffd25a;border-color:rgba(255,210,90,.8);text-shadow:0 0 12px rgba(255,210,90,.6)}

/* a coworker who has not finished */
.mr-ptitle{margin:0 0 4px;font:700 20px/1.1 var(--display);letter-spacing:.1em;text-transform:uppercase;color:var(--gold);text-shadow:0 1px 6px rgba(0,0,0,.9)}
.mr-pline{margin:0;max-width:66%;font:500 15px/1.35 var(--sans);color:var(--cream);opacity:.85;text-shadow:0 1px 4px rgba(0,0,0,.8);text-wrap:balance}

/* ---------- the tray: five big faces ---------- */
.sc-personality .k-tray>h3{height:20px}

/* ---------- the dock at the end: who you are most like, painted ---------- */
.mr-fam{flex:1;min-width:0;display:flex;align-items:center;gap:12px;padding:2px 0}
.mr-frame{position:relative;flex:none;width:80px;height:88px;padding:4px;border-radius:12px;background:linear-gradient(#f6dc8e,#a47822 50%,#e2b552);
  box-shadow:0 0 0 1.5px #5a3a14,0 5px 10px rgba(0,0,0,.6),inset 0 0 0 1px rgba(255,248,200,.7)}
.mr-frame .k-pic{display:block;width:100%;height:100%;border-radius:8px;overflow:hidden}
.mr-ft{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.mr-ft small{font:700 12px/1.2 var(--sans);letter-spacing:.08em;text-transform:uppercase;color:rgba(246,220,142,.85)}
.mr-ft b{font:700 17px/1.15 var(--display);letter-spacing:.03em;color:var(--lamp);text-shadow:0 1px 4px rgba(0,0,0,.8);text-wrap:balance}
.mr-retake{flex:none;min-width:76px;min-height:44px;padding:0 14px;border-radius:999px;font:700 12px var(--display);letter-spacing:.06em;color:#ecdcb8;
  background:rgba(30,16,8,.82);border:1px solid rgba(216,178,92,.45)}

/* the review's C10: the candle reflections were left from an older painting (no candles stand before this mirror) */
.mr-candle{display:none}

/* the five faces all fit on a 360 px phone: no sideways sliding, none cut (the kit's row is overridden here only) */
.sc-personality .k-tray .k-row{gap:6px;padding:4px 8px 2px;overflow:visible;justify-content:center;scroll-snap-type:none}
.sc-personality .k-tray .k-card{flex:0 1 calc((100% - 16px - 24px) / 5);min-width:0;height:auto;max-height:100%;aspect-ratio:.92;align-self:center}
.sc-personality .k-tray .k-rowwrap.over .k-row{margin-right:0;padding-right:8px}
/* the five result cards are at least 44 px tall to tap (they were 43 on a 360 phone) */
.sc-personality .k-tray .k-card{min-height:46px}
.sc-personality .k-tray .k-cardbtn{min-height:44px}
