/* =========================================================
   Global Pro · Motor de Dopamina (gp-joy.css) · 12/11/2026
   Sem dependências. Prefixo gp-joy-. Use junto com gp-joy.js.
   Brilho sempre em volta da peça, sem borrar o vizinho.
   ========================================================= */
:root {
  --gpj-bg: #0d0620; --gpj-panel: #1c1033; --gpj-line: rgba(160,110,255,.32);
  --gpj-ink: #f6f0ff; --gpj-muted: #c9b8ec;
  --gpj-purple: #7c2ae8; --gpj-magenta: #e930ff; --gpj-cyan: #5adcff;
  --gpj-gold: #ffc84a; --gpj-gold2: #fff0b8; --gpj-green: #3dff8a; --gpj-red: #ff3b5c;
  --gpj-disp: "Barlow Condensed", "Arial Narrow", sans-serif;
  --gpj-body: "Inter", system-ui, sans-serif;
}

/* ---------- toast ---------- */
.gp-joy-toasts { position: fixed; z-index: 9998; top: calc(12px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%);
  width: min(380px, calc(100vw - 24px)); display: grid; gap: 8px; pointer-events: none; }
.gp-joy-toast { --c: var(--gpj-green); position: relative; display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center;
  padding: 11px 14px 11px 11px; border-radius: 14px; pointer-events: auto; overflow: hidden;
  background: linear-gradient(180deg, #24123f, #150a2b); color: var(--gpj-ink); font-family: var(--gpj-body);
  border: 1px solid color-mix(in srgb, var(--c) 70%, transparent);
  box-shadow: 0 0 0 1px rgba(255,200,74,.18) inset, 0 0 12px color-mix(in srgb, var(--c) 35%, transparent), 0 10px 28px rgba(0,0,0,.45); }
.gp-joy-toast::before { content: ""; position: absolute; left: 14%; right: 14%; top: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--gpj-gold), transparent); }
.gp-joy-toast--conquista { --c: var(--gpj-gold); }
.gp-joy-toast--alerta { --c: #ff9b3d; }
.gp-joy-toast--info { --c: var(--gpj-cyan); }
.gp-joy-toast--neutro { --c: #a596c2; }
.gp-joy-toast__ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 20px;
  background: color-mix(in srgb, var(--c) 18%, #12082a); border: 1px solid color-mix(in srgb, var(--c) 60%, transparent); color: var(--c); }
.gp-joy-toast__t { font: 800 17px/1.05 var(--gpj-disp); letter-spacing: .04em; text-transform: uppercase; color: var(--c); }
.gp-joy-toast__x { font-size: 13px; line-height: 1.35; color: var(--gpj-ink); margin-top: 2px; }
.gp-joy-toast__bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--c); transform-origin: left; opacity: .8; }

/* ---------- progress ---------- */
.gp-joy-progress { position: relative; height: 12px; border-radius: 99px; background: #241638; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.gp-joy-progress__fill { position: relative; height: 100%; width: 0; border-radius: 99px;
  background: linear-gradient(90deg, #ff7ad9, var(--gpj-magenta) 55%, var(--gpj-cyan) 88%, var(--gpj-gold));
  box-shadow: 0 0 10px rgba(233,48,255,.6); transition: width 1.2s cubic-bezier(.2,.8,.2,1); }
.gp-joy-progress__fill::after { content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%); background-size: 220% 100%; }
.gp-joy-progress.is-full .gp-joy-progress__fill { background: linear-gradient(90deg, var(--gpj-gold2), var(--gpj-gold)); box-shadow: 0 0 12px rgba(255,200,74,.8); }

/* ---------- overlay base (unlock / celebrate / upsell) ---------- */
.gp-joy-ov { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(70% 55% at 50% 38%, rgba(70,24,140,.96), rgba(8,3,18,.97) 70%); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); font-family: var(--gpj-body); color: var(--gpj-ink);
  opacity: 0; transition: opacity .25s ease; }
.gp-joy-ov.is-on { opacity: 1; }
.gp-joy-ov canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.gp-joy-ov__box { position: relative; text-align: center; width: min(360px, 100%); }
.gp-joy-ov__close { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: 14px; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--gpj-line); background: rgba(20,10,40,.7); color: var(--gpj-ink); font-size: 18px; cursor: pointer; }
.gp-joy-kicker { display: inline-block; font: 800 12px var(--gpj-disp); letter-spacing: .22em; text-transform: uppercase; color: var(--gpj-gold);
  padding: 4px 12px; border-radius: 999px; border: 1px solid rgba(255,200,74,.6); background: rgba(255,200,74,.1); }
.gp-joy-big { font: 800 58px/.9 var(--gpj-disp); text-transform: uppercase; margin: 12px 0 6px;
  background: linear-gradient(180deg, #fff7d6, #ffd76a 45%, #e9a72a); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 10px rgba(255,190,60,.35)); }
.gp-joy-sub { font: 800 20px/1.15 var(--gpj-disp); letter-spacing: .04em; text-transform: uppercase; }
.gp-joy-sub b { color: var(--gpj-gold); }
.gp-joy-txt { font-size: 14px; line-height: 1.45; color: var(--gpj-muted); margin-top: 8px; }
.gp-joy-trophy { width: 150px; height: 150px; object-fit: contain; filter: drop-shadow(0 0 14px rgba(255,200,74,.55)); }
.gp-joy-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px; margin-top: 16px; border: 0; border-radius: 12px; cursor: pointer;
  font: 800 16px var(--gpj-disp); letter-spacing: .1em; text-transform: uppercase; color: #1a0d00;
  background: linear-gradient(180deg, var(--gpj-gold2), var(--gpj-gold)); box-shadow: 0 0 12px rgba(255,200,74,.45); text-decoration: none; }
.gp-joy-btn--p { color: #fff; background: linear-gradient(135deg, var(--gpj-purple), var(--gpj-magenta)); box-shadow: 0 0 12px rgba(233,48,255,.45), inset 0 0 0 1px rgba(255,214,110,.7); }
.gp-joy-timer { position: absolute; left: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--gpj-gold2), var(--gpj-gold)); width: 100%; transform-origin: left; }

/* ---------- unlock ---------- */
.gp-joy-lock { position: relative; width: 120px; height: 120px; margin: 0 auto; display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #3a2508, #160a02); border: 2px solid var(--gpj-gold); box-shadow: 0 0 16px rgba(255,200,74,.6); }
.gp-joy-lock svg { width: 54px; height: 54px; color: var(--gpj-gold); overflow: visible; }
.gp-joy-lock .shackle { transform-origin: 70% 100%; transition: transform .45s cubic-bezier(.2,.9,.3,1.4); }
.gp-joy-lock.is-open .shackle { transform: translateY(-8px) rotate(28deg); }
.gp-joy-unlock-img { width: 120px; height: 120px; object-fit: contain; margin: 0 auto; display: block; }

/* ---------- celebrate ---------- */
.gp-joy-cel .gp-joy-rayswrap { position: absolute; left: 50%; top: 22%; width: 520px; height: 520px; transform: translate(-50%, -50%); pointer-events: none; }
.gp-joy-cel .gp-joy-rays { position: absolute; inset: 0; opacity: .5;
  background: repeating-conic-gradient(from 0deg, rgba(255,200,74,.16) 0 6deg, transparent 6deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 0 30%, transparent 62%); mask: radial-gradient(circle, #000 0 30%, transparent 62%); }

/* ---------- sync ---------- */
.gp-joy-sync { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px;
  background: linear-gradient(180deg, #24123f, #150a2b); border: 1px solid var(--gpj-line); box-shadow: inset 0 0 0 1px rgba(255,200,74,.15); color: var(--gpj-ink); font-family: var(--gpj-body); }
.gp-joy-sync__ic { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(255,255,255,.2); border-top-color: var(--gpj-gold); }
.gp-joy-sync__t { font: 800 15px var(--gpj-disp); letter-spacing: .08em; text-transform: uppercase; }
.gp-joy-sync__s { font: 700 12px var(--gpj-disp); letter-spacing: .12em; text-transform: uppercase; color: var(--gpj-cyan); min-height: 14px; }
.gp-joy-sync .gp-joy-progress { grid-column: 1 / -1; height: 6px; }
.gp-joy-sync.is-done { border-color: rgba(61,255,138,.7); box-shadow: 0 0 10px rgba(61,255,138,.35); }
.gp-joy-sync.is-done .gp-joy-sync__ic { border: 0; background: var(--gpj-green); display: grid; place-items: center; color: #04210f; font-weight: 900; }
.gp-joy-sync.is-done .gp-joy-sync__s { color: var(--gpj-green); }

/* ---------- burst + xp ---------- */
.gp-joy-fx { position: fixed; inset: 0; pointer-events: none; z-index: 9997; }
.gp-joy-xp { position: fixed; z-index: 9997; pointer-events: none; font: 800 18px var(--gpj-disp); letter-spacing: .04em; white-space: nowrap;
  color: var(--gpj-gold2); text-shadow: 0 0 8px rgba(255,200,74,.9), 0 1px 0 #000; transform: translate(-50%, 0); }

/* ---------- upsell ---------- */
.gp-joy-up { position: relative; text-align: left; padding: 20px; border-radius: 18px; overflow: hidden;
  background: radial-gradient(300px 160px at 85% 0, rgba(255,200,74,.2), transparent 70%), linear-gradient(180deg, #24142e, #140b24);
  border: 1px solid rgba(255,200,74,.75); box-shadow: 0 0 0 1px rgba(255,200,74,.25), 0 0 18px rgba(255,200,74,.25); }
.gp-joy-up__t { font: 800 30px/1 var(--gpj-disp); text-transform: uppercase; color: var(--gpj-gold); margin: 10px 0 12px; }
.gp-joy-up ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.gp-joy-up li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.4; }
.gp-joy-up li::before { content: "★"; flex: 0 0 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-size: 12px;
  background: rgba(255,200,74,.16); color: var(--gpj-gold); }
.gp-joy-up .gp-joy-btn { width: 100%; }
.gp-joy-up__no { display: block; width: 100%; margin-top: 10px; background: none; border: 0; color: var(--gpj-muted); font: 600 13px var(--gpj-body); cursor: pointer; }

/* ---------- interaction: CTAs + button states ---------- */
.gp-joy-toast__cta { display: inline-flex; align-items: center; margin-top: 8px; min-height: 32px; padding: 6px 12px; border-radius: 9px; border: 1px solid color-mix(in srgb, var(--c) 70%, transparent);
  background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--gpj-ink); font: 800 13px var(--gpj-disp); letter-spacing: .08em; text-transform: uppercase; text-decoration: none; cursor: pointer; }
.gp-joy-ctas { display: grid; gap: 8px; margin-top: 16px; }
.gp-joy-ctas .gp-joy-btn { margin-top: 0; width: 100%; }
.gp-joy-btn--ghost { color: var(--gpj-ink); background: rgba(20,10,40,.6); border: 1px solid rgba(255,200,74,.55); box-shadow: none; }
.gp-joy-btn, .gp-joy-toast__cta, .gp-joy-press { transition: transform .12s ease, filter .12s ease, box-shadow .2s ease; -webkit-tap-highlight-color: transparent; }
.gp-joy-btn:active, .gp-joy-toast__cta:active, .gp-joy-press:active { transform: scale(.96); filter: brightness(1.12); }
.gp-joy-btn:focus-visible, .gp-joy-toast__cta:focus-visible { outline: 2px solid var(--gpj-gold); outline-offset: 2px; }
.gp-joy-press.is-loading { pointer-events: none; filter: saturate(.85); }
.gp-joy-press.is-done { background: linear-gradient(180deg, #7dffb5, #2ee08a) !important; color: #04210f !important; box-shadow: 0 0 12px rgba(61,255,138,.55) !important; }
.gp-joy-press.is-error { background: linear-gradient(180deg, #ff8a9c, #ff3b5c) !important; color: #2a0008 !important; }
.gp-joy-press__spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #ffc84a; display: inline-block; }
@media (prefers-reduced-motion: no-preference) { .gp-joy-press__spin { animation: gpj-spin .7s linear infinite; } .gp-joy-press.is-done { animation: gpj-pop .35s cubic-bezier(.2,.9,.3,1.6); } }


/* ---------- v2: ambient flakes, gold strokes, levels, mute ---------- */
.gp-joy-amb { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; border-radius: inherit; }
.gp-joy-toast > :not(.gp-joy-amb), .gp-joy-up > :not(.gp-joy-amb), .gp-joy-card > :not(.gp-joy-amb) { position: relative; z-index: 1; }
.gp-joy-toast > .gp-joy-toast__bar { position: absolute; }
/* cantoneiras douradas (pincelada) */
.gp-joy-toast::after, .gp-joy-up::before, .gp-joy-card::after { content: ""; position: absolute; inset: 4px; pointer-events: none; z-index: 2;
  background: linear-gradient(#ffc84a,#ffc84a) left top/10px 2px, linear-gradient(#ffc84a,#ffc84a) left top/2px 10px,
             linear-gradient(#ffc84a,#ffc84a) right bottom/10px 2px, linear-gradient(#ffc84a,#ffc84a) right bottom/2px 10px;
  background-repeat: no-repeat; opacity: .85; }
.gp-joy-card { position: relative; overflow: hidden; padding: 22px 18px 20px; border-radius: 20px;
  background: radial-gradient(260px 160px at 50% 0, rgba(255,200,74,.14), transparent 70%), linear-gradient(180deg, #24123f, #120827);
  border: 1px solid rgba(255,200,74,.55); box-shadow: 0 0 14px rgba(255,200,74,.22); }
.gp-joy-card::before { content: ""; position: absolute; left: 18%; right: 18%; top: 0; height: 2px; z-index: 2; background: linear-gradient(90deg, transparent, #ffc84a, #fff0b8, #ffc84a, transparent); }
/* N1 brilho: glow curto só em volta da peça */
.gp-joy-glow { box-shadow: 0 0 0 2px rgba(255,200,74,.85), 0 0 12px rgba(255,200,74,.55) !important; transition: box-shadow .25s ease; }
/* N3 toast grande */
.gp-joy-toast--big { grid-template-columns: 52px 1fr; padding: 14px 16px 14px 14px; }
.gp-joy-toast--big .gp-joy-toast__ic { width: 52px; height: 52px; font-size: 26px; border-radius: 14px; }
.gp-joy-toast--big .gp-joy-toast__t { font-size: 22px; }
.gp-joy-toast--big .gp-joy-toast__x { font-size: 14px; }
/* N5 épico: troféu girando com brilho */
.gp-joy-trophywrap { perspective: 600px; display: inline-block; }
.gp-joy-epic .gp-joy-trophy { width: 180px; height: 180px; filter: drop-shadow(0 0 18px rgba(255,200,74,.7)); }
.gp-joy-epic .gp-joy-rays { opacity: .75; }
.gp-joy-epic .gp-joy-big { font-size: 66px; }
/* botão de mudo flutuante */
.gp-joy-mute { position: fixed; z-index: 9996; left: 12px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255,200,74,.55); background: rgba(20,10,40,.85); color: #fff; font-size: 17px; line-height: 1; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.4); -webkit-tap-highlight-color: transparent; }
.gp-joy-mute:focus-visible { outline: 2px solid var(--gpj-gold); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .gp-joy-epic .gp-joy-trophy { animation: gpj-trophy .8s cubic-bezier(.2,.9,.3,1.35) both, gpj-turn 3.2s .8s ease-in-out infinite; }
  .gp-joy-epic .gp-joy-big { animation: gpj-pop .55s .25s cubic-bezier(.2,.9,.3,1.5) both, gpj-breath 2.4s 1s ease-in-out infinite; }
}
@keyframes gpj-turn { 0%, 100% { transform: rotateY(0); } 50% { transform: rotateY(360deg); } }
@keyframes gpj-breath { 50% { filter: drop-shadow(0 2px 16px rgba(255,190,60,.6)); } }

/* ---------- motion (only when allowed) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .gp-joy-toast { animation: gpj-in .45s cubic-bezier(.2,.9,.3,1.25) both; }
  .gp-joy-toast.is-out { animation: gpj-out .3s ease-in forwards; }
  .gp-joy-toast__bar { animation: gpj-shrink var(--gpj-dur, 3.2s) linear forwards; }
  .gp-joy-toast--conquista .gp-joy-toast__ic { animation: gpj-pop .6s .1s cubic-bezier(.2,.9,.3,1.6) both; }
  .gp-joy-progress__fill::after { animation: gpj-run 1.6s linear infinite; }
  .gp-joy-ov__box { animation: gpj-rise .5s cubic-bezier(.2,.9,.3,1.2) both; }
  .gp-joy-trophy, .gp-joy-unlock-img.is-in { animation: gpj-trophy .8s cubic-bezier(.2,.9,.3,1.35) both; }
  .gp-joy-big { animation: gpj-pop .55s .25s cubic-bezier(.2,.9,.3,1.5) both; }
  .gp-joy-cel .gp-joy-rays { animation: gpj-spin 18s linear infinite; }
  .gp-joy-timer { animation: gpj-shrink var(--gpj-dur, 4s) linear forwards; }
  .gp-joy-sync__ic { animation: gpj-spin .8s linear infinite; }
  .gp-joy-sync.is-done .gp-joy-sync__ic { animation: gpj-pop .4s cubic-bezier(.2,.9,.3,1.6) both; }
  .gp-joy-xp { animation: gpj-xp 1.4s cubic-bezier(.2,.8,.2,1) forwards; }
  .gp-joy-lock.is-shake { animation: gpj-shake .4s ease-in-out; }
  .gp-joy-up::after { content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.14) 50%, transparent 65%); background-size: 250% 100%; animation: gpj-sweep 4s ease-in-out infinite; }
}
@media (prefers-reduced-motion: reduce) {
  .gp-joy-toast, .gp-joy-ov__box { animation: gpj-fade .2s both; }
  .gp-joy-progress__fill { transition: none; }
  .gp-joy-xp { animation: gpj-fade 1.2s both; }
}
@keyframes gpj-in { from { opacity: 0; transform: translateY(-14px) scale(.96); } }
@keyframes gpj-out { to { opacity: 0; transform: translateY(-10px); } }
@keyframes gpj-shrink { to { transform: scaleX(0); } }
@keyframes gpj-pop { from { opacity: 0; transform: scale(.5); } }
@keyframes gpj-run { from { background-position: 160% 0; } to { background-position: -60% 0; } }
@keyframes gpj-rise { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes gpj-trophy { 0% { opacity: 0; transform: scale(.6); } 70% { transform: scale(1.1); } 100% { transform: scale(1); } }
@keyframes gpj-spin { to { transform: rotate(360deg); } }
@keyframes gpj-xp { 0% { opacity: 0; transform: translate(-50%, 6px) scale(.8); } 20% { opacity: 1; transform: translate(-50%, -8px) scale(1.08); } 100% { opacity: 0; transform: translate(-50%, -52px) scale(1); } }
@keyframes gpj-shake { 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
@keyframes gpj-sweep { from { background-position: 150% 0; } to { background-position: -100% 0; } }
@keyframes gpj-fade { from { opacity: 0; } }
.gp-joy-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
