/* Splash — bichinho virtual. Tudo abaixo do root; tokens do portal com fallback, nunca redefinidos. */
.jpm-game[data-game="splash"] {
  --splash-glass: rgba(255, 255, 255, .86);
  --splash-dark: rgba(23, 27, 52, .78);
  container-type: size;
  font-family: inherit;
  color: var(--ink, #172033);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  font-size: clamp(11px, 2.1cqw, 17px);
}
.jpm-game[data-game="splash"] .sp-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.jpm-game[data-game="splash"] button { font: inherit; color: inherit; cursor: pointer; }
.jpm-game[data-game="splash"] button:focus-visible { outline: 3px solid var(--primary, #6046FF); outline-offset: 2px; }

/* topo */
.jpm-game[data-game="splash"] .sp-top { position: absolute; left: 0; right: 0; top: 0; z-index: 3; display: flex; align-items: center; gap: 8px; padding: 1.6cqh 1.6cqw; pointer-events: none; }
.jpm-game[data-game="splash"] .sp-top > * { pointer-events: auto; }
.jpm-game[data-game="splash"] .sp-name { display: inline-flex; align-items: baseline; gap: .5em; max-width: 52cqw; padding: .45em .9em; border: 0; border-radius: var(--r-pill, 999px); background: var(--splash-glass); box-shadow: var(--shadow, 0 6px 22px rgba(23, 32, 51, .09)); }
.jpm-game[data-game="splash"] .sp-name-text { font-weight: 900; font-size: 1.15em; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jpm-game[data-game="splash"] .sp-stage { font-size: .8em; font-weight: 800; color: var(--muted, #606B80); white-space: nowrap; }
.jpm-game[data-game="splash"] .sp-top-right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.jpm-game[data-game="splash"] .sp-coins { display: inline-flex; align-items: center; gap: .35em; padding: .45em .9em .45em .5em; border-radius: var(--r-pill, 999px); background: var(--splash-glass); font-weight: 900; font-variant-numeric: tabular-nums; box-shadow: var(--shadow, 0 6px 22px rgba(23, 32, 51, .09)); }
.jpm-game[data-game="splash"] .sp-coins svg { width: 1.4em; height: 1.4em; }
.jpm-game[data-game="splash"] .sp-icon-btn { width: 2.5em; height: 2.5em; min-width: 32px; min-height: 32px; border: 0; border-radius: 50%; background: var(--splash-glass); display: grid; place-items: center; box-shadow: var(--shadow, 0 6px 22px rgba(23, 32, 51, .09)); }
.jpm-game[data-game="splash"] .sp-icon-btn svg { width: 62%; height: 62%; }

/* necessidades */
.jpm-game[data-game="splash"] .sp-needs { position: absolute; left: 1.6cqw; top: 13cqh; z-index: 2; display: flex; flex-direction: column; gap: 1.3cqh; padding: 1.2cqh 1.2cqw; border-radius: var(--r-card, 16px); background: var(--splash-glass); box-shadow: var(--shadow, 0 6px 22px rgba(23, 32, 51, .09)); }
.jpm-game[data-game="splash"] .sp-need { display: flex; align-items: center; gap: .5em; }
.jpm-game[data-game="splash"] .sp-need-ico { width: 1.6em; height: 1.6em; flex: none; }
.jpm-game[data-game="splash"] .sp-need-ico svg { width: 100%; height: 100%; display: block; }
.jpm-game[data-game="splash"] .sp-bar { position: relative; width: 15cqw; height: .7em; border-radius: var(--r-pill, 999px); background: var(--line, #E3E8EF); overflow: hidden; }
.jpm-game[data-game="splash"] .sp-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 50%; border-radius: inherit; background: var(--green, #46D68C); transition: width .4s ease, background-color .4s; }
.jpm-game[data-game="splash"] .sp-need.is-mid .sp-fill { background: var(--yellow, #FFD43B); }
.jpm-game[data-game="splash"] .sp-need.is-low .sp-fill { background: var(--coral, #FF6868); }
.jpm-game[data-game="splash"] .sp-need.is-low .sp-need-ico { animation: splash-wiggle 1.2s ease-in-out infinite; }
@keyframes splash-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }

/* balão */
.jpm-game[data-game="splash"] .sp-bubble { position: absolute; z-index: 3; left: 50%; top: 14cqh; transform: translateX(-30%); max-width: 46cqw; padding: .6em 1em; border-radius: 1.1em; background: var(--surface, #fff); font-weight: 800; box-shadow: var(--shadow2, 0 18px 44px rgba(23, 32, 51, .16)); animation: splash-pop .25s ease-out; }
.jpm-game[data-game="splash"] .sp-bubble svg { width: 1.6em; height: 1.6em; margin-right: .35em; vertical-align: -.45em; }
.jpm-game[data-game="splash"] .sp-bubble::after { content: ""; position: absolute; left: 1.6em; bottom: -.5em; border: .55em solid transparent; border-top-color: var(--surface, #fff); border-bottom: 0; }
@keyframes splash-pop { from { transform: translateX(-30%) scale(.8); opacity: 0; } to { transform: translateX(-30%) scale(1); opacity: 1; } }

/* ações */
.jpm-game[data-game="splash"] .sp-actions { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; justify-content: center; gap: 1.2cqw; padding: 1.4cqh 1.6cqw 1.8cqh; }
.jpm-game[data-game="splash"] .sp-act { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2em; min-width: 44px; width: 13.5cqw; height: 15cqh; min-height: 44px; padding: 0; border: 0; border-radius: var(--r-card, 16px); background: var(--surface, #fff); font-weight: 800; font-size: .92em; box-shadow: var(--shadow, 0 6px 22px rgba(23, 32, 51, .09)); transition: transform .12s; }
.jpm-game[data-game="splash"] .sp-act svg { width: 46%; max-width: 3em; height: auto; aspect-ratio: 1; }
.jpm-game[data-game="splash"] .sp-act:active { transform: scale(.95); }
.jpm-game[data-game="splash"] .sp-act.is-on { background: var(--primary, #6046FF); color: var(--surface, #fff); }
.jpm-game[data-game="splash"] .sp-act.is-alert { box-shadow: 0 0 0 3px var(--coral, #FF6868), var(--shadow, 0 6px 22px rgba(23, 32, 51, .09)); }
.jpm-game[data-game="splash"] .sp-act[disabled] { opacity: .45; cursor: default; }

.jpm-game[data-game="splash"] .sp-context { position: absolute; left: 50%; bottom: 2.2cqh; transform: translateX(-50%); z-index: 4; display: flex; align-items: center; gap: 1em; padding: .6em .6em .6em 1.2em; border-radius: var(--r-pill, 999px); background: var(--splash-dark); color: var(--surface, #fff); box-shadow: var(--shadow2, 0 18px 44px rgba(23, 32, 51, .16)); white-space: nowrap; }
.jpm-game[data-game="splash"] .sp-context-text { margin: 0; font-weight: 800; }

/* botões e cartões */
.jpm-game[data-game="splash"] .sp-btn { min-height: 44px; padding: 0 1.6em; border: 0; border-radius: var(--r-pill, 999px); background: var(--primary, #6046FF); color: var(--surface, #fff); font-weight: 900; font-size: 1.05em; box-shadow: 0 6px 16px rgba(96, 70, 255, .3); }
.jpm-game[data-game="splash"] .sp-btn--ghost { background: var(--surface, #fff); color: var(--ink, #172033); box-shadow: inset 0 0 0 2px var(--line, #E3E8EF); }
.jpm-game[data-game="splash"] .sp-btn[disabled] { opacity: .5; cursor: default; }
.jpm-game[data-game="splash"] .sp-screen { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; padding: 3cqh 3cqw; background: rgba(23, 27, 52, .32); overflow: auto; }
.jpm-game[data-game="splash"] .sp-intro { background: linear-gradient(90deg, rgba(23, 27, 52, .22), rgba(23, 27, 52, 0) 60%); justify-items: start; padding-left: 6cqw; }
.jpm-game[data-game="splash"] .sp-intro .sp-card { width: min(54%, 24em); }
.jpm-game[data-game="splash"] .sp-card { width: min(92%, 30em); padding: 1.6em; border-radius: var(--r-field, 24px); background: var(--surface, #fff); text-align: center; box-shadow: var(--shadow2, 0 18px 44px rgba(23, 32, 51, .16)); }
.jpm-game[data-game="splash"] .sp-card--wide { width: min(96%, 38em); padding: 1.2em 1.4em; }
.jpm-game[data-game="splash"] .sp-card--small { width: auto; }
.jpm-game[data-game="splash"] .sp-kicker { margin: 0; font-size: .78em; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--muted, #606B80); }
.jpm-game[data-game="splash"] .sp-title { margin: .15em 0 .3em; font-size: 1.9em; line-height: 1.05; letter-spacing: -.04em; font-weight: 900; }
.jpm-game[data-game="splash"] .sp-text { margin: 0 0 1em; color: var(--muted, #606B80); font-weight: 600; }
.jpm-game[data-game="splash"] .sp-row { display: flex; gap: .6em; justify-content: center; flex-wrap: wrap; }

.jpm-game[data-game="splash"] .sp-bichos { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(5.8em, 1fr); gap: .5em; margin: .3em -.4em .7em; padding: .3em .4em .5em; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.jpm-game[data-game="splash"] .sp-bicho { scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; gap: .1em; padding: .35em .2em .45em; border: 0; border-radius: var(--r-card, 16px); background: var(--bg, #F3F6FA); font-weight: 800; font-size: .92em; }
.jpm-game[data-game="splash"] .sp-bicho img { display: block; width: 100%; max-width: 5.6em; height: auto; aspect-ratio: 1; transition: transform .15s ease; pointer-events: none; }
.jpm-game[data-game="splash"] .sp-bicho[aria-checked="true"] { background: var(--primary-soft, #EEEBFF); box-shadow: inset 0 0 0 3px var(--primary, #6046FF); }
.jpm-game[data-game="splash"] .sp-bicho[aria-checked="true"] img { transform: scale(1.1) translateY(-2%); }
.jpm-game[data-game="splash"] .sp-name-row { display: flex; gap: .5em; justify-content: center; align-items: center; }
.jpm-game[data-game="splash"] .sp-name-row .sp-input { flex: 1 1 auto; min-width: 0; max-width: 15em; }
.jpm-game[data-game="splash"] .sp-link { min-height: 36px; padding: 0 1em; border: 0; background: none; font-weight: 800; color: var(--muted, #606B80); text-decoration: underline; }
.jpm-game[data-game="splash"] .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.jpm-game[data-game="splash"] .sp-input { width: min(100%, 18em); height: 2.8em; min-height: 42px; padding: 0 1em; border: 0; border-radius: var(--r-pill, 999px); background: var(--bg, #F3F6FA); box-shadow: inset 0 0 0 2px var(--line, #E3E8EF); font: inherit; font-weight: 800; text-align: center; color: var(--ink, #172033); user-select: text; -webkit-user-select: text; }
.jpm-game[data-game="splash"] .sp-input:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--primary, #6046FF); }
.jpm-game[data-game="splash"] .sp-hint { margin: .4em 0 .2em; font-size: .85em; color: var(--muted, #606B80); font-weight: 600; min-height: 1.2em; }
.jpm-game[data-game="splash"] .sp-hint.is-error { color: var(--danger, #B42318); }

/* painel */
.jpm-game[data-game="splash"] .sp-sheet { position: absolute; inset: 0; z-index: 5; display: flex; align-items: flex-end; justify-content: center; background: rgba(23, 27, 52, .28); }
.jpm-game[data-game="splash"] .sp-sheet-card { width: min(96%, 44em); max-height: 84cqh; display: flex; flex-direction: column; border-radius: var(--r-field, 24px) var(--r-field, 24px) 0 0; background: var(--surface, #fff); box-shadow: var(--shadow2, 0 18px 44px rgba(23, 32, 51, .16)); animation: splash-up .22s ease-out; }
@keyframes splash-up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.jpm-game[data-game="splash"] .sp-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: .9em 1em .4em 1.3em; }
.jpm-game[data-game="splash"] .sp-sheet-title { margin: 0; font-size: 1.35em; font-weight: 900; letter-spacing: -.03em; }
.jpm-game[data-game="splash"] .sp-close { background: var(--bg, #F3F6FA); box-shadow: none; }
.jpm-game[data-game="splash"] .sp-sheet-body { overflow-y: auto; padding: .3em 1.3em 1.3em; display: grid; grid-auto-rows: max-content; align-content: start; grid-template-columns: repeat(auto-fill, minmax(8.4em, 1fr)); gap: .7em; }
.jpm-game[data-game="splash"] .sp-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: .25em; padding: .7em .4em .6em; min-height: 44px; border: 0; border-radius: var(--r-card, 16px); background: var(--bg, #F3F6FA); font-weight: 800; text-align: center; }
.jpm-game[data-game="splash"] .sp-item canvas, .jpm-game[data-game="splash"] .sp-item img { width: 3.6em; height: 3.6em; object-fit: contain; }
.jpm-game[data-game="splash"] .sp-item small { display: block; font-size: .8em; font-weight: 700; color: var(--muted, #606B80); }
.jpm-game[data-game="splash"] .sp-item.is-on { background: var(--primary-soft, #EEEBFF); box-shadow: inset 0 0 0 3px var(--primary, #6046FF); }
.jpm-game[data-game="splash"] .sp-item.is-locked { opacity: .55; }
.jpm-game[data-game="splash"] .sp-item .sp-tag { position: absolute; top: .4em; right: .4em; padding: .1em .5em; border-radius: var(--r-pill, 999px); background: var(--navy, #171B34); color: var(--surface, #fff); font-size: .7em; font-weight: 900; }
.jpm-game[data-game="splash"] .sp-sheet-body .sp-wide { grid-column: 1 / -1; }
.jpm-game[data-game="splash"] .sp-note { grid-column: 1 / -1; margin: 0; color: var(--muted, #606B80); font-weight: 600; font-size: .9em; }

/* minijogos e pausa */
.jpm-game[data-game="splash"] .sp-mini-hud { position: absolute; top: 1.6cqh; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; gap: .6em; }
.jpm-game[data-game="splash"] .sp-chip { padding: .4em 1em; border-radius: var(--r-pill, 999px); background: var(--splash-dark); color: var(--surface, #fff); font-weight: 900; font-variant-numeric: tabular-nums; font-size: 1.2em; }

.jpm-game[data-game="splash"] .sp-toast { position: absolute; left: 50%; top: 13cqh; transform: translateX(-50%); z-index: 7; padding: .55em 1.1em; border-radius: var(--r-pill, 999px); background: var(--navy, #171B34); color: var(--surface, #fff); font-weight: 800; white-space: nowrap; box-shadow: var(--shadow2, 0 18px 44px rgba(23, 32, 51, .16)); animation: splash-pop2 .25s ease-out; }
@keyframes splash-pop2 { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }
.jpm-game[data-game="splash"] .sp-storage-note { position: absolute; right: 1.6cqw; bottom: 19cqh; z-index: 2; margin: 0; padding: .3em .8em; border-radius: var(--r-pill, 999px); background: var(--splash-glass); font-size: .78em; font-weight: 700; color: var(--muted, #606B80); }

/* telas pequenas: só ícones nas ações */
@container (max-width: 480px) {
  .jpm-game[data-game="splash"] .sp-act span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .jpm-game[data-game="splash"] .sp-act svg { width: 58%; }
  .jpm-game[data-game="splash"] .sp-bar { width: 12cqw; }
  .jpm-game[data-game="splash"] .sp-card { padding: 1em; }
  .jpm-game[data-game="splash"] .sp-title { font-size: 1.5em; }
}
/* telas altas: os 10 bichinhos em grade, sem rolagem */
@container (min-height: 500px) {
  .jpm-game[data-game="splash"] .sp-bichos { grid-auto-flow: row; grid-template-columns: repeat(5, 1fr); overflow: visible; }
}
@media (prefers-reduced-motion: reduce) {
  .jpm-game[data-game="splash"] .sp-bicho img { transition: none; }
  .jpm-game[data-game="splash"] .sp-need.is-low .sp-need-ico { animation: none; }
}

/* garante [hidden] mesmo fora do portal (harness, prévias) */
.jpm-game[data-game="splash"] [hidden] { display: none; }
