/* Entry animations move and scale only, never fade from 0: a paused animation must not hide the word. */
/* Rápido — game styles. Colors, depth, type and shape all come from tokens.css ("Açaí Spatial"). */
html, body { height: 100%; overscroll-behavior: none; }
/* touch-action: no double-tap zoom and no tap delay on iPhone */
body { -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
#app {
  max-width: 520px; margin: 0 auto; min-height: 100dvh;
  padding: calc(18px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
}
.hidden { display: none !important; }
.screen { display: none; flex-direction: column; gap: 14px; flex: 1; }
.screen.active { display: flex; animation: rise .25s ease; }
@keyframes rise { from { transform: translateY(10px); } }

/* ---------- shared ---------- */
.mark { align-self: center; margin-top: 10px; border-radius: 24px; box-shadow: var(--d-mid); }
.logo { font-size: 46px; font-weight: 700; text-align: center; margin: 0 0 6px; color: var(--acai); letter-spacing: -.5px; }
.sub { margin: 0; text-align: center; color: var(--mute); font-size: 15px; min-height: 1.2em; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat {
  background: var(--glass); border: 1px solid var(--glass-edge); border-radius: var(--r-card);
  box-shadow: var(--d-mid); padding: 12px 6px; text-align: center;
  backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2);
}
.stat b { display: block; font-size: 28px; font-weight: 700; color: var(--acai); line-height: 1.1; }
.stat span { font-size: 12.5px; color: var(--mute); }
.row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
#more { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

button { cursor: pointer; border: 0; font-weight: 600; transition: transform .12s ease, box-shadow .2s ease; }
button:active { transform: scale(.97); }
.big {
  background: var(--banana); color: var(--banana-ink); border-radius: var(--r-pill);
  font-size: 26px; font-weight: 700; padding: 18px; min-height: 72px; margin-top: 8px;
  box-shadow: 0 14px 30px rgba(255, 216, 77, .6), 0 0 0 6px var(--glass-strong);
}
.small {
  background: var(--glass); border: 1px solid var(--glass-edge); color: var(--ink);
  border-radius: var(--r-pill); padding: 8px 16px; min-height: 40px; font-size: 14px; box-shadow: var(--d-far);
}
.small.danger { color: var(--bad); }

/* ---------- game ---------- */
.hud { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--mute); }
.hud #g-score { margin-inline-start: auto; font-size: 22px; font-weight: 700; color: var(--acai); }
.combo {
  background: var(--banana); color: var(--banana-ink); border-radius: var(--r-pill);
  padding: 2px 12px; font-weight: 700; visibility: hidden;
}
.combo.on { visibility: visible; animation: pop .25s ease; }
@keyframes pop { 50% { transform: scale(1.35); } }
.timer > i { width: 100%; transition: none; }
.timer.low > i { background: var(--bad); }

.prompt { margin: 18px 0 0; text-align: center; color: var(--mute); font-size: 16px; }
.word {
  margin: 0; text-align: center; font-size: clamp(34px, 11vw, 54px); font-weight: 700; line-height: 1.15;
  color: var(--acai); min-height: 2.3em; display: grid; place-items: center; word-break: break-word;
}
.word.small { font-size: clamp(22px, 6.6vw, 30px); font-weight: 600; }
.word.listen { font-size: 64px; cursor: pointer; }
.word.in { animation: wordin .18s ease; }
@keyframes wordin { from { transform: scale(.9); } }

.answers { display: grid; gap: 12px; margin-top: auto; padding-bottom: 6px; }
.ans {
  position: relative; text-align: center; font-size: 21px; font-weight: 600; color: var(--ink);
  background: var(--glass-strong); border: 1px solid var(--glass-edge); border-radius: var(--r-card);
  padding: 14px 44px; min-height: 64px; box-shadow: var(--d-mid);
}
.ans[dir="ltr"] { font-size: 23px; }
.ans kbd {
  position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 50%; background: var(--line); color: var(--mute);
  font: 600 13px/26px var(--font); text-align: center;
}
@media (hover: none) { .ans kbd { display: none; } .ans { padding-inline: 16px; } }
.ans.right { background: var(--ok); color: #fff; border-color: transparent; box-shadow: var(--d-near); animation: pop .25s ease; }
.ans.wrong { background: var(--bad); color: #fff; border-color: transparent; animation: shake .3s ease; }
.ans.dim { opacity: .45; box-shadow: var(--d-far); }
.ans.right kbd, .ans.wrong kbd { background: rgba(255, 255, 255, .25); color: #fff; }
@keyframes shake { 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }

/* ---------- result ---------- */
#result h2 { font-size: 30px; font-weight: 700; text-align: center; color: var(--acai); margin: 22px 0 4px; }
.missed {
  background: var(--glass); border: 1px solid var(--glass-edge); border-radius: var(--r-panel);
  box-shadow: var(--d-far); padding: 6px 14px; max-height: 34dvh; overflow: auto;
}
.missed:empty { display: none; }
.missed div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.missed div:last-child { border: 0; }
.missed b { color: var(--acai); font-weight: 600; direction: ltr; }
#result .big { margin-top: auto; }
#result #btn-home { align-self: center; }

/* ---------- toast + level up ---------- */
.toast {
  position: fixed; left: 50%; top: calc(22px + env(safe-area-inset-top)); transform: translateX(-50%);
  background: var(--acai); color: var(--room-2); border-radius: var(--r-pill); padding: 10px 22px;
  font-weight: 600; box-shadow: var(--d-near); z-index: 50; white-space: nowrap; animation: rise .25s ease;
}
.confetti { position: fixed; top: -12px; width: 10px; height: 14px; border-radius: 3px; z-index: 40; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110dvh) rotate(720deg); opacity: .6; } }

/* ---------- short screens (small iPhones, landscape) ---------- */
@media (max-height: 620px) {
  .screen { gap: 10px; }
  .mark { width: 56px; height: 56px; margin-top: 0; border-radius: 16px; }
  .logo { font-size: 36px; }
  .stat { padding: 8px 4px; }
  .stat b { font-size: 24px; }
  .big { min-height: 60px; padding: 12px; font-size: 23px; }
  .word { min-height: 1.9em; }
  .ans { min-height: 54px; padding-block: 9px; font-size: 19px; }
  .answers { gap: 9px; }
}
