/* v5-play: test-play, locks, choices, split clues, Then & Now, jigsaw, voice notes, wax seals */

/* ---- test-play */
.practice-banner { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; padding: 14px 18px; border-radius: 18px; background: repeating-linear-gradient(135deg, rgba(143, 176, 221, 0.1) 0 14px, rgba(143, 176, 221, 0.04) 14px 28px); box-shadow: inset 0 0 0 1px rgba(143, 176, 221, 0.4); }
.practice-banner > span { font-size: 30px; }
.practice-banner b { display: block; font: 700 17px var(--f-display); color: var(--sky); }
.practice-banner small { color: var(--muted); font-size: 13px; }
.skip-step { margin-top: 14px; align-self: flex-start; border: 1px dashed rgba(143, 176, 221, 0.5); color: var(--sky); }

/* ---- combination lock */
.lockbox { position: relative; padding-top: 46px; display: flex; flex-direction: column; align-items: center; }
.lock-shackle { position: absolute; top: 0; left: 50%; width: 110px; height: 82px; transform: translateX(-50%); border: 14px solid #8a8f99; border-bottom: 0; border-radius: 60px 60px 0 0; background: none;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.25); transition: transform 0.7s var(--spring); transform-origin: 90% 100%; z-index: 0; }
.lock-body { position: relative; z-index: 1; width: 100%; padding: 22px 16px 14px; border-radius: 22px; background: linear-gradient(160deg, #d8b25a, #a9853a 55%, #7d5f22); box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.8), inset 0 2px 0 rgba(255, 255, 255, 0.35), inset 0 -3px 0 rgba(0, 0, 0, 0.25); }
.lock-ctl { justify-content: space-between; margin-top: 10px; }
.lock-ctl .btn { background: rgba(0, 0, 0, 0.22); color: #fbf1d6; min-width: 40px; }
.lock-ctl .dim { color: rgba(31, 38, 50, 0.75); }
.dials { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.dial { display: flex; flex-direction: column; align-items: center; width: 50px; border-radius: 14px; overflow: hidden; background: linear-gradient(#0e1116, #262d38 30%, #262d38 70%, #0e1116); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.5), 0 2px 0 rgba(255, 255, 255, 0.25); }
.dial button { position: relative; z-index: 1; width: 100%; height: 26px; border: 0; background: none; color: rgba(243, 236, 220, 0.5); font-size: 11px; cursor: pointer; }
.dial button:hover { color: #f0d38a; background: rgba(255, 255, 255, 0.05); }
.dial-in { width: 100%; height: 50px; border: 0; background: none; text-align: center; font: 800 30px var(--f-mono); color: #fbf1d6; text-transform: uppercase; caret-color: transparent; outline: none;
  border-top: 1px solid rgba(255, 255, 255, 0.07); border-bottom: 1px solid rgba(0, 0, 0, 0.6); }
.dial-in:focus { background: rgba(240, 211, 138, 0.12); box-shadow: inset 0 0 0 2px rgba(240, 211, 138, 0.6); }
.dial.spin-up .dial-in { animation: dialUp 0.18s var(--ease); }
.dial.spin-dn .dial-in { animation: dialDn 0.18s var(--ease); }
@keyframes dialUp { from { transform: translateY(14px); opacity: 0.2; } }
@keyframes dialDn { from { transform: translateY(-14px); opacity: 0.2; } }
.lockbox.shake { animation: lockShake 0.5s; }
@keyframes lockShake { 15% { transform: translateX(-10px) rotate(-2deg); } 35% { transform: translateX(9px) rotate(2deg); } 55% { transform: translateX(-6px) rotate(-1deg); } 75% { transform: translateX(4px); } }
.lockbox.open .lock-shackle { transform: translateX(-50%) translateY(-26px) rotate(-18deg); border-color: #a3b86c; }
.lockbox.open .lock-body { box-shadow: 0 0 0 3px rgba(159, 194, 94, 0.8), 0 0 60px rgba(159, 194, 94, 0.5); }
.lockbox.open .dial-in { color: #cde6a0; }

/* ---- choices */
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice-opt { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border: 0; border-radius: 16px; text-align: left; cursor: pointer; color: var(--text); font: 600 16px var(--f-body);
  background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--line); transition: transform 0.25s var(--spring), background 0.2s, box-shadow 0.2s; }
.choice-opt:hover:not(:disabled) { transform: translateX(4px); background: rgba(240, 211, 138, 0.08); box-shadow: inset 0 0 0 1px rgba(240, 211, 138, 0.5); }
.choice-opt .ci { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font: 800 15px var(--f-mono); color: #1f2632; background: #f0d38a; }
.choice-opt.picked { box-shadow: inset 0 0 0 2px var(--amber); }
.choice-opt.miss { opacity: 0.45; cursor: default; text-decoration: line-through; text-decoration-color: var(--coral); }
.choice-opt.miss .ci { background: var(--coral); color: #fff; }
.choice-opt.right { background: rgba(159, 194, 94, 0.16); box-shadow: inset 0 0 0 2px var(--good); }
.choice-opt.right .ci { background: var(--good); }
.choice-note { padding: 12px 16px; border-radius: 14px; background: rgba(233, 169, 79, 0.08); box-shadow: inset 0 0 0 1px rgba(233, 169, 79, 0.35); color: #f5e2b0; font: 500 15.5px/1.45 var(--f-display); }
.choice-note b { color: var(--amber); }
.choice-note.pop { animation: fadeUp 0.4s var(--ease); }
.case-closed { position: relative; }
.cc-stamp { position: absolute; top: 4px; right: -6px; padding: 6px 12px; border: 4px double var(--coral); border-radius: 8px; color: var(--coral); font: 800 17px var(--f-mono); letter-spacing: 0.14em; transform: rotate(12deg);
  animation: slam 0.6s var(--spring) 0.35s both; }
.cc-reveal { margin-top: 6px; padding: 18px 20px; border-radius: 16px; text-align: left; background: #f4ead3; color: #1f2632; font: italic 500 18px/1.5 var(--f-serif); box-shadow: 0 16px 40px -20px #000; animation: fadeUp 0.6s var(--ease) 0.5s both; }

/* ---- split clues */
.split-card { margin-top: 16px; padding: 16px 18px; border-radius: 16px; background: rgba(163, 184, 108, 0.07); box-shadow: inset 0 0 0 1px rgba(163, 184, 108, 0.35); display: flex; flex-direction: column; gap: 8px; }
.split-card > b { font: 700 18px var(--f-display); }
.split-card .piece { position: relative; padding: 12px 14px 12px 40px; border-radius: 10px; background: #f4ead3; color: #1f2632; font: 500 16px/1.4 var(--f-display);
  clip-path: polygon(0 6%, 3% 0, 97% 4%, 100% 0, 99% 94%, 96% 100%, 4% 96%, 0 100%); }
.split-card .piece::before { content: '🧩'; position: absolute; left: 12px; top: 11px; }
.split-card small { font-size: 12.5px; }

/* ---- Then & Now */
.ghost-card { display: flex; gap: 14px; align-items: center; padding: 10px; border-radius: 16px; background: rgba(244, 234, 211, 0.06); box-shadow: inset 0 0 0 1px rgba(244, 234, 211, 0.18); }
.ghost-card img { flex: none; width: 112px; height: 84px; object-fit: cover; border-radius: 8px; filter: sepia(0.35); box-shadow: 0 0 0 4px #f4ead3, 0 10px 24px -10px #000; transform: rotate(-2deg); margin: 6px; }
.ghost-card > div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ghost-card b { font: 600 16px/1.3 var(--f-display); }
.ghost-card small { color: var(--dim); font-size: 12px; }
.ghost-year { align-self: flex-start; padding: 2px 9px; border-radius: 99px; background: #f0d38a; color: #1f2632; font: 800 12px var(--f-mono); letter-spacing: 0.08em; }
.tn-preview { width: 100%; border-radius: 12px; box-shadow: 0 20px 50px -24px #000; }

.ghostcam { position: fixed; inset: 0; z-index: 176; background: #05070a; overflow: hidden; animation: fadeIn 0.3s; color: #fff; touch-action: manipulation; }
.ghostcam.out { animation: fadeOut 0.3s forwards; }
.ghostcam video, .ghostcam .gc-ghost, .ghostcam .gc-freeze { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ghostcam video { opacity: 0; transition: opacity 0.6s; }
.ghostcam.cam video { opacity: 1; }
.ghostcam .gc-ghost { pointer-events: none; filter: sepia(0.25) contrast(1.05); transition: opacity 0.25s; }
.ghostcam .gc-freeze { z-index: 2; }
.ghostcam.review .gc-ghost, .ghostcam.review .gc-hint { display: none; }
.ghostcam.flash::after { content: ''; position: absolute; inset: 0; z-index: 5; background: #fff; animation: fadeOut 0.35s forwards; }
.gc-top { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; gap: 12px; align-items: flex-start; padding: max(14px, env(safe-area-inset-top)) 16px 30px; background: linear-gradient(rgba(0, 0, 0, 0.7), transparent); }
.gc-x { flex: none; width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.5); color: #fff; font-size: 18px; cursor: pointer; }
.gc-cap { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.gc-cap b { font: 600 17px/1.25 var(--f-display); }
.gc-cap small { opacity: 0.7; font-size: 12px; }
.gc-year { align-self: flex-start; padding: 2px 9px; border-radius: 99px; background: #f0d38a; color: #1f2632; font: 800 12px var(--f-mono); }
.gc-hint { position: absolute; left: 50%; top: 46%; z-index: 3; transform: translate(-50%, -50%); max-width: 80%; padding: 10px 16px; border-radius: 99px; background: rgba(0, 0, 0, 0.55); text-align: center; font-size: 14px; pointer-events: none; animation: fadeOut 0.6s 6s forwards; }
.ghostcam.nocam .gc-hint { animation: none; }
.gc-bottom { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 30px 18px max(20px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0, 0, 0, 0.75)); }
.gc-slide { display: flex; align-items: center; gap: 12px; max-width: 440px; margin: 0 auto 16px; font: 700 12px var(--f-mono); letter-spacing: 0.1em; text-transform: uppercase; }
.gc-slide input { flex: 1; accent-color: #f0d38a; }
.ghostcam.then .gc-slide { opacity: 0.5; }
.gc-btns { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; max-width: 440px; margin: 0 auto; }
.gc-flip, .gc-file { justify-self: start; padding: 10px 14px; border: 0; border-radius: 99px; background: rgba(255, 255, 255, 0.14); color: #fff; font: 600 14px var(--f-body); cursor: pointer; }
.gc-file { justify-self: end; grid-column: 3; }
.ghostcam.then .gc-flip { background: #f0d38a; color: #1f2632; }
.gc-shutter { grid-column: 2; width: 76px; height: 76px; border-radius: 50%; border: 5px solid #fff; background: rgba(255, 255, 255, 0.25); cursor: pointer; transition: transform 0.2s var(--spring); }
.gc-shutter:active { transform: scale(0.88); background: #fff; }
.gc-review { display: flex; justify-content: center; gap: 12px; }
.gc-review[hidden], .gc-live[hidden] { display: none; }

/* ---- collect jigsaw */
.jigsaw { position: relative; margin: 12px 0; border-radius: 16px; overflow: hidden; aspect-ratio: 4 / 3; box-shadow: 0 0 0 1px var(--line), 0 18px 40px -24px #000; }
.jigsaw img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.jg-grid { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--c), 1fr); grid-template-rows: repeat(var(--r), 1fr); }
.jg-grid i { background: linear-gradient(135deg, #2a3240, #1b212b); box-shadow: inset 0 0 0 1px rgba(240, 211, 138, 0.18); display: grid; place-items: center; transition: opacity 0.6s var(--ease) var(--d), transform 0.6s var(--spring) var(--d); }
.jg-grid i::after { content: '?'; font: 800 20px var(--f-display); color: rgba(240, 211, 138, 0.35); }
.jg-grid i.on { opacity: 0; transform: scale(0.6) rotate(8deg); }
.jg-lbl { position: absolute; left: 10px; bottom: 10px; padding: 4px 10px; border-radius: 99px; background: rgba(16, 19, 24, 0.75); font: 700 12px var(--f-mono); }
.jigsaw.whole { box-shadow: 0 0 0 2px rgba(159, 194, 94, 0.6), 0 18px 40px -24px #000; }

/* ---- voice notes */
.vn-row { display: flex; align-items: center; gap: 10px; }
.vn-play { flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; cursor: pointer; font-size: 16px; background: rgba(240, 211, 138, 0.16); box-shadow: inset 0 0 0 1px rgba(240, 211, 138, 0.45); }
.vn-play.on { background: #f0d38a; animation: vnPulse 1s infinite; }
@keyframes vnPulse { 50% { box-shadow: 0 0 0 6px rgba(240, 211, 138, 0.2); } }

/* ---- wax seals */
.wax-seal { width: 180px; height: 180px; margin: 0 auto 14px; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.55)); animation: slam 0.7s var(--spring) 0.2s both; }
.wax-seal svg { display: block; }
.mini-seal { flex: none; width: 64px; height: 64px; transform: rotate(-8deg); filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)); }

@media (max-width: 560px) {
  .dial { width: 40px; }
  .dial-in { height: 44px; font-size: 24px; }
  .ghost-card img { width: 88px; height: 66px; }
}

/* keep quest-log steps inside narrow phones (a long title or card must never widen the page) */
.jstep { grid-template-columns: 56px minmax(0, 1fr); }
.jstep > * { min-width: 0; }
.jstep h4 { overflow-wrap: anywhere; }
