/* JFun Game FX v1 - classes are prefixed jfx-. Colours come only from var(--...) tokens (jfun-brand.css / jfun-game.css / jfun-ui.css). */

/* ---------- mute button (40x40 visible, 44x44 hit area) ---------- */
.jfx-mute {
  position: relative; flex: none; width: 40px; height: 40px; margin: 0 8px 0 0; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--jf-glass-border); border-radius: 50%;
  background: var(--jf-glass-strong);
  color: var(--text-color); font-size: 16px; line-height: 1;
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.jfx-mute::after { content: ''; position: absolute; top: -2px; right: -2px; bottom: -2px; left: -2px; }
.jfx-mute:active { transform: scale(0.94); }
.jfx-mute.is-muted { color: var(--text-secondary); }

/* ---------- confetti (transparent, never blocks input) ---------- */
#jfx-confetti {
  position: fixed; left: 0; top: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 100001;
}

/* ---------- result modal (id prefix beats the game's own modal css) ---------- */
html body #result-modal .jfx-res-body { padding: 8px 4px; }
html body #result-modal .jfx-res-icon { font-size: 64px; line-height: 1; margin-bottom: 8px; }
html body #result-modal .jfx-res-title {
  font-family: var(--jg-font-display, 'Rajdhani', 'Poppins', 'Segoe UI', system-ui, sans-serif);
  font-weight: 700; font-size: 30px; line-height: 1.1; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-color);
}
html body #result-modal .jfx-res-amount {
  font-family: var(--jg-font-display, 'Rajdhani', 'Poppins', 'Segoe UI', system-ui, sans-serif);
  font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
  margin-top: 6px; color: var(--text-secondary);
}
html body #result-modal .jfx-res-note { font-size: 14px; color: var(--text-secondary); margin-top: 6px; }
html body #result-modal .jfx-res-note:empty { display: none; }
html body #result-modal .jfx-res-reason { font-size: 12px; color: var(--text-secondary); margin-top: 6px; }
html body #result-modal .jfx-res-footer { display: flex; flex-direction: column; flex-wrap: nowrap; gap: 10px; }
html body #result-modal .jfx-res-footer .modal-btn { flex: none; width: 100%; min-height: 48px; margin: 0; }

/* loss and draw: soft */
html body #result-modal.jfx-loss .jfx-res-title,
html body #result-modal.jfx-draw .jfx-res-title { font-size: 26px; color: var(--text-color); }
html body #result-modal.jfx-loss .jfx-res-amount,
html body #result-modal.jfx-draw .jfx-res-amount { font-size: 16px; color: var(--text-secondary); }

/* win: brand gradient title (solid pink where background-clip:text is missing), big green amount */
html body #result-modal.jfx-win .jfx-res-title { color: var(--jf-pink); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  html body #result-modal.jfx-win .jfx-res-title {
    background: var(--jf-grad);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    -webkit-text-fill-color: transparent;
  }
}
html body #result-modal.jfx-win .jfx-res-amount {
  font-size: 36px; color: var(--accent-green); text-shadow: 0 0 16px var(--jg-ok-glow);
}

@keyframes jfx-pop {
  0% { opacity: 0; transform: scale(0.7); }
  60% { opacity: 1; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: no-preference) {
  html body #result-modal.jfx-win .jfx-res-icon,
  html body #result-modal.jfx-win .jfx-res-amount { animation: jfx-pop 450ms ease-out both; }
}

/* ---------- share card ---------- */
.jfx-share {
  margin-top: 14px; padding: 12px; border-radius: 16px; text-align: left; overflow-wrap: anywhere;
  background: var(--jf-grad-soft);
  border: 1px solid var(--border-color);
  font-size: 13px; color: var(--text-color);
}
.jfx-share-actions { display: flex; gap: 8px; margin-top: 10px; }
.jfx-btn {
  flex: 1; min-height: 44px; padding: 0 12px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--jf-pink); background: transparent; color: var(--jf-pink);
  font-family: var(--jg-font-display, 'Rajdhani', 'Poppins', 'Segoe UI', system-ui, sans-serif);
  font-weight: 700; font-size: 15px; letter-spacing: 0.04em; text-transform: uppercase;
  cursor: pointer; touch-action: manipulation;
}
.jfx-btn-primary {
  background: var(--jf-grad); color: var(--ui-on-accent); border-color: transparent;
}
.jfx-btn:active { transform: scale(0.97); }
