/* =========================================================================
   Monte seu Milkshake Trufado — linguagem visual PRÓPRIA do jogo.
   Não deriva do site: fundo claro/rosado, superfícies brancas e creme,
   rosa Reby's como identidade, peças "fofas" de jogo casual.
   Mobile-first; no desktop o jogo vira uma "tela de celular" centralizada.
   Classes com prefixo rg-.
   ========================================================================= */
:root {
  /* marca */
  --rose: #ff2d84;
  --rose-deep: #d0145f;      /* rosa para texto sobre branco (contraste AA) */
  --rose-soft: #ffc6dc;
  --rose-mist: #fff0f6;
  --magenta: #e0189b;
  --violet: #8f45f5;
  /* base */
  --bg-top: #fff3f8;
  --bg-bottom: #ffe0ec;
  --cream: #fffaf2;
  --surface: #ffffff;
  --plum: #3b1531;           /* texto principal */
  --plum-2: #7a5570;         /* texto secundário */
  --ok: #17a36b;
  --bad: #e5484d;
  --gold: #ffb020;
  /* forma */
  --r-lg: 28px;
  --r-md: 20px;
  --r-sm: 14px;
  --ledge: #f5bdd3;          /* "degrau" sólido sob peças tocáveis */
  --shadow: 0 10px 24px rgba(208, 20, 95, .10);
  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }

body.rg {
  margin: 0;
  overflow: hidden;
  font-family: var(--font-body);
  color: var(--plum);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  background: var(--bg-bottom);
  display: grid;
  place-items: center;
}

.rg-ico { width: 1em; height: 1em; fill: currentColor; flex: none; }
.rg-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }
button { font: inherit; color: inherit; }

.rg-alert-file { display: none; }
.rg-file .rg-alert-file {
  display: block; position: fixed; inset: 12px 12px auto; z-index: 99; padding: 14px 16px;
  border-radius: var(--r-sm); background: #fff; box-shadow: var(--shadow); font-size: .95rem;
}

/* ---------- "aparelho": ocupa a tela no celular */
.rg-device {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(120% 60% at 50% 0%, #fff 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}
.rg-screen {
  position: absolute; inset: 0;
  padding: max(12px, env(safe-area-inset-top)) 14px max(12px, env(safe-area-inset-bottom));
}

/* ---------- botões de jogo */
.rg-cta {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 62px; padding: 0 24px; border: 0; border-radius: var(--r-md); cursor: pointer;
  font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; letter-spacing: .04em; color: #fff;
  background: linear-gradient(180deg, #ff4f98, var(--rose) 55%, #f01f7a);
  box-shadow: 0 6px 0 #b50f55, 0 14px 26px rgba(208, 20, 95, .28);
  transition: transform .08s ease, box-shadow .08s ease;
  touch-action: manipulation;
}
.rg-cta .rg-ico { font-size: 1.1em; }
.rg-cta:active { transform: translateY(5px); box-shadow: 0 1px 0 #b50f55, 0 6px 14px rgba(208, 20, 95, .25); }

.rg-btn2 {
  width: 100%; min-height: 52px; border-radius: var(--r-md); cursor: pointer;
  border: 2px solid var(--rose-soft); background: var(--surface); color: var(--plum);
  font-family: var(--font-display); font-weight: 700; font-size: 1rem;
  box-shadow: 0 4px 0 var(--ledge);
  touch-action: manipulation;
}
.rg-btn2:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ledge); }

/* =========================================================================
   INÍCIO
   ========================================================================= */
.rg-home {
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
  padding-inline: 20px;
}
.rg-home__brand {
  display: flex; align-items: center; gap: 8px; margin-top: 6px;
  font-family: var(--font-display); font-weight: 700; font-size: .82rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--plum-2);
}
.rg-home__logo { width: 34px; height: 34px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--rose-soft); object-fit: cover; }
.rg-home__title {
  margin: 4px 0 0; font-family: var(--font-display); font-weight: 800; line-height: 1.02;
  font-size: clamp(1.9rem, 9vw, 2.6rem); letter-spacing: -.01em; text-wrap: balance;
}
.rg-home__title span { display: block; color: var(--rose); }
.rg-home__cup {
  position: relative; flex: 1 1 auto; min-height: 120px; width: 100%;
  display: grid; place-items: center;
}
.rg-home__cup::before {
  content: ""; position: absolute; width: min(78%, 300px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, rgba(255, 255, 255, .6) 45%, transparent 70%);
}
.rg-home__cup .rg-cup__svg { position: relative; height: 100%; max-height: 340px; width: auto; animation: rg-float-idle 3.2s ease-in-out infinite; }
.rg-home__best, .rg-result__best {
  display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 6px 14px; border-radius: 999px;
  background: var(--surface); box-shadow: var(--shadow); font-weight: 700; font-size: .92rem; color: var(--plum-2);
}
.rg-home__best strong, .rg-result__best strong { font-family: var(--font-display); color: var(--plum); }
.rg-home__best .rg-ico, .rg-result__best .rg-ico { color: var(--gold); }
.rg-result__best { flex-wrap: wrap; justify-content: center; }
/* coleção de receitas na home: linha pequena e secundária sob o recorde */
.rg-home__recipes { display: inline-flex; align-items: center; gap: 5px; margin: -6px 0 0; font-size: .74rem; font-weight: 700; color: var(--plum-2); }
.rg-home__recipes strong { font-family: var(--font-display); color: var(--rose-deep); }
.rg-home__recipes .rg-ico { color: var(--rose); font-size: .9rem; }
@media (max-height: 480px) { .rg-home__recipes { display: none; } }   /* tela baixa (horizontal): não empurra o JOGAR */
.rg-result__sep { margin: 0 2px; opacity: .5; }
.rg-home .rg-cta { max-width: 360px; }
/* ---------- barra de progresso (XP) */
.rg-bar { position: relative; display: block; height: 8px; border-radius: 99px; background: #f6dce8; overflow: hidden; }
.rg-bar i { position: absolute; inset: 0; border-radius: inherit; transform-origin: left; transform: scaleX(0);
  background: linear-gradient(90deg, var(--rose), #ff7ab5); transition: transform .8s cubic-bezier(.2, .8, .3, 1); }

/* ---------- MINHA JORNADA (cartão compacto na home; JOGAR continua sendo o destaque) */
.rg-journey {
  width: 100%; max-width: 360px; display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px;
  margin-bottom: 4px; padding: 10px 12px; border: 0; border-radius: var(--r-md); cursor: pointer; text-align: left;
  background: rgba(255, 255, 255, .85); box-shadow: 0 3px 0 var(--ledge); color: var(--plum);
  touch-action: manipulation;
}
.rg-journey:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ledge); }
.rg-journey__lvl {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; line-height: 1;
  background: linear-gradient(160deg, #ff5f9e, var(--rose-deep)); color: #fff; box-shadow: 0 2px 0 #9d0f4c;
}
.rg-journey__lvl small { font-size: .52rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .9; }
.rg-journey__lvl b { font-family: var(--font-display); font-size: 1.3rem; }
.rg-journey__main { display: grid; gap: 3px; min-width: 0; }
.rg-journey__eyebrow { font-size: .62rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--plum-2); }
/* título e detalhe do próximo objetivo: quebram em até 2 linhas (sem reticências) */
.rg-journey__title { font-family: var(--font-display); font-weight: 700; font-size: .92rem; line-height: 1.1;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.rg-journey__hint { font-size: .7rem; font-weight: 700; color: var(--plum-2); line-height: 1.25;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.rg-journey__chev { font-size: .8rem; color: var(--rose-deep); }
/* miniatura do próximo objetivo (sabor, medalha ou troféu) */
.rg-journey__art, .rg-jnext__art, .rg-xp__goal-art { display: grid; place-items: center; }
.rg-journey__art { width: 36px; height: 36px; }
.rg-journey__art .rg-art, .rg-jnext__art .rg-art, .rg-xp__goal-art .rg-art { width: 100%; height: 100%; }
.rg-journey__art .rg-ico, .rg-jnext__art .rg-ico, .rg-xp__goal-art .rg-ico { font-size: 1.5rem; color: var(--gold); }

/* ---------- painel "Minha jornada" (lista rolável dentro do painel; fora da partida) */
/* o overlay vira flex para o limite de altura (100%) valer: o painel nunca passa da tela */
.rg-journey-sheet { display: flex; align-items: center; justify-content: center; padding: 16px; }
.rg-sheet--tall { max-width: 380px; max-height: min(100%, 640px); min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 18px 16px 12px; text-align: left; }
/* `.rg-sheet` (display: grid, mais abaixo) sobrescrevia o flex acima → a lista não rolava; só o display volta */
.rg-sheet.rg-sheet--tall { display: flex; }
.rg-sheet__head { display: flex; align-items: center; justify-content: space-between; }
.rg-sheet__head .rg-sheet__title { margin: 0; font-size: 1.3rem; }
.rg-sheet__close {
  width: 44px; height: 44px; border: 0; border-radius: 14px; cursor: pointer; background: var(--rose-mist);
  font-size: 1.6rem; line-height: 1; color: var(--plum);
}
.rg-sheet__scroll { min-height: 0; overflow: auto; overscroll-behavior: contain; display: grid; gap: 10px; padding-right: 2px; }
.rg-jlevel { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; }
.rg-jlevel > div { display: grid; gap: 5px; }
.rg-jlevel strong { font-family: var(--font-display); font-size: 1rem; }
.rg-jlevel small { font-size: .72rem; font-weight: 700; color: var(--plum-2); }
/* "a seguir": próximo nível + sabor que ele libera */
.rg-jnext { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 8px 10px; border-radius: var(--r-sm); background: var(--rose-mist); }
.rg-jnext__art { width: 46px; height: 46px; }
.rg-jnext > div { display: grid; gap: 2px; min-width: 0; }
.rg-jnext strong { font-family: var(--font-display); font-size: .92rem; }
.rg-jnext small { font-size: .72rem; font-weight: 700; color: var(--plum-2); }
.rg-jnext .rg-journey__eyebrow { font-size: .6rem; }
.rg-jstats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.rg-jstats li { display: grid; gap: 1px; padding: 7px 6px; border-radius: var(--r-sm); background: var(--cream); text-align: center; }
.rg-jstats strong { font-family: var(--font-display); font-weight: 800; font-size: .95rem; }
.rg-jstats span { font-size: .6rem; font-weight: 700; color: var(--plum-2); }
.rg-jhead { margin: 4px 0 0; font-family: var(--font-display); font-size: .9rem; }
.rg-jhead span { font-weight: 700; color: var(--plum-2); font-size: .8rem; }
.rg-jach { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rg-jach li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; padding: 7px 10px; border-radius: var(--r-sm); background: #faf4f7; color: var(--plum-2); }
.rg-jach li .rg-ico { font-size: 1.4rem; color: #cdb9c5; }
.rg-jach li b { display: block; font-size: .8rem; color: var(--plum); }
.rg-jach li small { font-size: .7rem; }
.rg-jach li.is-got { background: #fff6e2; }
.rg-jach li.is-got .rg-ico { color: var(--gold); }
.rg-jnote { margin: -4px 0 0; font-size: .7rem; font-weight: 600; line-height: 1.35; color: var(--plum-2); }
/* maestria: uma linha por desafio (nome · degrau atual e melhor) */
.rg-jmastery { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rg-jmastery li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; border-radius: var(--r-sm); background: #faf4f7; }
.rg-jmastery b { font-size: .8rem; color: var(--plum); }
.rg-jmastery span { font-size: .7rem; font-weight: 700; color: var(--plum-2); white-space: nowrap; }
/* progresso parcial (só quando um recorde salvo mede o critério) */
.rg-jach__prog { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; margin-top: 4px; }
.rg-jach__prog .rg-bar { height: 6px; }
.rg-jach__prog .rg-bar i { transition: none; }
.rg-jach__prog em { font-style: normal; font-size: .66rem; font-weight: 800; color: var(--plum); white-space: nowrap; }
.rg-jrecipes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.rg-jrecipes li { display: grid; align-content: start; gap: 1px; padding: 7px 10px; border-radius: var(--r-sm); background: #faf4f7; min-width: 0; }
.rg-jrecipes b { font-size: .78rem; color: var(--plum); overflow-wrap: anywhere; }
.rg-jrecipes small { font-size: .64rem; font-weight: 600; line-height: 1.25; color: var(--plum-2); overflow-wrap: anywhere; }
.rg-jrecipes li.is-got { background: var(--rose-mist); box-shadow: inset 0 0 0 1.5px var(--rose-soft); }
.rg-jrecipes li.is-locked b { color: #cdb9c5; letter-spacing: .08em; }
.rg-jflavors { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.rg-jflavors li { display: grid; justify-items: center; gap: 2px; text-align: center; }
.rg-jflavors__art { width: 46px; height: 46px; }
.rg-jflavors__art .rg-art { width: 100%; height: 100%; }
.rg-jflavors small { font-size: .6rem; font-weight: 700; line-height: 1.1; color: var(--plum); }
.rg-jflavors li.is-locked .rg-jflavors__art { filter: grayscale(1) brightness(.6); opacity: .35; }
.rg-jflavors li.is-locked small { color: var(--plum-2); }

/* botão de som na tela inicial (o da pausa continua existindo) */
.rg-sound-btn {
  position: absolute; top: max(12px, env(safe-area-inset-top)); right: 14px; z-index: 2;
  width: 44px; height: 44px; border-radius: 14px; border: 0; cursor: pointer;
  display: grid; place-items: center; background: var(--surface); color: var(--plum);
  box-shadow: 0 3px 0 var(--ledge); font-size: 1.25rem; touch-action: manipulation;
}
.rg-sound-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ledge); }
.rg-sound-btn [data-icon-off], .rg-sound-btn[data-muted="true"] [data-icon-on] { display: none; }
.rg-sound-btn[data-muted="true"] [data-icon-off] { display: block; color: var(--plum-2); }

/* =========================================================================
   PARTIDA
   ========================================================================= */
.rg-game {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: 10px;
  padding-bottom: 0;
}

/* ---------- HUD */
.rg-hud {
  display: grid; grid-template-columns: 44px 1fr auto auto; align-items: center; gap: 8px;
}
.rg-hud__pause {
  width: 44px; height: 44px; border-radius: 14px; border: 0; cursor: pointer;
  display: grid; place-items: center; background: var(--surface); color: var(--plum);
  box-shadow: 0 3px 0 var(--ledge); font-size: 1.1rem;
}
.rg-hud__pause:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ledge); }
.rg-hud__score { display: flex; align-items: baseline; gap: 4px; padding-left: 4px; }
.rg-hud__score span {
  font-family: var(--font-display); font-weight: 800; font-size: 2rem; line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--plum);
}
.rg-hud__score small { font-weight: 800; font-size: .72rem; color: var(--plum-2); text-transform: uppercase; letter-spacing: .08em; }
.rg-hud__score.is-bump span { animation: rg-bump .28s ease-out; }

.rg-hud__combo, .rg-hud__errors {
  display: inline-flex; align-items: center; gap: 5px; height: 44px; padding: 0 12px; border-radius: 999px;
  background: var(--surface); box-shadow: 0 3px 0 var(--ledge);
  font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums;
}

/* ---------- COMBO: esquenta a cada pedido seguido; pips mostram o caminho até o Turbo */
.rg-hud__combo {
  position: relative; min-width: 70px; justify-content: center; padding-bottom: 7px; color: #8a6d82;
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.rg-hud__combo .rg-ico { transition: transform .2s ease; }
.rg-hud__pips { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); display: flex; gap: 3px; }
.rg-hud__pips i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .25; transition: opacity .2s ease, transform .2s ease; }
.rg-hud__pips i.is-on { opacity: 1; transform: scale(1.2); }
.rg-hud__combo[data-heat="1"] { background: #ffe0ec; color: #c01358; box-shadow: 0 3px 0 #f5aac8; }
.rg-hud__combo[data-heat="2"] { background: linear-gradient(135deg, #ff5b9a, #e41c72); color: #fff; box-shadow: 0 3px 0 #b3105a; }
.rg-hud__combo[data-heat="3"] { background: linear-gradient(135deg, #ff6a3d, #e41c72); color: #fff; box-shadow: 0 3px 0 #b3264a; }
.rg-hud__combo[data-heat="4"] { background: linear-gradient(135deg, #e41c72, #b7148a); color: #fff; box-shadow: 0 3px 0 #86105f; }
.rg-hud__combo[data-heat="2"] .rg-ico { transform: scale(1.1); }
.rg-hud__combo[data-heat="3"] .rg-ico, .rg-hud__combo[data-heat="4"] .rg-ico { transform: scale(1.22) rotate(-6deg); }
.rg-hud__combo.is-turbo { background: linear-gradient(135deg, #d0145f, #7b35e0); color: #fff; box-shadow: 0 3px 0 #55209e; }
.rg-hud__combo.is-pop { animation: rg-pop .34s ease-out; }
.rg-hud__combo.is-lost { animation: rg-lost .4s ease-out; }

/* ---------- ERROS DA PARTIDA (Microfase 18): 3 marcas; o 3º erro encerra a partida */
.rg-hud__errors { flex-direction: column; justify-content: center; gap: 3px; min-width: 72px; color: var(--plum); }
.rg-hud__errors small { font-family: var(--font-body); font-weight: 800; font-size: .62rem; line-height: 1; letter-spacing: .08em; text-transform: uppercase; color: var(--plum-2); }
.rg-hud__marks { display: flex; gap: 5px; }
.rg-hud__marks i { width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 2px #d9b8cb; }
.rg-hud__marks i.is-on { background: #c0202f; box-shadow: none; }
.rg-hud__errors.is-hit { animation: rg-lost .4s ease-out; }

/* ---------- PEDIDO (comanda de jogo) */
.rg-ticket {
  position: relative; padding: 9px 12px 16px; border-radius: var(--r-md);
  background: var(--cream); box-shadow: 0 4px 0 #f1d6c9, var(--shadow);
}
.rg-ticket.is-new { animation: rg-ticket-in .22s ease-out; }
.rg-ticket__head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px; padding-bottom: 7px;
  border-bottom: 2px dashed #f0d5c8;
}
.rg-ticket__tag {
  padding: 3px 9px; border-radius: 8px; transform: rotate(-3deg);
  background: var(--rose); color: #fff; font-family: var(--font-display); font-weight: 800; font-size: .74rem; letter-spacing: .06em;
  box-shadow: 0 2px 0 #b50f55;
}
.rg-ticket__title { font-family: var(--font-display); font-weight: 700; font-size: .95rem; }
.rg-ticket__num { margin-left: auto; font-weight: 800; font-size: .8rem; color: var(--plum-2); }
/* sabor recém-liberado no pedido: selo no cabeçalho (no lugar do título) + estrela na peça e no passo */
.rg-ticket__new {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px 2px 6px; border-radius: 99px;
  background: linear-gradient(135deg, #ffd46b, var(--gold)); color: #5a3300; box-shadow: 0 2px 0 #d68a00;
  font-family: var(--font-display); font-weight: 800; font-size: .74rem; letter-spacing: .03em; white-space: nowrap;
}
.rg-ticket__new[hidden], .rg-ticket__title[hidden] { display: none; }
.rg-new-star {
  position: absolute; z-index: 2; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold); color: #fff; box-shadow: 0 0 0 2px #fff; font-size: .62rem; line-height: 1; pointer-events: none;
}
.rg-new-star::after { content: "★"; }
.rg-step__art .rg-new-star { top: -4px; right: -6px; }
.rg-tile .rg-new-star { top: 5px; left: 5px; }

.rg-ticket__steps {
  list-style: none; margin: 0; padding: 0;
  display: flex; justify-content: center; gap: 12px;
}
.rg-step {
  position: relative; flex: 0 1 84px; min-width: 0;
  display: grid; justify-items: center; gap: 5px; text-align: center;
  transition: opacity .2s ease;
}
.rg-step.is-new { animation: rg-step-in .24s ease-out both; animation-delay: calc(var(--i, 0) * 40ms); }
.rg-step + .rg-step::before {
  content: "+"; position: absolute; left: -11px; top: 17px;
  font-family: var(--font-display); font-weight: 800; font-size: .95rem; color: #e5a5bf;
}
.rg-step__art {
  position: relative; width: 52px; height: 52px; border-radius: 50%; padding: 5px;
  background: var(--tint, #fff); box-shadow: 0 0 0 2px #f1dde6;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.rg-step__art .rg-art { width: 100%; height: 100%; display: block; }
.rg-step__n {
  position: absolute; top: -4px; left: calc(50% - 33px); z-index: 1;
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: var(--plum); color: #fff; font-size: .7rem; font-weight: 800;
}
.rg-step__name {
  padding: 1px 6px; border-radius: 8px;
  font-weight: 800; font-size: .72rem; line-height: 1.15; color: var(--plum);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* próximo: destaque firme, sem piscar */
.rg-step.is-next .rg-step__art { transform: scale(1.12); background: #fff; box-shadow: 0 0 0 3px var(--rose), 0 8px 16px rgba(255, 45, 132, .28); }
.rg-step.is-next .rg-step__n { background: var(--rose); }
.rg-step.is-next .rg-step__name { background: var(--rose-deep); color: #fff; }
/* futuros: visíveis, com menos destaque */
.rg-step.is-todo { opacity: .7; }
.rg-step.is-todo .rg-step__art { transform: scale(.9); }
/* feitos: marcados e recolhidos */
.rg-step.is-done { opacity: .5; }
.rg-step.is-done .rg-step__art { transform: scale(.84); box-shadow: 0 0 0 2px #bfe8d5; }
.rg-step.is-done .rg-step__n { background: var(--ok); font-size: 0; }
.rg-step.is-done .rg-step__n::after { content: "✓"; font-size: .72rem; }
.rg-step.is-done .rg-step__name { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: rgba(23, 163, 107, .6); }
.rg-step.is-arrived .rg-step__art { animation: rg-arrive .32s ease-out; }
.rg-step.is-nudge .rg-step__art { animation: rg-nudge .4s ease-out; }

.rg-ticket__hint { margin: 8px 0 0; text-align: center; font-weight: 800; font-size: .8rem; color: var(--rose-deep); }

/* H7 (Microfase 16.3) — pedido pelo nome de uma receita já descoberta: mesma comanda, selo + nome */
.rg-ticket.is-named { background: linear-gradient(180deg, #fff6fa, var(--cream)); box-shadow: 0 4px 0 #f5c4d8, 0 0 0 2px var(--rose-soft), var(--shadow); }
.rg-ticket__house {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 7px; border-radius: 99px;
  background: var(--rose); color: #fff; box-shadow: 0 2px 0 #b50f55;
  font-family: var(--font-display); font-weight: 800; font-size: .74rem; letter-spacing: .05em; white-space: nowrap;
}
.rg-ticket__house[hidden], .rg-ticket__steps[hidden], .rg-ticket__name[hidden], .rg-ticket__help[hidden] { display: none; }
.rg-ticket__name {
  margin: 2px 0 4px; text-align: center; font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.4rem, 6.5vw, 1.85rem); line-height: 1.1; color: var(--rose-deep); overflow-wrap: anywhere;
}
.rg-ticket__help { margin: 6px 0 0; text-align: center; font-weight: 800; font-size: .88rem; color: var(--bad); }
.rg-ticket__help + .rg-ticket__help { margin-top: 5px; }
.rg-ticket__help.is-tip { color: #6a4300; background: #fff8e8; border-radius: 10px; padding: 5px 8px; box-shadow: 0 0 0 1.5px #ffd46b; }
.rg-ticket__help.is-in { animation: rg-help-in .2s ease-out both; }
@keyframes rg-help-in { from { opacity: 0; transform: translateY(-4px); } }
.rg-stage.is-h7 .rg-cup__guides { display: none; }
.rg-ticket__timer {
  position: absolute; left: 14px; right: 14px; bottom: 6px; height: 5px; border-radius: 99px;
  background: #f6e3da; overflow: hidden;
}
.rg-ticket__timer span {
  display: block; height: 100%; border-radius: inherit; transform-origin: left;
  background: linear-gradient(90deg, var(--rose), #ff6fae); transition: transform .1s linear, background-color .2s;
}
.rg-ticket__timer span.is-low { background: var(--bad); }

/* ---------- PALCO DO COPO */
.rg-stage { position: relative; min-height: 0; display: grid; place-items: center; isolation: isolate; }
.rg-stage::before, .rg-stage::after {
  content: ""; position: absolute; z-index: -1; border-radius: 50%; pointer-events: none;
}
.rg-stage::before {
  width: min(92%, 350px); aspect-ratio: 1.25;
  background: radial-gradient(closest-side, #fff 0%, rgba(255, 255, 255, .6) 50%, transparent 100%);
}
/* brilho do pedido perfeito */
.rg-stage::after {
  width: min(80%, 300px); aspect-ratio: 1; opacity: 0;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 1), rgba(255, 207, 226, .7) 55%, transparent 100%);
}
.rg-stage.is-perfect::after { animation: rg-glow-pop .6s ease-out .24s both; }
.rg-stage__cup { position: relative; height: 100%; max-height: 320px; aspect-ratio: 200 / 274; }
.rg-stage__cup .rg-cup__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }

.rg-stage__turbo {
  position: absolute; top: 2px; left: 50%; z-index: 2; transform: translateX(-50%);
  display: none; align-items: center; gap: 6px; padding: 5px 12px 7px; border-radius: 999px;
  background: linear-gradient(135deg, #d0145f, #7b35e0); color: #fff;
  font-size: .72rem; font-weight: 700; white-space: nowrap; box-shadow: 0 6px 16px rgba(123, 53, 224, .3);
}
.rg-stage__turbo b { font-family: var(--font-display); letter-spacing: .08em; }
.rg-stage__turbo span { position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px; background: rgba(255, 255, 255, .35); border-radius: 2px; }
.rg-stage__turbo i { display: block; height: 100%; background: #fff; transform-origin: left; transition: transform .1s linear; }
.rg-stage.is-turbo .rg-stage__turbo { display: inline-flex; }
/* entrada do Turbo: faixa entra com um pulo e o palco "respira" luz uma vez */
.rg-stage.is-turbo-in .rg-stage__turbo { animation: rg-turbo-pop .38s cubic-bezier(.2, .9, .3, 1.3) both; }
.rg-stage.is-turbo-in::before { animation: rg-turbo-glow .6s ease-out; }
/* últimos 2 s: a faixa pulsa de leve (aviso de que vai acabar) */
.rg-stage.is-turbo-ending .rg-stage__turbo { animation: rg-breathe .5s ease-in-out infinite alternate; }
/* saída: a faixa some com calma (não parece erro) */
.rg-stage.is-turbo-out:not(.is-turbo) .rg-stage__turbo { display: inline-flex; animation: rg-turbo-out .35s ease-in forwards; }
@keyframes rg-turbo-pop { 0% { transform: translateX(-50%) scale(.7); opacity: 0; } 60% { transform: translateX(-50%) scale(1.08); opacity: 1; } 100% { transform: translateX(-50%) scale(1); } }
@keyframes rg-turbo-out { to { transform: translateX(-50%) translateY(-6px) scale(.9); opacity: 0; } }
@keyframes rg-turbo-glow { 40% { transform: scale(1.12); opacity: 1; } }
@keyframes rg-breathe { to { opacity: .6; } }
.rg-stage.is-turbo::before { background: radial-gradient(closest-side, #fff 0%, rgba(228, 212, 255, .8) 50%, transparent 100%); }

/* desafio opcional: uma linha pequena entre o copo e a bancada (secundária, sem animação) */
.rg-challenge {
  justify-self: center; max-width: 100%; margin: -5px 0 -3px; padding: 3px 10px;
  display: inline-flex; align-items: center; gap: 5px; border-radius: 99px;
  background: rgba(255, 255, 255, .72); color: var(--plum-2);
  font-size: .7rem; font-weight: 700; line-height: 1.2; white-space: nowrap;
}
.rg-challenge .rg-ico { flex: none; font-size: .85rem; color: var(--rose-deep); }
.rg-challenge small { font-size: .58rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.rg-challenge span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.rg-challenge b { flex: none; font-weight: 800; color: var(--plum); }
.rg-challenge.is-done { color: #0f7a50; }
.rg-challenge.is-done .rg-ico, .rg-challenge.is-done b { color: #0f7a50; }

/* copo: camadas, encaixe e troca */
.rg-cup__guide { fill: none; stroke: #f2b3cb; stroke-width: 2; stroke-dasharray: 5 7; }
.rg-cup__body { transform-box: fill-box; transform-origin: 50% 100%; }
.rg-cup__layer { transform-box: fill-box; transform-origin: 50% 100%; animation: rg-pour .3s cubic-bezier(.2, .9, .3, 1.2) both; }
.rg-cup__layer--drip { transform-origin: 50% 0%; animation-name: rg-drip; animation-duration: .45s; }
.rg-cup__layer--top { animation-name: rg-plop; animation-duration: .34s; }
.rg-cup__ripple { fill: none; stroke: #fff; stroke-width: 3; opacity: 0; transform-box: fill-box; transform-origin: center; animation: rg-ripple .45s ease-out both; }
.rg-cup__body.is-gulp { animation: rg-gulp .26s ease-out; }
.rg-cup__body.is-wobble { animation: rg-wobble .35s ease-out; }
.is-done .rg-cup__body { animation: rg-hop .38s ease-out .24s; }
.rg-cup__straw { opacity: 0; transform: translateY(-70px); transition: opacity .12s ease .22s, transform .3s cubic-bezier(.2, .9, .3, 1.25) .22s; }
.is-done .rg-cup__straw { opacity: 1; transform: none; }
.rg-cup__sparks path { opacity: 0; transform-box: fill-box; transform-origin: center; }
.is-perfect .rg-cup__sparks path { animation: rg-twinkle .55s ease-out .3s both; }
.is-perfect .rg-cup__sparks path:nth-child(2) { animation-delay: .38s; }
.is-perfect .rg-cup__sparks path:nth-child(3) { animation-delay: .44s; }
.is-static .rg-cup__layer, .is-static .rg-cup__body, .is-static .rg-cup__sparks path { animation: none; }
.is-static .rg-cup__straw { transition: none; }

.rg-cup__svg.is-entering { animation: rg-cup-in .24s cubic-bezier(.2, .9, .3, 1.2) both; }
.rg-cup__svg.is-entering.is-delayed { animation-delay: .72s; }
.rg-cup__svg.is-leaving { animation: rg-cup-out .3s cubic-bezier(.5, 0, .8, .4) .62s both; }
.rg-cup__svg.is-dropping { animation: rg-cup-drop .22s ease-in both; }

/* ---------- BANCADA (balcão com os ingredientes) */
.rg-board {
  --cols: 3;
  display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 10px;
  margin: 0 -14px; padding: 14px 14px max(14px, env(safe-area-inset-bottom));
  background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: 0 -10px 28px rgba(208, 20, 95, .08);
}
.rg-tile {
  position: relative; min-width: 0; min-height: clamp(70px, 9.5dvh, 88px); padding: 7px 6px 6px;
  border: 2px solid #ffe3ee; border-radius: var(--r-md); cursor: pointer;
  background: #fff;
  box-shadow: 0 4px 0 var(--ledge), 0 6px 12px rgba(208, 20, 95, .06);
  display: grid; grid-template-rows: 1fr auto; justify-items: center; align-items: center; gap: 3px;
  transition: transform .1s ease, box-shadow .1s ease, border-color .15s ease, opacity .2s;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.rg-tile.is-new { animation: rg-tile-in .2s ease-out both; animation-delay: calc(var(--i, 0) * 18ms); }
.rg-tile__art {
  width: clamp(40px, 5.8dvh, 54px); aspect-ratio: 1; border-radius: 50%; padding: 3px;
  background: radial-gradient(circle, var(--tint, #fff0f6) 0 64%, transparent 65%);
}
.rg-tile__art .rg-art { width: 100%; height: 100%; display: block; filter: drop-shadow(0 2px 2px rgba(59, 21, 49, .12)); }
.rg-tile__name {
  font-family: var(--font-display); font-weight: 700; font-size: .76rem; line-height: 1.12; text-align: center;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rg-tile__check {
  position: absolute; top: 5px; right: 5px; width: 20px; height: 20px; border-radius: 50%;
  display: none; place-items: center; background: var(--ok); color: #fff; font-size: .7rem; font-weight: 800;
}
.rg-tile__check::after { content: "✓"; }
@media (hover: hover) and (pointer: fine) {
  .rg-tile:not(:disabled):hover { transform: translateY(-2px) scale(1.02); border-color: var(--rose-soft); box-shadow: 0 6px 0 var(--ledge), 0 10px 18px rgba(208, 20, 95, .1); }
}
.rg-tile:active:not(:disabled) { transform: translateY(3px) scale(.97); box-shadow: 0 1px 0 var(--ledge); }
.rg-tile:disabled { cursor: default; opacity: .6; }
.rg-tile.is-used { border-color: #c9eedd; }
.rg-tile.is-used .rg-tile__art { opacity: .5; }
.rg-tile.is-used .rg-tile__check { display: grid; }
.rg-tile.is-hint { border-color: var(--rose); animation: rg-hint 1.6s ease-in-out infinite; }
.rg-tile.is-correct { animation: rg-tile-ok .32s ease-out; }
.rg-tile.is-correct .rg-tile__art { animation: rg-art-send .3s ease-out; }
.rg-tile.is-shake { animation: rg-shake .34s ease-out; }

/* ---------- PAUSA */
.rg-overlay {
  position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; padding: 24px;
  background: rgba(59, 21, 49, .38);
}
.rg-sheet {
  width: 100%; max-width: 340px; display: grid; gap: 12px; padding: 24px 20px;
  border-radius: var(--r-lg); background: var(--surface); box-shadow: 0 24px 60px rgba(59, 21, 49, .3);
  animation: rg-cup-in .22s cubic-bezier(.2, .9, .3, 1.2) both;
}
.rg-sheet__title { margin: 0 0 4px; text-align: center; font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; }

/* =========================================================================
   RESULTADO
   ========================================================================= */
.rg-result {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center;
  padding-inline: 24px;
}
.rg-result > .rg-cta, .rg-result > .rg-btn2 { max-width: 360px; }
.rg-result__kicker {
  margin: 0; padding: 5px 12px; border-radius: 10px; transform: rotate(-2deg);
  background: var(--rose); color: #fff; font-family: var(--font-display); font-weight: 800; font-size: .85rem; letter-spacing: .04em;
}
.rg-result__label { margin: 8px 0 0; font-weight: 700; font-size: 1rem; color: var(--plum-2); }
.rg-result__score {
  margin: -6px 0 0; font-family: var(--font-display); font-weight: 800; line-height: 1;
  font-size: clamp(4rem, 22vw, 5.6rem); font-variant-numeric: tabular-nums; color: var(--plum);
  animation: rg-pop .4s ease-out;
}
.rg-result__record {
  margin: 0; padding: 6px 14px; border-radius: 999px; animation: rg-pop .5s ease-out .1s both;
  background: linear-gradient(135deg, #ffd46b, var(--gold)); color: #5a3300;
  font-family: var(--font-display); font-weight: 800; font-size: .9rem; letter-spacing: .06em;
  box-shadow: 0 4px 0 #d68a00;
}
.rg-result__stats { list-style: none; margin: 6px 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; max-width: 360px; }
.rg-result__stats li { padding: 10px 4px; border-radius: var(--r-sm); background: var(--surface); box-shadow: var(--shadow); display: grid; gap: 2px; }
.rg-result__stats strong { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; }
.rg-result__stats span { font-size: .72rem; font-weight: 700; color: var(--plum-2); }

/* =========================================================================
   EFEITOS
   ========================================================================= */
.rg-fx { position: absolute; inset: 0; z-index: 40; pointer-events: none; overflow: hidden; }
.rg-float {
  position: absolute; transform: translate(-50%, -50%); white-space: nowrap;
  display: grid; justify-items: center; line-height: 1;
  font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; color: var(--rose-deep);
  text-shadow: 0 2px 0 #fff, 0 -2px 0 #fff, 2px 0 0 #fff, -2px 0 0 #fff, 0 6px 14px rgba(208, 20, 95, .22);
  animation: rg-float-up .7s ease-out forwards;
}
.rg-float small { margin-top: 3px; font-size: .62em; }
.rg-float--perfect { font-size: 2rem; color: var(--rose); animation: rg-stamp .95s ease-out forwards; }
.rg-float--perfect small { color: var(--plum); font-size: .7em; }
.rg-float--done { font-size: 1.5rem; color: var(--plum-2); animation: rg-stamp .8s ease-out forwards; }
.rg-float--done small { color: var(--plum); }
.rg-float--combo { font-size: 1rem; color: #d93d17; animation-duration: .8s; }
.rg-float--lost { font-size: .8rem; color: var(--plum-2); animation-duration: .8s; }
.rg-float--turbo-end { font-size: .95rem; color: #6a2cc0; animation-duration: .9s; }
.rg-float--wrong { font-size: 1rem; color: var(--bad); animation-duration: .6s; }
.rg-float--turbo { font-size: 2.2rem; color: #7b35e0; animation: rg-stamp 1s ease-out forwards; }
.rg-float--turbo small { font-size: .45em; color: var(--plum); }
.rg-fly { position: absolute; z-index: 41; pointer-events: none; }
.rg-spark { position: absolute; width: 8px; height: 8px; border-radius: 50%; }

/* ---------- animações (só transform/opacity) */
@keyframes rg-pour { 0% { transform: scaleY(0); } 70% { transform: scaleY(1.06); } 100% { transform: scaleY(1); } }
@keyframes rg-drip { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes rg-plop { 0% { transform: translateY(-34px); opacity: 0; } 55% { transform: translateY(3px) scaleY(.94); opacity: 1; } 100% { transform: none; } }
@keyframes rg-ripple { 0% { opacity: .9; transform: scale(.7); } 100% { opacity: 0; transform: scale(1.12); } }
@keyframes rg-gulp { 35% { transform: scale(1.035, .965); } 70% { transform: scale(.99, 1.01); } }
@keyframes rg-hop { 30% { transform: translateY(-10px) scale(1.03); } 60% { transform: translateY(0) scale(1.02, .98); } }
@keyframes rg-twinkle { 0% { opacity: 0; transform: scale(.2) rotate(0); } 50% { opacity: 1; transform: scale(1.1) rotate(20deg); } 100% { opacity: 0; transform: scale(.6) rotate(40deg); } }
@keyframes rg-glow-pop { 0% { opacity: 0; transform: scale(.6); } 40% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.15); } }
@keyframes rg-cup-in { from { transform: translateY(18px) scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rg-cup-out { to { transform: translateX(-115%) rotate(-8deg) scale(.85); opacity: 0; } }
@keyframes rg-cup-drop { to { transform: translateY(26px) scale(.9); opacity: 0; } }
@keyframes rg-wobble { 25% { transform: rotate(-4deg); } 50% { transform: rotate(3deg); } 75% { transform: rotate(-2deg); } }
@keyframes rg-bump { 40% { transform: scale(1.16); } }
@keyframes rg-pop { 0% { transform: scale(.85); } 50% { transform: scale(1.14); } 100% { transform: scale(1); } }
@keyframes rg-lost { 20%, 60% { transform: translateX(-4px); opacity: .75; } 40%, 80% { transform: translateX(4px); } }
@keyframes rg-tick { 30% { transform: scale(1.14); } }
@keyframes rg-shake {
  0%, 70% { border-color: var(--bad); }
  15%, 45% { transform: translateX(-6px); }
  30%, 60% { transform: translateX(6px); }
}
@keyframes rg-tile-ok {
  0% { border-color: var(--ok); box-shadow: 0 4px 0 var(--ledge), 0 0 0 0 rgba(23, 163, 107, .35); }
  45% { border-color: var(--ok); box-shadow: 0 4px 0 var(--ledge), 0 0 0 5px rgba(23, 163, 107, .25); }
}
@keyframes rg-art-send { 0% { transform: scale(1); } 35% { transform: scale(.72); opacity: .5; } 100% { transform: scale(1); } }
@keyframes rg-tile-in { from { transform: translateY(8px) scale(.94); opacity: 0; } }
@keyframes rg-step-in { from { transform: translateY(-6px) scale(.9); opacity: 0; } }
@keyframes rg-ticket-in { from { transform: translateY(-4px) scale(.985); } }
@keyframes rg-arrive { 0% { transform: scale(1); } 50% { transform: scale(1.24); } 100% { transform: scale(1.12); } }
@keyframes rg-nudge { 30% { transform: scale(1.24); } 100% { transform: scale(1.12); } }
@keyframes rg-hint { 50% { box-shadow: 0 4px 0 var(--ledge), 0 0 0 5px rgba(255, 45, 132, .2); } }
@keyframes rg-float-up {
  0% { transform: translate(-50%, -30%) scale(.6); opacity: 0; }
  20% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(-50%, -130%) scale(1); opacity: 0; }
}
@keyframes rg-stamp {
  0% { transform: translate(-50%, -50%) scale(.5); opacity: 0; }
  18% { transform: translate(-50%, -50%) scale(1.12); opacity: 1; }
  30% { transform: translate(-50%, -50%) scale(1); }
  75% { transform: translate(-50%, -58%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -75%) scale(.96); opacity: 0; }
}
@keyframes rg-float-idle { 50% { transform: translateY(-8px); } }

/* ---------- pedidos de 4: um pouco mais justos para nomes como "Sorvete de Morango" caberem em 2 linhas */
.rg-ticket__steps[data-count="4"] { gap: 9px; }
.rg-ticket__steps[data-count="4"] .rg-step__name { font-size: .68rem; padding: 1px 3px; }
.rg-ticket__steps[data-count="4"] .rg-step + .rg-step::before { left: -9px; }

/* ---------- pedidos longos (5–6 ingredientes): passos compactos, tudo em uma linha */
.rg-ticket__steps[data-count="5"], .rg-ticket__steps[data-count="6"] { gap: 7px; }
.rg-ticket__steps[data-count="5"] .rg-step, .rg-ticket__steps[data-count="6"] .rg-step { flex-basis: 60px; }
.rg-ticket__steps[data-count="5"] .rg-step__art, .rg-ticket__steps[data-count="6"] .rg-step__art { width: 42px; height: 42px; padding: 4px; }
.rg-ticket__steps[data-count="5"] .rg-step__n, .rg-ticket__steps[data-count="6"] .rg-step__n { width: 17px; height: 17px; font-size: .62rem; left: calc(50% - 27px); }
.rg-ticket__steps[data-count="5"] .rg-step__name, .rg-ticket__steps[data-count="6"] .rg-step__name { font-size: .62rem; line-height: 1.08; padding: 1px 3px; -webkit-line-clamp: 3; }
.rg-ticket__steps[data-count="5"] .rg-step + .rg-step::before, .rg-ticket__steps[data-count="6"] .rg-step + .rg-step::before { left: -7px; top: 12px; font-size: .75rem; }

/* ---------- anúncio de novo estágio e recordes pessoais no resultado */
.rg-float--stage { font-size: 1.35rem; color: var(--rose-deep); animation: rg-stamp 1.2s ease-out forwards; }
.rg-float--stage small { font-size: .55em; color: var(--plum-2); }
.rg-result__stats small { font-size: .64rem; font-weight: 700; color: var(--plum-2); }

/* ---------- resultado: XP e nível (abaixo da pontuação, que continua protagonista) */
.rg-xp { width: 100%; max-width: 360px; display: grid; gap: 6px; padding: 10px 12px; border-radius: var(--r-md); background: rgba(255, 255, 255, .8); text-align: left; }
.rg-xp__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.rg-xp__head strong { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; color: var(--rose-deep); }
.rg-xp__head span { font-size: .78rem; font-weight: 800; color: var(--plum); text-align: right; }
.rg-bar--xp { height: 10px; }
.rg-bar--xp #xp-bar-before { background: #f3b4cf; transition: none; }
/* próximo objetivo (um só) — no lugar do antigo "faltam N XP" */
.rg-xp__goal { margin: 0; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; }
.rg-xp__goal-art { width: 30px; height: 30px; }
.rg-xp__goal-art:empty { display: none; }
.rg-xp__goal > span:last-child { display: grid; min-width: 0; line-height: 1.2; }
.rg-xp__goal small { font-size: .58rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--plum-2); }
.rg-xp__goal b { font-size: .8rem; font-weight: 800; color: var(--plum); }
.rg-xp__goal b + span { font-size: .72rem; font-weight: 700; color: var(--plum-2); }
/* desafio da partida no resultado: uma linha */
.rg-xp__challenge { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; font-size: .74rem; font-weight: 700; color: var(--plum-2); }
.rg-xp__next { flex-basis: 100%; padding-left: 20px; font-style: normal; font-size: .68rem; font-weight: 700; color: var(--plum-2); }
.rg-xp__challenge .rg-ico { flex: none; font-size: .9rem; color: var(--rose-deep); }
.rg-xp__challenge small { font-size: .58rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.rg-xp__challenge b { font-weight: 800; color: var(--plum); }
.rg-xp__challenge span { margin-left: auto; font-weight: 800; color: var(--plum); white-space: nowrap; }
.rg-xp__challenge.is-done b, .rg-xp__challenge.is-done span { color: #0f7a50; }
.rg-xp__ach { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.rg-xp__ach li { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 6px; border-radius: 99px; background: #fff3d6; color: #7a4a00; font-size: .7rem; font-weight: 800; }
.rg-xp__ach li .rg-ico { color: var(--gold); }
.rg-xp__ach li.is-recipe { background: var(--rose-mist); color: var(--rose-deep); }
.rg-xp__ach li.is-recipe .rg-ico { color: var(--rose); }

/* ---------- celebração de sabor novo */
.rg-unlock__sheet { text-align: center; justify-items: center; }
.rg-unlock__sheet.is-in { animation: rg-cup-in .3s cubic-bezier(.2, .9, .3, 1.3) both; }
.rg-unlock__kicker {
  margin: 0; padding: 4px 12px; border-radius: 10px; transform: rotate(-2deg);
  background: linear-gradient(135deg, #ffd46b, var(--gold)); color: #5a3300; font-family: var(--font-display); font-weight: 800; font-size: .85rem; letter-spacing: .06em;
}
.rg-unlock__art { width: 112px; height: 112px; }
.rg-unlock__art .rg-art { width: 100%; height: 100%; }
.rg-unlock__text { margin: 0; font-size: .88rem; font-weight: 600; color: var(--plum-2); }

/* ---------- aviso de conquista durante a partida (topo, pequeno, some sozinho) */
.rg-toast {
  position: absolute; top: calc(max(12px, env(safe-area-inset-top)) + 50px); left: 50%; z-index: 25; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; white-space: nowrap;
  background: #fff8e8; color: #6a4300; box-shadow: 0 6px 16px rgba(154, 91, 0, .18), 0 0 0 1.5px #ffd46b;
  font-size: .78rem; font-weight: 800; pointer-events: none;
}
.rg-toast .rg-ico { color: var(--gold); font-size: 1rem; }
.rg-toast.is-recipe { background: var(--rose-mist); color: var(--rose-deep); box-shadow: 0 6px 16px rgba(208, 20, 95, .16), 0 0 0 1.5px var(--rose-soft); }
.rg-toast.is-recipe .rg-ico { color: var(--rose); }
/* receita já descoberta: só reconhece o pedido — mais discreto que a descoberta */
.rg-toast.is-recipe-known { background: var(--surface); color: var(--plum-2); font-weight: 700; box-shadow: 0 4px 12px rgba(59, 21, 49, .10), 0 0 0 1px var(--rose-soft); }
.rg-toast.is-recipe-known .rg-ico { color: var(--rose-soft); }
.rg-toast.is-in { animation: rg-toast-in .25s ease-out both; }
@keyframes rg-toast-in { from { transform: translateX(-50%) translateY(-8px); opacity: 0; } }
.rg-result__stats li.is-new-best { box-shadow: 0 0 0 2px var(--gold), var(--shadow); }
.rg-result__stats li.is-new-best small { color: #9a5b00; font-weight: 800; }

/* ---------- telas baixas (ex.: iPhone SE) */
@media (max-height: 700px) {
  .rg-game { gap: 7px; }
  .rg-hud__score span { font-size: 1.7rem; }
  .rg-hud__combo, .rg-hud__errors { height: 42px; }
  .rg-step__art { width: 42px; height: 42px; padding: 4px; }
  .rg-step__n { left: calc(50% - 28px); }
  .rg-step + .rg-step::before { top: 12px; }
  .rg-ticket { padding-top: 7px; }
  .rg-ticket__head { margin-bottom: 7px; padding-bottom: 5px; }
  .rg-board { gap: 8px; padding-top: 10px; }
  /* resultado mais compacto: pontuação continua grande, o resto se aperta */
  .rg-result { gap: 8px; }
  .rg-result__label { display: none; }
  .rg-result__score { font-size: clamp(3.4rem, 18vw, 4.4rem); margin-top: 0; }
  .rg-result__stats li { padding: 7px 4px; }
  .rg-result__best { padding: 3px 12px; font-size: .8rem; }   /* estágio + recorde: linha compacta */
  .rg-result .rg-cta { min-height: 56px; }
  .rg-result .rg-btn2 { min-height: 46px; }
  .rg-journey { padding: 8px 10px; }
}

/* ---------- telas até 860px de altura (maioria dos celulares e a moldura no desktop):
   peças mais baixas (arte ao lado do nome) para o copo continuar dominante */
@media (max-height: 860px) {
  .rg-tile {
    min-height: 60px; padding: 6px 6px 6px 5px; gap: 5px;
    grid-template-rows: none; grid-template-columns: auto minmax(0, 1fr); justify-items: start;
  }
  .rg-tile__art { width: 36px; padding: 2px; }
  /* nomes longos (sabores futuros) cabem em até 3 linhas sem cortar */
  .rg-tile__name { text-align: left; font-size: .72rem; line-height: 1.08; -webkit-line-clamp: 3; }
  .rg-tile__check { top: -6px; right: -6px; }
}

/* ---------- desktop/tablet: o jogo vira uma "tela de celular" centralizada */
@media (min-width: 600px) and (min-height: 640px) {
  body.rg {
    background:
      radial-gradient(900px 600px at 20% 10%, #fff 0%, transparent 60%),
      radial-gradient(700px 500px at 90% 90%, #ffd0e2 0%, transparent 60%),
      radial-gradient(circle at 1px 1px, rgba(208, 20, 95, .08) 1px, transparent 0) 0 0 / 22px 22px,
      var(--bg-bottom);
  }
  .rg-device {
    width: 430px;
    height: min(calc(100dvh - 48px), 900px);
    border-radius: 40px;
    box-shadow: 0 0 0 10px #fff, 0 40px 80px rgba(120, 20, 70, .22);
  }
  .rg-board { border-radius: var(--r-lg); margin: 0 -4px 10px; }
}

/* ---------- celular deitado (paisagem baixa): em coluna única o copo sumia e o JOGAR/bancada saíam da tela.
   Duas colunas: copo à esquerda; o resto à direita. Só itens do fluxo mudam de coluna (som e painéis são absolutos). */
@media (orientation: landscape) and (max-height: 500px) {
  .rg-home { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 24px; row-gap: 8px; align-content: center; justify-items: center; }
  .rg-home > .rg-home__brand, .rg-home > .rg-home__title, .rg-home > .rg-home__best, .rg-home > .rg-home__recipes, .rg-home > .rg-cta, .rg-home > .rg-journey { grid-column: 2; }
  .rg-home__cup { grid-column: 1; grid-row: 1 / span 6; align-self: stretch; min-height: 0; height: 100%; }
  .rg-game {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); grid-template-rows: auto auto auto minmax(0, 1fr); column-gap: 14px;
    grid-template-areas: "hud hud" "stage ticket" "stage challenge" "stage board";
  }
  .rg-hud { grid-area: hud; }
  .rg-ticket { grid-area: ticket; }
  .rg-stage { grid-area: stage; }
  .rg-challenge { grid-area: challenge; }
  /* colunas automáticas (o --cols do ui.js continua valendo no retrato): até 9 peças em 2 linhas */
  .rg-board { grid-area: board; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); align-self: end; margin: 0 -14px 0 0; }
}

/* ---------- movimento reduzido: sem deslocamentos; estados continuam visíveis */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important;
    transition-duration: .01ms !important; transition-delay: 0s !important;
  }
  .rg-tile.is-hint { animation: none; box-shadow: 0 4px 0 var(--ledge), 0 0 0 4px rgba(255, 45, 132, .25); }
  .rg-float { animation: rg-fade 1s steps(1) forwards !important; animation-duration: 1s !important; }
}
@keyframes rg-fade { to { opacity: 0; } }

/* =========================================================================
   PAINEL DEV (?dev=1) — ferramenta interna, fora da experiência
   ========================================================================= */
.rg-dev-toggle {
  position: absolute; top: 2px; left: 50%; z-index: 60; transform: translateX(-50%);
  padding: 1px 8px; border: 0; border-radius: 6px; background: var(--plum); color: #fff;
  font: 700 .6rem/1.4 ui-monospace, monospace; opacity: .55; cursor: pointer;
}
.rg-dev {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 61; max-height: 78%; overflow: auto;
  padding: 14px; background: #fff; border-radius: 20px 20px 0 0; box-shadow: 0 -20px 50px rgba(59, 21, 49, .3);
  font: .78rem/1.4 ui-monospace, Consolas, monospace; color: var(--plum);
}
.rg-dev__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.rg-dev__row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.rg-dev__row label, .rg-dev label { display: flex; gap: 6px; align-items: center; flex: 1 1 100%; }
.rg-dev input, .rg-dev select { flex: 1; min-height: 36px; padding: 4px 8px; border: 1px solid #e6c9d6; border-radius: 8px; font: inherit; min-width: 0; }
.rg-dev__btn { min-height: 36px; padding: 4px 10px; border: 1px solid #e6c9d6; border-radius: 8px; background: var(--rose-mist); cursor: pointer; font: inherit; }
.rg-dev__label { margin: 10px 0 4px; font-weight: 700; }
.rg-dev__list, .rg-dev__log { margin: 0; padding-left: 1.4em; }
.rg-dev__log { list-style: none; padding: 0; max-height: 160px; overflow: auto; color: var(--plum-2); }
.rg-dev__msg { margin: 4px 0; font-weight: 700; }
.rg-dev__msg[data-ok="true"] { color: var(--ok); }
.rg-dev__msg[data-ok="false"] { color: var(--bad); }
