/* Decoreba — visual de jogo na linha do Dindin + DM.
   Azul royal com brilho, cards com arte do modo, botões 3D com "beiço" (sombra sólida embaixo que some ao apertar).
   Catamaran no texto, Fredoka (arredondada) em títulos e números. */
@font-face { font-family: 'Catamaran'; src: url('/fonts/catamaran-500.woff2') format('woff2'); font-weight: 400 500; font-display: swap; }
@font-face { font-family: 'Catamaran'; src: url('/fonts/catamaran-700.woff2') format('woff2'); font-weight: 600 700; font-display: swap; }
@font-face { font-family: 'Catamaran'; src: url('/fonts/catamaran-800.woff2') format('woff2'); font-weight: 800 900; font-display: swap; }
@font-face { font-family: 'Fredoka'; src: url('/fonts/fredoka.woff2') format('woff2'); font-weight: 300 700; font-display: swap; }

:root {
  color-scheme: dark;
  --deep: #0a0e5c; --canvas: #0f147a;
  --surface: #1a22b0; --surface-2: #141b95; --surface-3: #232ccf; --well: #0c1170;
  --border: #2c36d8; --border-hi: #4652ff;
  --text: #f5f7ff; --text-2: #b9c0ff; --text-3: #b3baf2;
  --gold: #ffd84a; --gold-lip: #c99412; --green: #36d97f; --green-lip: #138a48; --blue: #3a47ff; --blue-lip: #1c24b0;
  --cyan: #7df4ed; --pink: #ff7aa8; --red: #ff6b6b; --on-gold: #2a1a00;
  --ink: var(--deep); --muted: var(--text-3); --line: #ffffff1a; --lime: var(--gold); --accent: #8b7bff;
  --card-bg: linear-gradient(180deg, #1e27c6, #141b95);
  --card-shadow: inset 0 1px 0 #ffffff22, 0 10px 22px #06083c73;
  --lip: 0 5px 0 var(--deep);
  --display: 'Fredoka', 'Catamaran', ui-rounded, system-ui, sans-serif;
  --bg: #0a0e5c; --bg-top: #141c9e;
  font-family: 'Catamaran', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--deep); color: var(--text);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; height: 100dvh; overflow: hidden; -webkit-font-smoothing: antialiased;
  background: radial-gradient(circle at 1px 1px, #ffffff0d 1px, transparent 1.5px) 0 0 / 22px 22px, radial-gradient(120% 55% at 50% -8%, #3b46ff66, transparent 65%), linear-gradient(180deg, var(--bg-top), var(--bg)), var(--bg); }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; border: 0; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
button:disabled { cursor: default; }
button svg { flex-shrink: 0; }
h1, h2, p { margin: 0; }
h1, h2 { text-wrap: balance; font-family: var(--display); font-weight: 600; }
#app { height: 100%; max-width: 500px; margin: auto; }
.screen { height: 100%; padding: max(20px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); display: flex; flex-direction: column; }

/* Peças com beiço 3D: afundam ao tocar. */
.icon-button, .coin-chip, .level-option, .primary-button, .secondary-button, .help-button, .streak-recover, .free-actions button, .product-price, .shop-action, .ranking-identity, .ranking-modes button, .ranking-period button {
  transition: transform 90ms ease-out, box-shadow 90ms ease-out, filter 150ms;
}
:is(.icon-button, .coin-chip, .level-option, .primary-button, .secondary-button, .help-button, .streak-recover, .free-actions button, .shop-action, .ranking-identity, .ranking-modes button, .ranking-period button):not(:disabled):active,
:is(.offer-card, .coin-pack):active .product-price, .mode-tile:active .mode-play, .shop-item:active .shop-action { transform: translateY(4px); box-shadow: 0 1px 0 var(--lip-c, var(--deep)); }
.mode-tile, .month-mode, .offer-card, .coin-pack, .shop-item { transition: transform 120ms ease-out, filter 150ms; }
:is(.mode-tile, .month-mode, .offer-card, .coin-pack, .shop-item):active { transform: scale(.975); }
@media (hover: hover) { :is(.mode-tile, .month-mode, .level-option, .primary-button, .secondary-button, .offer-card, .coin-pack, .shop-item):not(:disabled):hover { filter: brightness(1.08); } }

.icon-button { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--surface-3); border: 1.5px solid var(--border-hi); box-shadow: var(--lip); color: var(--text); }
.icon-button svg { width: 20px; height: 20px; }
.wordmark-mini, .eyebrow, .section-label, .screen-header > span, .result-footer { font-size: 13px; font-weight: 700; color: var(--text-2); }
.wordmark-mini { display: flex; align-items: center; gap: 8px; }
.brand-dot, .status-dot { width: 9px; height: 9px; border-radius: 3px; background: var(--gold); display: inline-block; flex-shrink: 0; rotate: 45deg; box-shadow: 0 0 10px var(--gold); }

/* Botões */
.primary-button, .secondary-button { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 18px; border-radius: 18px; font-family: var(--display); font-size: 19px; font-weight: 600; min-height: 58px; color: #fff; text-shadow: 0 2px 0 #00000033; }
.primary-button { --lip-c: var(--green-lip); background: linear-gradient(180deg, #4ff09a, var(--green)); box-shadow: 0 5px 0 var(--green-lip), 0 10px 20px #04063f80, inset 0 2px 0 #ffffff55; }
.secondary-button { --lip-c: var(--blue-lip); background: linear-gradient(180deg, #5562ff, var(--blue)); box-shadow: 0 5px 0 var(--blue-lip), 0 10px 20px #04063f80, inset 0 2px 0 #ffffff40; }
.primary-button svg, .secondary-button svg { width: 20px; height: 20px; filter: drop-shadow(0 2px 0 #00000033); }
.text-button { background: transparent; padding: 13px; color: var(--cyan); font-size: 16px; font-weight: 700; }

/* Menu */
.menu-screen { overflow-y: auto; scrollbar-width: none; padding-bottom: 0; }
.menu-screen::-webkit-scrollbar { display: none; }
.menu-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 20px; }
.menu-tools { display: flex; gap: 8px; flex-shrink: 0; }
/* O título usa a sobra da barra (presente + moedas + som): a fonte acompanha a largura, e o subtítulo e as cartas saem quando falta espaço. */
.menu-title { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; container-type: inline-size; }
.menu-title h1 { font-size: clamp(18px, calc((100cqi - 54px) / 4.25), 30px); white-space: nowrap; line-height: 1; font-weight: 700; letter-spacing: -.3px; text-shadow: 0 3px 0 var(--deep); }
@container (max-width: 165px) { .menu-title p { display: none; } }
@container (max-width: 149px) { .brand-cards { display: none; } .menu-title h1 { font-size: clamp(18px, calc(100cqi / 4.25), 30px); } }
.menu-title p { margin-top: 3px; color: var(--text-2); font-size: 13px; font-weight: 600; }
.brand-cards { position: relative; width: 44px; height: 48px; flex-shrink: 0; }
.brand-cards span { position: absolute; width: 30px; height: 40px; border-radius: 7px; background: linear-gradient(160deg, #8b7bff, #5a3fe0); border: 1.5px solid #ffffff40; transform: rotate(-12deg); top: 6px; left: 0; box-shadow: 0 3px 0 var(--deep); }
.brand-cards span + span { display: grid; place-items: center; background: linear-gradient(160deg, #ffe372, #ffb21e); color: var(--on-gold); font-family: var(--display); font-size: 22px; font-weight: 700; transform: rotate(10deg); left: 14px; top: 0; }
.section-label { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--display); font-size: 20px; font-weight: 600; color: var(--text); margin: 4px 0 12px; }
.section-label > span { font-family: 'Catamaran', sans-serif; font-size: 13px; font-weight: 600; color: var(--text-3); }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mode-destaque { margin-bottom: 14px; }
.mode-tile { position: relative; display: flex; flex-direction: column; text-align: left; padding: 0; border-radius: 22px; overflow: hidden; min-width: 0; background: var(--card-bg); border: 1.5px solid var(--border); box-shadow: var(--card-shadow); }
.mode-tile.mode-desafio { order: -1; grid-column: 1 / -1; border-color: #ffd84a88; box-shadow: var(--card-shadow), 0 0 0 1px #ffd84a33, 0 0 28px #ffd84a26; }
.mode-tile.mode-duelo { order: 10; grid-column: 1 / -1; display: grid; grid-template-columns: 120px 1fr; }
.mode-classico { --accent: #8b7bff; }.mode-relampago { --accent: #ffcf33; }.mode-danca { --accent: #ff6fa8; }.mode-trio { --accent: #3ddc84; }.mode-contraparte { --accent: #4cc3ff; }.mode-duelo { --accent: #ff8a4c; }.mode-desafio { --accent: #ffd84a; }.mode-mosaico { --accent: #c77dff; }
.mode-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: var(--deep); flex-shrink: 0; }
.mode-icon svg { width: 22px; height: 22px; }
.mode-number { display: none; }
/* Arte do modo: cartinhas sobre um brilho na cor do modo. */
.mode-art { position: relative; display: flex; align-items: center; justify-content: center; gap: 5px; height: 92px; flex-shrink: 0; border-bottom: 1.5px solid var(--border); background: radial-gradient(85% 120% at 50% 0%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 72%), var(--well); --mcw: 28px; }
.mode-desafio .mode-art { height: 118px; gap: 8px; --mcw: 38px; }
.mode-duelo .mode-art { height: auto; min-height: 96px; border-bottom: 0; border-right: 1.5px solid var(--border); }
.mc { display: grid; place-items: center; width: var(--mcw); aspect-ratio: 3 / 4; border-radius: 7px; overflow: hidden; flex-shrink: 0; background: var(--back-bg, var(--back-a, #5a64ff)); border: 1.5px solid #ffffff38; box-shadow: 0 3px 0 #04063f99; }
.mc > svg { width: 100%; height: 100%; display: block; }
.mc.up { background: #f5f7ff; border-color: #ffffff; }
.mc.up > svg { width: 82%; height: auto; }
.mc.ok { box-shadow: 0 3px 0 #04063f99, 0 0 0 2.5px var(--green); }
.mc.lit { scale: 1.2; translate: 0 -4px; box-shadow: 0 0 0 3px var(--gold), 0 0 26px var(--gold); animation: lit 1.6s ease-in-out infinite alternate; }
@keyframes lit { to { box-shadow: 0 0 0 3px var(--gold), 0 0 10px var(--gold); } }
.art-danca .mc:nth-child(1) { rotate: -14deg; translate: 0 5px; } .art-danca .mc:nth-child(2) { rotate: 8deg; translate: 0 -7px; } .art-danca .mc:nth-child(3) { rotate: -6deg; translate: 0 6px; } .art-danca .mc:nth-child(4) { rotate: 15deg; translate: 0 -3px; }
.art-duelo .mc:first-child { rotate: -12deg; } .art-duelo .mc:last-child { rotate: 12deg; }
.art-vs, .art-link { font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--gold); text-shadow: 0 2px 0 var(--deep); }
.art-link { color: #fff; font-size: 22px; }
.art-badge { position: absolute; right: 8px; bottom: 6px; font-size: 11px; letter-spacing: 1px; color: var(--pink); background: #04063f99; border-radius: 99px; padding: 1px 7px; }
.art-mosaico { display: grid; grid-template-columns: repeat(2, 30px); grid-auto-rows: 30px; gap: 3px; align-content: center; justify-content: center; }
.mp { display: block; border-radius: 5px; overflow: hidden; box-shadow: 0 3px 0 #04063f99; }
.mp:nth-child(2) { translate: 4px -3px; rotate: 6deg; }
.mp svg { display: block; width: 100%; height: 100%; }
.art-sequencia { display: grid; grid-template-columns: repeat(3, 18px); grid-auto-rows: 18px; gap: 4px; align-content: center; justify-content: center; }
.sq { display: grid; place-items: center; border-radius: 5px; background: #ffffff33; box-shadow: inset 0 0 0 1px #ffffff26; font-style: normal; font-family: var(--display); font-size: 11px; font-weight: 700; color: var(--deep); }
.sq.on { background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.mode-body { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 12px 13px 14px; min-width: 0; }
.mode-desafio .mode-body { flex-direction: row; align-items: flex-end; justify-content: space-between; }
.mode-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mode-copy strong { font-family: var(--display); font-size: 19px; font-weight: 600; line-height: 1.15; }
.mode-desafio .mode-copy strong { font-size: 24px; }
.mode-rule { color: var(--text-2); font-size: 13.5px; font-weight: 500; line-height: 1.3; text-wrap: pretty; }
.mode-copy small { color: var(--text-3); font-size: 11.5px; font-weight: 600; line-height: 1.35; margin-top: 3px; }
.mode-play { --lip-c: var(--green-lip); display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin-top: auto; padding: 7px 14px 6px; border-radius: 99px; background: linear-gradient(180deg, #4ff09a, var(--green)); box-shadow: 0 4px 0 var(--green-lip), inset 0 2px 0 #ffffff55; color: #fff; font-family: var(--display); font-size: 15px; font-weight: 600; text-shadow: 0 1px 0 #00000033; transition: transform 90ms, box-shadow 90ms; flex-shrink: 0; }
.mode-play svg { width: 11px; height: 11px; fill: currentColor; }
.mode-desafio .mode-play { align-self: flex-end; padding: 10px 20px 9px; font-size: 18px; }
.mode-desafio .mode-play { --lip-c: var(--gold-lip); background: linear-gradient(180deg, #ffe680, var(--gold)); box-shadow: 0 5px 0 var(--gold-lip), inset 0 2px 0 #ffffff80; color: var(--on-gold); text-shadow: none; }
.streak { position: absolute; top: 10px; right: 10px; z-index: 1; display: flex; align-items: center; gap: 4px; color: var(--on-gold); background: linear-gradient(180deg, #ffe680, var(--gold)); border-radius: 99px; padding: 3px 10px 2px; font-size: 12.5px; font-weight: 800; line-height: 1.2; box-shadow: 0 3px 0 var(--gold-lip); }
.streak svg { width: 13px; height: 14px; }
.menu-footer { display: flex; justify-content: center; margin-top: 18px; color: var(--text-3); font-size: 12px; font-weight: 600; }
.footer-mark { font-family: var(--display); font-weight: 700; }
.tab-bar { position: sticky; bottom: 0; z-index: 5; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; margin: 12px -6px 0; padding: 7px; border-radius: 24px; background: #0b0f6be8; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1.5px solid var(--border); box-shadow: 0 -8px 26px #04063f99; }
.tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 4px 7px; border-radius: 17px; background: transparent; color: var(--text-2); font-family: var(--display); font-size: 13px; font-weight: 600; }
.tab svg { width: 22px; height: 22px; }
.tab.is-active { background: linear-gradient(180deg, #4652ff, #2a35e0); color: #fff; box-shadow: inset 0 1px 0 #ffffff33; }
.tab.is-active::before { content: ''; position: absolute; top: 4px; width: 26px; height: 3px; border-radius: 3px; background: var(--gold); }
.tab:active { transform: scale(.95); }

/* Cabeçalho e nível */
.screen-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-shrink: 0; }
.screen-header > span { font-family: var(--display); font-size: 17px; font-weight: 600; color: var(--text); }
.header-mark { font-family: var(--display) !important; font-size: 22px !important; font-weight: 700 !important; color: var(--gold) !important; text-shadow: 0 2px 0 var(--deep); }
.level-intro { margin: auto 0 26px; }
.large-mode { width: 88px; height: 88px; display: grid; place-items: center; background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 70%, #fff), var(--accent)); color: var(--deep); border-radius: 26px; margin-bottom: 22px; rotate: -5deg; box-shadow: 0 6px 0 color-mix(in srgb, var(--accent) 55%, #000), 0 0 40px color-mix(in srgb, var(--accent) 45%, transparent), inset 0 2px 0 #ffffff80; }
.large-mode svg { width: 46px; height: 46px; }
.eyebrow { color: var(--text-2); }
.level-intro h1 { font-size: 46px; line-height: 1; font-weight: 700; margin: 6px 0 10px; text-shadow: 0 4px 0 var(--deep); }
.level-intro > p:last-child { font-size: 16px; color: var(--text-2); }
.levels { display: flex; flex-direction: column; gap: 14px; }
.level-option { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 20px; background: var(--card-bg); border: 1.5px solid var(--border-hi); box-shadow: var(--lip), 0 10px 20px #04063f66, inset 0 1px 0 #ffffff22; text-align: left; }
.level-option > span:nth-child(2) { flex: 1; }
.level-option strong { display: block; font-family: var(--display); font-size: 22px; font-weight: 600; }
.level-option small { display: block; font-size: 13px; color: var(--text-2); margin-top: 3px; }
.level-option > svg { width: 22px; color: var(--gold); }
.level-dots { color: var(--gold); width: 40px; font-size: 12px; letter-spacing: 2px; text-shadow: 0 0 8px #ffd84a88; }
.level-dots i { font-style: normal; color: #ffffff30; text-shadow: none; }
.quiet-tip { margin: 22px 10px auto; color: var(--text-2); font-size: 14px; line-height: 1.55; text-align: center; text-wrap: pretty; }

/* Partida */
.game-screen { gap: 12px; padding-top: max(20px, env(safe-area-inset-top)); }
.game-title { text-align: center; }
.game-title h1 { font-size: 22px; font-weight: 600; }
.game-title > span { display: inline-block; margin-top: 4px; background: var(--accent); border-radius: 99px; padding: 1px 10px; color: var(--deep); font-size: 12px; font-weight: 800; }
.game-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-radius: 20px; background: var(--card-bg); border: 1.5px solid var(--border); box-shadow: var(--card-shadow); padding: 10px 0; flex-shrink: 0; }
.game-stats > div { display: flex; flex-direction: column; align-items: center; gap: 3px; border-right: 1.5px solid var(--border); }
.game-stats > div:last-child { border: 0; }
.game-stats span { font-size: 10.5px; font-weight: 800; letter-spacing: 1px; color: var(--text-3); }
.game-stats strong { font-family: var(--display); font-size: 28px; line-height: 1; font-weight: 600; font-variant-numeric: tabular-nums; text-shadow: 0 2px 0 var(--deep); }
/* Altura fixa: aviso que muda de tamanho empurra o tabuleiro e as cartas pulam. */
.game-notice { display: flex; align-items: center; justify-content: center; flex-shrink: 0; height: 40px; overflow: hidden; line-height: 1.2; font-size: 14px; font-weight: 600; color: var(--text-2); text-align: center; text-wrap: balance; border-radius: 99px; padding: 0 16px; background: #ffffff0f; }
.game-notice.emphasis { color: var(--on-gold); font-weight: 800; background: linear-gradient(180deg, #ffe680, var(--gold)); box-shadow: 0 3px 0 var(--gold-lip); }
.board { flex: 1; min-height: 0; position: relative; width: 100%; }
/* Combo de acertos: a visibilidade vem de .is-on (+ prazo em ui/combo.js), nunca da animação. */
.combo { --nivel: 2; position: absolute; left: 50%; top: 30%; z-index: 8; pointer-events: none; visibility: hidden; opacity: 0; transform: translate(-50%, -50%) scale(calc(.88 + var(--nivel) * .06)); font-family: var(--display); font-size: 46px; font-weight: 700; line-height: 1; color: var(--gold); text-shadow: 0 3px 0 var(--gold-lip), 0 0 calc(var(--nivel) * 5px) #ffd84acc; }
.combo.is-on { visibility: visible; opacity: 1; animation: combo-pop 260ms cubic-bezier(.3,1.5,.5,1); }
@keyframes combo-pop { from { transform: translate(-50%, -50%) scale(.4); } }
@media (prefers-reduced-motion: reduce) { .combo.is-on { animation: none; } }
.card { position: absolute; left: 0; top: 0; border: 0; padding: 0; background: transparent; border-radius: 12px; perspective: 700px; transition: transform 500ms cubic-bezier(.2,.7,.25,1); }
.card-inner { display: block; width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform 300ms cubic-bezier(.3,1.35,.5,1); border-radius: 12px; }
.card.is-open .card-inner { transform: rotateY(180deg); }
.card-back, .card-front { position: absolute; inset: 0; border-radius: 12px; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.card-back { background: var(--back-bg, var(--back-a, #5a64ff)); border: 2px solid var(--back-border, #ffffff40); box-shadow: 0 4px 0 #04063fb3; }
.card-back > svg { width: 100%; height: 100%; }
.back-frame { fill: none; stroke: var(--back-line, #aab2ff); stroke-opacity: .7; stroke-width: 1.6; }
.back-medal { fill: var(--back-medal, var(--back-a, #5a64ff)); stroke: var(--back-line, #aab2ff); stroke-width: 1.6; }
.back-d { fill: var(--back-d, #e3e6ff); fill-rule: evenodd; }
.card-front { background: #f5f7ff; transform: rotateY(180deg); border: 2px solid #ffffff; box-shadow: 0 4px 0 #04063fb3; }
.card-front > svg { width: 78%; height: 78%; }
.card.is-matched .card-front { background: #e6fbee; box-shadow: 0 4px 0 #04063fb3, 0 0 0 3px var(--green), 0 0 18px #36d97f88; animation: matched 450ms ease-out; }
.match-check { display: none; position: absolute; bottom: 4px; right: 4px; width: 17px; height: 17px; border-radius: 50%; background: var(--green); color: #fff; font-size: 10px; line-height: 17px; text-align: center; font-weight: 800; }
.is-matched .match-check { display: block; }
.is-miss .card-inner { animation: shake 350ms ease-in-out; }
.is-miss .card-front { background: #ffe8e8; box-shadow: 0 4px 0 #04063fb3, 0 0 0 3px var(--red); }
@keyframes matched { 50% { scale: 1.1; } }
@keyframes shake { 25% { translate: -4px 0; } 75% { translate: 4px 0; } }
.game-footer { display: flex; align-items: center; gap: 8px; flex-shrink: 0; height: 46px; font-size: 13px; font-weight: 600; line-height: 1.2; color: var(--text-2); }
#footer-tip { flex: 1; min-width: 0; }
.game-footer .help-button { white-space: nowrap; }
.game-footer .status-dot { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.game-footer .header-mark { margin-left: auto; }
.player-score { display: flex; align-items: center; justify-content: space-between; min-height: 50px; border-radius: 16px; padding: 8px 14px; color: var(--text-2); background: #ffffff0d; border: 1.5px solid var(--border); font-size: 14px; font-weight: 700; flex-shrink: 0; }
.player-score strong { font-family: var(--display); font-size: 26px; font-variant-numeric: tabular-nums; }
.player-score small { display: inline-block; margin-left: 9px; font-size: 12px; }
.player-score.active { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 80%, #fff), var(--accent)); border-color: transparent; color: var(--deep); box-shadow: 0 4px 0 color-mix(in srgb, var(--accent) 55%, #000), 0 0 22px color-mix(in srgb, var(--accent) 45%, transparent); }
.opponent { transform: rotate(180deg); }
.mode-duelo.game-screen { gap: 10px; }
.mode-relampago .game-stats { grid-template-columns: repeat(4, 1fr); }
.mode-relampago .game-stats strong { font-size: 24px; }
#stat4 { color: var(--pink); letter-spacing: -1px; }
.mode-duelo .game-stats { padding: 8px 0; }
.mode-duelo .game-stats strong { font-size: 22px; }
.pause-overlay { position: absolute; inset: 0; z-index: 10; background: #0a0e5cf2; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; }
.pause-overlay[hidden] { display: none; }
.pause-overlay .large-mode { margin: 0 0 14px; }
.pause-overlay h2 { font-size: 38px; font-weight: 700; text-shadow: 0 3px 0 var(--deep); }
.pause-overlay > p:not(.eyebrow) { font-size: 15px; color: var(--text-2); }
.pause-overlay .primary-button { width: min(340px, 100%); margin-top: 18px; }

/* Resultado */
.result-screen { align-items: stretch; text-align: center; }
.result-header { display: flex; align-items: center; justify-content: space-between; }
.result-art { position: relative; margin: auto auto 22px; width: 210px; height: 170px; display: grid; place-items: center; }
.result-art::before { content: ''; position: absolute; inset: 10%; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 50%, transparent), transparent 70%); filter: blur(6px); }
.result-symbol { position: relative; z-index: 1; width: 96px; height: 122px; display: grid; place-items: center; background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 70%, #fff), var(--accent)); color: var(--deep); border-radius: 20px; transform: rotate(7deg); box-shadow: 0 6px 0 color-mix(in srgb, var(--accent) 55%, #000), -14px 6px 0 -3px #5a64ff, inset 0 2px 0 #ffffff80; }
.result-symbol svg { width: 56px; }
.orbit { position: absolute; border: 2px dashed #ffffff26; border-radius: 50%; width: 170px; height: 170px; }
.orbit-two { width: 216px; height: 216px; border-style: dotted; border-color: #ffd84a40; }
.spark { position: absolute; font-style: normal; color: var(--gold); text-shadow: 0 0 12px var(--gold); font-weight: 800; }
.s1 { right: 6px; top: 20px; font-size: 30px; }
.s2 { left: 4px; bottom: 26px; font-size: 22px; color: var(--cyan); text-shadow: 0 0 12px var(--cyan); }
.s3 { bottom: 0; right: 32px; font-size: 24px; color: var(--pink); text-shadow: none; }
.result-screen > .eyebrow { font-size: 13px; font-weight: 800; color: var(--accent); }
.stars { font-size: 44px; letter-spacing: 6px; color: #ffffff1f; margin: 8px 0 0; line-height: 1.1; }
.stars .earned { color: var(--gold); text-shadow: 0 3px 0 var(--gold-lip), 0 0 18px #ffd84a99; }
.result-screen h1 { font-size: 36px; line-height: 1.05; font-weight: 700; margin-top: 8px; text-shadow: 0 3px 0 var(--deep); }
.result-message { font-size: 15px; color: var(--text-2); margin-top: 8px; }
.result-stats { display: flex; align-items: center; justify-content: center; gap: 28px; margin: 20px 0 0; padding: 14px 10px; border-radius: 20px; background: var(--card-bg); border: 1.5px solid var(--border); box-shadow: var(--card-shadow); }
.result-stats > div { display: flex; flex-direction: column; gap: 5px; min-width: 70px; }
.result-stats strong { font-family: var(--display); font-size: 36px; line-height: 1; font-weight: 600; font-variant-numeric: tabular-nums; text-shadow: 0 3px 0 var(--deep); }
.result-stats div > span { color: var(--text-3); font-size: 10.5px; font-weight: 800; letter-spacing: 1px; }
.stats-divider { height: 34px; width: 1.5px; background: var(--border); }
.record-message:empty { display: none; }
.record-message { margin: 14px 0 18px; color: var(--gold); font-weight: 800; font-size: 14px; }
.result-actions { display: flex; flex-direction: column; gap: 8px; }
.result-actions .primary-button { margin-bottom: 6px; }
.result-footer { margin: auto 0 0; padding-top: 14px; font-size: 12px; font-weight: 600; color: var(--text-3); }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 20; }

/* Mosaico */
.is-piece .card-front { border-width: 3px; }
.is-piece .card-front > svg { width: 100%; height: 100%; }
.is-piece.is-assembling { visibility: hidden; }
.mosaic-assembly { position: absolute; inset: 0; z-index: 3; pointer-events: none; background: #0a0e5ca6; border-radius: 12px; }
.mosaic-assembly > span { display: block; position: absolute; }
/* Cantos externos arredondados: as 4 peças fecham numa imagem com borda de figurinha, não num quadrado cru. */
.mosaic-assembly > span { overflow: hidden; }
.mosaic-assembly > span[data-q="0"] { border-top-left-radius: 14px; } .mosaic-assembly > span[data-q="1"] { border-top-right-radius: 14px; }
.mosaic-assembly > span[data-q="2"] { border-bottom-left-radius: 14px; } .mosaic-assembly > span[data-q="3"] { border-bottom-right-radius: 14px; }
/* Traço de nanquim: contorno fino e constante dá cara de ilustração de livro, em vez de vetor chapado. */
.scene-ink > * { stroke: #3b2c3d; stroke-width: 1.6; stroke-linejoin: round; stroke-opacity: .85; vector-effect: non-scaling-stroke; }
.mosaic-assembly svg { display: block; width: 100%; height: 100%; }
.mosaic-gallery { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin: auto 0 16px; }
.mosaic-gallery figure { margin: 0; width: min(calc((100% - 28px) / 3), 96px); min-width: 0; }
.mosaic-gallery svg { display: block; width: 100%; aspect-ratio: 1; border-radius: 14px; border: 2px solid #fff; box-shadow: 0 5px 0 var(--deep); }
.mosaic-gallery figure:nth-child(odd) { rotate: -3deg; }
.mosaic-gallery figure:nth-child(even) { rotate: 3deg; }
.mosaic-gallery figcaption { font-size: 12px; font-weight: 700; color: var(--text-2); margin-top: 8px; }
.mode-mosaico.result-screen .stars { margin-top: 6px; font-size: 34px; line-height: 1; }
.mode-mosaico.result-screen .result-stats { margin-top: 14px; padding: 10px; }
.mode-mosaico.result-screen .record-message { margin: 12px 0 14px; }

@media (max-height: 740px) {
  .screen { padding-top: max(14px, env(safe-area-inset-top)); padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .menu-top { margin-bottom: 14px; }
  .mode-art { height: 76px; --mcw: 24px; }
  .mode-desafio .mode-art { height: 96px; --mcw: 32px; }
  .mode-body { padding: 10px 11px 12px; gap: 8px; }
  .mode-copy strong { font-size: 17px; }
  .mode-rule { font-size: 12.5px; }
  .mode-copy small { font-size: 11px; }
  .mode-grid { gap: 12px; }
  .game-screen { gap: 9px; }
  .game-stats { padding: 7px 0; }
  .game-stats strong { font-size: 24px; }
  .result-art { height: 115px; width: 170px; margin-bottom: 16px; }
  .result-symbol { width: 70px; height: 90px; }
  .result-symbol svg { width: 40px; }
  .orbit { width: 120px; height: 120px; }
  .orbit-two { width: 150px; height: 150px; }
  .result-stats { margin-top: 12px; padding: 10px; }
  .result-stats strong { font-size: 30px; }
  .stars { margin: 4px 0 0; font-size: 34px; }
  .result-screen h1 { font-size: 30px; }
  .record-message { margin: 10px 0 12px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }

/* Ranking */
.ranking-screen { gap: 14px; min-height: 0; }
.ranking-screen > :not(.ranking-list) { flex-shrink: 0; }
.ranking-title { display: flex; gap: 14px; align-items: center; margin-top: 8px; }
.ranking-title > span { width: 60px; height: 60px; display: grid; place-items: center; border-radius: 18px; background: linear-gradient(160deg, #ffe680, var(--gold)); color: var(--on-gold); box-shadow: 0 5px 0 var(--gold-lip), 0 0 26px #ffd84a55, inset 0 2px 0 #ffffff80; rotate: -5deg; flex-shrink: 0; }
.ranking-title svg { width: 32px; height: 32px; }
.ranking-title h1 { font-size: 38px; line-height: 1; font-weight: 700; text-shadow: 0 3px 0 var(--deep); }
.ranking-title p, .ranking-description { color: var(--text-2); font-size: 14px; line-height: 1.45; }
.ranking-identity { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 16px; background: var(--surface-3); border: 1.5px solid var(--border-hi); box-shadow: var(--lip); text-align: left; }
.ranking-identity > span { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.ranking-identity small { display: flex; gap: 6px; align-items: center; color: var(--cyan); font-size: 12px; font-weight: 700; flex-shrink: 0; }
.ranking-identity svg { width: 14px; height: 14px; }
.ranking-modes { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory; padding: 2px 0 6px; }
.ranking-modes::-webkit-scrollbar { display: none; }
.ranking-modes button { flex-shrink: 0; scroll-snap-align: center; white-space: nowrap; padding: 8px 15px; border-radius: 99px; background: var(--surface-3); border: 1.5px solid var(--border-hi); box-shadow: 0 3px 0 var(--deep); color: var(--text-2); font-size: 14px; font-weight: 700; }
.ranking-modes [aria-pressed="true"] { --lip-c: var(--gold-lip); background: linear-gradient(180deg, #ffe680, var(--gold)); border-color: transparent; color: var(--on-gold); box-shadow: 0 3px 0 var(--gold-lip); }
.nickname-sheet label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text-2); }
.nickname-sheet input { min-width: 0; width: 100%; background: var(--well); color: var(--text); border: 1.5px solid var(--border-hi); border-radius: 14px; padding: 12px 10px; font: inherit; font-size: 16px; }
.ranking-period { display: flex; gap: 8px; }
.ranking-period button { border-radius: 99px; padding: 6px 14px; font-size: 13px; font-weight: 700; background: transparent; border: 1.5px solid var(--border-hi); color: var(--text-2); }
.ranking-period [aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 3px 0 var(--blue-lip); }
.ranking-columns { display: flex; justify-content: space-between; color: var(--text-3); font-size: 10.5px; font-weight: 800; letter-spacing: 1px; padding: 0 12px; }
.ranking-list { overflow-y: auto; flex: 1; min-height: 0; border-radius: 20px; background: var(--card-bg); border: 1.5px solid var(--border); padding: 4px 6px; }
.ranking-row { display: flex; align-items: center; gap: 12px; padding: 11px 8px; border-bottom: 1.5px solid #ffffff12; }
.ranking-row:last-child { border-bottom: 0; }
.ranking-position { color: var(--text-2); font-family: var(--display); font-weight: 600; width: 30px; flex-shrink: 0; font-size: 19px; font-variant-numeric: tabular-nums; }
.ranking-row:nth-child(1) .ranking-position { color: var(--gold); text-shadow: 0 0 10px #ffd84a88; }
.ranking-row:nth-child(2) .ranking-position { color: #dfe4ff; }
.ranking-row:nth-child(3) .ranking-position { color: #ffb37a; }
.ranking-name { font-size: 15px; font-weight: 700; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ranking-name small { display: block; color: var(--text-3); font-size: 11px; font-weight: 600; margin-top: 2px; }
.ranking-score { display: flex; gap: 14px; align-items: center; font-variant-numeric: tabular-nums; }
.ranking-score strong { font-family: var(--display); font-size: 18px; font-weight: 600; }
.ranking-score small { color: var(--text-3); font-size: 13px; }
.ranking-row.is-you { background: #ffd84a1f; border: 1.5px solid #ffd84a99; border-radius: 14px; margin: 4px 0; }
.ranking-state { color: var(--text-2); text-align: center; font-size: 15px; padding: 40px 15px; line-height: 1.6; }
.ranking-footer { font-size: 12px; text-align: center; color: var(--text-3); }
.ranking-result { font-size: 14px; font-weight: 800; color: var(--cyan); line-height: 1.5; margin: -8px 0 12px; }
.ranking-result:empty { display: none; }
.result-screen:has(#ranking-open) .result-art { height: 132px; margin-bottom: 14px; }
.result-screen:has(#ranking-open) .orbit { width: 132px; height: 132px; }
.result-screen:has(#ranking-open) .orbit-two { width: 166px; height: 166px; }
.result-screen:has(#ranking-open) .mosaic-gallery figure { max-width: 72px; }
.result-screen:has(#ranking-open) .result-stats { margin-top: 12px; padding: 10px; }
.result-screen:has(#ranking-open) .record-message { margin: 10px 0 12px; }
.result-actions:has(#ranking-open) .text-button { padding: 8px 12px; }

/* Folha que sobe de baixo (apelido, compra) */
.nickname-overlay { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; background: #04063fb3; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); padding-top: env(safe-area-inset-top); }
.nickname-sheet { width: min(500px, 100%); max-height: 100%; overflow-y: auto; padding: 12px 22px max(20px, env(safe-area-inset-bottom)); background: linear-gradient(180deg, #1e27c6, #10168a 40%); border: 1.5px solid var(--border-hi); border-bottom: 0; border-radius: 28px 28px 0 0; box-shadow: 0 -12px 40px #04063f99; }
.sheet-handle { display: block; height: 5px; width: 44px; background: #ffffff40; border-radius: 4px; margin: 0 auto 20px; }
.nickname-sheet h2 { font-size: 28px; line-height: 1.1; font-weight: 700; margin: 8px 0; }
.nickname-sheet > p:not(.eyebrow) { color: var(--text-2); font-size: 15px; line-height: 1.55; }
.nickname-sheet form { margin-top: 18px; }
.nickname-sheet input { margin-top: 8px; font-size: 17px; padding: 14px; }
.nickname-sheet input:focus { outline: 3px solid var(--gold); outline-offset: 1px; }
#nickname-error { color: var(--red); font-weight: 700; min-height: 32px; font-size: 13px; padding: 6px 0; }
.nickname-sheet .primary-button, .nickname-sheet > .text-button { width: 100%; }

.bonus-dias { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 16px 0; }
.bonus-dia { display: grid; justify-items: center; gap: 3px; padding: 8px 4px; border-radius: 14px; background: #ffffff12; border: 1.5px solid var(--border); font-weight: 700; }
.bonus-dia small { font-size: 11px; color: var(--text-2); }
.bonus-dia:last-child { grid-column: span 2; background: linear-gradient(180deg, #ffe68033, #ffc83d22); border-color: var(--gold); }
.bonus-dia.is-pego { opacity: .55; }
.bonus-dia.is-hoje { opacity: 1; border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.bonus-proximo { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: var(--well); margin-bottom: 14px; font-size: 14px; }
.bonus-proximo .shop-preview { width: 34px; height: 45px; }
/* `.bonus-sheet > p.x` (0,2,1) vem depois e ganha de `.nickname-sheet > p:not(.eyebrow)` (0,2,1). */
.bonus-sheet > p.bonus-resultado { color: var(--gold); font-size: 20px; }
.bonus-sheet > p.bonus-aviso { color: var(--cyan); font-weight: 700; }
.bonus-sheet > p.bonus-motivo { color: var(--red); font-weight: 700; font-size: 13px; }
.bonus-motivo:empty { display: none; }
.bonus-sheet .secondary-button { width: 100%; margin-top: 10px; }
#bonus-abrir { position: relative; }
#bonus-abrir svg { width: 22px; height: 22px; color: var(--gold); }
#bonus-abrir.has-dot::after { content: ''; position: absolute; top: 6px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--surface-3); }

.conta-screen { gap: 30px; overflow-y: auto; }
.conta-card, .conta-form, .conta-convite { display: grid; gap: 14px; }
.conta-card, .conta-convite { padding: 22px; border: 1.5px solid var(--border); border-radius: 24px; background: var(--card-bg); box-shadow: var(--card-shadow); }
.conta-card { margin: auto 0; }
.conta-card h1 { font-size: 30px; line-height: 1.1; overflow-wrap: anywhere; }
.conta-form label { display: grid; gap: 6px; color: var(--text-2); font-weight: 700; }
.conta-form input { width: 100%; min-width: 0; padding: 12px; border: 1.5px solid var(--border-hi); border-radius: 14px; background: var(--well); color: var(--text); font: inherit; font-size: 17px; }
.conta-form input:focus { outline: 3px solid var(--gold); outline-offset: 1px; }
.conta-dica, .conta-mensagem { font-size: 14px; line-height: 1.35; color: var(--text-2); }
.conta-mensagem, .conta-perigo { color: var(--red); }
.conta-mensagem.ok { color: var(--green); }
.conta-mensagem:empty, .menu-notice:empty { display: none; }
.conta-destaque { color: var(--gold); font-weight: 700; }
.codigo-valor { display: block; padding: 14px 8px; border-radius: 14px; background: var(--well); color: var(--gold); text-align: center; font: 700 clamp(20px, 7vw, 32px) var(--display); user-select: all; }
.excluir-sheet > p + p { margin-top: 10px; }
.excluir-sheet .primary-button { margin-top: 18px; --lip-c: #91253f; background: #b63251; box-shadow: 0 5px 0 var(--lip-c); }
.menu-notice { margin-bottom: 12px; color: var(--cyan); font-weight: 700; }

/* Versos (costas da carta) e temas (cor do fundo): só trocam variáveis. */
[data-verso="padrao"] { --back-a: #5a64ff; --back-b: #3039d6; --back-line: #aab2ff; --back-d: #e3e6ff; --back-border: #8a93ff; --back-bg: repeating-linear-gradient(45deg, #ffffff1f 0 1.5px, transparent 1.5px 8px), repeating-linear-gradient(-45deg, #ffffff1f 0 1.5px, transparent 1.5px 8px), #4f59ec }
[data-verso="aurora"] { --back-a: #ff6fa8; --back-b: #b8336f; --back-line: #ffc2da; --back-d: #fff0f6; --back-border: #ffa3c6; --back-bg: repeating-conic-gradient(from 0deg at 50% 50%, #ffffff24 0 7deg, transparent 7deg 14deg), radial-gradient(circle at 50% 50%, #ff8fbc, #c43f7a) }
[data-verso="menta"] { --back-a: #2fd8a0; --back-b: #11866a; --back-line: #b8ffe6; --back-d: #effff9; --back-border: #8cf0cc; --back-bg: radial-gradient(#ffffff38 26%, transparent 28%) 0 0 / 12px 12px, radial-gradient(#ffffff38 26%, transparent 28%) 6px 6px / 12px 12px, #1fb487 }
[data-verso="brasa"] { --back-a: #ff7a45; --back-b: #c1381b; --back-line: #ffd0b8; --back-d: #fff1e8; --back-border: #ffab88; --back-bg: linear-gradient(135deg, #ffffff2e 25%, transparent 25%) -7px 0 / 14px 14px, linear-gradient(225deg, #ffffff2e 25%, transparent 25%) -7px 0 / 14px 14px, linear-gradient(315deg, #ffffff2e 25%, transparent 25%) 0 0 / 14px 14px, linear-gradient(45deg, #ffffff2e 25%, transparent 25%) 0 0 / 14px 14px, #d9502a }
[data-verso="oceano"] { --back-a: #2fa4ff; --back-b: #1559c9; --back-line: #b9e2ff; --back-d: #eef8ff; --back-border: #86c8ff; --back-bg: radial-gradient(circle at 50% 0, transparent 6px, #ffffff3d 6.5px 8px, transparent 8.5px) 0 0 / 16px 9px, radial-gradient(circle at 50% 0, transparent 6px, #ffffff3d 6.5px 8px, transparent 8.5px) 8px 4.5px / 16px 9px, #1d74dd }
[data-verso="ouro"] { --back-a: #ffe372; --back-b: #e0a412; --back-line: #fff6c8; --back-d: #6b4700; --back-border: #fff0a8; --back-bg: repeating-radial-gradient(circle at 50% 100%, #fff6c85e 0 1.2px, transparent 1.2px 3.6px) 0 0 / 18px 11px, #e8b21f }
[data-verso="neon"] { --back-a: #1d1240; --back-b: #0b0720; --back-line: #ff4fd8; --back-d: #7cf7ff; --back-border: #ff4fd8aa; --back-bg: linear-gradient(#ff4fd84d 1px, transparent 1px) 0 0 / 11px 11px, linear-gradient(90deg, #ff4fd84d 1px, transparent 1px) 0 0 / 11px 11px, #170d36 }
[data-verso="arcoiris"] { --back-a: #6a3df0; --back-b: #f0506e; --back-line: #ffd478; --back-d: #fff4e8; --back-border: #ffd478aa; --back-bg: repeating-linear-gradient(135deg, #f0506e 0 9px, #ff9a3c 9px 18px, #ffd478 18px 27px, #2fd8a0 27px 36px, #2fa4ff 36px 45px, #6a3df0 45px 54px) }
[data-verso="cristal"] { --back-a: #b8ecff; --back-b: #5ab4e0; --back-line: #ffffff; --back-d: #0d3b66; --back-border: #e8f8ff; --back-bg: conic-gradient(from 30deg at 50% 50%, #ffffff66 0 60deg, transparent 60deg 120deg, #ffffff2a 120deg 180deg, transparent 180deg 240deg, #ffffff44 240deg 300deg, transparent 300deg) 0 0 / 18px 31px, #7cc6ea }
[data-verso="fogo"] { --back-medal: #b81d14; --back-a: #ffd23f; --back-b: #e3261b; --back-line: #fff3b0; --back-d: #fff8e1; --back-border: #ffb347; --back-bg: radial-gradient(ellipse 50% 100% at 50% 100%, #ffd23f 0 60%, transparent 62%) 0 100% / 12px 34px repeat-x, radial-gradient(ellipse 50% 100% at 50% 100%, #ff8a2a 0 60%, transparent 62%) 6px 100% / 12px 58px repeat-x, radial-gradient(ellipse 50% 100% at 50% 100%, #f0561f 0 60%, transparent 62%) 3px 100% / 16px 86px repeat-x, linear-gradient(#7d0f10, #c2241a) }
[data-verso="diamante"] { --back-a: #f5fbff; --back-b: #a58cff; --back-line: #ffffff; --back-d: #3b2a7a; --back-border: #ffffff; --back-bg: conic-gradient(from 45deg at 50% 50%, #ffffff70 0 90deg, transparent 90deg 180deg, #ffffff70 180deg 270deg, transparent 270deg) 0 0 / 14px 18px, #b6a2ff }
[data-tema="padrao"] { --bg: #0a0e5c; --bg-top: #141c9e; }
[data-tema="mar"] { --bg: #06324a; --bg-top: #0b7290; }
[data-tema="mata"] { --bg: #073d27; --bg-top: #138a55; }
[data-tema="vinho"] { --bg: #3e0822; --bg-top: #9a1850; }
[data-tema="ceu"] { --bg: #143d8f; --bg-top: #2f86f0; }
[data-tema="galaxia"] { --bg: #1b0b47; --bg-top: #5a22b8; }
[data-tema="sol"] { --bg: #6b1f05; --bg-top: #e0561a; }
[data-tema="boreal"] { --bg: #1d0b45; --bg-top: #13a88a; }

/* Moedas, ajudas com vídeo */
.coin { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3b0, var(--gold) 55%, #e6a910); color: #8a5a00; box-shadow: 0 2px 0 var(--gold-lip); font-family: var(--display); font-size: 11px; font-weight: 700; flex-shrink: 0; }
.coin-chip { display: flex; align-items: center; gap: 7px; height: 44px; padding: 0 14px 0 10px; border-radius: 99px; background: var(--surface-3); border: 1.5px solid var(--border-hi); box-shadow: var(--lip); font-family: var(--display); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.screen-header > .coin-balance { display: flex; align-items: center; gap: 7px; font-family: var(--display); font-size: 20px; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.video-mark { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 6px; font-size: 8px; flex-shrink: 0; }
.help-button { --lip-c: var(--gold-lip); display: inline-flex; align-items: center; gap: 7px; margin-left: auto; padding: 7px 13px; border-radius: 99px; color: var(--on-gold); background: linear-gradient(180deg, #ffe680, var(--gold)); font-size: 14px; font-weight: 800; box-shadow: 0 4px 0 var(--gold-lip); }
.help-button .video-mark, .streak-recover .video-mark { background: var(--on-gold); color: var(--gold); }
.help-button:disabled { opacity: .45; }
.coin-row { display: flex; align-items: center; justify-content: center; gap: 8px; margin: -8px 0 14px; font-size: 16px; font-weight: 700; color: var(--text); min-height: 34px; }
.coin-row .help-button { margin-left: 6px; }
#coins-earned { display: inline-block; text-align: end; }
.streak-recover { --lip-c: var(--gold-lip); display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; margin-bottom: 14px; padding: 11px 14px; border-radius: 18px; background: linear-gradient(180deg, #ffe680, var(--gold)); box-shadow: 0 5px 0 var(--gold-lip); font-size: 13px; font-weight: 700; color: var(--on-gold); }
.streak-recover span { display: flex; align-items: center; gap: 6px; }
.streak-recover span svg { width: 15px; height: 15px; }
.streak-recover strong { display: flex; align-items: center; gap: 6px; }
.missoes { margin: 0 0 12px; padding: 12px 14px; border-radius: 22px; background: var(--card-bg); border: 1px solid var(--border); box-shadow: var(--card-shadow); }
.missoes-topo { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.missoes-topo strong { font-family: var(--display); }
.missoes-topo span { color: var(--gold); font-size: 13px; }
.missoes ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.missao { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--text-2); }
.missao span { min-width: 0; }
.missao b { white-space: nowrap; color: var(--text); }
.missao.is-feita { color: var(--text-3); }
.missao.is-feita b { color: var(--green); }

/* Loja */
.shop-screen { gap: 14px; }
.shop-screen .screen-header { flex-shrink: 0; }
.shop-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; margin: 0 -4px; padding: 4px 4px 12px; scrollbar-width: none; }
.shop-scroll::-webkit-scrollbar { display: none; }
.shop-scroll .section-label { margin-bottom: 12px; }
.shop-free { border-radius: 22px; padding: 12px; background: var(--card-bg); border: 1.5px solid var(--border); box-shadow: var(--card-shadow); }
.shop-free .section-label { margin: 0 0 10px; font-size: 17px; }
.free-actions { display: grid; grid-template-columns: 1fr; gap: 10px; }
.free-actions button { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 10px 9px; border-radius: 16px; background: var(--surface-3); border: 1.5px solid var(--border-hi); box-shadow: var(--lip); text-align: left; }
.free-actions button > span:not(.video-mark) { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.free-actions svg { width: 24px; height: 24px; color: var(--gold); }
.free-actions strong { font-size: 13.5px; white-space: nowrap; }
.free-actions small { font-size: 12px; color: var(--text-2); }
.free-actions .video-mark { width: 26px; height: 26px; color: var(--on-gold); background: var(--gold); }
.free-actions button:disabled { opacity: .45; box-shadow: none; transform: translateY(4px); }
.shop-note { font-size: 13px; color: var(--text-2); line-height: 1.5; margin: 12px 0 18px; min-height: 18px; }
.shop-offers { display: flex; flex-direction: column; gap: 18px; margin-bottom: 26px; }
.offer-card { position: relative; isolation: isolate; display: flex; flex-direction: column; gap: 12px; width: 100%; min-width: 0; overflow: hidden; padding: 14px; border-radius: 24px; text-align: left; scroll-margin: 16px; color: #fff; border: 1.5px solid #ffffff40; box-shadow: 0 6px 0 var(--deep), 0 14px 28px #04063f80, inset 0 2px 0 #ffffff40; }
.offer-welcome { background: linear-gradient(160deg, #ffe680, #ffb21e); color: var(--on-gold); }
.offer-welcome::before { content: ''; position: absolute; z-index: -1; inset: -50%; background: conic-gradient(from 0deg, transparent 0 20deg, #ffffff30 20deg 35deg, transparent 35deg 70deg, #ffffff30 70deg 85deg, transparent 85deg 120deg, #ffffff30 120deg 135deg, transparent 135deg 180deg, #ffffff30 180deg 195deg, transparent 195deg 240deg, #ffffff30 240deg 255deg, transparent 255deg 300deg, #ffffff30 300deg 315deg, transparent 315deg); animation: raios 18s linear infinite; pointer-events: none; }
@keyframes raios { to { rotate: 360deg; } }
.offer-plus { background: linear-gradient(160deg, #9b7bff, #5a2fd6); }
.offer-top, .offer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.offer-seal { align-self: flex-start; margin: -14px 0 0 -14px; padding: 6px 14px; border-radius: 0 0 16px 0; background: var(--deep); color: var(--gold); font-size: 11px; font-weight: 800; letter-spacing: .5px; }
.offer-plus .offer-seal { background: var(--deep); color: #d9ccff; }
.offer-countdown { font-size: 12px; font-weight: 800; white-space: nowrap; }
.offer-title { font-family: var(--display); font-size: 26px; font-weight: 700; line-height: 1.05; }
.offer-rewards { display: flex; justify-content: space-around; align-items: center; gap: 6px; }
.offer-loot { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.offer-loot small { font-size: 12px; font-weight: 800; white-space: nowrap; }
.loot-plus { font-family: var(--display); font-size: 22px; font-weight: 700; }
.offer-discount { display: flex; align-items: center; gap: 7px; }
.offer-discount del { opacity: .7; font-size: 13px; font-weight: 600; white-space: nowrap; }
.bonus-chip { display: inline-block; border-radius: 99px; padding: 2px 8px; background: var(--pink); color: #fff; font-size: 12px; font-weight: 800; white-space: nowrap; box-shadow: 0 2px 0 #b8336f; }
.product-price { --lip-c: var(--green-lip); display: inline-flex; justify-content: center; align-items: center; flex-shrink: 0; padding: 10px 16px; border-radius: 99px; background: linear-gradient(180deg, #4ff09a, var(--green)); color: #fff; font-family: var(--display); font-size: 18px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; box-shadow: 0 4px 0 var(--green-lip), inset 0 2px 0 #ffffff55; text-shadow: 0 1px 0 #00000033; }
.plus-wordmark { font-family: var(--display); font-size: 14px; font-weight: 700; letter-spacing: 1px; }
.plus-content { display: flex; align-items: center; gap: 8px; }
.offer-benefits { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; line-height: 1.35; }
.offer-benefits > span { display: flex; align-items: baseline; gap: 7px; }
.benefit-check { color: var(--gold); font-weight: 800; }
.plus-previews { display: flex; align-items: center; gap: 6px; }
.plus-previews .shop-preview { width: 38px; height: 50px; }
.offer-bottom > small { max-width: 150px; font-size: 12px; font-weight: 600; opacity: .85; line-height: 1.4; }
.plus-owned { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 22px; background: linear-gradient(160deg, #9b7bff, #5a2fd6); box-shadow: 0 5px 0 var(--deep); }
.plus-owned strong { font-family: var(--display); font-size: 19px; font-weight: 600; }
.plus-owned span { font-size: 13px; color: #e6defe; }
.coin-packs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 22px 0 26px; }
.coin-pack { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; gap: 4px; padding: 20px 6px 10px; border-radius: 20px; background: var(--card-bg); border: 1.5px solid var(--border); box-shadow: var(--card-shadow); scroll-margin: 16px; }
.pack-seal { position: absolute; top: -11px; left: 6px; right: 6px; padding: 3px 1px; border-radius: 99px; background: linear-gradient(180deg, #ffe680, var(--gold)); color: var(--on-gold); font-size: 10px; font-weight: 800; text-align: center; white-space: nowrap; box-shadow: 0 2px 0 var(--gold-lip); }
.coin-pack[data-product="bau"] .pack-seal { background: var(--pink); color: #fff; box-shadow: 0 2px 0 #b8336f; }
.pack-name { font-size: 13px; color: var(--text-2); font-weight: 700; }
.coin-stack { display: flex; align-items: center; justify-content: center; height: 56px; padding-left: 18px; filter: drop-shadow(0 0 12px #ffd84a55); }
.coin-stack .coin { width: 38px; height: 38px; margin-left: -18px; font-size: 20px; box-shadow: 0 3px 0 var(--gold-lip); }
.coin-stack .coin:nth-child(2) { transform: translateY(-5px); }
.coin-stack .coin:nth-child(3) { transform: translateY(4px); }
.coin-stack .coin:not(:last-child) { color: transparent; }
.pack-quantity { font-family: var(--display); font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.coin-pack > small { font-size: 12px; color: var(--text-3); font-weight: 600; }
.pack-bonus { height: 24px; }
.coin-pack .product-price { width: 100%; padding: 8px 2px; font-size: 15px; }
.shop-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 24px; }
.shop-item { display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; padding: 12px 5px; border-radius: 20px; background: var(--card-bg); border: 1.5px solid var(--border); box-shadow: var(--card-shadow); font-size: 13px; font-weight: 700; text-align: center; }
.shop-item.is-active { border-color: var(--green); box-shadow: var(--card-shadow), 0 0 0 1px var(--green), 0 0 18px #36d97f44; }
.shop-item.is-exclusive { background: #ffffff0a; border-style: dashed; box-shadow: none; }
.shop-item > strong { line-height: 1.3; }
.shop-preview { position: relative; display: block; width: 46px; height: 61px; flex-shrink: 0; }
.verso-preview .card-back { border-radius: 8px; box-shadow: 0 3px 0 #04063fb3; }
.tema-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 7px; border-radius: 10px; background: linear-gradient(180deg, var(--bg-top), var(--bg)); border: 1.5px solid #ffffff40; box-shadow: 0 3px 0 #04063fb3; }
.tema-preview i { border-radius: 3px; background: #ffffff33; }
.tema-preview i:first-child { grid-row: span 2; background: var(--gold); }
.shop-action { --lip-c: var(--gold-lip); display: flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 99px; background: linear-gradient(180deg, #ffe680, var(--gold)); color: var(--on-gold); font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; margin-top: auto; box-shadow: 0 3px 0 var(--gold-lip); }
.shop-action .coin { width: 15px; height: 15px; font-size: 8px; box-shadow: none; }
.shop-tag { font-size: 12px; font-weight: 800; color: var(--green); padding: 6px 0; margin-top: auto; }
.exclusive-tag { display: inline-flex; align-items: center; gap: 3px; color: var(--gold); font-size: 10px; font-weight: 800; white-space: nowrap; }
.exclusive-tag svg { width: 12px; height: 12px; }
.shop-footnote { font-size: 12px; color: var(--text-3); text-align: center; margin-top: 18px; line-height: 1.5; }
.privacy-link { display: block; text-decoration: none; }
.purchase-overlay .nickname-sheet { max-height: 100dvh; overflow-y: auto; }
.purchase-contents { padding-left: 20px; margin: 12px 0; color: var(--text); font-size: 15px; line-height: 1.6; }
.purchase-contents li::marker { color: var(--gold); }
.sheet-warning { font-size: 13px !important; color: var(--on-gold) !important; font-weight: 700; background: linear-gradient(180deg, #ffe680, var(--gold)); border-radius: 14px; padding: 10px 12px; margin: 10px 0 14px; }
.purchase-overlay h2 { font-size: 28px; margin: 6px 0 8px; }

/* Anúncio simulado (navegador) */
.ad-overlay { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; padding: max(18px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom)); background: linear-gradient(180deg, var(--bg-top), var(--bg)); }
.ad-top { display: flex; align-items: center; justify-content: space-between; }
.ad-label { font-size: 12px; font-weight: 800; color: var(--text-2); letter-spacing: .5px; }
.ad-count { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--gold); color: var(--on-gold); font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; box-shadow: 0 3px 0 var(--gold-lip); }
.ad-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; margin: 18px 0; border: 2px dashed var(--border-hi); border-radius: 26px; text-align: center; padding: 24px; background: radial-gradient(70% 50% at 50% 30%, #3b46ff55, transparent 70%), #ffffff08; }
.ad-body h2 { font-size: 32px; font-weight: 700; }
.ad-body > p:last-child { font-size: 15px; color: var(--text-2); max-width: 260px; line-height: 1.5; }
.ad-logo { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 22px; background: linear-gradient(160deg, #ffe680, var(--gold)); color: var(--on-gold); box-shadow: 0 5px 0 var(--gold-lip), 0 0 30px #ffd84a55; }
.ad-logo svg { width: 36px; }
.ad-warning { text-align: center; font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 12px; line-height: 1.5; }
.ad-actions { display: flex; flex-direction: column; gap: 8px; }
.ad-actions .primary-button:disabled { background: #ffffff1a; color: var(--text-3); box-shadow: none; text-shadow: none; transform: translateY(4px); }
.life-offer .primary-button { gap: 10px; }
.life-offer .video-mark { background: #fff; color: var(--green-lip); }

/* Passe mensal e Sequência */
.mode-sequencia { --accent: #2ee6d6; }
.month-mode { position: relative; display: grid; grid-template-columns: 96px 1fr auto; align-items: stretch; flex-shrink: 0; width: 100%; padding: 0; margin: 14px 0 18px; text-align: left; border-radius: 22px; overflow: hidden; color: var(--text); background: linear-gradient(120deg, #0f8f9a, #12379c 70%); border: 1.5px solid #2ee6d6aa; box-shadow: var(--card-shadow), 0 0 26px #2ee6d633; }
.month-mode .mode-art { height: auto; border-bottom: 0; border-right: 1.5px solid #2ee6d655; background: radial-gradient(90% 90% at 50% 50%, #2ee6d655, transparent 75%), #04063f55; }
.month-copy, .month-status { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.month-copy { padding: 11px 6px 11px 12px; justify-content: center; }
.month-copy .eyebrow { font-size: 11px; font-weight: 800; color: var(--cyan); }
.month-title { display: flex; align-items: center; gap: 6px; }
.month-title svg { display: none; }
.month-title strong { font-family: var(--display); font-size: 22px; font-weight: 600; }
.month-copy .mode-rule { white-space: normal; color: #d8fffb; font-size: 12.5px; }
.month-status { align-items: flex-end; justify-content: center; padding: 10px 12px 10px 0; max-width: 130px; text-align: right; }
.month-status small { font-size: 11px; line-height: 1.35; color: #d8fffb; font-weight: 600; }
.month-status .month-pitch { display: block; margin-top: 6px; font-size: 11px; line-height: 1.35; color: #d8fffb; font-weight: 600; }
.month-status .exclusive-tag { font-size: 12px; gap: 5px; padding: 7px 11px 6px; border-radius: 99px; background: linear-gradient(180deg, #ffe680, var(--gold)); color: var(--on-gold); box-shadow: 0 3px 0 var(--gold-lip); }
.month-status .exclusive-tag svg { width: 14px; height: 14px; }
.passe-daily { font-size: 11px; font-weight: 800; line-height: 1.4; color: var(--on-gold); background: var(--gold); border-radius: 99px; padding: 3px 8px; }
.menu-screen:has(.month-mode) .menu-top { margin-bottom: 16px; }
.offer-passe { background: linear-gradient(160deg, #22d3c5, #0f6f9a); }
.offer-passe .offer-seal { background: var(--deep); color: var(--cyan); }
.offer-passe .plus-wordmark { color: #fff; }
.offer-passe .product-price { font-size: 16px; padding: 10px 12px; }
.passe-previews { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.passe-previews .shop-preview { width: 38px; height: 50px; }
.passe-mode { display: flex; flex-direction: column; align-items: center; gap: 3px; color: #fff; padding: 7px; border-radius: 14px; background: #04063f55; border: 1.5px solid #ffffff40; }
.passe-mode svg { width: 24px; height: 24px; }
.passe-mode small { font-size: 11px; font-weight: 800; }
.passe-owned { background: linear-gradient(160deg, #22d3c5, #0f6f9a); }
.passe-owned strong { color: #fff; }
[data-verso="constelacao"] { --back-a: #1b2d55; --back-b: #0a1024; --back-line: #ffd84a; --back-d: #ffd84a; --back-border: #ffd84a88; --back-bg: radial-gradient(1.6px 1.6px at 5px 6px, #ffd84a 99%, transparent) 0 0 / 26px 26px, radial-gradient(1px 1px at 17px 19px, #ffffff 99%, transparent) 0 0 / 26px 26px, radial-gradient(1.3px 1.3px at 9px 27px, #ffd84a 99%, transparent) 0 0 / 41px 41px, radial-gradient(.9px .9px at 30px 8px, #ffffffcc 99%, transparent) 0 0 / 41px 41px, radial-gradient(.8px .8px at 21px 34px, #ffffffaa 99%, transparent) 0 0 / 41px 41px, radial-gradient(1.1px 1.1px at 12px 40px, #ffffffdd 99%, transparent) 0 0 / 53px 53px, radial-gradient(circle at 30% 20%, #1f3570, #0c1530) }
.card .card-front { transition: box-shadow 120ms, background-color 120ms; }
.card.is-lit { scale: 1.07; }
.mode-sequencia .card { transition: scale 120ms; }
.card.is-lit .card-front { background: #fff6c2; box-shadow: 0 0 0 4px var(--gold), 0 0 30px var(--gold); }
.card.is-expected .card-front { background: #e6fbee; animation: expected-pulse 650ms ease-in-out infinite alternate; }
@keyframes expected-pulse { from { box-shadow: 0 0 0 0 var(--green); } to { box-shadow: 0 0 0 5px var(--green), 0 0 20px var(--green); } }
@media (max-width: 380px) {
  .month-mode { grid-template-columns: 80px 1fr auto; }
  .month-copy .eyebrow { font-size: 10px; }
  .month-copy .mode-rule { font-size: 12px; }
  .month-status small { font-size: 10px; }
  .passe-daily { font-size: 10px; }
  .offer-passe .offer-bottom { gap: 6px; }
  .offer-passe .product-price { font-size: 14px; }
}
@media (max-height: 740px) {
  .month-mode { margin-bottom: 12px; }
  .month-title strong { font-size: 19px; }
  .month-copy { gap: 1px; padding: 8px 6px 8px 10px; }
  .menu-screen:has(.month-mode) .section-label { margin-bottom: 9px; }
}

.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 16px; background: #fff; color: var(--deep); font-size: 15px; font-weight: 800; text-align: center; box-shadow: 0 4px 0 #b9c0ff, 0 12px 26px #04063f99; }
