/* Pop Merge look (Oct 18 2026), laid out by the owner in the "Atur Pop Merge" artifact (https://claude.ai/artifact/RkNXhf3uGLiBkXMKzDrkPZ).
   White page and the old colour blocks (now jelly-style); Codex art only for the frame, plates, round buttons, crown, Gemi and
   merge effects (design/v1 -> asset/game/, plates cropped to their visible edges). Loaded last, restyles only. */

/* ── header: back | wordmark | ranking, how-to, account (round art buttons) ── */
.top .icon { width: 38px; height: 38px; font-size: 17px; border: 0; border-radius: 50%; color: #fff; box-shadow: none;
  background: url(../asset/game/btn-round.webp) center / 100% 100% no-repeat; }
.top #rpAccountIcon { overflow: hidden; padding: 0; background: none; }
.brand { height: 42px; }

/* ── row: score plate (text in the bar, clear of the gem) + Meta plaque (text clear of the emblem) ── */
.board-wrap { flex-direction: column; justify-content: flex-start; gap: 4px; }
.meta-wrap { margin: 0; flex-shrink: 0; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.score-badge { position: relative; flex: 0 0 41%; aspect-ratio: 378 / 79; height: auto; padding: 0; gap: 0; border: 0; border-radius: 0; box-shadow: none;
  background: url(../asset/game/score-badge.webp) center / 100% 100% no-repeat; }
.score-badge .stat-val { position: absolute; left: 33%; right: 5%; top: 18%; bottom: 16%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: 'Baloo 2', sans-serif; font-size: clamp(13px, 4vw, 17px); text-shadow: 0 1px 2px rgba(27,17,69,.7); }
.target-badge { position: relative; flex: 0 0 51%; aspect-ratio: 626 / 128; padding: 0; border: 0; border-radius: 0; animation: none;
  background: url(../asset/game/target-plaque.webp) center / 100% 100% no-repeat; }
.target-badge > b { position: absolute; left: 26%; right: 14%; top: 22%; bottom: 14%; display: flex; align-items: center; justify-content: center; gap: 4px;
  color: #fff; font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: clamp(12px, 3.6vw, 15px); white-space: nowrap; text-shadow: 0 1px 2px rgba(27,17,69,.8); }
.target-badge span { color: #fde68a; font-size: inherit; }

/* ── board frame, full width; the board takes the height that's left (short phones) ── */
.frame-box { flex: 1 1 0; min-height: 0; width: 100%; container-type: size; display: flex; justify-content: center; align-items: flex-start; padding-top: 22px; }
/* frame inner area: 70/1100 = 6.364% on every side (padding % is of the width) */
.grid-card { width: min(100cqw, calc((100cqh - 22px) * 1100 / 1260)); aspect-ratio: 1100 / 1260; padding: 6.364%;
  background: url(../asset/game/board-frame.webp) center / 100% 100% no-repeat; border: 0; border-radius: 0; box-shadow: none;
  overflow: visible; justify-content: center; }
.grid-board { clip-path: inset(-6% -9% -6% -9%); }   /* blocks falling in from above only show once inside */

/* ── jelly blocks: rounder, lighter top / deeper bottom, glossy blob, darker bottom lip (colour from game.js --col) ── */
.grid-tile { border: 0; border-radius: 34% 34% 30% 30% / 36% 36% 28% 28%;
  background: radial-gradient(120% 90% at 50% 20%, color-mix(in srgb, var(--col) 55%, #fff) 0%, var(--col) 48%, color-mix(in srgb, var(--col) 72%, #000) 100%) !important;
  box-shadow: inset 0 -5px 0 color-mix(in srgb, var(--col) 62%, #000), inset 0 3px 6px rgba(255,255,255,.55), inset 0 -10px 14px rgba(0,0,0,.12),
    0 4px 7px color-mix(in srgb, var(--col) 40%, transparent); }
.grid-tile::before { top: 9%; left: 16%; width: 52%; height: 26%; transform: none; filter: none;
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.15)); }
.grid-tile::after { top: 14%; right: 16%; bottom: auto; width: 11%; height: 11%; background: rgba(255,255,255,.8); box-shadow: none; }
.grid-tile .crown { top: -30%; width: 52%; font-size: 0; filter: drop-shadow(0 2px 2px rgba(20,8,50,.4)); z-index: 2; }
.grid-tile .crown img { display: block; width: 100%; height: auto; }

/* ── Gemi on the frame's top edge, paws on the rim (owner's spot: 78.5% across, 13.3% wide) ── */
.gemi { position: absolute; left: 78.5%; bottom: 96.4%; width: 13.3%; aspect-ratio: 1; pointer-events: none; z-index: 3;
  background: url(../asset/game/mascot-peek.webp) 0 0 / 1200% 100% no-repeat; animation: gemiLoop 2.4s steps(12, jump-none) infinite; }
@keyframes gemiLoop { from { background-position-x: 0; } to { background-position-x: 100%; } }

/* ── merge effects (sprite strips, played once; added by game.js) ── */
.mfx { position: absolute; pointer-events: none; transform: translate(-50%, -50%); background-repeat: no-repeat; z-index: 25; aspect-ratio: 1; }
.mfx.merge { background-image: url(../asset/game/fx-merge.webp); background-size: 1000% 100%; animation: mfx10 .46s steps(10, jump-none) forwards; }
.mfx.combo { background-image: url(../asset/game/fx-combo.webp); background-size: 1200% 100%; animation: mfx12 .7s steps(12, jump-none) forwards; }
.mfx.spawn { background-image: url(../asset/game/fx-spawn.webp); background-size: 600% 100%; animation: mfx6 .34s steps(6, jump-none) forwards; }
.mfx.levelup { background-image: url(../asset/game/fx-levelup.webp); background-size: 1200% 100%; animation: mfx12 1.1s steps(12, jump-none) forwards; z-index: 30; }
.mfx-trail { position: absolute; left: 50%; top: 50%; width: 70%; aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none;
  background: url(../asset/game/fx-trail.webp) 0 0 / 600% 100% no-repeat; animation: mfx6 .3s steps(6, jump-none) infinite; }
@keyframes mfx6 { from { background-position-x: 0; } to { background-position-x: 100%; } }
@keyframes mfx10 { from { background-position-x: 0; } to { background-position-x: 100%; } }
@keyframes mfx12 { from { background-position-x: 0; } to { background-position-x: 100%; } }

/* ── bottom: score plate (3 slots) + sound / new game; the right end stays free for the Dúvidas button ── */
.hud { width: calc(100% - 84px); max-width: none; margin: 0 0 calc(6px + env(safe-area-inset-bottom, 0px)); align-self: flex-start;
  background: none; border: 0; box-shadow: none; padding: 0; gap: 6px; overflow: visible; }
@media (min-width: 481px) { .hud { width: calc(100% - 104px); } }
.hud-stats { flex: 1 1 auto; min-width: 0; max-width: 300px; aspect-ratio: 815 / 183; display: grid; grid-template-columns: 27% 26% 27%;
  column-gap: 2%; padding: 0 8%; align-items: center; background: url(../asset/game/hud-plate.webp) center / 100% 100% no-repeat; }
.hud .stat { min-width: 0; }
.hud .stat-val { color: #fff; font-family: 'Baloo 2', sans-serif; font-size: clamp(12px, 3.8vw, 15px); line-height: 1; }
.hud .stat-val.score { color: #fff; }
.hud .stat-val.best { color: #fde68a; }
.hud .stat-val.bonus { color: #86efac; }
.hud .stat-lbl { color: #ddd6fe; font-size: 7.5px; }
.hud-btns { flex: 0 0 auto; gap: 5px; }
.hud .btn, .hud .btn:hover { width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%; font-size: 17px; color: #fff; letter-spacing: 0; box-shadow: none;
  background: url(../asset/game/btn-round.webp) center / 100% 100% no-repeat; }
.hud .btn-new { font-size: 21px; font-weight: 800; }

body:has(#rpGuestBanner > *) { padding-bottom: 92px; }   /* the guest banner (src/authui.js) must not cover the score plate */
@media (max-height: 700px) {
  .frame-box { padding-top: 16px; }
  .grid-card { width: min(100cqw, calc((100cqh - 16px) * 1100 / 1260)); }
}
@media (prefers-reduced-motion: reduce) { .gemi { animation: none; } }
.hud-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 3%; padding: 0 8.5%; }
.hud .stat { text-align: center; overflow: hidden; }
.hud .stat-lbl { font-size: 6.5px; letter-spacing: 0; white-space: nowrap; }
.hud .stat-val { font-size: clamp(11px, 3.4vw, 15px); }

/* owner, Oct 18: no art for the score plate, Meta plaque and bottom plate: plain clear code-drawn pills instead */
.score-badge, .target-badge, .hud-stats { aspect-ratio: auto; height: 44px; border-radius: 14px;
  background: linear-gradient(180deg, #8b5cf6, #6d28d9) !important;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.35), inset 0 -3px 0 rgba(0,0,0,.15), 0 3px 8px rgba(76,29,149,.25); }
.score-badge { flex: 0 0 38%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.score-badge::before { content: 'PONTOS'; font: 700 9px/1 'Sora', sans-serif; letter-spacing: .08em; color: #ddd6fe; }
.score-badge .stat-val { position: static; font-size: 18px; line-height: 1; }
.target-badge { flex: 1 1 auto; margin-left: 8px; display: flex; align-items: center; justify-content: center; }
.target-badge > b { position: static; font-size: 16px; }
.hud-stats { height: 48px; max-width: none; padding: 0 4px; column-gap: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hud .stat { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.hud .stat + .stat { border-left: 1px solid rgba(255,255,255,.25); }
.hud .stat-val { font-size: 16px; }
.hud .stat-lbl { font-size: 9px; letter-spacing: .04em; color: #ddd6fe; }
.hud .stat-lbl { font-size: 8px; letter-spacing: 0; }
/* "Sem jogadas" panel: the second button is the quiet one */
.result-btn.result-btn-ghost { background: transparent; color: var(--muted, #64748b); box-shadow: none; border: 2px solid currentColor; margin-top: 8px; }
