/* x-grails.css — the 14 grails as a crime board: black thread, push pins, evidence tags,
   the rug torn in half and glued back wrong, the whale card too big, a big typed "1 in 63." strip. */

/* one transform for every grail: the add-on adds a lift (hover) and a scale (the whale) */
.gitem { min-width: 0; transform: translate(var(--ox, 0px), calc(var(--oy, 0px) - var(--lift, 0px))) rotate(var(--rot, 0deg)) scale(var(--sc, 1)); transition: transform .18s ease-out; }
.gitem.hot, .gitem:focus-visible { --lift: 6px; }
.gitem.xwhale { --sc: 1.35; transform-origin: 50% 100%; z-index: 3; }

/* evidence tag hung under every grail */
.gitem .xtag { position: relative; display: block; width: max-content; max-width: 100%; margin: 12px 0 0 10%; padding: 3px 7px 4px 18px; background: var(--sheet); color: var(--ink); font-size: 11px; line-height: 1.25; transform: rotate(var(--rot, 0deg)); filter: var(--sh-scrap); }
.gitem .xtag b, .gitem .xtag .of { font-weight: 700; white-space: nowrap; }
.gitem .xtag .of { font-weight: 400; }
.gitem .xtag i { display: block; font-style: italic; color: var(--grey); }
.gitem .xtag::before { content: ""; position: absolute; left: 7px; top: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--loud); }
.gitem .xtag .stub { z-index: 1; }

/* the rug: torn in half, the lower half glued back a little off, one bit of tape holding it */
.gitem.rug .half { display: block; position: relative; filter: var(--sh-scrap); }
.gitem.rug .half .icard { filter: none; }
.gitem.rug .half.bot { position: absolute; left: 0; top: 0; width: 100%; transform: translate(4px, 11px) rotate(2.4deg); transform-origin: 50% 47%; transition: transform .25s ease-out; }
.gitem.rug.hot .half.bot { transform: translate(9px, 17px) rotate(3.6deg); }
.gitem.rug .xtape { top: 40%; left: -16px; width: 92px; height: 26px; transform: rotate(-12deg); z-index: 4; }

/* the thread + pins, drawn over the whole red block */
.xthread { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 5; }
.xthread path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: xdraw .26s linear forwards; animation-delay: var(--d, 0ms); transition: stroke .18s; }
.xthread.static path { animation: none; stroke-dashoffset: 0; }
@keyframes xdraw { to { stroke-dashoffset: 0; } }
.xthread .seg { transition: opacity .18s; }
.xthread .pin { filter: drop-shadow(0 1px 1.5px rgba(30, 15, 0, .45)); transition: opacity .18s; }
.xthread .pinin { transform-box: fill-box; transform-origin: center; animation: xpin .3s ease-out both; animation-delay: var(--d, 0ms); }
.xthread.static .pinin { animation: none; }
@keyframes xpin { from { transform: scale(0); } 70% { transform: scale(1.3); } to { transform: scale(1); } }
.xthread.hot .seg:not(.lit) { opacity: .4; }
.xthread.hot .pin:not(.lit) { opacity: .55; }
.xthread .seg.lit path { stroke: var(--sheet); }
.xthread .pin.lit .dot { fill: var(--loud); }

/* the big typed "1 in 63." strip and the case slip, both in the section head */
.xodds { position: absolute; right: 0; top: -86px; z-index: 2; }
.xodds > .scrap { display: flex; align-items: center; gap: 22px; padding: 8px 30px 8px 26px; color: var(--ink); }
.xodds .big { font-weight: 700; font-size: clamp(46px, 4.5vw, 64px); line-height: .95; white-space: nowrap; }
.xodds .side { display: flex; flex-direction: column; align-items: flex-start; gap: 0; font-size: 15px; line-height: 1.3; white-space: nowrap; }
.xodds .xtally { display: block; width: 122px; height: 30px; overflow: visible; }
.xcase { display: block; width: max-content; margin: 18px 0 0 40px; z-index: 2; }
.xcase > .scrap { background: var(--kraft2); color: var(--ink); width: 250px; font-size: 15px; line-height: 1.35; padding: 12px 16px 12px 24px; }
.xcase > .scrap b { display: block; font-weight: 700; }
.xcase > .scrap i { display: block; font-size: 13px; margin-top: 4px; }

@media (max-width: 960px) {
  .xodds { position: relative; right: auto; top: auto; display: inline-block; margin: 22px 0 0 8px; }
  .xodds > .scrap { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 22px 12px 18px; }
  .xodds .side { gap: 4px; }
  .xodds .big { font-size: 48px; }
  .xcase { margin: 18px 0 0 12px; }
}
@media (max-width: 720px) {
  .gitem .xtag { font-size: 11px; padding: 2px 7px 3px 17px; margin-top: 9px; }
  .gitem .xtag::before { left: 6px; top: 6px; width: 5px; height: 5px; }
  .gitem.xwhale { --sc: 1.15; transform-origin: 50% 60%; }
  .gitem.rug .xtape { width: 70px; height: 22px; left: -10px; }
  .xodds .big { font-size: 42px; }
  .xodds .side { font-size: 13px; }
  .xcase > .scrap { width: min(250px, 78vw); font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .xthread path { animation: none; stroke-dashoffset: 0; }
  .xthread .pinin { animation: none; }
  .gitem, .gitem.rug .half.bot, .xthread .seg, .xthread .pin, .xthread path { transition: none; }
}
