/* Motor de idiomas: base.css. Reset, tipografia, ícones, barra superior, navegação inferior, botões, modal e toast. */
/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font-body);
  font-size: 16px; line-height: 1.45; color: var(--ink);
  background-color: var(--bg-outer);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  /* sem regras extras de quebra de linha */
}
#app { --tabbar-h: 63px; position: relative; max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
@media (min-width: 600px) {
  body {
    background-image: radial-gradient(var(--grid-dot) 1.2px, transparent 1.6px);
    background-size: 24px 24px; background-attachment: fixed;
  }
  #app { box-shadow: 0 0 0 1px var(--line), 0 40px 80px -48px rgb(0 0 0 / .35); }
}
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--tint-2); }
.ico { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
h1, h2, h3, h4 { font-family: var(--font-display); font-optical-sizing: auto; }

/* ---------- barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 6px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.topbar .logo {
  display: flex; align-items: center; gap: 9px; margin-right: auto; min-width: 0;
  font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -.025em; color: var(--brand-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar .logo::before {
  content: ""; flex: none; width: 30px; height: 30px; border-radius: 9px;
  background: var(--primary) var(--mark) center / 20px no-repeat;
  box-shadow: inset 0 -3px 0 var(--primary-edge);
}
.stat {
  display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 10px 0 8px; border-radius: 999px;
  font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--ink);
  background: var(--card); box-shadow: inset 0 0 0 1px var(--line);
}
.stat:empty { display: none; }
.stat .ico { width: 19px; height: 19px; stroke-width: 1.6; }
.stat.streak .ico { color: var(--flame); fill: var(--flame); }
.stat.xp .ico { color: var(--accent-edge); fill: var(--accent); }
.stat.hearts .ico { color: var(--heart); fill: var(--heart); }
.stat.off { color: var(--muted); }
.stat.off .ico { color: var(--muted); fill: none; }

/* ---------- navegação inferior ---------- */
.tabbar {
  position: fixed; z-index: 6; bottom: 0; left: 0; right: 0; max-width: 560px; margin: 0 auto;
  background: var(--card); border-top: 1px solid var(--line-strong);
  box-shadow: 0 -8px 24px -18px rgb(0 0 0 / .35); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar .inner { display: flex; width: 100%; }
.tabbar button {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 62px;
  padding: 8px 2px 8px; background: none; border: 0; color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap;
}
.tabbar .ic { display: grid; place-items: center; width: 54px; height: 30px; border-radius: 999px; transition: background-color .18s, color .18s; }
.tabbar .ic .ico { width: 22px; height: 22px; }
.tabbar button:hover .ic { background: var(--line); }
.tabbar button.on { color: var(--primary-ink); }
.tabbar button.on .ic { background: var(--tint-2); }
.tabbar button.on .ic .ico { stroke-width: 2.3; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px;
  padding: 0 20px 3px; border: 0; border-radius: 15px; text-align: center;
  font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: .005em; line-height: 1.15;
  background: var(--primary); color: #fff; box-shadow: inset 0 -4px 0 var(--primary-edge);
  transition: transform .15s, filter .15s, background-color .15s, box-shadow .15s;
}
.btn .ico { width: 20px; height: 20px; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 -2px 0 var(--primary-edge); }
.btn[disabled] { background: var(--line); color: var(--muted); box-shadow: inset 0 -4px 0 var(--line-strong); cursor: default; filter: none; transform: none; }
.btn.ok { background: var(--ok-solid); box-shadow: inset 0 -4px 0 var(--ok-edge); }
.btn.bad { background: var(--bad-solid); box-shadow: inset 0 -4px 0 var(--bad-edge); }
.btn.ghost { background: var(--card); color: var(--primary-ink); box-shadow: inset 0 0 0 2px var(--line), inset 0 -4px 0 var(--line); }
.btn.ghost:active { box-shadow: inset 0 0 0 2px var(--line), inset 0 -2px 0 var(--line); }
.btn.small { min-height: 40px; padding: 0 14px 3px; border-radius: 12px; font-size: 14.5px; box-shadow: inset 0 -3px 0 var(--primary-edge); }
.btn.small.ghost { box-shadow: inset 0 0 0 2px var(--line), inset 0 -3px 0 var(--line); }
.btn.small.bad { box-shadow: inset 0 -3px 0 var(--bad-edge); }
.btn.block { width: 100%; }
.btn.danger, .btn.small.danger { background: transparent; color: var(--bad); box-shadow: inset 0 0 0 2px var(--bad-line); }
.btn.danger:hover { background: var(--bad-bg); filter: none; }

/* ---------- modal ---------- */
.modal-bg { position: fixed; inset: 0; z-index: 20; display: grid; place-items: end center; background: rgb(8 10 18 / .5); animation: fade .18s ease-out; }
.modal {
  position: relative; width: 100%; max-width: 560px; padding: 30px 20px calc(20px + env(safe-area-inset-bottom));
  background: var(--card); border-radius: 26px 26px 0 0; box-shadow: 0 -10px 40px rgb(0 0 0 / .18); animation: sheet .24s cubic-bezier(.2, .8, .2, 1);
}
.modal::before { content: ""; position: absolute; top: 10px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--line-strong); }
.modal .eyebrow { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary-ink); }
.modal .eyebrow .ico { width: 16px; height: 16px; }
.modal h3 { margin: 0 0 8px; font-size: 25px; line-height: 1.2; letter-spacing: -.02em; }
.modal p { margin: 0 0 22px; color: var(--ink-2); font-size: 16px; line-height: 1.5; }
.modal .foot { background: transparent; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (min-width: 600px) {
  .modal-bg { place-items: center; padding: 24px; }
  .modal { max-width: 440px; padding: 28px 24px 24px; border-radius: 24px; animation-name: pop; }
  .modal::before { display: none; }
}
.toast {
  position: fixed; z-index: 30; top: calc(14px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  max-width: calc(100% - 32px); width: max-content; padding: 11px 18px; border-radius: 14px;
  background: var(--toast); color: var(--toast-ink); font-weight: 600; font-size: 14.5px; line-height: 1.35; text-align: center;
  box-shadow: 0 10px 30px rgb(0 0 0 / .22); animation: toastin .2s ease-out;
}
@keyframes toastin { from { transform: translate(-50%, -8px); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }
