@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@600;700;800;900&display=swap");
/* Tela da partida (real e demo) — CRUSH WIN */
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body.arena { overflow: hidden; color: #4a1640; font-family: "Nunito", ui-rounded, system-ui, sans-serif; -webkit-font-smoothing: antialiased; background: #ffd6ec url("/assets/candyland.svg") center / cover no-repeat; touch-action: none; overscroll-behavior: none; }
.ar { height: 100dvh; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); }
.ar[hidden] { display: none; }
.ar-top { flex: 0 0 auto; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ar-btn { width: 46px; height: 46px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgb(255 255 255 / 0.85); color: #c0157e; cursor: pointer; box-shadow: 0 4px 12px rgb(140 30 100 / 0.2); }
.ar-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ar-btn[aria-pressed="false"] { opacity: .5; }
.ar-brand { display: grid; justify-items: center; gap: 4px; }
.ar-brand .wm { --wm-size: 26px; }
.ar-brand small { padding: 2px 10px; border-radius: 999px; background: rgb(42 15 58 / 0.75); color: #fff; font-size: 9px; font-weight: 900; letter-spacing: .1em; }

.ar-frame { flex: 1 1 auto; min-height: 0; margin: 4px 10px 0; padding: 10px; display: flex; flex-direction: column; border-radius: 26px; background: linear-gradient(180deg, rgb(255 225 242 / 0.95), rgb(255 200 230 / 0.92)); box-shadow: 0 0 0 4px #ff8fd6, 0 0 0 8px rgb(140 220 255 / 0.9), 0 20px 40px rgb(140 30 100 / 0.3); }
.ar-hud { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 16px; background: #2a0f3a; color: #fff; }
.ar-hud div { display: grid; text-align: center; }
.ar-hud small { font-size: 9px; font-weight: 800; opacity: .7; letter-spacing: .08em; }
.ar-hud b { font-size: 13px; }
.ar-hud strong { font-size: clamp(20px, 6.4vw, 28px); color: #5ee05e; font-weight: 900; text-shadow: 0 0 12px rgb(94 224 94 / 0.4); }
.ar-bar { height: 8px; margin: 8px 14px 0; border-radius: 99px; background: rgb(42 15 58 / 0.2); overflow: hidden; }
.ar-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #5ee05e, #ffd21e); transition: width .4s; }
.ar-chips { display: flex; justify-content: center; gap: 8px; margin: 8px 0 4px; }
.ar-chips span { padding: 4px 12px; border-radius: 999px; background: #2a0f3a; color: #fff; font-size: 10px; font-weight: 900; letter-spacing: .06em; }
.ar-chips b { color: #ffd21e; font-size: 13px; }
.ar-chips .is-low b { color: #ff6b8b; }
.ar-stage { position: relative; flex: 1 1 auto; min-height: 0; }
.ar-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.ar-meta { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 6px; border-radius: 18px; background: rgb(42 15 58 / 0.6); color: #fff; text-align: center; pointer-events: none; animation: ar-meta 2.6s ease both; }
.ar-meta small { color: #ffd21e; font-weight: 900; letter-spacing: .14em; }
.ar-meta b { font-size: 24px; font-weight: 900; }
@keyframes ar-meta { 0% { opacity: 0; transform: scale(.85); } 12% { opacity: 1; transform: scale(1.03); } 80% { opacity: 1; } 100% { opacity: 0; } }

.ar-bottom { flex: 0 0 auto; padding: 8px 12px 10px; }
.ar-msg { margin: 0; min-height: 18px; text-align: center; color: #fff; font-size: 13px; font-weight: 800; text-shadow: 0 1px 3px rgb(120 10 70 / 0.7); }
.ar-cash { margin-top: 8px; width: 100%; min-height: 60px; padding: 0 12px 0 20px; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: 20px; background: rgb(255 255 255 / 0.7); color: #8a5a7e; font: inherit; font-size: 15px; font-weight: 900; letter-spacing: .04em; }
.ar-cash b { padding: 8px 12px; border-radius: 13px; background: #2a0f3a; color: #5ee05e; font-size: 15px; }
.ar-cash:not(:disabled) { color: #fff; cursor: pointer; background: linear-gradient(180deg, #ff8fd0, #ff3f9b 55%, #e0207f); box-shadow: inset 0 -4px 0 rgb(120 10 70 / 0.35), 0 10px 24px rgb(220 30 130 / 0.45); animation: ar-glow 1.4s ease-in-out infinite; }
@keyframes ar-glow { 50% { transform: scale(1.02); } }
.ar-cash--go { justify-content: center; background: linear-gradient(180deg, #ff8fd0, #ff3f9b) !important; color: #fff !important; cursor: pointer; animation: none !important; }
.ar-foot { margin-top: 8px; display: flex; justify-content: space-around; gap: 6px; color: #fff; font-size: 10px; font-weight: 900; letter-spacing: .06em; text-shadow: 0 1px 3px rgb(120 10 70 / 0.7); }
.ar-foot b { color: #ffd21e; font-size: 13px; }
.ar-note { margin: 6px 0 0; text-align: center; color: #fff; font-size: 11px; font-weight: 700; opacity: .9; text-shadow: 0 1px 3px rgb(120 10 70 / 0.7); }
.app-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 90; transform: translateX(-50%); max-width: 92vw; padding: 12px 18px; border-radius: 14px; background: #2a0f3a; color: #fff; font-size: 14px; font-weight: 800; box-shadow: 0 10px 30px rgb(0 0 0 / 0.3); }
.app-toast[hidden] { display: none; }
@media (max-height: 700px) { .ar-note { display: none; } .ar-cash { min-height: 52px; } }
.ar-dialog { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; background: rgb(60 10 50 / 0.6); backdrop-filter: blur(8px); }
.ar-dialog > div { width: min(380px, 100%); padding: 26px 22px; border: 1px solid rgb(255 255 255 / 0.16); border-radius: 26px; background: linear-gradient(180deg, #fff, #ffe6f3); text-align: center; }
.ar-dialog small { color: #ff4fa6; font-size: 10px; font-weight: 900; letter-spacing: .14em; }
.ar-dialog h2 { margin: 8px 0 0; font-size: 1.7rem; font-weight: 900;  color: #8a1f63; }
.ar-dialog p { margin: 10px 0 0; color: #7a3a68; font-size: 14px; line-height: 1.5; font-weight: 600; }
.ar-link { margin-top: 16px; padding: 10px; border: 0; background: none; color: #c0157e; font: inherit; font-size: 12px; font-weight: 900; letter-spacing: .1em; cursor: pointer; }

/* ── Resultado ────────────────────────────────────────── */
.ar-result { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; max-width: 520px; margin: 0 auto; background: linear-gradient(180deg, #fff7fb 0, #ffeef7 45%, #ffe6f2 100%); color: #5a1846; overflow-y: auto; animation: ar-rin .4s ease; }
@keyframes ar-rin { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.ar-result[data-lose] { background: linear-gradient(180deg, #fff3f9 0, #ffe8f4 60%, #ffe0f0 100%); }
.ar-result__x { position: absolute; top: 12px; right: 12px; z-index: 3; width: 46px; height: 46px; display: grid; place-items: center; border: 0; border-radius: 50%; background: #4a4f6a; color: #fff; font-size: 20px; cursor: pointer; }
.ar-result__in { flex: 1; padding: 26px 20px 0; text-align: center; }
.ar-result__mascot { width: 88px; height: 88px; margin: 6px auto 0; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle, rgb(255 120 200 / 0.35), transparent 70%); box-shadow: 0 0 40px rgb(255 120 200 / 0.35); }
.ar-result__mascot img { width: 78px; height: 78px; object-fit: contain; }
.ar-result__tag { margin: 8px 0 0; color: #e0207f; font-size: 12px; font-weight: 900; letter-spacing: .16em; }
.ar-result h1 { margin: 4px 0 0; color: #8a1f63; font-size: clamp(2rem, 9vw, 2.6rem); line-height: 1.02; font-weight: 900; letter-spacing: -.02em; }
.ar-result[data-lose] h1 { color: #5a1846; }
.ar-result__sub { margin: 10px auto 0; max-width: 330px; color: #7a3a68; font-size: 15px; line-height: 1.45; font-weight: 600; }
.ar-result__value { margin: 18px 0 0; padding: 18px 16px 14px; border: 1px solid #ffc9e6; border-radius: 26px; background: linear-gradient(180deg, #fff, #f3f0ff); }
.ar-result__value small { color: #b0508e; font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.ar-result__value b { display: block; margin-top: 4px; color: #0ea45a; font-size: clamp(2.8rem, 15vw, 4rem); line-height: 1; font-weight: 900; letter-spacing: -.03em; }
.ar-result[data-lose] .ar-result__value b { color: #9a6a8e; }
.ar-result__stats { margin-top: 12px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ar-result__stats > div { padding: 12px 6px; border: 1px solid #ffd6ec; border-radius: 16px; background: #fff6fb; }
.ar-result__stats small { display: block; color: #b0508e; font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.ar-result__stats b { display: block; margin-top: 4px; color: #5a1846; font-size: 18px; font-weight: 900; }
.ar-gem { font-size: 14px; }
.ar-result__note { margin: 16px 0 0; color: #b0508e; font-size: 12px; font-weight: 600; }
.ar-result__actions { flex: 0 0 auto; padding: 18px 20px calc(18px + env(safe-area-inset-bottom)); text-align: center; }
.ar-again { min-height: 66px; padding: 0 14px 0 26px; display: flex; align-items: center; justify-content: space-between; border-radius: 20px; background: linear-gradient(90deg, #ffd42a, #ff8a3d); color: #2a0f5a; font-size: 16px; font-weight: 900; letter-spacing: .08em; box-shadow: 0 12px 30px rgb(255 150 40 / 0.3); }
.ar-again__ic { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: #8a1f63; color: #fff; font-size: 20px; }
.ar-portal { margin-top: 16px; display: block; color: #8a1f63; font-size: 13px; font-weight: 900; letter-spacing: .12em; }
.ar-confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
