/* Annyeong! — visual editorial: serifa nos títulos, cartões pastel, pílulas pretas e a carinha rabiscada */
:root {
  --bg: #F1F0F6;
  --surface: #FFFFFF;
  --surface-2: #E8E7EF;
  --ink: #141414;
  --muted: #6D6B78;
  --line: #DCDAE6;
  --line-2: #C9C6D6;
  --cta-bg: #141414;
  --cta-tx: #FFFFFF;
  --forte: #141414;
  --on-pastel: #141414;
  --lima: #DDF26B;
  --amarelo: #FFE55C;
  --coral: #FF9C8F;
  --rosa: #FFB8DD;
  --apagado: #AEABBB;
  /* hangul: Nanum Myeongjo nos títulos; na interface, a fonte coreana do sistema */
  --serif: "Instrument Serif", "Nanum Myeongjo", "Iowan Old Style", Georgia, serif;
  --sans: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Apple SD Gothic Neo", "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E0E11;
    --surface: #1B1B20;
    --surface-2: #26262D;
    --ink: #F4F3F8;
    --muted: #9C9AA8;
    --line: #2E2E36;
    --line-2: #3D3D47;
    --cta-bg: #DDF26B;
    --cta-tx: #141414;
    --forte: #23232A;
    --apagado: #5C5A68;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E0E11;
  --surface: #1B1B20;
  --surface-2: #26262D;
  --ink: #F4F3F8;
  --muted: #9C9AA8;
  --line: #2E2E36;
  --line-2: #3D3D47;
  --cta-bg: #DDF26B;
  --cta-tx: #141414;
  --forte: #23232A;
  --apagado: #5C5A68;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: var(--sans); overscroll-behavior: none; }
body { -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; touch-action: manipulation; -webkit-user-select: none; user-select: none; font-variation-settings: "opsz" 14; }
input, textarea { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
h1, h2, h3, h4, p, dl, dd { margin: 0; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: 0; }

#app { position: fixed; left: 0; right: 0; top: var(--vvt, 0px); height: var(--vvh, 100dvh); overflow: hidden; }
.tela {
  height: 100%; max-width: 520px; margin: 0 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: calc(env(safe-area-inset-top) + 14px) 18px calc(env(safe-area-inset-bottom) + 32px);
  animation: entra .3s ease both;
}
@keyframes entra { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- peças ---------- */
.ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic.cheio { fill: currentColor; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 56px; padding: 0 22px;
  border: 0; border-radius: 999px; background: var(--cta-bg); color: var(--cta-tx);
  font-family: var(--sans); font-weight: 700; font-size: 17px; letter-spacing: -0.01em;
  transition: transform .12s ease, opacity .2s;
}
.btn.grande { min-height: 60px; font-size: 18px; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .3; cursor: default; }
.btn.contorno { background: transparent; color: inherit; box-shadow: inset 0 0 0 1.5px currentColor; }
.btn.escuro { background: #141414; color: #fff; }
.btn.perigo { background: transparent; color: #E5484D; box-shadow: inset 0 0 0 1.5px var(--line-2); font-weight: 600; }
.btn + .btn { margin-top: 10px; }
.circ {
  width: 46px; height: 46px; flex: none; border-radius: 50%; padding: 0; display: grid; place-items: center;
  border: 0; background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line);
  transition: transform .12s;
}
.circ:active { transform: scale(.92); }
.tag {
  display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 12px; border-radius: 999px;
  box-shadow: inset 0 0 0 1.5px currentColor; font-size: 14px; font-weight: 600; white-space: nowrap;
}
.stat {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 999px;
  background: var(--surface); font-size: 15px; color: var(--muted); font-weight: 500; white-space: nowrap;
}
.stat b { color: var(--ink); font-weight: 700; }
.stat .ic { width: 18px; height: 18px; color: var(--ink); }
.card { background: var(--surface); border-radius: 28px; padding: 20px; }
.barra { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.barra i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--ink); transition: width .5s cubic-bezier(.3, 1.2, .5, 1); }
.estrelas { display: inline-flex; gap: 2px; }
.estrelas .ic { width: 15px; height: 15px; stroke-width: 2; }
.estrelas .ic.vazio { opacity: .35; }

/* carinha: 3 quadros que se alternam (traço "fervendo", como desenho à mão) */
.rosto { display: block; overflow: visible; }
.rosto.boil .q { opacity: 0; }
.rosto.boil .q1 { animation: q1 .5s steps(1) infinite; }
.rosto.boil .q2 { animation: q2 .5s steps(1) infinite; }
.rosto.boil .q3 { animation: q3 .5s steps(1) infinite; }
@keyframes q1 { 0% { opacity: 1; } 33.33%, 100% { opacity: 0; } }
@keyframes q2 { 0%, 33.32% { opacity: 0; } 33.33% { opacity: 1; } 66.66%, 100% { opacity: 0; } }
@keyframes q3 { 0%, 66.65% { opacity: 0; } 66.66%, 100% { opacity: 1; } }
.rosto.pula { animation: pula .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pula { 0% { transform: scale(1); } 40% { transform: scale(1.12) rotate(-4deg); } 100% { transform: none; } }
.rosto.treme { animation: bravo .45s; }
@keyframes bravo { 0%, 100% { transform: none; } 20% { transform: translateX(-7px) rotate(-5deg); } 40% { transform: translateX(6px) rotate(4deg); } 60% { transform: translateX(-4px) rotate(-3deg); } 80% { transform: translateX(3px); } }
.rosto .boca-canta { transform-box: fill-box; transform-origin: 50% 20%; transform: scaleY(var(--abre, 1)); transition: transform .07s; }
.rosto.mini { width: 48px; height: 48px; }
.rosto.medio { width: 112px; height: 112px; }
.rosto.grande { width: 168px; height: 168px; }

.aviso {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 14px); z-index: 80; transform: translate(-50%, -160%);
  display: inline-flex; align-items: center; gap: 6px;
  background: #141414; color: #fff; font-weight: 600; font-size: 15px; padding: 11px 18px; border-radius: 99px;
  transition: transform .35s cubic-bezier(.2, .9, .3, 1.2); pointer-events: none; white-space: nowrap; max-width: 92vw;
}
.aviso .ic { width: 18px; height: 18px; fill: #FF9A70; stroke: #FF9A70; }
.aviso.on { transform: translate(-50%, 0); }
.confete { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 90; }

/* ---------- folha (bottom sheet) ---------- */
.folha-wrap { position: fixed; inset: 0; z-index: 50; }
.folha-fundo { position: absolute; inset: 0; background: rgba(10, 10, 14, .45); opacity: 0; transition: opacity .25s; }
.folha {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 520px; max-height: 90%; overflow-y: auto;
  background: var(--surface); border-radius: 32px 32px 0 0; padding: 10px 18px calc(env(safe-area-inset-bottom) + 22px);
  transform: translateY(100%); transition: transform .34s cubic-bezier(.2, .9, .3, 1.04);
}
.folha-wrap.on .folha-fundo { opacity: 1; }
.folha-wrap.on .folha { transform: none; }
.folha-alca { width: 40px; height: 5px; border-radius: 9px; background: var(--line-2); margin: 0 auto 16px; }
.folha-tit { font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 1; margin-bottom: 8px; }
.rot { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .02em; margin: 18px 4px 8px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg[data-k="tema"] { grid-template-columns: repeat(3, 1fr); margin-bottom: 16px; }
.seg button {
  display: flex; align-items: center; justify-content: center; gap: 8px; height: 52px; border: 0; border-radius: 999px;
  background: var(--surface-2); color: var(--ink); font-weight: 600; font-size: 15px; transition: background .15s, color .15s, transform .12s;
}
.seg button:active { transform: scale(.97); }
.seg button.on { background: var(--ink); color: var(--bg); }
.seg .ic { width: 19px; height: 19px; }
.seta-dir { opacity: .6; }
.fase-cab {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  background: var(--c); color: var(--on-pastel); border-radius: 26px; padding: 20px 18px 20px 22px;
}
.fase-cab small { font-size: 13px; font-weight: 600; opacity: .7; }
.fase-cab h3 { font-family: var(--serif); font-weight: 400; font-size: 38px; line-height: 1; margin: 6px 0 6px; letter-spacing: -0.01em; }
.fase-cab p { font-size: 15px; font-weight: 500; opacity: .8; }
.fase-cab .rosto { width: 64px; height: 64px; margin-top: -4px; }
.fase-rec { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 14px; color: var(--muted); font-size: 15px; }
.fase-rec b { color: var(--ink); }
.folha .btn.grande { margin-top: 22px; }
.espiar { margin-top: 14px; }
.espiar summary { font-weight: 600; color: var(--muted); cursor: pointer; text-align: center; list-style: none; padding: 8px; text-decoration: underline; text-underline-offset: 4px; }
.espiar summary::-webkit-details-marker { display: none; }
.espiar ul, .res-revisar ul { list-style: none; padding: 0; margin: 6px 0 0; }
.espiar li, .res-revisar li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--line); font-size: 16px; }
.espiar li span, .res-revisar li span { color: var(--muted); }
.espiar li b, .res-revisar li b { text-align: right; font-weight: 600; }
.cfg { display: flex; align-items: center; justify-content: space-between; padding: 15px 2px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 17px; cursor: pointer; }
.cfg input { position: absolute; opacity: 0; pointer-events: none; }
.sw { width: 52px; height: 32px; border-radius: 99px; background: var(--line-2); position: relative; transition: background .2s; flex: none; }
.sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.cfg input:checked + .sw { background: var(--cta-bg); }
.cfg input:checked + .sw::after { transform: translateX(20px); background: var(--cta-tx); }
.testes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.testes .btn + .btn { margin-top: 0; }
.testes .btn { font-size: 15px; min-height: 50px; padding: 0 10px; }
.mini { text-align: center; color: var(--muted); font-size: 14px; line-height: 1.45; margin: 14px 8px; }
.sair-box { text-align: center; padding: 4px 0 18px; }
.sair-box .rosto { margin: 0 auto 10px; }
.sair-box h3 { font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 1; }
.sair-box p { color: var(--muted); margin-top: 8px; }
.zerou { text-align: center; padding: 4px 0 18px; }
.zerou .rosto { margin: 0 auto 6px; }
.zerou h2 { font-family: var(--serif); font-weight: 400; font-size: 44px; line-height: 1; margin: 6px 0 10px; }
.zerou p { color: var(--muted); line-height: 1.45; }

/* levar o progresso */
.codigo {
  display: block; width: 100%; margin: 8px 0 4px; padding: 14px 16px; border: 0; border-radius: 20px; resize: none;
  background: var(--surface-2); color: var(--ink); font: 500 16px/1.35 ui-monospace, "SF Mono", Menlo, monospace; word-break: break-all; outline: none;
}
.codigo:focus { box-shadow: inset 0 0 0 2px var(--ink); }
.transf-resumo { font-weight: 600; font-size: 16px; margin: 4px 2px 10px; min-height: 20px; }
.passos { margin: 6px 0 4px; padding-left: 22px; line-height: 1.45; font-size: 16px; }
.passos li { margin-bottom: 6px; padding-left: 4px; }
.mini.alinhado { text-align: left; margin: 0 2px 10px; }
.folha .btn + .btn.grande { margin-top: 10px; }

/* ---------- início ---------- */
.topo { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.marca { font-family: var(--serif); font-style: italic; font-size: 34px; line-height: 1; letter-spacing: -0.01em; }
.ola { display: flex; align-items: center; gap: 4px; margin-bottom: 18px; }
.ola-rosto { border: 0; background: none; padding: 0; flex: none; }
.rosto.heroi { width: 120px; height: 120px; }
.balao {
  position: relative; background: var(--surface); border-radius: 22px; padding: 14px 16px; margin-left: 8px;
  display: flex; flex-direction: column; gap: 3px; max-width: 220px;
}
.balao::before { content: ''; position: absolute; left: -9px; top: 50%; width: 18px; height: 18px; background: inherit; border-radius: 3px; transform: translateY(-50%) rotate(45deg); }
.balao b { font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 1.1; position: relative; }
.balao span { font-size: 13px; color: var(--muted); position: relative; }
.ola-rosto.cantando .rosto { animation: balanca 1.07s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes balanca { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg) translateY(-3px); } }
.balao.canta { min-height: 96px; justify-content: center; }
.balao.canta b { font-size: 20px; color: var(--apagado); }
.balao.canta mark { background: none; color: var(--ink); }
.titulo { font-family: var(--serif); font-weight: 400; font-size: clamp(44px, 13vw, 58px); line-height: .98; letter-spacing: -0.02em; margin-bottom: 18px; }
.titulo em { color: var(--muted); }
.titulo.ola-titulo { font-size: clamp(36px, 10.5vw, 48px); line-height: 1.12; margin-bottom: 6px; letter-spacing: -0.01em; }
.titulo-pt { font-size: 15px; color: var(--muted); margin: 0 0 18px; }
.stats { display: flex; gap: 8px; overflow-x: auto; margin: 0 -18px 16px; padding: 0 18px; scrollbar-width: none; }
.stats::-webkit-scrollbar { display: none; }
.zerar { margin-bottom: 12px; }
.numeros { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.numeros b { display: block; font-family: var(--serif); font-weight: 400; font-size: 48px; line-height: 1; letter-spacing: -0.02em; }
.numeros b small { font-size: 24px; color: var(--muted); }
.numeros span { font-size: 14px; color: var(--muted); }
.continuar {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; border: 0; border-radius: 28px; padding: 18px 18px 18px 22px;
  background: var(--forte); color: #fff; margin-bottom: 8px; transition: transform .12s;
}
.continuar:active { transform: scale(.98); }
.continuar-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.continuar-txt small { font-size: 13px; opacity: .65; }
.continuar-txt b { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.continuar-ir { width: 48px; height: 48px; border-radius: 50%; background: var(--lima); color: #141414; display: grid; place-items: center; flex: none; }
.sec { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 4px 14px; }
.sec h2 { font-family: var(--serif); font-weight: 400; font-size: 38px; line-height: 1; }
.sec span { font-size: 14px; color: var(--muted); }
/* cartões empilhados: cada um cobre o pé do anterior */
.pilha { display: flex; flex-direction: column; }
.nivel {
  position: relative; display: flex; flex-direction: column; gap: 14px; width: 100%; text-align: left; border: 0;
  border-radius: 32px; background: var(--c); color: var(--on-pastel); padding: 22px 20px 54px 22px; margin-top: -32px;
  box-shadow: 0 -6px 18px rgba(20, 20, 20, .06); transition: transform .15s;
}
.nivel:first-child { margin-top: 0; }
.nivel:last-child { padding-bottom: 22px; }
.nivel:active { transform: translateY(-3px); }
.nivel-topo { display: flex; justify-content: space-between; align-items: flex-start; }
.nivel-topo b { font-size: 34px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; font-variation-settings: "opsz" 60; }
.pct { font-size: 15px; font-weight: 600; }
.nivel-pe { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nivel .ir { margin-left: auto; width: 40px; height: 40px; border-radius: 50%; background: #141414; color: #fff; display: grid; place-items: center; }
.nivel .ir .ic { width: 20px; height: 20px; }
.instalar { display: flex; gap: 12px; align-items: flex-start; position: relative; margin-top: 18px; padding-right: 44px; }
.instalar .rosto { width: 44px; height: 44px; flex: none; }
.instalar b { font-size: 16px; }
.instalar p { color: var(--muted); margin-top: 4px; line-height: 1.4; font-size: 15px; }
.instalar p b { color: var(--ink); font-size: inherit; }
.fechar-dica { position: absolute; top: 12px; right: 12px; border: 0; background: none; color: var(--muted); padding: 4px; }
.fechar-dica .ic { width: 18px; height: 18px; }
.rodape { text-align: center; color: var(--muted); font-size: 13px; margin-top: 24px; }

/* ---------- trilha do nível ---------- */
.nv-topo { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.nv-heroi { margin-bottom: 22px; }
.sobre { font-size: 14px; color: var(--muted); }
.nv-heroi h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(56px, 17vw, 76px); line-height: .95; letter-spacing: -0.03em; margin: 4px 0 6px; }
.nv-heroi p { color: var(--muted); font-size: 16px; }
.nv-prog { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.nv-prog .barra { flex: 1; }
.nv-prog b { font-size: 14px; font-weight: 600; }
.trilha { display: flex; flex-direction: column; gap: 14px; }
.bloco {
  background: var(--c); color: var(--on-pastel); border-radius: 30px; padding: 20px 18px 18px 20px;
  transform: rotate(var(--rot, 0deg)); transition: transform .2s;
}
.bloco.ativo { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink); }
.bloco-topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.bloco-topo small { font-size: 13px; font-weight: 600; opacity: .65; }
.bloco-topo h3 { font-size: 28px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.02; margin-top: 2px; font-variation-settings: "opsz" 48; }
.bloco-emoji { width: 52px; height: 52px; border-radius: 50%; background: rgba(255, 255, 255, .55); display: grid; place-items: center; font-size: 26px; flex: none; }
.bloco-info { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 16px; align-items: center; font-size: 15px; }
.bloco-info .ic { width: 16px; height: 16px; color: #E5484D; }
.paradas { display: flex; gap: 12px; flex-wrap: wrap; }
.parada-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 58px; }
.parada {
  position: relative; width: 58px; height: 58px; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center;
  font-size: 20px; font-weight: 700; transition: transform .12s;
}
.parada:active { transform: scale(.9); }
.parada.feita { background: #141414; color: #fff; }
.parada.atual { background: #fff; color: #141414; box-shadow: inset 0 0 0 2.5px #141414; }
.parada.atual::after { content: ''; position: absolute; inset: -7px; border-radius: 50%; border: 2.5px solid #141414; opacity: .3; animation: pulso 1.6s ease-in-out infinite; }
.parada.bloq { background: rgba(255, 255, 255, .38); color: rgba(20, 20, 20, .45); box-shadow: inset 0 0 0 1.5px rgba(20, 20, 20, .18); }
.parada .ic { width: 24px; height: 24px; }
.parada.atual .ic { width: 22px; height: 22px; margin-left: 2px; }
.rep {
  position: absolute; top: -6px; right: -10px; display: inline-flex; align-items: center; gap: 1px; height: 22px; padding: 0 7px 0 5px;
  border-radius: 99px; background: #fff; color: #141414; font-size: 12px; font-weight: 700; box-shadow: inset 0 0 0 1.5px #141414;
}
.rep .ic { width: 12px; height: 12px; stroke-width: 2.6; }
.parada-rot { font-size: 12px; font-weight: 600; min-height: 15px; }
.parada-rot .estrelas .ic { width: 13px; height: 13px; }
.bloco.chefe { background: #141414; color: #fff; --rot: 0deg; }
.bloco.chefe .bloco-info .ic { color: #FF7A7A; }
.bloco.chefe .parada.atual { background: var(--lima); box-shadow: none; }
.bloco.chefe .parada.atual::after { border-color: var(--lima); opacity: .5; }
.bloco.chefe .parada.feita { background: var(--lima); color: #141414; }
.bloco.chefe .parada.bloq { background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .45); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .2); }
.bloco.chefe .rosto { width: 54px; height: 54px; }
.fim-nivel { text-align: center; color: var(--muted); font-size: 14px; margin-top: 22px; }
@keyframes pulso { 0%, 100% { transform: scale(.95); opacity: .4; } 50% { transform: scale(1.08); opacity: .1; } }
.treme { animation: treme .4s; }
@keyframes treme { 0%, 100% { translate: 0; } 20% { translate: -8px; } 40% { translate: 7px; } 60% { translate: -5px; } 80% { translate: 3px; } }

/* ---------- jogo ---------- */
.tela.jogo { display: flex; flex-direction: column; overflow: hidden; position: relative; padding-bottom: calc(env(safe-area-inset-bottom) + 14px); animation: none; }
html.kb .tela.jogo { padding-bottom: 10px; }
.g-topo { display: flex; align-items: center; gap: 12px; flex: none; }
.g-barra { flex: 1; height: 10px; }
.g-meta { flex: none; }
.meta-pill {
  display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 12px; border-radius: 99px;
  background: var(--surface); font-weight: 700; font-size: 15px;
}
.meta-pill .ic { width: 17px; height: 17px; color: #E5484D; }
.meta-pill.combo .ic { color: #FF7A2F; }
.g-meio { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 12px 0; }
.g-cab { display: flex; align-items: center; gap: 10px; }
.g-rosto { flex: none; width: 52px; height: 52px; }
.g-rosto .rosto { width: 52px; height: 52px; }
html.kb .g-rosto, html.kb .g-rosto .rosto { width: 42px; height: 42px; }
.g-rotulo { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; font-variation-settings: "opsz" 36; }
.g-rotulo em { font-size: 1.15em; }
/* carta com duas cartas coloridas atrás */
.g-carta { position: relative; isolation: isolate; margin-top: 22px; }
.g-carta::before, .g-carta::after { content: ''; position: absolute; height: 60px; border-radius: 28px; transition: background .3s; }
.g-carta::before { left: 14px; right: 14px; top: -11px; background: var(--c2, #CBB8FF); z-index: 0; }
.g-carta::after { left: 30px; right: 30px; top: -21px; background: var(--c3, #A8D5FF); z-index: -1; }
.g-face {
  position: relative; z-index: 1; min-height: clamp(150px, 26vh, 230px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
  padding: 30px 26px; border-radius: 32px; background: var(--c1, #FFB8DD); color: var(--on-pastel); transition: background .3s;
}
html.kb .g-face { min-height: 104px; padding: 18px 22px; }
html.kb .g-meio { gap: 8px; padding: 4px 0; }
html.kb .g-carta { margin-top: 16px; }
.g-carta.entra .g-face { animation: carta .4s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes carta { from { opacity: 0; transform: translateY(16px) scale(.95) rotate(-1.5deg); } to { opacity: 1; transform: none; } }
.g-palavra { font-family: var(--serif); font-size: 60px; line-height: 1; text-align: center; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.g-palavra.m { font-size: 46px; }
.g-palavra.p { font-size: 36px; line-height: 1.05; }
.g-palavra.pp { font-size: 29px; line-height: 1.1; }
html.kb .g-palavra { font-size: 46px; }
html.kb .g-palavra.m { font-size: 38px; }
html.kb .g-palavra.p { font-size: 30px; }
html.kb .g-palavra.pp { font-size: 25px; }
.g-ouvir { position: absolute; right: 12px; bottom: 12px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .6); color: #141414; display: grid; place-items: center; padding: 0; }
.g-ouvir[hidden] { display: none; }
/* romanização embaixo do hangul */
.g-rom { font-size: 16px; font-weight: 600; letter-spacing: .02em; opacity: .55; margin-top: -4px; }
.g-rom[hidden] { display: none; }
html.kb .g-rom { font-size: 14px; }
.g-carta.trava .g-rom, .g-carta.resolvida .g-rom { display: none; }
.rom { font-size: .62em; font-weight: 600; opacity: .6; letter-spacing: .02em; }
.op-rom { display: block; font-size: 12.5px; font-weight: 600; opacity: .5; margin-top: 2px; letter-spacing: .02em; }
/* palavra que você errou e voltou */
.g-selo { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 11px; border-radius: 99px; background: #141414; color: #fff; font-size: 12.5px; font-weight: 700; }
.g-selo .ic { width: 13px; height: 13px; stroke-width: 2.6; }
.g-selo[hidden], .g-trava[hidden] { display: none; }
/* travada até a resposta ficar perfeita */
.g-carta.trava.quase .g-face { background: var(--amarelo); }
.g-carta.trava.erro .g-face { background: var(--coral); }
.g-carta.resolvida .g-face { background: var(--lima); }
.g-carta.trava .g-palavra, .g-carta.resolvida .g-palavra { font-size: 28px; opacity: .6; }
.g-carta.trava .g-ouvir, .g-carta.resolvida .g-ouvir { display: none; }
.g-carta.trava .g-selo, .g-carta.resolvida .g-selo { display: none; }
.g-trava { display: grid; gap: 6px; justify-items: center; color: #141414; }
.tr-dica { font-size: 17px; font-weight: 700; line-height: 1.25; }
.tr-resp { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 8px; font-size: 23px; letter-spacing: -0.01em; }
.tr-resp b { font-weight: 700; }
.tr-sua { font-size: 14px; opacity: .7; }
.tr-acoes { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; }
.tr-acoes button { border: 0; background: none; color: #141414; padding: 4px 0; font-size: 13.5px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
html.kb .g-carta.trava .g-palavra, html.kb .g-carta.resolvida .g-palavra { font-size: 22px; }
html.kb .g-face { gap: 6px; }
html.kb .tr-dica { font-size: 15.5px; }
html.kb .tr-resp { font-size: 20px; }
html.kb .tr-sua { display: none; }
.g-resp { flex: none; }
.acentos { display: flex; gap: 6px; overflow-x: auto; padding: 0 0 10px; scrollbar-width: none; }
.acentos[hidden] { display: none; }
.acentos::-webkit-scrollbar { display: none; }
.acentos button { flex: none; min-width: 42px; height: 40px; border-radius: 999px; border: 0; background: var(--surface); color: var(--ink); font-size: 18px; padding: 0 10px; }
.acentos button:active { transform: scale(.92); }
.g-input {
  width: 100%; height: 60px; font-family: var(--sans); font-size: 20px; font-weight: 600; padding: 0 22px; border-radius: 999px;
  border: 0; background: var(--surface); color: var(--ink); outline: none; box-shadow: inset 0 0 0 1.5px var(--line);
  -webkit-appearance: none; appearance: none; transition: box-shadow .15s;
}
.g-input:focus { box-shadow: inset 0 0 0 2px var(--ink); }
.g-input.treme { animation: treme .4s; }
.g-input::placeholder { color: var(--muted); font-weight: 500; }
.g-pe { flex: none; padding-top: 10px; }
.g-pe .btn .ic { display: none; }
/* com o teclado aberto, "Verificar" vira uma seta dentro do campo (sobra espaço para a carta) */
html.kb .g-pe { position: absolute; right: 24px; bottom: 16px; padding: 0; z-index: 2; }
html.kb .g-pe .btn { width: 48px; min-height: 48px; height: 48px; padding: 0; }
html.kb .g-pe .btn .txt { display: none; }
html.kb .g-pe .btn .ic { display: block; width: 24px; height: 24px; stroke-width: 2.4; }
html.kb .g-input { padding-right: 66px; }
.opcoes { display: grid; gap: 10px; }
.opcoes.grade { grid-template-columns: 1fr 1fr; }
.op {
  min-height: 64px; padding: 12px 18px; border-radius: 22px; border: 0; background: var(--surface); color: var(--ink);
  font-size: 18px; font-weight: 600; text-align: center; letter-spacing: -0.01em; overflow-wrap: anywhere;
  transition: transform .12s, background .15s;
}
.opcoes:not(.grade) .op { text-align: left; }
.op:active:not(:disabled) { transform: scale(.97); }
.op:disabled { cursor: default; }
.op.certa { background: var(--lima); color: #141414; }
.op.errada { background: var(--coral); color: #141414; animation: treme .4s; }
.op:disabled:not(.certa):not(.errada) { opacity: .4; }

.fb {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; padding: 20px 18px calc(env(safe-area-inset-bottom) + 16px);
  border-radius: 32px 32px 0 0; color: #141414; transform: translateY(110%); transition: transform .3s cubic-bezier(.2, .9, .3, 1.08);
  visibility: hidden;
}
html.kb .fb { padding-bottom: 12px; }
.fb.on { transform: none; visibility: visible; }
.fb.ok { background: var(--lima); }
.fb.quase { background: var(--amarelo); }
.fb.erro { background: var(--coral); }
.fb-linha { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.fb-rosto { width: 70px; height: 70px; flex: none; }
.fb-txt { flex: 1; min-width: 0; }
.fb-tit { display: block; font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1; margin-bottom: 6px; }
.fb-txt p { margin-top: 4px; font-size: 15px; line-height: 1.35; }
.fb-resp { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; font-size: 21px !important; font-weight: 700; letter-spacing: -0.01em; }
.lingua { font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 99px; box-shadow: inset 0 0 0 1.5px #141414; letter-spacing: .04em; }
.fb-ouvir { width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .55); display: grid; place-items: center; padding: 0; color: #141414; }
.fb-ouvir .ic { width: 18px; height: 18px; }
.fb-alt { opacity: .75; font-size: 14px !important; }
.fb-sua { opacity: .75; }
.fb-link { border: 0; background: none; color: inherit; padding: 6px 0 0; font-weight: 700; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- resultado ---------- */
.tela.resultado { background: var(--c); color: var(--on-pastel); max-width: none; }
.res { max-width: 484px; margin: 0 auto; display: flex; flex-direction: column; min-height: 100%; }
.res-topo { display: flex; align-items: center; justify-content: space-between; }
.res-topo .circ { background: rgba(255, 255, 255, .55); box-shadow: none; color: #141414; }
.res-rosto { margin: 14px 0 6px; }
.res-rosto .rosto { margin: 0 auto; }
.res h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(56px, 16vw, 72px); line-height: .95; letter-spacing: -0.03em; }
.res-sub { font-size: 16px; opacity: .75; margin-top: 8px; }
.res-estrelas { display: flex; gap: 6px; margin-top: 16px; }
.res-estrelas span { animation: estrela .5s var(--d) both cubic-bezier(.2, .9, .3, 1.6); }
.res-estrelas .ic { width: 38px; height: 38px; stroke-width: 1.6; }
.res-estrelas .ic.vazio { opacity: .3; }
@keyframes estrela { from { transform: scale(0) rotate(-40deg); opacity: 0; } to { transform: none; opacity: 1; } }
.res-numeros { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; margin: 26px 0 18px; padding-top: 20px; border-top: 1.5px solid rgba(20, 20, 20, .15); }
.res-numeros dd { font-family: var(--serif); font-size: 46px; line-height: 1; letter-spacing: -0.02em; }
.res-numeros dt { font-size: 14px; opacity: .7; margin-bottom: 2px; }
.res-numeros div { display: flex; flex-direction: column-reverse; }
.res-rep { display: flex; align-items: center; gap: 6px; font-size: 15px; opacity: .85; }
.res-rep .ic { width: 18px; height: 18px; }
.res-revisar { margin-top: 18px; background: rgba(255, 255, 255, .5); border-radius: 24px; padding: 16px 18px; }
.res-revisar h4 { font-size: 13px; font-weight: 600; opacity: .7; }
.res-revisar li { border-color: rgba(20, 20, 20, .12); }
.res-revisar li span { color: rgba(20, 20, 20, .6); }
.res-btns { margin-top: auto; padding-top: 24px; }
.res-btns .btn.contorno { color: #141414; }
.res-link { display: block; margin: 14px auto 0; border: 0; background: none; color: #141414; opacity: .75; font-weight: 600; font-size: 15px; padding: 8px 12px; text-decoration: underline; text-underline-offset: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rosto.boil .q { opacity: 0 !important; }
  .rosto.boil .q1 { opacity: 1 !important; }
}
@media (min-width: 560px) {
  .tela { padding-left: 24px; padding-right: 24px; }
}
