/* THE CARD VIEWER, upgraded (1 Dec 2026): pinch and pan, the print grows out of the one tapped, a swipe follows the finger,
   the main card's eight coloured boxes open their fans, nine dots say where you are. Loaded after the site's own sheets;
   it overrides their .v-stage layout (the print is now placed and zoomed by krexul-viewer.js) and adds the rest. */
.viewer { touch-action:none; overscroll-behavior:contain; -webkit-user-select:none; user-select:none; -webkit-tap-highlight-color:transparent; }
.viewer .v-stage { display:block; position:relative; overflow:hidden; padding:0; touch-action:none; }
.viewer .v-frame { position:absolute; left:0; top:0; transform-origin:0 0; background:#efe9dd; border-radius:6px; box-shadow:0 20px 50px -20px rgba(0,0,0,.8); cursor:zoom-in; -webkit-touch-callout:none; }
.viewer .v-frame img { position:relative; display:block; width:100%; height:100%; max-width:none; max-height:none; border-radius:inherit; box-shadow:none; cursor:inherit; pointer-events:none; -webkit-user-drag:none; }
.viewer.v-z .v-frame { border-radius:0; cursor:grab; }
.viewer.v-drag .v-frame { cursor:grabbing; }

/* loading: the full picture stays hidden until it is in (never the last print's picture under a new name); the print's own small picture
   shows in its place - sharp when it is the whole sheet (a print), blurred when it is only a fan's wheel - with a quiet spinner after a beat, and no hint */
.viewer.v-loading .v-frame img { visibility:hidden; }
.viewer.v-loading .v-frame::before { content:""; position:absolute; inset:0; background:var(--ph) center/cover no-repeat; filter:blur(10px) saturate(.85); opacity:.6; clip-path:inset(0 round 6px); pointer-events:none; }
.viewer.v-loading.v-sharp .v-frame::before { filter:none; opacity:1; }
.viewer.v-loading .v-frame::after { content:""; position:absolute; left:50%; top:50%; width:26px; height:26px; margin:-13px 0 0 -13px; border-radius:50%; border:2.5px solid rgba(58,51,42,.22); border-top-color:rgba(58,51,42,.7); background:rgba(255,253,249,.8); box-shadow:0 0 0 7px rgba(255,253,249,.8); pointer-events:none; animation:v-spin .9s linear infinite, v-in .25s .35s backwards; }
.viewer.v-loading .v-hint { visibility:hidden; }
@keyframes v-spin { to { transform:rotate(1turn); } }
@keyframes v-in { from { opacity:0; } }

/* the eight great-grandparent boxes on the main card */
.v-seats { position:absolute; inset:0; pointer-events:none; }
.v-seats[hidden], .viewer.v-z .v-seats { display:none; }
.v-seat { position:absolute; top:10.4%; width:10.5%; height:22.2%; pointer-events:auto; margin:0; padding:0; border:0; border-radius:5px; background:transparent; cursor:pointer; box-shadow:0 0 0 0 transparent, 0 0 0 0 transparent; }
.v-seat:focus { outline:none; }
.v-seat:focus-visible { box-shadow:0 0 0 3px var(--c), 0 0 0 6px #fff; }
@media (hover:hover) { .v-seat:hover { box-shadow:0 0 0 2px var(--c), 0 0 0 4px rgba(255,255,255,.7); } }
.viewer.v-hinting .v-seat { animation:v-seat 2.6s ease-in-out calc(.35s + var(--i) * 70ms) both; }
@keyframes v-seat { 0%, 100% { box-shadow:0 0 0 0 transparent, 0 0 0 0 transparent; } 22%, 70% { box-shadow:0 0 0 2px var(--c), 0 0 0 4px rgba(255,255,255,.6); } }

/* the dots under the print: the main card, then the eight fans in their colours */
.v-dots { display:flex; flex-wrap:wrap; justify-content:center; padding:6px 12px 0; }
.v-dots[hidden] { display:none; }
.v-dot { flex:none; display:grid; place-items:center; width:32px; height:30px; margin:0; padding:0; border:0; background:none; cursor:pointer; }
.v-dot::before { content:""; width:9px; height:9px; border-radius:50%; background:var(--c, #9aa1ad); opacity:.8; transition:transform .2s, opacity .2s; }
.v-dot.v-card::before { width:13px; height:10px; border-radius:2px; background:#efe6d2; }
.v-dot[aria-current="true"]::before { opacity:1; transform:scale(1.4); box-shadow:0 0 0 1.5px #0e1014, 0 0 0 2.5px rgba(255,255,255,.85); }
.v-dot:focus { outline:none; }
.v-dot:focus-visible { outline:2px solid #d6a61a; outline-offset:-3px; border-radius:9px; }
@media (hover:hover) { .v-dot:hover::before { opacity:1; } }

/* a phone on its side (a short screen): the bars float over the print, slim and see-through, so the print keeps nearly the full height
   (blind check: 237x182 sideways, smaller than upright). The arrows sit in the space beside the print; while zoomed only the close button
   and the hint stay. The bars pass touches through, so a pinch or a coloured box under them still works. */
@media (max-height:500px) and (orientation:landscape) {
  .viewer .v-stage { position:absolute; inset:0; }
  .viewer .v-top, .viewer .v-dots, .viewer .v-bot { position:absolute; left:0; right:0; z-index:2; transition:opacity .2s, visibility .2s; }
  .viewer .v-dots, .viewer .v-bot, .viewer.v-z .v-top { pointer-events:none; }
  .viewer button { pointer-events:auto; }
  .viewer .v-top { top:0; gap:8px; padding:5px max(8px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left)); background:linear-gradient(rgba(14,16,20,.82) 60%, rgba(14,16,20,0)); }
  .viewer .v-name { white-space:nowrap; font-size:15px; line-height:1.2; }
  .viewer .v-x { width:38px; height:38px; font-size:24px; background:rgba(14,16,20,.7); box-shadow:0 0 0 1px rgba(255,255,255,.18); }
  .viewer .v-bot { top:0; bottom:0; padding:0 max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left)); justify-content:space-between; gap:0; }
  .viewer .v-prev, .viewer .v-next { width:40px; height:40px; font-size:26px; background:rgba(14,16,20,.6); box-shadow:0 0 0 1px rgba(255,255,255,.12); }
  .viewer .v-hint { position:absolute; left:0; right:0; bottom:5px; width:max-content; max-width:70%; margin:0 auto; padding:2px 10px; border-radius:10px; background:rgba(14,16,20,.86); color:#c9ced8; font-size:11px; line-height:1.35; }
  .viewer .v-dots { bottom:27px; width:max-content; margin:0 auto; padding:0 6px; border-radius:15px; background:rgba(14,16,20,.86); box-shadow:0 2px 10px rgba(0,0,0,.25); }
  .viewer .v-dot { width:28px; height:26px; }
  .viewer.v-z .v-dots, .viewer.v-z .v-prev, .viewer.v-z .v-next, .viewer.v-z .v-count, .viewer.v-z .v-name { opacity:0; visibility:hidden; }
  .viewer.v-z .v-top { background:none; }
}

@media (prefers-reduced-motion:reduce) {
  .v-dot::before, .viewer .v-top, .viewer .v-dots, .viewer .v-bot { transition:none; }
  .viewer.v-hinting .v-seat { animation:none; box-shadow:0 0 0 2px var(--c), 0 0 0 4px rgba(255,255,255,.6); }
  .viewer.v-loading .v-frame::after { animation:v-in .25s .35s backwards; }
}
