/* base-prod.css — прод-обвязка капчи для встраивания в игру.
   Всё под #captcha-overlay: имена cap-/cd-/energy-/art- пересекаются с игрой,
   поэтому скоуп обязателен. Токены-дефолты (= skin-1) кладём на #captcha-overlay;
   скин s02 (заскоупленный сборщиком в #captcha-overlay …) их перекрывает.
   Собирается assemble.js --prod: base + scope(s02) + games css в game/captcha.css. */

#captcha-overlay {
  position: fixed; inset: 0; z-index: 2500;
  display: none;
  color: #fff;
  font-family: 'Montserrat', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;

  --bg: #0d0f13; --text: #fff; --muted: rgba(210,210,210,.5);
  --gold-hi: #f8e6a2; --gold: #fddaa7; --gold-mid: #e9bf7d; --bronze: #91603c;
  --danger: #e23b4c; --success: #3bd27f;

  --k-card-bg: rgba(0,0,0,.78);
  --k-card-border: rgba(255,255,255,.06);
  --k-radius: 10px;
  --k-title: #fddaa7;
  --k-task: #fff;
  --k-taskb: #fddaa7;
  --k-muted: rgba(210,210,210,.5);
  --k-chip-bg: rgba(0,0,0,.75);
  --k-chip-border: rgba(255,255,255,.10);
  --k-chip-text: #fff;
  --k-cell-bg: rgba(0,0,0,.35);
  --k-cell-border: #2d2416;
  --k-sel-border: rgba(233,191,125,.55);
  --k-sel-bg: linear-gradient(105deg, rgba(255,207,134,.20), rgba(69,42,22,.20));
  --k-bad-border: rgba(226,35,58,.55);
  --k-bad-bg: linear-gradient(180deg, rgba(226,35,58,.10), rgba(226,35,58,.02));
  --k-hud-bg: rgba(0,0,0,.75);
  --k-hud-text: #fff;
  --k-bar: #be925b;
  --k-field-bg: rgba(0,0,0,.35);
  --k-field-border: #2d2416;
}
#captcha-overlay.show { display: block; }
#captcha-overlay * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* overlay column (несёт сцену туннеля через скин) */
#captcha-overlay .cap-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  /* верх — под нативный хедер Telegram (кнопки Закрыть/⌄/…): те же токены, что топбар игры;
     --tg-content-top ставит игра из Telegram API, фикс-запас 52px на случай если он 0 */
  padding: max(12px, var(--tg-content-top, 0px), calc(env(safe-area-inset-top) + 52px)) 20px calc(10px + max(env(safe-area-inset-bottom), var(--tg-safe-bottom, 0px)));
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(5px);
  overflow-y: auto;
}
#captcha-overlay .cap-card {
  position: relative; width: 100%; max-width: 335px; margin-top: auto;
  flex-shrink: 0;
  display: flex; flex-direction: column;
  background: var(--k-card-bg);
  border: 1px solid var(--k-card-border); border-radius: var(--k-radius);
  padding: 8px; overflow: hidden;
}
#captcha-overlay .cd-line { display: none; }
#captcha-overlay .cd-big { display: none; }
#captcha-overlay .cd-ring { display: none; }
#captcha-overlay .cap-card.shake { animation: capShake .38s ease; }
@keyframes capShake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-9px); } 40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); } 80% { transform: translateX(4px); }
}
#captcha-overlay .cap-card.enter { animation: cardIn1 .3s ease; }
@keyframes cardIn1 { from { opacity: .35; transform: translateY(8px); } to { opacity: 1; } }

#captcha-overlay .cap-hd { display: flex; align-items: center; justify-content: space-between; padding: 6px 6px 8px; }
#captcha-overlay .cap-hd h3 {
  margin: 0; display: flex; align-items: center; gap: 8px;
  font-family: 'Bounded', sans-serif; font-weight: 500; font-size: 17px;
  color: var(--k-title); text-transform: uppercase; letter-spacing: 0;
}
#captcha-overlay .cap-hd h3 img { width: 20px; height: 20px; object-fit: contain; }
#captcha-overlay .cd-chip {
  font-size: 12px; font-weight: 400; color: var(--k-chip-text); font-variant-numeric: tabular-nums;
  background: var(--k-chip-bg); border: 1px solid var(--k-chip-border);
  border-radius: 999px; padding: 4px 10px; white-space: nowrap;
}
#captcha-overlay .cd-chip.hot { color: var(--danger); border-color: rgba(226,35,58,.6); }

#captcha-overlay .cap-task {
  padding: 0 6px; text-align: center; font-size: 13px; font-weight: 600; color: var(--k-task);
  min-height: 34px; display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap;
}
#captcha-overlay .cap-task img.t-ico { width: 22px; height: 22px; object-fit: contain; vertical-align: -5px; }
#captcha-overlay .cap-task b { color: var(--k-taskb); }
#captcha-overlay .cap-body { margin: 10px 6px 0; }

#captcha-overlay .cap-hud {
  margin: 12px 6px 6px; padding: 6px 14px; height: 38px;
  background: var(--k-hud-bg); border-radius: 10px;
  display: flex; flex-direction: column; justify-content: center; gap: 5px;
}
#captcha-overlay .energy-row { display: flex; justify-content: space-between; align-items: center; font-weight: 400; font-size: 12px; color: var(--k-hud-text); }
#captcha-overlay .energy-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; font-size: 12px; color: var(--k-hud-text); }
#captcha-overlay .energy-label img { width: 15px; height: 15px; object-fit: contain; }
#captcha-overlay .energy-count { font-weight: 400; font-size: 12px; color: var(--k-hud-text); font-variant-numeric: tabular-nums; }
#captcha-overlay .energy-count.hot { color: var(--danger); font-weight: 600; }
#captcha-overlay .energy-bar { height: 6px; background: transparent; border: .5px solid var(--k-bar); border-radius: 5px; overflow: hidden; position: relative; }
#captcha-overlay .energy-fill { height: 100%; background: var(--k-bar); transition: width .25s linear; border-radius: 5px; }
#captcha-overlay .energy-fill.hot { background: var(--danger); }

#captcha-overlay .hidden { display: none !important; }

/* result card (glow = статичный radial-gradient, без drop-shadow) */
#captcha-overlay .cap-result {
  position: absolute; inset: 0; z-index: 20;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 16px 20px;
  background: radial-gradient(120% 80% at 50% 32%, rgba(60,42,20,.38), transparent 70%), rgba(8,6,10,.96);
  backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity .26s ease;
}
#captcha-overlay .cap-result.show { opacity: 1; pointer-events: auto; }
#captcha-overlay .art-wrap { position: relative; width: 46%; max-width: 150px; aspect-ratio: 1; }
#captcha-overlay .art-glow {
  position: absolute; inset: -34%;
  background: radial-gradient(circle, rgba(233,191,125,.34) 0%, rgba(233,191,125,.12) 45%, rgba(233,191,125,0) 70%);
  opacity: 0; transition: opacity .5s ease .15s;
}
#captcha-overlay .cap-result.show .art-glow { opacity: 1; }
#captcha-overlay .art-wrap img.art {
  position: relative; width: 100%; height: 100%; object-fit: contain;
  animation: prizePop .55s cubic-bezier(.34,1.56,.64,1);
}
@keyframes prizePop { 0%{transform:scale(.4);opacity:0} 60%{transform:scale(1.08);opacity:1} 100%{transform:scale(1)} }
#captcha-overlay .cap-result .rt { font-family:'Bounded',sans-serif; font-weight:500; font-size:24px; color:var(--gold); text-transform:uppercase; letter-spacing:.02em; }
#captcha-overlay .cap-result .ra { font-family:'Bounded',sans-serif; font-size: 16px; font-weight: 400; color: var(--gold-hi); }
#captcha-overlay .cap-result .rh { margin-top: 6px; font-size: 11px; font-weight: 400; color: var(--muted); }

/* toast (свой, чтобы не конфликтовать с игровым #toast) */
#cap-toast {
  position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%); z-index: 2600;
  background: rgba(20,26,36,.92);
  color: #fff; font-size: 13px; font-weight: 600;
  padding: 9px 16px; border-radius: 12px; opacity: 0; pointer-events: none; transition: opacity .2s ease;
  max-width: 86vw; text-align: center;
}
#cap-toast.show { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  #captcha-overlay .cap-card.enter, #captcha-overlay .cap-card.shake, #captcha-overlay .art-wrap img.art { animation: none !important; }
  #captcha-overlay .energy-fill { transition: none !important; }
}


/* ═══ s02.css (scoped) ═══ */
/* s02 «Mine Drift» — the captcha happens right inside the mine tunnel (Back.png):
   fullscreen scene, glass HUD strips instead of a card. Timer widget: .cd-line. */

#captcha-overlay {
  /* fullscreen scene: dark vignette over the tunnel photo (static bg, no filter) */
  --k-card-bg: linear-gradient(180deg, rgba(8,6,10,.35), rgba(8,6,10,.88) 78%), url('Back.png') center/cover no-repeat;
  --k-card-border: transparent;
  --k-radius: 0px;
  --k-title: #fddaa7;
  --k-task: #fff;
  --k-taskb: #f8e6a2;
  --k-muted: rgba(210,210,210,.5);
  --k-chip-bg: rgba(0,0,0,.75);
  --k-chip-border: #e0b577;        /* .gb-balance hairline recipe */
  --k-chip-text: #fff;
  --k-cell-bg: rgba(0,0,0,.75);    /* denser glass: cells must read on the photo bg */
  --k-cell-border: #2d2416;
  --k-sel-border: rgba(233,191,125,.55);
  --k-sel-bg: linear-gradient(105deg, rgba(255,207,134,.20), rgba(69,42,22,.20));
  --k-bad-border: rgba(226,35,58,.35);
  --k-bad-bg: linear-gradient(180deg, rgba(226,35,58,.10), rgba(226,35,58,.02));
  --k-hud-bg: rgba(0,0,0,.75);
  --k-hud-text: #fff;
  --k-bar: #be925b;
  --k-field-bg: rgba(0,0,0,.78);
  --k-field-border: rgba(255,255,255,.06);
}

/* ── fullscreen: the overlay dim is off, the OVERLAY carries the scene ──
   The tunnel is painted by .cap-overlay (inset:0), so it bleeds edge to edge — under the
   notch, under the stand's dev header — while the card stops being a box and becomes a
   plain transparent column inside the overlay's padding. That padding is where the shell
   already accounts for whatever chrome sits on top, so this skin measures nothing itself. */
#captcha-overlay .cap-overlay {
  background: var(--k-card-bg);  /* --k-card-bg IS the scene: here the card and the screen are one */
  backdrop-filter: none;
  padding-left: 12px;            /* only the sides are ours — top/bottom stay the shell's */
  padding-right: 12px;
}
#captcha-overlay .cap-card {
  max-width: none; width: 100%;
  flex: 1 0 auto;          /* fills the column: the pot HUD stays pinned at the bottom */
  margin-top: 0;           /* no auto margin — the strips start right under the fuse */
  padding: 0;
  background: transparent; /* the scene is on the overlay now */
  border: 0; border-radius: 0;
}

/* ── header = black HUD strip, like the game topbar (no blur, no shadow: it animates) ── */
#captcha-overlay .cap-hd {
  width: 100%; max-width: 480px; margin: 0 auto;
  background: var(--k-hud-bg);
  border: 1px solid var(--k-field-border);
  border-radius: 10px;
  padding: 8px 12px;
}
#captcha-overlay .cap-hd h3 { font-size: 18px; }

/* ── таймер: секунды в шапке-полоске ──
   Полоса-фитиль над сценой (.cd-line) снята по просьбе заказчика: во всю ширину
   оверлея она читалась как артефакт вёрстки. Котёл тает в баре .cap-hud. */
#captcha-overlay .cd-line, #captcha-overlay .cd-big, #captcha-overlay .cd-ring { display: none; }
#captcha-overlay .cd-chip {
  display: inline-block;
  font-size: 12px; font-weight: 400;
  background: var(--k-chip-bg);
  border: 1px solid var(--k-chip-border);
  color: var(--k-chip-text);
  border-radius: 999px; padding: 4px 10px;
}
#captcha-overlay .cd-chip.hot { color: var(--danger); border-color: var(--danger); }

/* ── task = its own glass strip ── */
#captcha-overlay .cap-task {
  width: 100%; max-width: 480px; margin: 14px auto 0;
  background: var(--k-hud-bg);
  border: 1px solid var(--k-field-border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px; font-weight: 500;
}

/* ── game body centres in the free space between the strips ── */
#captcha-overlay .cap-body {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  width: 100%; max-width: 480px; margin: 12px auto;
}

/* ── pot HUD pinned to the bottom, like the in-game energy bar ── */
#captcha-overlay .cap-hud {
  width: 100%; max-width: 480px; margin: 0 auto;
  background: var(--k-hud-bg);
  border: 1px solid var(--k-field-border);
  border-radius: 10px;
}

/* ── entry: strips cascade in (0/60/120ms), the tunnel just fades ──
   the tunnel lives on the overlay, and the shell only ever flags the card — :has() is the
   hook (no-op if unsupported: the strips still cascade, the scene just appears) */
#captcha-overlay .cap-overlay:has(.cap-card.enter) { animation: bgFade2 .22s ease; }
#captcha-overlay .cap-card.enter { animation: none; }
@keyframes bgFade2 { from { opacity: 0; } to { opacity: 1; } }
#captcha-overlay .cap-card.enter .cap-hd   { animation: stripIn2 .28s cubic-bezier(.22,.61,.36,1) both; }
#captcha-overlay .cap-card.enter .cap-task { animation: stripIn2 .28s cubic-bezier(.22,.61,.36,1) .06s both; }
#captcha-overlay .cap-card.enter .cap-hud  { animation: stripIn2 .28s cubic-bezier(.22,.61,.36,1) .12s both; }
@keyframes stripIn2 {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* ── error = tunnel cave-in: the BODY shakes (fullscreen card itself must not jump),
      the timer line dims twice; the bad cell colour comes from --k-bad-* tokens ── */
#captcha-overlay .cap-card.shake { animation: none; }
#captcha-overlay .cap-card.shake .cap-body { animation: bodyShake2 .38s ease; }
@keyframes bodyShake2 {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-9px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(4px); }
}
/* #cd-line precedes the card in the DOM — only :has() can reach it (no-op if unsupported) */
#captcha-overlay .cap-overlay:has(.cap-card.shake) .cd-line { animation: lineDim2 .32s ease; }
@keyframes lineDim2 {
  0%, 50%, 100% { opacity: 1; }
  25%, 75% { opacity: .4; }
}

/* ── result = hauled up from the pit: art rises from below, glass amount plate follows ── */
#captcha-overlay .cap-result { border-radius: 0; }
#captcha-overlay .cap-result.show img.art { animation: riseUp2 .45s cubic-bezier(.22,.61,.36,1) both; }
@keyframes riseUp2 {
  from { transform: translateY(46px) scale(.9); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
#captcha-overlay .cap-result .ra {
  background: var(--k-hud-bg);
  border: 1px solid var(--k-field-border);
  border-radius: 10px;
  padding: 7px 16px;
}
#captcha-overlay .cap-result.show .ra { animation: plateIn2 .3s ease .14s both; }
@keyframes plateIn2 {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
#captcha-overlay .cap-result.show .rt,
#captcha-overlay .cap-result.show .rh { animation: fadeIn2 .26s ease .2s both; }
@keyframes fadeIn2 { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  #captcha-overlay .cap-overlay:has(.cap-card.enter),
  #captcha-overlay .cap-card.enter .cap-hd,
  #captcha-overlay .cap-card.enter .cap-task,
  #captcha-overlay .cap-card.enter .cap-hud,
  #captcha-overlay .cap-card.shake .cap-body,
  #captcha-overlay .cap-overlay:has(.cap-card.shake) .cd-line,
  #captcha-overlay .cap-result.show img.art,
  #captcha-overlay .cap-result.show .ra,
  #captcha-overlay .cap-result.show .rt,
  #captcha-overlay .cap-result.show .rh { animation: none !important; }
}


/* ─── mini-games ─── */

/* ═══ g01.css ═══ */
/* g01 «Spot the Loot» — 3×3 grid, tap the 3 matching items */
.g01 .g01-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  max-width: 280px; margin: 0 auto; /* keeps field height ≤ 280px on the widest card */
}
.g01 .g01-cell {
  aspect-ratio: 1; min-width: 44px; min-height: 44px;
  border-radius: 12px; cursor: pointer; padding: 10px;
  background: var(--k-cell-bg);
  border: 1px solid var(--k-cell-border);
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s ease, border-color .12s ease;
}
.g01 .g01-cell img {
  width: 78%; height: 78%; object-fit: contain; pointer-events: none;
  -webkit-user-drag: none; user-select: none; -webkit-user-select: none;
}
.g01 .g01-cell.sel {
  border-color: var(--k-sel-border);
  background: var(--k-sel-bg);
  transform: scale(1.04);
}
/* error: the player must SEE the wrong tap before the captcha swaps */
.g01 .g01-cell.bad {
  border-color: var(--k-bad-border);
  background: var(--k-bad-bg);
  animation: g01BadCell .32s ease;
}
@keyframes g01BadCell { 0%,100% { transform: scale(1); } 40% { transform: scale(.92); } }
.g01 .g01-cell:active { transform: scale(.96); }

@media (prefers-reduced-motion: reduce) {
  .g01 .g01-cell.bad { animation: none; }
}


/* ═══ g03.css ═══ */
/* g03 «Load the Cart» — drag 3 ore chunks into the mine cart */
.g03 .g03-field {
  position: relative; height: 268px; touch-action: none; border-radius: 10px;
  background: var(--k-field-bg);
  border: 1px solid var(--k-field-border); overflow: hidden;
}
/* no drop-shadow/filters: on moving elements they leave ghost trails
   (compositing artifact); movement — transform only */
.g03 .g03-ore {
  position: absolute; width: 52px; height: 52px; object-fit: contain; cursor: grab;
  touch-action: none; z-index: 3; will-change: transform;
  -webkit-user-drag: none; user-select: none; -webkit-user-select: none;
}
.g03 .g03-ore.drag { z-index: 9; }
.g03 .g03-ore.back { transition: transform .28s ease; }
.g03 .g03-ore.gone { transition: transform .22s ease, opacity .22s ease; opacity: 0; }
.g03 .g03-cart {
  position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%);
  width: 148px; z-index: 2;
  -webkit-user-drag: none; user-select: none; -webkit-user-select: none;
}
.g03 .g03-cart.bump { animation: g03-bump .3s ease; }
@keyframes g03-bump {
  0%   { transform: translateX(-50%) scale(1); }
  40%  { transform: translateX(-50%) scale(1.08); }
  100% { transform: translateX(-50%) scale(1); }
}
.g03 .g03-count {
  position: absolute; left: 50%; bottom: 116px; transform: translateX(-50%); z-index: 4;
  padding: 3px 12px; border-radius: 999px; font-size: 12px; font-weight: 300; color: var(--k-chip-text);
  font-variant-numeric: tabular-nums;
  background: var(--k-chip-bg); border: 1px solid var(--k-chip-border); pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .g03 .g03-cart.bump { animation: none !important; }
  .g03 .g03-ore.back, .g03 .g03-ore.gone { transition: none !important; }
}


/* ═══ g11.css ═══ */
/* g11 «Ore Swipe» — tinder-swipe sort: gold right, junk left */
.g11 .g11-stage {
  position: relative; height: 200px;
  touch-action: none; overflow: hidden;
}

/* hint zones: ghost by default, class is coded by label colour only;
   pointer-events off — the card is the sole pointer target */
.g11 .g11-zone {
  position: absolute; top: 0; bottom: 0; width: 25%; min-width: 56px;
  border: 1px solid var(--k-cell-border); border-radius: 10px;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  font-weight: 500; font-size: 12px; letter-spacing: .5px;
  pointer-events: none;
}
.g11 .g11-left  { left: 0;  color: var(--k-muted); }
.g11 .g11-right { right: 0; color: var(--k-taskb); }
.g11 .g11-zone.is-armed {
  border-color: var(--k-sel-border);
  background: var(--k-sel-bg);
  color: var(--k-chip-text);
}
.g11 .g11-zone.is-wrong {
  border-color: var(--k-bad-border);
  background: var(--k-bad-bg);
}

/* the only moving node — driven by inline transform (translateX + rotate) */
.g11 .g11-card {
  position: absolute; left: 50%; top: 50%; margin: -66px 0 0 -66px;
  width: 132px; height: 132px;
  background: var(--k-cell-bg);
  border: 1px solid var(--k-cell-border); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: grab; touch-action: none; will-change: transform;
}
.g11 .g11-card:active { cursor: grabbing; }
.g11 .g11-item {
  width: 96px; height: 96px; object-fit: contain;
  pointer-events: none; -webkit-user-drag: none;
  user-select: none; -webkit-user-select: none;
}
/* transitions live in classes so the raw drag (no class) is transition-free */
.g11 .g11-card.is-spring { transition: transform .16s ease; }
.g11 .g11-card.is-fly    { transition: transform .18s ease; }
.g11 .g11-card.is-spawn  { transition: transform .16s ease, opacity .16s ease; }

.g11 .g11-count {
  position: absolute; bottom: 6px; left: 0; right: 0;
  text-align: center; font-weight: 400; font-size: 10px;
  color: var(--k-muted); font-variant-numeric: tabular-nums;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .g11 .g11-card.is-spring,
  .g11 .g11-card.is-fly,
  .g11 .g11-card.is-spawn { transition: none; }
}


/* ═══ g13.css ═══ */
/* g13 «Lantern Hunt» — pitch-black cave: one baked-hole darkness layer (transform-only), tap the nugget you lit up */
.g13 .g13-scene {
  position: relative; height: 220px; border-radius: 10px; overflow: hidden;
  background: url('Back.png') center / cover no-repeat;
  border: 1px solid var(--k-field-border);
  touch-action: none;
  cursor: pointer;
  user-select: none; -webkit-user-select: none;
}

.g13 .g13-obj {
  position: absolute; width: 52px; height: 52px; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  pointer-events: none; /* hit-testing is coordinate-based on the scene */
}
.g13 .g13-obj img {
  width: 48px; height: 48px; object-fit: contain;
  -webkit-user-drag: none; user-select: none; -webkit-user-select: none;
}
/* lifted above the darkness (z2): the tap puts the light 56px ABOVE the stone, so at z1 the
   flash would fire under near-opaque black and the player would never see what went wrong */
.g13 .g13-obj.is-wrong {
  z-index: 3;
  border: 1px solid var(--k-bad-border);
  background: var(--k-bad-bg);
  animation: g13Wrong .32s ease;
}
@keyframes g13Wrong { 0%, 100% { transform: scale(1); } 40% { transform: scale(.88); } }

/* the darkness: single 300%×300% layer, light hole baked into the gradient — the ONLY moving node (transform in rAF).
   raw rgba blacks: this IS the darkness over a photo background — identical in every skin, not themable */
.g13 .g13-dark {
  position: absolute; width: 300%; height: 300%; left: -100%; top: -100%;
  z-index: 2; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, transparent 0 55px, rgba(0,0,0,.85) 68px, rgba(0,0,0,.96) 120px);
  transform: translate3d(0, 0, 0);
}
/* round start: solid black, no hole → the pixels carry zero info about the target */
.g13 .g13-dark.is-off { background: rgba(0,0,0,.96); }

.g13 .g13-hint {
  position: absolute; left: 0; right: 0; top: 50%; z-index: 3;
  transform: translateY(-50%);
  text-align: center; pointer-events: none;
  font: 400 12px 'Montserrat', sans-serif;
  color: rgba(255,255,255,.45); /* raw: sits on the solid darkness layer (always near-black), skin tokens don't apply */
  transition: opacity .2s ease;
}
.g13 .g13-hint.is-hide { opacity: 0; }

/* success fx above the darkness (z3): glow div + spark img — transform/opacity only */
.g13 .g13-glow {
  position: absolute; width: 140px; height: 140px; z-index: 3; pointer-events: none;
  background: radial-gradient(circle, rgba(233,191,125,.35), transparent 70%); /* raw: --gold-mid #e9bf7d needs a baked alpha stop inside the gradient */
  animation: g13GlowIn .25s ease forwards;
}
@keyframes g13GlowIn { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }

.g13 .g13-spark {
  position: absolute; width: 64px; height: 64px; z-index: 3; pointer-events: none;
  opacity: 0;
  animation: g13Spark .3s ease forwards;
}
@keyframes g13Spark {
  0%   { transform: scale(.6);  opacity: 0; }
  50%  { transform: scale(.9);  opacity: 1; }
  100% { transform: scale(1.15); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .g13 .g13-obj.is-wrong { animation: none; }
  .g13 .g13-glow { animation: none; }
  .g13 .g13-spark { animation: none; opacity: 1; transform: scale(1); } /* show statically instead of pulsing */
}


/* ═══ g15.css ═══ */
/* g15 «Fuse Run» — winding fuse (static SVG polyline) + draggable spark into the dynamite;
   the spark is the ONLY moving node (JS sets transform:translate; its halo is baked in the PNG) */
.g15 .g15-stage {
  position: relative;
  width: 100%;
  height: 210px; /* pre-measure fallback; JS pins the inner box to exactly 0.7·width each round */
  touch-action: none; /* the stage owns the whole drag gesture */
  cursor: grab;
  border-radius: 12px;
  background: var(--k-field-bg);
  border: 1px solid var(--k-field-border);
}
.g15 .g15-stage:active { cursor: grabbing; }

.g15 .g15-path {
  position: absolute; left: 0; top: 0;
  width: 100%; height: 100%;
  display: block;
}
/* the fuse cord per spec: stroke-width 4, dash 6 5; --k-bar is the game's #be925b bar token */
.g15 .g15-fuse {
  fill: none;
  stroke: var(--k-bar);
  stroke-width: 4;
  stroke-dasharray: 6 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* burnt-through part of the fuse: dasharray/dashoffset are driven from JS via setAttribute
   (static SVG node, no CSS transition — progress feedback, not DOM movement) */
.g15 .g15-prog {
  fill: none;
  stroke: var(--gold-mid);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* spark: 56×56, centered via left/top -28px, moved ONLY by transform:translate from JS */
.g15 .g15-spark {
  position: absolute; left: -28px; top: -28px;
  width: 56px; height: 56px;
  will-change: transform;
}
/* dynamite target: 72px, positioned once per round at the end of the path */
.g15 .g15-dyn {
  position: absolute; left: -36px; top: -36px;
  width: 72px; height: 72px;
}
/* target cue: radial-gradient layer div (no shadows/filters), opacity-only pulse */
.g15 .g15-glow {
  position: absolute; left: -48px; top: -48px;
  width: 96px; height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--k-sel-border) 0%, transparent 70%);
  opacity: .35;
  animation: g15Glow 1.6s ease-in-out infinite alternate;
}
@keyframes g15Glow { from { opacity: .16; } to { opacity: .55; } }

/* input goes to the stage only */
.g15 .g15-path, .g15 .g15-glow, .g15 .g15-stage img {
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none; /* iOS long-press save-image menu */
}

@media (prefers-reduced-motion: reduce) {
  .g15 .g15-glow { animation: none; opacity: .35; }
}

