/* ============================================================
   Roleta Mundo da Má — arcade pixel, dark roxo
   ============================================================ */

@font-face {
    font-family: 'Pixel';
    src: url('fonts/press-start-2p.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Rubik';
    src: url('fonts/rubik-400.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Rubik';
    src: url('fonts/rubik-600.woff2') format('woff2');
    font-weight: 600;
    font-display: swap;
}

:root {
    --bg:      #150a2e;
    --bg-2:    #221246;
    --panel:   #24154400;
    --purple:  #5636d1;
    --pink:    #e2498a;
    --lilac:   #c9b8ff;
    --cyan:    #30c8dc;
    --orange:  #ff8a5c;
    --yellow:  #ffd166;
    --text:    #f4f0ff;
    --muted:   #a99cd6;
    --line:    #3b2a6e;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
    font-family: 'Rubik', system-ui, sans-serif;
    background:
        radial-gradient(1100px 700px at 50% -10%, #2c1758 0%, transparent 60%),
        radial-gradient(900px 500px at 110% 110%, #3a1250 0%, transparent 55%),
        var(--bg);
    color: var(--text);
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

/* grid de "pixels" no fundo */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(201, 184, 255, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(201, 184, 255, .05) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 75%);
    pointer-events: none;
}

/* scanlines de CRT por cima de tudo (efeito telão retrô) */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .16) 0 2px, transparent 2px 4px);
    opacity: .35;
    pointer-events: none;
    z-index: 65;
}

.pixel { font-family: 'Pixel', monospace; letter-spacing: .04em; }

/* ---------- telas ---------- */

.screen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(14px, 2.5vh, 26px);
    padding: max(20px, env(safe-area-inset-top)) 22px max(20px, env(safe-area-inset-bottom));
    opacity: 0;
    transform: translateY(14px);
    pointer-events: none;
    transition: opacity .35s ease, transform .35s ease;
    overflow-y: auto;
}
.screen.active {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.screen-title { font-size: clamp(15px, 3.4vw, 24px); color: var(--lilac); text-shadow: 0 0 18px rgba(86, 54, 209, .8); }

/* ---------- botões arcade ---------- */

.btn {
    font-family: inherit;
    color: var(--text);
    background: var(--bg-2);
    border: 3px solid var(--lilac);
    border-radius: 14px;
    padding: 14px 26px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 5px 5px 0 rgba(0, 0, 0, .45);
    transition: transform .06s ease, box-shadow .06s ease, filter .15s;
}
.btn:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 rgba(0, 0, 0, .45); }

.btn-hero {
    font-size: clamp(16px, 3.2vw, 22px);
    padding: clamp(16px, 3vh, 22px) clamp(30px, 6vw, 54px);
    background: linear-gradient(135deg, var(--purple), var(--pink));
    border-color: #fff;
    animation: hero-pulse 1.6s ease-in-out infinite;
}
@keyframes hero-pulse {
    0%, 100% { box-shadow: 5px 5px 0 rgba(0,0,0,.45), 0 0 22px rgba(226, 73, 138, .55); }
    50%      { box-shadow: 5px 5px 0 rgba(0,0,0,.45), 0 0 44px rgba(226, 73, 138, .95); }
}

.btn-primary {
    background: linear-gradient(135deg, var(--purple), var(--pink));
    border-color: #fff;
    font-size: clamp(13px, 2.6vw, 18px);
}
.btn-primary:disabled {
    filter: grayscale(.6) brightness(.6);
    cursor: not-allowed;
    animation: none;
}

.btn-small { padding: 8px 16px; font-size: 14px; border-width: 2px; }

.btn-back {
    position: absolute;
    top: max(16px, env(safe-area-inset-top));
    left: 18px;
    background: none;
    border: none;
    color: var(--muted);
    font: 500 15px 'Rubik', sans-serif;
    cursor: pointer;
    padding: 8px;
}

/* ---------- home ---------- */

.title-home {
    font-size: clamp(22px, 6vw, 44px);
    background: linear-gradient(90deg, var(--lilac), var(--pink), var(--cyan));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 16px rgba(226, 73, 138, .45));
    animation: title-flicker 5s infinite;
}

/* o neonsco dos fliperamas: o título pisca de vez em quando */
@keyframes title-flicker {
    0%, 90%, 100% { opacity: 1; }
    91% { opacity: .5; }
    92% { opacity: 1; }
    94% { opacity: .72; }
    95% { opacity: 1; }
}

/* TV ligando: cada vez que a home aparece, o "console" dá power-on */
#s-home.active {
    animation: crt-on .6s ease-out;
}
@keyframes crt-on {
    0%   { transform: scaleY(.012) scaleX(.7); filter: brightness(5) saturate(0); }
    45%  { transform: scaleY(1.03) scaleX(1); filter: brightness(2.1); }
    100% { transform: none; filter: none; }
}

.subtitle { color: var(--muted); text-align: center; font-size: clamp(15px, 2.6vw, 19px); line-height: 1.55; }

.home-footer {
    position: absolute;
    bottom: max(18px, env(safe-area-inset-bottom));
    left: 0;
    right: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 10px;
    padding: 0 16px;
    color: var(--muted);
    font-size: 13px;
    opacity: .8;
}
.home-footer i { font-style: normal; opacity: .5; }

/* logos: <M> oficial + evento Felicidar lado a lado, alinhados pelo centro */
.logos-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: clamp(16px, 4vw, 32px);
    width: 100%;
    margin-bottom: 6px;
}
.event-logo {
    flex: 0 0 auto;
    filter: drop-shadow(0 4px 18px rgba(0, 0, 0, .45));
    animation: logo-in .55s cubic-bezier(.2, 1.5, .4, 1) .35s backwards;
}
.event-logo img { display: block; width: clamp(72px, 13vw, 104px); }

/* logo oficial (favicon <M>) — 7 fatias <img> empilhadas revelando em cascata */
.official-logo {
    position: relative;
    flex: 0 0 auto;
    width: clamp(130px, 26vw, 190px);
    aspect-ratio: 1;
    filter: drop-shadow(0 0 28px rgba(124, 92, 255, .5));
}
.official-logo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    animation: logo-in .55s cubic-bezier(.2, 1.5, .4, 1) backwards;
}
@keyframes logo-in {
    from { opacity: 0; transform: translateY(-18px); }
}

/* ---------- formulário ---------- */

#leadForm {
    width: min(560px, 100%);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 14px; font-weight: 600; color: var(--lilac); letter-spacing: .06em; text-transform: uppercase; }

.field input {
    font: 400 19px 'Rubik', sans-serif;
    color: var(--text);
    background: var(--bg-2);
    border: 2px solid var(--line);
    border-radius: 14px;
    padding: 15px 18px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: #6f5fa8; }
.field input:focus {
    border-color: var(--pink);
    box-shadow: 0 0 0 4px rgba(226, 73, 138, .22), 0 0 24px rgba(226, 73, 138, .25);
}
.field input.invalid { border-color: #ff5c7a; }

.err { display: none; color: #ff9fb3; font-size: 13.5px; font-style: normal; padding-left: 4px; }
.err.show { display: block; }

.consent { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; color: var(--muted); font-size: 14.5px; line-height: 1.45; }
.consent input { width: 22px; height: 22px; accent-color: var(--pink); margin-top: 1px; flex: none; }
.err-consent { margin-top: -8px; }

#leadForm .btn-primary { margin-top: 6px; padding-block: clamp(14px, 2.6vh, 18px); }

/* ---------- momento do negócio ---------- */

.question { color: var(--muted); font-size: clamp(15px, 2.8vw, 19px); text-align: center; }

.moment-grid {
    width: min(640px, 100%);
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
@media (min-width: 620px) and (min-height: 560px) {
    .moment-grid { grid-template-columns: 1fr 1fr; }
}

.moment-card {
    --accent: var(--pink);
    font-family: inherit;
    text-align: left;
    color: var(--text);
    background: var(--bg-2);
    border: 2px solid var(--line);
    border-left: 6px solid var(--accent);
    border-radius: 14px;
    padding: 14px 16px;
    cursor: pointer;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 14px;
    align-items: center;
    transition: transform .08s, border-color .15s, box-shadow .15s, background .15s;
}
.m-icon { grid-row: span 2; width: clamp(34px, 6vw, 48px); height: auto; border-radius: 10px; filter: drop-shadow(0 0 10px var(--accent)); }
.m-title { font-weight: 600; font-size: clamp(15px, 2.6vw, 18px); }
.m-solution { color: var(--muted); font-size: 13.5px; line-height: 1.4; }

.moment-card:active { transform: scale(.98); }
.moment-card.selected {
    background: #2d1a5c;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .08), 0 0 26px color-mix(in srgb, var(--accent) 55%, transparent);
}

#toWheel { margin-top: 4px; }

/* ---------- roleta ---------- */

.wheel-wrap {
    position: relative;
    width: min(78vw, 62vh, 520px);
    aspect-ratio: 1;
    filter: drop-shadow(0 18px 44px rgba(0, 0, 0, .5));
}

#wheel { width: 100%; height: 100%; display: block; }

.wheel-pointer {
    position: absolute;
    top: -12px;
    left: 50%;
    translate: -50% 0;
    width: 0; height: 0;
    border-left: 17px solid transparent;
    border-right: 17px solid transparent;
    border-top: 34px solid var(--yellow);
    filter: drop-shadow(0 0 12px rgba(255, 209, 102, .9));
    z-index: 3;
}

.spin-btn {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 31%;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 4px solid #fff;
    background: radial-gradient(circle at 32% 28%, #ff7ab0, var(--pink) 55%, #b02c60);
    color: #fff;
    font-size: clamp(13px, 2.8vw, 20px);
    cursor: pointer;
    z-index: 2;
    box-shadow: 0 0 0 7px rgba(255, 255, 255, .14), 0 0 34px rgba(226, 73, 138, .75);
    text-shadow: 0 2px 0 rgba(0, 0, 0, .4);
    transition: transform .06s;
    animation: hero-pulse 1.8s ease-in-out infinite;
}
.spin-btn:active { transform: scale(.94); }
.spin-btn:disabled { animation: none; filter: saturate(.5) brightness(.75); cursor: default; }

.wheel-hint { color: var(--muted); font-size: 15px; }

/* ---------- resultado ---------- */

.result-box {
    width: min(640px, 100%);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.r-emoji { font-size: clamp(64px, 16vw, 110px); line-height: 1; animation: r-pop .7s cubic-bezier(.2, 1.8, .4, 1); filter: drop-shadow(0 10px 30px rgba(0,0,0,.5)); }
.r-logo { width: clamp(76px, 17vw, 124px); height: auto; animation: r-pop .7s cubic-bezier(.2, 1.8, .4, 1); filter: drop-shadow(0 10px 30px rgba(0,0,0,.5)); }
@keyframes r-pop { from { transform: scale(0) rotate(-16deg); } }

.r-title { font-family: 'Pixel'; font-size: clamp(17px, 4vw, 30px); color: var(--yellow); text-shadow: 0 0 22px rgba(255, 209, 102, .6); }
.r-title.is-coupon { color: var(--cyan); text-shadow: 0 0 22px rgba(48, 200, 220, .6); }

.r-sub { color: var(--text); font-size: clamp(16px, 3vw, 21px); font-weight: 600; }
.r-note { color: var(--muted); font-size: 15px; }

.coupon-code {
    font-family: 'Pixel';
    font-size: clamp(22px, 6vw, 40px);
    color: #062024;
    background: var(--cyan);
    border-radius: 12px;
    padding: 14px 26px;
    box-shadow: 5px 5px 0 rgba(0, 0, 0, .45);
    border: 3px dashed rgba(6, 32, 36, .55);
    margin: 6px 0;
}

.r-pitch {
    margin-top: 8px;
    width: fit-content;
    max-width: 100%;
    background: var(--bg-2);
    border: 2px solid var(--line);
    border-left: 6px solid var(--pitch-accent, var(--pink));
    border-radius: 14px;
    padding: 12px 18px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--muted);
    text-align: left;
}
.r-pitch strong { color: var(--text); }
.r-pitch a, .r-pitch span.domain { color: var(--pitch-accent, var(--pink)); font-weight: 600; text-decoration: none; }

.partner-credit { font-size: 12.5px; color: var(--muted); opacity: .75; }

.sync-status {
    display: flex; align-items: center; gap: 12px;
    background: rgba(255, 92, 122, .12);
    border: 2px solid rgba(255, 92, 122, .45);
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 14.5px;
    color: #ffb3c2;
}
.sync-status.ok {
    background: rgba(48, 200, 220, .1);
    border-color: rgba(48, 200, 220, .4);
    color: #a8ecf4;
}

.reset-bar {
    width: min(320px, 60vw);
    height: 6px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .12);
    overflow: hidden;
}
#resetFill {
    height: 100%;
    width: 0%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--purple), var(--pink));
}

/* ---------- confete ---------- */

#confetti {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 60;
}

/* ---------- mute ---------- */

.mute-btn {
    position: fixed;
    top: max(14px, env(safe-area-inset-top));
    right: 16px;
    z-index: 70;
    width: 46px; height: 46px;
    border-radius: 12px;
    border: 2px solid var(--line);
    background: rgba(34, 18, 70, .8);
    font-size: 19px;
    cursor: pointer;
    backdrop-filter: blur(4px);
}
.mute-btn .icon-off { display: none; }
body.muted .icon-on  { display: none; }
body.muted .icon-off { display: inline; }

/* teleporte de tela pequena demais: permite scroll nas telas de conteúdo */
@media (max-height: 620px) {
    .screen { justify-content: flex-start; }
}
