/* =========================================================================
   El caso: expediente, tablero de pistas, sospechosos, acusación,
   modales y los juegos nuevos. Se carga después de styles.css.
   ========================================================================= */
:root {
  --felt: #1E4631;
  --felt-2: #163524;
  --felt-ink: #E6EFD9;
  --chalk: #EEF3E4;
  --mono: "Courier Prime", "Courier New", ui-monospace, monospace;
  --back: cubic-bezier(.34, 1.56, .64, 1);
  --std: cubic-bezier(.2, 0, 0, 1);
}

.eyebrow { font: 700 .78rem/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.eyebrow strong { color: var(--red); font-size: .95rem; letter-spacing: .04em; }
.eyebrow-ok { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--leaf); color: #fff; letter-spacing: .02em; text-transform: none; font-family: var(--sans); }
.eyebrow-ok .ico { width: 13px; height: 13px; }
.game-title .eyebrow { margin-bottom: 4px; }
.nav-n { font: 700 .72rem var(--mono); opacity: .55; margin-right: 5px; }
.nav a[aria-current="page"] .nav-n { opacity: .9; }
.garland { gap: 3px !important; }

.paper {
  position: relative; padding: 18px 20px; border-radius: 6px; background: #F8FAF1;
  border: 1px solid var(--line); box-shadow: var(--shadow);
  background-image: repeating-linear-gradient(transparent 0 27px, rgba(46, 107, 69, .09) 27px 28px);
}
.paper .eyebrow { margin-bottom: 8px; }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; margin-bottom: 18px; }
.sec-head h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); letter-spacing: -.02em; }
.sec-head p { color: var(--ink-2); max-width: 52ch; }

/* ---------- Sello ---------- */
.stamp {
  display: inline-block; font: 700 .95rem/1 var(--mono); letter-spacing: .18em; text-transform: uppercase;
  color: var(--red); border: 3px solid currentColor; border-radius: 6px; padding: 8px 12px 7px;
  transform: rotate(-8deg); opacity: .88; mix-blend-mode: multiply;
}

/* ---------- Portada del expediente ---------- */
.case-hero {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: clamp(18px, 3vw, 34px);
  align-items: stretch; padding: clamp(26px, 5vw, 56px) 0 clamp(30px, 5vw, 56px);
}
.case-file {
  position: relative; padding: clamp(26px, 4vw, 44px); padding-top: clamp(34px, 5vw, 52px);
  background: #F4F7EC; border-radius: 4px 14px 14px 14px; border: 1px solid var(--line);
  box-shadow: 0 1px 0 #fff inset, 8px 8px 0 -2px var(--paper-3), 8px 8px 0 -1px var(--line-2), var(--shadow-lg);
  animation: fileIn .7s var(--ease) both;
}
.case-tab {
  position: absolute; left: -1px; top: -30px; padding: 7px 18px 6px; border-radius: 10px 10px 0 0;
  background: #F4F7EC; border: 1px solid var(--line); border-bottom: 0;
  font: 700 .8rem var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2);
}
.case-file > .stamp { position: absolute; right: clamp(14px, 3vw, 30px); top: clamp(14px, 3vw, 26px); animation: stampIn .5s .65s cubic-bezier(.5, 0, .75, 0) both; }
.case-hero.solved .case-file > .stamp { color: var(--leaf); }
.case-title { margin: 12px 0 18px; font-size: clamp(2.3rem, 6.4vw, 4.6rem); line-height: 1; letter-spacing: -.035em; max-width: 12ch; }
.case-title .w { display: inline-block; margin-right: .22em; animation: wordIn .6s calc(.15s + var(--i) * 60ms) var(--ease) both; }
.case-title .w-red { color: var(--red); font-family: var(--hand); font-weight: 700; font-size: 1.12em; letter-spacing: -.01em; }
.case-intro { display: grid; gap: 10px; max-width: 58ch; color: var(--ink-2); font-size: 1.04rem; }
.case-intro p { animation: fadeUp .6s calc(.55s + var(--i) * 90ms) var(--ease) both; }
.case-intro p:first-child { color: var(--ink); font-size: 1.1rem; }
.case-sign { margin-top: 14px; font-family: var(--hand); font-size: 1.35rem; color: var(--ink-2); animation: fadeIn .8s .9s both; }
.case-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 24px; animation: fadeUp .6s 1s var(--ease) both; }
.case-progress { display: grid; gap: 6px; min-width: 190px; flex: 1 1 190px; max-width: 280px; }
.cp-label { font-size: .9rem; color: var(--ink-2); }
.cp-label strong { font: 700 1rem var(--mono); color: var(--ink); }
.cp-bar { height: 8px; border-radius: 99px; background: var(--paper-3); overflow: hidden; }
.cp-bar span { display: block; height: 100%; width: 100%; border-radius: inherit; background: var(--red); transform-origin: left; transform: scaleX(var(--p)); animation: barIn 1.1s 1.1s var(--ease) both; }

.case-art {
  position: relative; border-radius: 14px; overflow: hidden; min-height: 300px;
  background: radial-gradient(120% 90% at 50% 0%, #2A5B40, var(--felt) 55%, var(--felt-2));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), inset 0 20px 60px rgba(0,0,0,.25), var(--shadow-lg);
  animation: fadeIn .8s .2s both;
}
.case-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.case-art .chalk { fill: none; stroke: var(--chalk); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: .9; animation: draw 1.8s .5s cubic-bezier(.45, 0, .2, 1) forwards; }
.case-art .crack { fill: none; stroke: var(--red); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .5s 2.3s cubic-bezier(.5, 0, .2, 1) forwards; }
.case-art .marker { animation: markerIn .45s var(--back) both; }
.case-art .marker:nth-of-type(1) { animation-delay: 1.4s; } .case-art .marker:nth-of-type(2) { animation-delay: 1.55s; } .case-art .marker:nth-of-type(3) { animation-delay: 1.7s; }
.case-art .marker path { fill: #E9D36A; stroke: #8A7416; stroke-width: 1.5; stroke-linejoin: round; }
.case-art .marker text { font: 700 15px var(--mono); fill: #2B2406; }
.case-art .marker { transform-box: fill-box; transform-origin: 50% 100%; }
.case-art .prints ellipse { fill: var(--chalk); opacity: 0; animation: printIn .4s ease-out forwards; }
.case-art .prints ellipse:nth-child(1) { animation-delay: 2.6s; } .case-art .prints ellipse:nth-child(2) { animation-delay: 2.85s; } .case-art .prints ellipse:nth-child(3) { animation-delay: 3.1s; }
.case-art .lupa { fill: none; stroke: #F3F6EA; stroke-width: 7; stroke-linecap: round; transform: translate(210px, 150px); animation: lupa 9s 1s ease-in-out infinite; }
.case-art .lupa .lupa-glass { fill: rgba(230, 239, 217, .12); stroke: none; }
.case-art .lupa .lupa-shine { stroke-width: 4; opacity: .7; }

/* ---------- Tablero de pistas ---------- */
.board { margin-top: 18px; }
.board-felt {
  position: relative; padding: clamp(22px, 3.4vw, 38px); border-radius: 16px;
  background: radial-gradient(140% 100% at 50% 0%, #285740, var(--felt) 50%, var(--felt-2));
  box-shadow: inset 0 0 0 10px #2E5E44, inset 0 0 0 11px rgba(0,0,0,.25), inset 0 30px 80px rgba(0,0,0,.25), var(--shadow-lg);
}
.board-string { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; overflow: visible; }
.board-string path { fill: none; stroke: #D8283F; stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .35s .5s cubic-bezier(.45, 0, .2, 1) forwards; filter: drop-shadow(0 2px 1px rgba(0,0,0,.35)); }
.board-string.top { z-index: 2; }
.board-cards { position: relative; z-index: 1; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: clamp(16px, 2.4vw, 26px); }
.ev { position: relative; animation: cardIn .5s calc(.1s + var(--i) * 35ms) var(--ease) both; }
.ev a {
  position: relative; display: grid; gap: 4px; align-content: start; height: 100%; min-height: 168px;
  padding: 22px 16px 16px; text-decoration: none; color: var(--ink);
  background: #EFF3E6; border-radius: 3px; transform: rotate(var(--r));
  box-shadow: 0 2px 0 rgba(0,0,0,.12), 0 12px 22px -12px rgba(0,0,0,.6);
  transition: transform .3s var(--back), box-shadow .3s var(--ease);
}
.ev a:hover, .ev a:focus-visible { transform: rotate(0deg) translateY(-4px) scale(1.02); box-shadow: 0 2px 0 rgba(0,0,0,.12), 0 22px 30px -14px rgba(0,0,0,.7); }
.ev:not(.on) a { background: #D7E2CC; color: var(--ink-2); }
.ev.on a { background: #F8FAF1; }
.pin {
  position: absolute; left: 50%; top: -7px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; z-index: 3;
  background: radial-gradient(circle at 35% 30%, #F2808F, var(--red) 45%, var(--red-deep));
  box-shadow: 0 3px 3px rgba(0,0,0,.35);
}
.ev:not(.on) .pin { background: radial-gradient(circle at 35% 30%, #C5D6BA, #7E9A84 50%, #56705C); }
.ev-n { font: 700 .78rem var(--mono); letter-spacing: .1em; color: var(--ink-3); }
.ev-ico { position: absolute; right: 12px; top: 16px; color: var(--leaf); opacity: .8; }
.ev-ico .ico { width: 24px; height: 24px; }
.ev-title { font-family: var(--serif); font-size: 1.12rem; line-height: 1.15; padding-right: 26px; }
.ev-game { font-size: .8rem; color: var(--ink-3); font-weight: 600; }
.ev-clue { margin-top: 8px; font-family: var(--hand); font-size: 1.28rem; line-height: 1.18; color: var(--red-deep); }
.ev-lock { margin-top: auto; padding-top: 10px; display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; font-weight: 650; color: var(--ink-2); }
.ev a:hover .ev-lock { color: var(--red); }

/* ---------- Sospechosos ---------- */
.suspects { margin-top: clamp(40px, 6vw, 64px); }
.sus-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 12px; }
.sus {
  position: relative; display: grid; justify-items: center; gap: 2px; padding: 18px 12px 14px; text-align: center;
  border-radius: var(--r); border: 1.5px solid var(--line); background: #F8FAF1; cursor: pointer; color: var(--ink);
  transition: transform .2s var(--back), border-color .2s, background .2s, opacity .3s;
}
.sus:hover { transform: translateY(-3px); border-color: var(--leaf-2); }
.sus:active { transform: scale(.97); }
.sus-face { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--leaf-soft); color: var(--leaf); margin-bottom: 6px; transition: background .3s, color .3s; }
.sus-face .ico { width: 36px; height: 36px; }
.sus-name { font-weight: 700; line-height: 1.2; }
.sus-rol { font-size: .8rem; color: var(--ink-3); }
.sus-x { position: absolute; inset: 10px; pointer-events: none; }
.sus-x::before, .sus-x::after {
  content: ""; position: absolute; left: 8%; right: 8%; top: 50%; height: 4px; border-radius: 4px; background: var(--red);
  transform: rotate(-24deg) scaleX(0); transform-origin: left; transition: transform .25s var(--std);
}
.sus-x::after { transform: rotate(24deg) scaleX(0); transform-origin: right; transition-delay: 0s; }
.sus.out { background: var(--paper-2); }
.sus.out .sus-face { background: var(--paper-3); color: var(--ink-3); }
.sus.out .sus-name, .sus.out .sus-rol { opacity: .55; }
.sus.out .sus-x::before { transform: rotate(-24deg) scaleX(1); }
.sus.out .sus-x::after { transform: rotate(24deg) scaleX(1); transition-delay: .12s; }
.sus-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; margin-top: 22px; }
.sus-group h3 { font-size: 1.15rem; margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  position: relative; min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line-2);
  background: #F8FAF1; color: var(--ink); font-weight: 600; cursor: pointer; transition: background .2s, color .2s, transform .15s;
}
.chip:active { transform: scale(.95); }
.chip::after { content: ""; position: absolute; left: 10px; right: 10px; top: 50%; height: 2.5px; background: var(--red); border-radius: 2px; transform: scaleX(0); transform-origin: left; transition: transform .25s var(--std); }
.chip.out { color: var(--ink-3); background: var(--paper-2); }
.chip.out::after { transform: scaleX(1); }

/* ---------- Acusación ---------- */
.accuse {
  position: relative; margin-top: clamp(40px, 6vw, 64px); padding: clamp(22px, 4vw, 40px); border-radius: 16px;
  background: #F8FAF1; border: 1.5px solid var(--line); box-shadow: var(--shadow-lg); scroll-margin-top: 110px;
  display: grid; gap: 12px; justify-items: start;
}
.accuse h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
.accuse.locked { background: var(--paper-2); border-style: dashed; box-shadow: none; }
.acc-lock { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--ink-2); color: #fff; }
.acc-lock.open { background: var(--red); animation: pop .5s var(--back); }
.acc-lock .ico { width: 26px; height: 26px; }
.acc-form { display: grid; gap: 14px; width: 100%; justify-items: start; }
.acc-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; width: 100%; }
.acc-field { display: grid; gap: 6px; font-weight: 700; }
.acc-field select { width: 100%; }
.acc-fb { min-height: 1.5em; color: var(--red-deep); font-weight: 600; }
.accuse.closed .stamp { position: absolute; right: 24px; top: 22px; font-size: 1.3rem; }
.acc-verdict { font-size: 1.2rem; }
.acc-verdict strong { color: var(--red); font-family: var(--hand); font-size: 1.8rem; }
.letter { scroll-margin-top: 110px; }

/* ---------- Modales ---------- */
.no-scroll { overflow: hidden; }
.modal {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 18px;
  background: rgba(14, 30, 20, 0); transition: background .3s var(--ease);
}
.modal.in { background: rgba(14, 30, 20, .62); }
.modal.out { background: rgba(14, 30, 20, 0); transition-duration: .2s; }
.modal-box {
  position: relative; width: min(100%, 460px); max-height: calc(100svh - 36px); overflow: auto;
  padding: 28px 24px 24px; border-radius: 18px; background: var(--paper); box-shadow: 0 30px 80px -20px rgba(0,0,0,.6);
  opacity: 0; transform: translateY(18px) scale(.96); transition: opacity .3s var(--ease), transform .4s var(--ease);
}
.modal.in .modal-box { opacity: 1; transform: none; }
.modal.out .modal-box { opacity: 0; transform: translateY(10px) scale(.98); transition-duration: .2s; transition-timing-function: ease-in; }
.modal-copy { display: grid; gap: 8px; margin-top: 18px; }
.modal-copy h2 { font-size: 1.7rem; line-height: 1.1; }
.modal-sub { color: var(--ink-2); }
.modal-copy .row-btns { margin-top: 8px; }

/* sobre + tarjeta de pista */
.modal-clue .modal-box { display: grid; justify-items: center; text-align: center; padding-top: 34px; overflow: visible; }
.modal-clue .modal-copy { justify-items: center; }
.modal-clue .eyebrow { justify-content: center; }
.env { position: relative; width: 210px; height: 120px; margin-bottom: -88px; z-index: 1; }
.env-body { position: absolute; inset: 0; border-radius: 6px; background: linear-gradient(160deg, #3C7A52, var(--leaf)); box-shadow: var(--shadow); }
.env-body::before { content: ""; position: absolute; inset: 0; clip-path: polygon(0 0, 50% 58%, 100% 0, 100% 100%, 0 100%); background: linear-gradient(200deg, #4A8B60, #2A6140); border-radius: 6px; }
.env-flap { position: absolute; left: 0; right: 0; top: 0; height: 70px; z-index: 2; clip-path: polygon(0 0, 100% 0, 50% 100%); background: #357150; transform-origin: top; animation: flap .5s .25s var(--std) forwards; }
.env::after { content: ""; position: absolute; left: 50%; top: 52px; width: 26px; height: 26px; margin-left: -13px; z-index: 3; border-radius: 50%; background: var(--red); box-shadow: 0 2px 3px rgba(0,0,0,.3); animation: sealOff .35s .15s ease-in forwards; }
.clue-card {
  position: relative; z-index: 2; width: min(100%, 300px); padding: 24px 20px 20px; border-radius: 3px; background: #F8FAF1;
  box-shadow: 0 2px 0 rgba(0,0,0,.08), 0 18px 34px -16px rgba(0,0,0,.5); transform: rotate(-1.5deg);
  animation: cardOut .8s .55s var(--back) both;
}
.clue-card-n { font: 700 .8rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.clue-card-t { margin-top: 8px; font-family: var(--hand); font-size: 1.55rem; line-height: 1.2; color: var(--red-deep); }

/* revelación final */
.modal-reveal.in { background: rgba(10, 22, 15, .86); }
.modal-reveal .modal-box { width: min(100%, 520px); display: grid; justify-items: center; text-align: center; gap: 14px; padding: 30px 24px 28px; background: #F4F7EC; overflow: hidden; }
.rv-kicker { font: 700 .8rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.rv-card { width: 172px; height: 206px; perspective: 900px; opacity: 0; transform: translateY(30px) scale(.9); transition: opacity .5s var(--ease), transform .6s var(--back); }
.s1 .rv-card { opacity: 1; transform: none; }
.rv-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .8s cubic-bezier(.6, 0, .2, 1); }
.s2 .rv-inner { transform: rotateY(180deg); }
.rv-face { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px; padding: 16px; border-radius: 10px; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: var(--shadow-lg); }
.rv-front { background: var(--felt); color: var(--felt-ink); font-weight: 700; }
.rv-ico { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.1); }
.rv-ico .ico { width: 60px; height: 60px; }
.rv-back { background: #F8FAF1; transform: rotateY(180deg); border: 2px solid var(--line); }
.rv-name { font-family: var(--hand); font-weight: 700; font-size: 3rem; line-height: 1; color: var(--red); }
.rv-heart { color: var(--red); animation: beat 1.4s 2.4s ease-in-out infinite; }
.rv-heart .ico { width: 46px; height: 46px; }
.rv-stamp {
  position: absolute; top: 212px; left: 50%; z-index: 3; font: 700 1.75rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--red); border: 5px solid currentColor; border-radius: 8px; padding: 10px 16px 8px; background: rgba(248, 250, 241, .55);
  opacity: 0; transform: translateX(-50%) rotate(-14deg) scale(2.4);
}
.s3 .rv-stamp { animation: slam .32s cubic-bezier(.55, 0, .9, .4) forwards; }
.s3.modal-box { animation: thud .36s .3s ease-out; }
.rv-lines { display: grid; gap: 6px; max-width: 42ch; margin-top: 26px; }
.rv-lines p { opacity: 0; transform: translateY(10px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.s4 .rv-lines p { opacity: 1; transform: none; }
.s4 .rv-lines p:nth-child(2) { transition-delay: .12s; } .s4 .rv-lines p:nth-child(3) { transition-delay: .24s; }
.rv-sentence { font-family: var(--hand); font-size: 1.6rem; line-height: 1.2; color: var(--red-deep); }
.modal-reveal .btn { opacity: 0; transition: opacity .4s .5s; }
.s4 .btn { opacity: 1; }

/* ---------- Nota cifrada ---------- */
.cf-layout { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: clamp(20px, 4vw, 44px); align-items: start; }
.cf-wheel-col { display: grid; justify-items: center; gap: 12px; }
.cf-wheel { position: relative; width: min(100%, 360px); aspect-ratio: 1; touch-action: none; cursor: grab; border-radius: 50%; }
.cf-wheel.grab { cursor: grabbing; }
.cf-svg { width: 100%; height: 100%; display: block; }
.cf-disc-o { fill: var(--felt); }
.cf-disc-i { fill: #F8FAF1; stroke: var(--line-2); }
.cf-l { font: 700 15px var(--mono); fill: var(--felt-ink); text-anchor: middle; dominant-baseline: central; }
.cf-l-red { fill: var(--red); font-size: 14px; }
.cf-inner { transform-origin: 150px 150px; transition: transform .35s var(--back); }
.cf-wheel.grab .cf-inner { transition-duration: .12s; }
.cf-window { fill: rgba(233, 211, 106, .16); stroke: #E9D36A; stroke-width: 2; }
.cf-mark { fill: #E9D36A; }
.cf-center { position: absolute; inset: 34%; border-radius: 50%; display: grid; place-items: center; align-content: center; background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--line-2); pointer-events: none; }
.cf-center span { font: 700 .7rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.cf-center strong { font: 700 2.2rem/1 var(--mono); color: var(--ink); }
.cf-turn { align-items: center; }
.cf-turn .btn { width: 48px; padding: 0; }
.cf-turn-l { font-size: .9rem; color: var(--ink-3); }
.cf-side { display: grid; gap: 14px; }
.cf-dots { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.cf-dots li { padding: 4px 12px; border-radius: 99px; font-size: .82rem; font-weight: 700; background: var(--paper-2); color: var(--ink-3); }
.cf-dots li.cur { background: var(--ink); color: var(--paper); }
.cf-dots li.done { background: var(--leaf); color: #fff; }
.cf-msg { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.cf-word { display: inline-flex; gap: 2px; }
.cf-ch { display: grid; justify-items: center; width: 1.25em; font: 700 1.15rem/1.15 var(--mono); }
.cf-c { color: var(--red); font-size: .8em; opacity: .8; }
.cf-p { color: var(--ink-3); transition: color .3s; }
.cf-msg.solved .cf-p { color: var(--leaf); animation: pop .4s var(--back); }
.cf-hint { display: flex; gap: 6px; align-items: flex-start; margin-top: 12px; color: var(--ink-2); font-size: .92rem; }
.cf-hint .ico { width: 18px; height: 18px; color: var(--leaf); margin-top: 2px; }
.cf-form { display: flex; gap: 10px; }
.cf-form .field { flex: 1; text-transform: uppercase; font-family: var(--mono); }
.cf-fb, .cj-fb, .an-fb, .pz-fb, .ah-fb, .cr-fb, .sm-fb { min-height: 1.5em; font-weight: 600; color: var(--ink-2); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.cf-fb strong, .cj-fb strong, .an-fb strong, .pz-fb strong, .ah-fb strong, .cr-fb strong, .sm-fb strong { color: var(--red); }

/* ---------- Caja fuerte ---------- */
.cj-layout { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: clamp(20px, 4vw, 44px); align-items: start; }
.cj-left { display: grid; gap: 16px; }
.cj-safe { position: relative; aspect-ratio: 1 / .92; border-radius: 16px; background: linear-gradient(160deg, #2D5A41, #183626); padding: 16px; perspective: 900px; box-shadow: var(--shadow-lg); }
.cj-inside { position: absolute; inset: 16px; border-radius: 8px; background: radial-gradient(circle at 50% 40%, #3C2A16, #140D06); display: flex; align-items: center; justify-content: center; gap: 4px; color: #E9D36A; }
.cj-inside .ico { width: 44px; height: 44px; transform: rotate(var(--r, 0deg)); }
.cj-inside span:nth-child(1) { --r: -12deg; } .cj-inside span:nth-child(3) { --r: 12deg; }
.cj-door { position: relative; height: 100%; border-radius: 8px; transform-origin: left center; transition: transform 1.1s cubic-bezier(.5, 0, .2, 1); transform-style: preserve-3d; }
.cj-safe.open .cj-door { transform: rotateY(-108deg); }
.cj-door-face { position: absolute; inset: 0; border-radius: 8px; background: linear-gradient(150deg, #8FB19A, #5E8269); box-shadow: inset 0 0 0 6px rgba(255,255,255,.12), inset 0 -10px 20px rgba(0,0,0,.2); display: grid; place-items: center; }
.cj-dial { width: 46%; aspect-ratio: 1; color: #1F3B2A; transition: transform 1s var(--ease); }
.cj-dial svg { width: 100%; height: 100%; fill: #D9E6CF; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; }
.cj-safe.open .cj-dial { transform: rotate(540deg); }
.cj-handle { position: absolute; right: 9%; top: 50%; width: 10px; height: 34%; margin-top: -17%; border-radius: 6px; background: #1F3B2A; }
.cj-legend { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: .9rem; color: var(--ink-2); }
.cj-legend li { display: flex; align-items: center; gap: 8px; }
.pip { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); display: inline-block; flex: none; }
.pip.hit { background: var(--leaf); border-color: var(--leaf); }
.pip.near { border-color: var(--red); background: var(--red-soft); }
.cj-right { display: grid; gap: 14px; justify-items: start; }
.cj-slots { display: flex; gap: 10px; }
.cj-slot { width: 58px; height: 68px; border-radius: 10px; display: grid; place-items: center; background: #0F2418; color: #B8F0C4; font: 700 2rem var(--mono); box-shadow: inset 0 2px 8px rgba(0,0,0,.5); }
.cj-slot.filled { animation: pop .25s var(--back); text-shadow: 0 0 8px rgba(184, 240, 196, .6); }
.cj-slot.cur { box-shadow: inset 0 2px 8px rgba(0,0,0,.5), 0 0 0 2px var(--red); }
.cj-pad { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; width: min(100%, 380px); }
.cj-key { height: 52px; font-family: var(--mono); font-size: 1.25rem; }
.cj-key.used { opacity: .35; text-decoration: line-through; }
.cj-key.wide { grid-column: span 2; }
.cj-open { grid-column: span 3; min-height: 52px; }
.cj-h { font-size: 1.1rem; margin-top: 4px; }
.cj-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; width: min(100%, 380px); }
.cj-row { display: flex; align-items: center; gap: 14px; padding: 8px 12px; border-radius: 10px; background: #F8FAF1; border: 1px solid var(--line); animation: fadeUp .3s var(--ease); }
.cj-n { font: 700 .8rem var(--mono); color: var(--ink-3); width: 2.2em; }
.cj-guess { font: 700 1.2rem var(--mono); letter-spacing: .1em; }
.cj-pips { display: flex; gap: 5px; margin-left: auto; }
.cj-pips .pip { animation: pop .3s calc(var(--i) * 70ms) var(--back) both; }

/* ---------- Documentos triturados ---------- */
.an-wrap { display: grid; gap: 16px; justify-items: center; max-width: 720px; margin: 0 auto; text-align: center; }
.an-paper { width: 100%; display: grid; justify-items: center; }
.an-clue { font-family: var(--hand); font-size: 1.6rem; color: var(--ink); margin-bottom: 14px; }
.an-slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.an-slot { width: clamp(36px, 10vw, 50px); height: clamp(44px, 12vw, 58px); border: 0; border-bottom: 3px solid var(--line-2); background: transparent; font: 700 1.6rem var(--mono); color: var(--ink); cursor: pointer; border-radius: 4px 4px 0 0; }
.an-slot.filled { background: var(--paper-2); }
.an-slot.pop { animation: pop .25s var(--back); }
.an-slot.locked { color: var(--leaf); cursor: default; }
.an-slots.ok .an-slot { background: var(--leaf); color: #fff; border-color: var(--leaf); animation: hop .4s var(--back) both; }
.an-slots.ok .an-slot:nth-child(2n) { animation-delay: .05s; } .an-slots.ok .an-slot:nth-child(3n) { animation-delay: .1s; }
.an-pool { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; min-height: 76px; padding: 8px; }
.an-tile {
  width: clamp(40px, 11vw, 54px); height: clamp(58px, 15vw, 70px); border: 0; cursor: pointer; font: 700 1.6rem var(--mono); color: var(--ink);
  background: #F8FAF1; box-shadow: var(--shadow); transform: rotate(var(--r));
  clip-path: polygon(0 4%, 18% 0, 40% 5%, 62% 0, 84% 4%, 100% 0, 100% 96%, 82% 100%, 60% 95%, 38% 100%, 16% 96%, 0 100%);
  transition: transform .2s var(--back), opacity .2s;
}
.an-tile:hover { transform: rotate(0) translateY(-4px); }
.an-tile.in { animation: tileIn .45s calc(var(--i) * 40ms) var(--back) both; }
.an-tile.used { opacity: 0; transform: scale(.6) translateY(-20px); pointer-events: none; }

/* ---------- Puzle ---------- */
.pz-layout { display: grid; grid-template-columns: minmax(0, 460px) minmax(0, 1fr); gap: clamp(20px, 4vw, 44px); align-items: start; margin-top: 14px; }
.pz-frame { position: relative; width: 100%; max-width: min(460px, calc(100svh - 280px)); min-width: min(100%, 300px); aspect-ratio: 1; border-radius: 14px; padding: 8px; background: #102A1C; box-shadow: var(--shadow-lg); }
.pz-board { position: relative; width: 100%; height: 100%; border-radius: 8px; overflow: hidden; background: #08140D; }
.pz-tile {
  position: absolute; left: 0; top: 0; width: calc(100% / var(--n)); height: calc(100% / var(--n)); border: 0; padding: 0; cursor: pointer;
  background-color: #1E4631; background-repeat: no-repeat; box-shadow: inset 0 0 0 1px rgba(8, 20, 13, .7);
  transform: translate(calc(var(--x) * 100%), calc(var(--y) * 100%)); transition: transform .18s var(--std);
}
.pz-tile.nope { animation: nudge .25s; }
.pz-board.done .pz-tile { box-shadow: none; transition: transform .18s, box-shadow .6s; }
.pz-preview { position: absolute; inset: 8px; border-radius: 8px; background-size: cover; opacity: 0; pointer-events: none; transition: opacity .3s; }
.pz-preview.on { opacity: 1; }
.pz-flash { position: absolute; inset: 0; border-radius: 14px; background: #fff; opacity: 0; pointer-events: none; }
.pz-frame.flash .pz-flash { animation: flash .7s ease-out; }
.pz-side { display: grid; gap: 12px; }

/* ---------- Ahorcado ---------- */
.ah-layout { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: clamp(20px, 4vw, 44px); align-items: start; }
.ah-left { display: grid; justify-items: center; gap: 8px; }
.ah-art { width: min(100%, 240px); }
.ah-svg { width: 100%; display: block; overflow: visible; }
.ah-shadow { fill: var(--paper-3); }
.ah-outline { fill: none; stroke: var(--red-deep); stroke-width: 3; stroke-dasharray: 6 5; }
.ah-strip { fill: var(--red); transform-box: fill-box; transform-origin: 50% 0; transition: transform .7s cubic-bezier(.5, 0, .9, .5), opacity .6s .15s; }
.ah-strip:nth-child(odd) { fill: #D02A41; }
.ah-strip.fall { transform: translateY(120px) rotate(18deg); opacity: 0; }
.ah-strip.fall:nth-child(even) { transform: translateY(120px) rotate(-16deg); }
.ah-art.hit { animation: shake .35s; }
.ah-art.whole .ah-svg { animation: beat 1.2s ease-in-out 2; }
.ah-art.broken .ah-outline { stroke: var(--ink-3); }
.ah-right { display: grid; gap: 14px; justify-items: start; }
.ah-right .paper { width: 100%; }
.ah-hint { font-family: var(--hand); font-size: 1.4rem; margin-bottom: 10px; }
.ah-phrase { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.ah-word { display: inline-flex; gap: 4px; }
.ah-ch { width: clamp(22px, 6vw, 32px); height: clamp(32px, 8vw, 42px); border-bottom: 3px solid var(--ink); display: grid; place-items: center; font: 700 clamp(1.1rem, 4vw, 1.5rem) var(--mono); }
.ah-ch.sym { border-color: transparent; }
.ah-ch.on { animation: pop .3s var(--back); }
.ah-ch.miss { color: var(--red); }
.ah-kb { width: 100%; margin: 0; }

/* ---------- La coartada ---------- */
.cr-wrap { display: grid; gap: 14px; max-width: 720px; }
.cr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cr-item {
  position: relative; display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 12px;
  padding: 12px 12px 12px 8px; border-radius: 12px; background: #F8FAF1; border: 1.5px solid var(--line); box-shadow: var(--shadow);
  animation: fadeUp .4s calc(var(--i) * 45ms) var(--ease) both; transition: border-color .25s, background .25s;
}
.cr-item.drag { z-index: 5; box-shadow: var(--shadow-lg); scale: 1.02; animation: none; transition: none; }
.cr-item.settle { transition: transform .2s var(--std), scale .2s; }
.cr-grip { width: 34px; height: 44px; display: grid; place-items: center; color: var(--ink-3); cursor: grab; touch-action: none; border-radius: 8px; }
.cr-grip:hover { background: var(--paper-2); color: var(--ink); }
.cr-time { font: 700 .95rem var(--mono); color: var(--leaf); width: 0; overflow: hidden; opacity: 0; transition: width .35s var(--ease), opacity .3s; }
.cr-item.ok .cr-time, .cr-list.solved .cr-time { width: 3.4em; opacity: 1; }
.cr-text { line-height: 1.35; }
.cr-moves { display: flex; gap: 4px; }
.cr-btn { width: 40px; height: 40px; border-radius: 10px; border: 1.5px solid var(--line-2); background: transparent; color: var(--ink-2); cursor: pointer; display: grid; place-items: center; }
.cr-btn:hover { background: var(--paper-2); color: var(--ink); }
.cr-item.ok { border-color: var(--leaf); background: #EAF3E1; }
.cr-item.bad { border-color: var(--red); animation: shake .35s; }
.cr-list.solved .cr-item { animation: hop .45s calc(var(--i) * 60ms) var(--back) both; }
.cr-list.solved .cr-moves { visibility: hidden; }

/* ---------- La alarma ---------- */
.sm-layout { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: clamp(20px, 4vw, 44px); align-items: center; }
.sm-wrap { display: grid; place-items: center; }
.sm-panel {
  position: relative; width: min(100%, 380px); aspect-ratio: 1; border-radius: 50%; padding: 14px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; background: #102A1C; box-shadow: var(--shadow-lg), inset 0 0 0 4px #2E5E44;
}
.sm-panel.busy .sm-pad { cursor: default; }
.sm-pad { border: 0; cursor: pointer; filter: saturate(.55) brightness(.62); transition: filter .12s, transform .12s; touch-action: manipulation; }
.sm-pad:active { transform: scale(.97); }
.sm-pad.lit { filter: saturate(1.15) brightness(1.15); transform: scale(1.02); }
.sm-verde { background: #3FA066; border-radius: 100% 10px 10px 10px; }
.sm-rojo { background: #E0304A; border-radius: 10px 100% 10px 10px; }
.sm-lima { background: #A9CF5C; border-radius: 10px 10px 10px 100%; }
.sm-rosa { background: #F09AA6; border-radius: 10px 10px 100% 10px; }
.sm-center { position: absolute; inset: 31%; border-radius: 50%; background: var(--paper); display: grid; place-items: center; align-content: center; box-shadow: 0 0 0 8px #102A1C; pointer-events: none; }
.sm-center span { font: 700 .7rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.sm-center strong { font: 700 2.6rem/1 var(--mono); }
.sm-panel.alarm { animation: shake .4s; box-shadow: var(--shadow-lg), inset 0 0 0 4px var(--red), 0 0 0 6px var(--red-soft); }
.sm-panel.won .sm-pad { filter: saturate(.3) brightness(.9); }
.sm-panel.won .sm-center { animation: pop .5s var(--back); }
.sm-side { display: grid; gap: 12px; }

/* ---------- Animaciones ---------- */
@keyframes fileIn { from { opacity: 0; transform: translateY(24px) rotate(-1deg); } }
@keyframes wordIn { from { opacity: 0; transform: translateY(.5em) rotate(4deg); } }
@keyframes stampIn { 0% { opacity: 0; transform: rotate(-8deg) scale(2.2); } 100% { opacity: .88; transform: rotate(-8deg) scale(1); } }
@keyframes barIn { from { transform: scaleX(0); } }
@keyframes markerIn { from { opacity: 0; transform: translateY(-16px) scale(.6); } }
@keyframes printIn { to { opacity: .55; } }
@keyframes lupa {
  0%, 100% { transform: translate(210px, 150px) rotate(0deg); }
  25% { transform: translate(120px, 120px) rotate(-8deg); }
  50% { transform: translate(150px, 210px) rotate(4deg); }
  75% { transform: translate(230px, 220px) rotate(10deg); }
}
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(.96); } }
@keyframes flap { to { transform: rotateX(180deg); } }
@keyframes sealOff { to { transform: scale(0); opacity: 0; } }
@keyframes cardOut { from { opacity: 0; transform: translateY(70px) rotate(0deg) scale(.85); } 60% { opacity: 1; } }
@keyframes slam { 0% { opacity: 0; transform: translateX(-50%) rotate(-14deg) scale(2.4); } 100% { opacity: 1; transform: translateX(-50%) rotate(-14deg) scale(1); } }
@keyframes thud { 0%, 100% { transform: none; } 30% { transform: translateY(4px) scale(.995); } 60% { transform: translateY(-2px); } }
@keyframes tileIn { from { opacity: 0; transform: translateY(-30px) rotate(calc(var(--r) * -4)); } }
@keyframes nudge { 30% { translate: -3px 0; } 60% { translate: 3px 0; } }
@keyframes flash { 0% { opacity: .9; } 100% { opacity: 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .case-hero { grid-template-columns: 1fr; }
  .case-art { min-height: 240px; aspect-ratio: 16 / 10; order: -1; }
  .case-file { margin-top: 30px; }
  .cf-layout, .cj-layout, .pz-layout, .ah-layout, .sm-layout { grid-template-columns: 1fr; }
  .cf-wheel { width: min(100%, 320px); }
  .cj-left { grid-template-columns: minmax(0, 180px) 1fr; align-items: center; }
  .pz-frame { max-width: 100%; justify-self: center; }
  .ah-left { grid-template-columns: 120px 1fr; justify-items: start; align-items: center; }
  .sm-panel { width: min(100%, 320px); }
}
@media (max-width: 560px) {
  .case-file > .stamp { top: -16px; right: 12px; font-size: .78rem; background: #F4F7EC; }
  .sus-groups, .acc-fields { grid-template-columns: 1fr; }
  .sus-people { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sus-people .sus:last-child { grid-column: 1 / -1; }
  .board-cards { grid-template-columns: 1fr 1fr; gap: 14px; }
  .ev a { min-height: 150px; padding: 20px 12px 12px; }
  .ev-title { font-size: 1rem; }
  .ev-clue { font-size: 1.12rem; }
  .ev-ico { display: none; }
  .ev-title { padding-right: 0; }
  .cr-item { grid-template-columns: auto 1fr auto; gap: 2px 10px; }
  .cr-grip { grid-column: 1; grid-row: 1 / span 2; }
  .cr-time { grid-column: 2; display: none; }
  .cr-item.ok .cr-time, .cr-list.solved .cr-time { display: block; width: auto; }
  .cr-text { grid-column: 2; }
  .cr-moves { grid-column: 3; grid-row: 1 / span 2; flex-direction: column; }
  .cj-slot { width: 52px; height: 62px; }
  .cf-form { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .case-art .lupa { animation: none; }
  .board-string path, .case-art .chalk, .case-art .crack { stroke-dashoffset: 0; }
  .rv-card, .rv-lines p, .modal-reveal .btn, .rv-inner, .modal-box, .cj-door, .cj-dial, .pz-tile, .ah-strip, .cf-inner { transition: none !important; }
}
.pz-last { animation: fadeIn .6s .1s both; cursor: default; }
